<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/block/blk-mq.h, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-12-01T14:18:31+00:00</updated>
<entry>
<title>blk-mq: use queue_hctx in blk_mq_map_queue_type</title>
<updated>2025-12-01T14:18:31+00:00</updated>
<author>
<name>Fengnan Chang</name>
<email>fengnanchang@gmail.com</email>
</author>
<published>2025-12-01T12:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d0e1f2139ad452d0e209a16b3d016af2f8ef1f7'/>
<id>urn:sha1:4d0e1f2139ad452d0e209a16b3d016af2f8ef1f7</id>
<content type='text'>
Some caller of blk_mq_map_queue_type now didn't grab
'q_usage_counter', such as blk_mq_cpu_mapped_to_hctx, so we need
protect 'queue_hw_ctx' through rcu.

Also checked all other functions, no more missed cases.

Fixes: 89e1fb7ceffd ("blk-mq: fix potential uaf for 'queue_hw_ctx'")
Reported-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Fengnan Chang &lt;changfengnan@bytedance.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: use array manage hctx map instead of xarray</title>
<updated>2025-11-28T16:09:19+00:00</updated>
<author>
<name>Fengnan Chang</name>
<email>fengnanchang@gmail.com</email>
</author>
<published>2025-11-28T08:53:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0c98769ee7d5db8d699a270690639cde1766cd4'/>
<id>urn:sha1:d0c98769ee7d5db8d699a270690639cde1766cd4</id>
<content type='text'>
After commit 4e5cc99e1e48 ("blk-mq: manage hctx map via xarray"), we use
an xarray instead of array to store hctx, but in poll mode, each time
in blk_mq_poll, we need use xa_load to find corresponding hctx, this
introduce some costs. In my test, xa_load may cost 3.8% cpu.

This patch revert previous change, eliminates the overhead of xa_load
and can result in a 3% performance improvement.

Signed-off-by: Fengnan Chang &lt;changfengnan@bytedance.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()</title>
<updated>2025-10-15T13:49:19+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-10-15T01:48:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc96cefef0d3032c69e46a21b345c60e56b18934'/>
<id>urn:sha1:dc96cefef0d3032c69e46a21b345c60e56b18934</id>
<content type='text'>
Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
before q-&gt;nr_requests is updated, however, it's still using the old
q-&gt;nr_requests to resize tag depth.

Fix this problem by passing in expected new tag depth.

Fixes: 7f2799c546db ("blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()")
Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Reported-by: Chris Mason &lt;clm@meta.com&gt;
Link: https://lore.kernel.org/linux-block/20251014130507.4187235-2-clm@meta.com/
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: remove blk_mq_tag_update_depth()</title>
<updated>2025-09-10T11:25:56+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-09-10T08:04:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9784041145796994f2b21f4c7e628d7c9db762f4'/>
<id>urn:sha1:9784041145796994f2b21f4c7e628d7c9db762f4</id>
<content type='text'>
This helper is not used now.

Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: fix potential deadlock while nr_requests grown</title>
<updated>2025-09-10T11:25:56+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-09-10T08:04:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b86433721f46d934940528f28d49c1dedb690df1'/>
<id>urn:sha1:b86433721f46d934940528f28d49c1dedb690df1</id>
<content type='text'>
Allocate and free sched_tags while queue is freezed can deadlock[1],
this is a long term problem, hence allocate memory before freezing
queue and free memory after queue is unfreezed.

[1] https://lore.kernel.org/all/0659ea8d-a463-47c8-9180-43c719e106eb@linux.ibm.com/
Fixes: e3a2b3f931f5 ("blk-mq: allow changing of queue depth through sysfs")

Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq-sched: add new parameter nr_requests in blk_mq_alloc_sched_tags()</title>
<updated>2025-09-10T11:25:56+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-09-10T08:04:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6293e336f6d7d3f3415346ce34993b3398846166'/>
<id>urn:sha1:6293e336f6d7d3f3415346ce34993b3398846166</id>
<content type='text'>
This helper only support to allocate the default number of requests,
add a new parameter to support specific number of requests.

Prepare to fix potential deadlock in the case nr_requests grow.

Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: check invalid nr_requests in queue_requests_store()</title>
<updated>2025-09-10T11:25:56+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-09-10T08:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b46d4c447db76e36906ed59ebb9b3ef8f3383322'/>
<id>urn:sha1:b46d4c447db76e36906ed59ebb9b3ef8f3383322</id>
<content type='text'>
queue_requests_store() is the only caller of
blk_mq_update_nr_requests(), and blk_mq_update_nr_requests() is the
only caller of blk_mq_tag_update_depth(), however, they all have
checkings for nr_requests input by user.

Make code cleaner by moving all the checkings to the top function:

1) nr_requests &gt; reserved tags;
2) if there is elevator, 4 &lt;= nr_requests &lt;= 2048;
3) if elevator is none, 4 &lt;= nr_requests &lt;= tag_set-&gt;queue_depth;

Meanwhile, case 2 is the only case tags can grow and -ENOMEM might be
returned.

Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: Pass tag_set to blk_mq_free_rq_map/tags</title>
<updated>2025-09-08T14:05:32+00:00</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2025-08-30T02:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ad8e5af327904dcc52e64ee5ab731c7018ffb0f'/>
<id>urn:sha1:9ad8e5af327904dcc52e64ee5ab731c7018ffb0f</id>
<content type='text'>
To prepare for converting the tag-&gt;rqs freeing to be SRCU-based, the
tag_set is needed in the freeing helper functions.

This patch adds 'struct blk_mq_tag_set *' as the first parameter to
blk_mq_free_rq_map() and blk_mq_free_tags(), and updates all their call
sites.

This allows access to the tag_set's SRCU structure in the next step,
which will be used to free the tag maps after a grace period.

No functional change is intended in this patch.

Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: clean up blk_mq_in_flight_rw()</title>
<updated>2025-05-10T08:11:21+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-05-06T12:48:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6b6c3a97abdebfafa25ef0f4b6b0b8b412b57bbb'/>
<id>urn:sha1:6b6c3a97abdebfafa25ef0f4b6b0b8b412b57bbb</id>
<content type='text'>
Also add comment for part_inflight_show() for the difference between
bio-based and rq-based device.

Link: https://lore.kernel.org/linux-raid/20250506124903.2540268-4-yukuai1@huaweicloud.com
Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>blk-mq: remove blk_mq_in_flight()</title>
<updated>2025-05-10T08:04:38+00:00</updated>
<author>
<name>Yu Kuai</name>
<email>yukuai3@huawei.com</email>
</author>
<published>2025-05-06T12:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c151919080ad4dc98bb40bc9cdcde412d72f8b23'/>
<id>urn:sha1:c151919080ad4dc98bb40bc9cdcde412d72f8b23</id>
<content type='text'>
After commit 7be835694dae ("block: fix that util can be greater than
100%"), it's not used and can be removed.

Link: https://lore.kernel.org/linux-raid/20250506124903.2540268-1-yukuai1@huaweicloud.com
Signed-off-by: Yu Kuai &lt;yukuai3@huawei.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
</content>
</entry>
</feed>
