[PATCH v3 0/2] blk-mq: fix update nr_requests regressions

Yu Kuai posted 2 patches 1 month, 1 week ago
block/bfq-iosched.c   | 22 +++++-----------------
block/blk-mq-sched.h  | 11 +++++++++++
block/blk-mq-tag.c    |  1 +
block/blk-mq.c        | 23 ++++++++++++-----------
block/elevator.h      |  2 +-
block/kyber-iosched.c | 19 +++++++++----------
block/mq-deadline.c   | 16 +++-------------
7 files changed, 42 insertions(+), 52 deletions(-)
[PATCH v3 0/2] blk-mq: fix update nr_requests regressions
Posted by Yu Kuai 1 month, 1 week ago
From: Yu Kuai <yukuai3@huawei.com>

Changes in v3:
 - call depth_updated() directly in init_sched() method in patch 1;
 - fix typos in patch 2;
 - add review for patch 2;
Changes in v2:
 - instead of refactor and cleanups and fix updating nr_requests
 thoroughly, fix the regression in patch 2 the easy way, and dealy
 refactor and cleanups to next merge window.

patch 1 fix regression that elevator async_depth is not updated correctly
if nr_requests changes, first from error path and then for mq-deadline,
and recently for bfq and kyber.

patch 2 fix regression that if nr_requests grow, kernel will panic due
to tags double free.

Yu Kuai (2):
  blk-mq: fix elevator depth_updated method
  blk-mq: fix blk_mq_tags double free while nr_requests grown

 block/bfq-iosched.c   | 22 +++++-----------------
 block/blk-mq-sched.h  | 11 +++++++++++
 block/blk-mq-tag.c    |  1 +
 block/blk-mq.c        | 23 ++++++++++++-----------
 block/elevator.h      |  2 +-
 block/kyber-iosched.c | 19 +++++++++----------
 block/mq-deadline.c   | 16 +++-------------
 7 files changed, 42 insertions(+), 52 deletions(-)

-- 
2.39.2
Re: [PATCH v3 0/2] blk-mq: fix update nr_requests regressions
Posted by Jens Axboe 4 weeks ago
On Thu, 21 Aug 2025 14:06:10 +0800, Yu Kuai wrote:
> Changes in v3:
>  - call depth_updated() directly in init_sched() method in patch 1;
>  - fix typos in patch 2;
>  - add review for patch 2;
> Changes in v2:
>  - instead of refactor and cleanups and fix updating nr_requests
>  thoroughly, fix the regression in patch 2 the easy way, and dealy
>  refactor and cleanups to next merge window.
> 
> [...]

Applied, thanks!

[1/2] blk-mq: fix elevator depth_updated method
      commit: 7d337eef4affc5e26e0570513168c69ddbc40f92
[2/2] blk-mq: fix blk_mq_tags double free while nr_requests grown
      commit: ba28afbd9eff2a6370f23ef4e6a036ab0cfda409

Best regards,
-- 
Jens Axboe
Re: [PATCH v3 0/2] blk-mq: fix update nr_requests regressions
Posted by Yu Kuai 1 month, 1 week ago
Hi, Jens

在 2025/08/21 14:06, Yu Kuai 写道:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> Changes in v3:
>   - call depth_updated() directly in init_sched() method in patch 1;
>   - fix typos in patch 2;
>   - add review for patch 2;
> Changes in v2:
>   - instead of refactor and cleanups and fix updating nr_requests
>   thoroughly, fix the regression in patch 2 the easy way, and dealy
>   refactor and cleanups to next merge window.
> 
> patch 1 fix regression that elevator async_depth is not updated correctly
> if nr_requests changes, first from error path and then for mq-deadline,
> and recently for bfq and kyber.
> 
> patch 2 fix regression that if nr_requests grow, kernel will panic due
> to tags double free.
> 
> Yu Kuai (2):
>    blk-mq: fix elevator depth_updated method
>    blk-mq: fix blk_mq_tags double free while nr_requests grown
> 
>   block/bfq-iosched.c   | 22 +++++-----------------
>   block/blk-mq-sched.h  | 11 +++++++++++
>   block/blk-mq-tag.c    |  1 +
>   block/blk-mq.c        | 23 ++++++++++++-----------
>   block/elevator.h      |  2 +-
>   block/kyber-iosched.c | 19 +++++++++----------
>   block/mq-deadline.c   | 16 +++-------------
>   7 files changed, 42 insertions(+), 52 deletions(-)
> 

Friendly ping, please consider this set in this merge window.

BTW, I see that for-6.18/block branch was created, however, I have
a pending set[1] for the next merge window that will have conflicts with
this set, not sure if you want to rebase for-6.18/block with block-6.17
or handle conflicts later for 6.18-rc1.

[1] 
https://lore.kernel.org/all/20250815080216.410665-1-yukuai1@huaweicloud.com/

Thanks,
Kuai

Re: [PATCH v3 0/2] blk-mq: fix update nr_requests regressions
Posted by Yu Kuai 4 weeks ago
Hi, Jens

在 2025/08/26 14:27, Yu Kuai 写道:
> Hi, Jens
> 
> 在 2025/08/21 14:06, Yu Kuai 写道:
>> From: Yu Kuai <yukuai3@huawei.com>
>>
>> Changes in v3:
>>   - call depth_updated() directly in init_sched() method in patch 1;
>>   - fix typos in patch 2;
>>   - add review for patch 2;
>> Changes in v2:
>>   - instead of refactor and cleanups and fix updating nr_requests
>>   thoroughly, fix the regression in patch 2 the easy way, and dealy
>>   refactor and cleanups to next merge window.
>>
>> patch 1 fix regression that elevator async_depth is not updated correctly
>> if nr_requests changes, first from error path and then for mq-deadline,
>> and recently for bfq and kyber.
>>
>> patch 2 fix regression that if nr_requests grow, kernel will panic due
>> to tags double free.
>>
>> Yu Kuai (2):
>>    blk-mq: fix elevator depth_updated method
>>    blk-mq: fix blk_mq_tags double free while nr_requests grown
>>
>>   block/bfq-iosched.c   | 22 +++++-----------------
>>   block/blk-mq-sched.h  | 11 +++++++++++
>>   block/blk-mq-tag.c    |  1 +
>>   block/blk-mq.c        | 23 ++++++++++++-----------
>>   block/elevator.h      |  2 +-
>>   block/kyber-iosched.c | 19 +++++++++----------
>>   block/mq-deadline.c   | 16 +++-------------
>>   7 files changed, 42 insertions(+), 52 deletions(-)
>>
> 
> Friendly ping, please consider this set in this merge window.
> 
> BTW, I see that for-6.18/block branch was created, however, I have
> a pending set[1] for the next merge window that will have conflicts with
> this set, not sure if you want to rebase for-6.18/block with block-6.17
> or handle conflicts later for 6.18-rc1.
> 
> [1] 
> https://lore.kernel.org/all/20250815080216.410665-1-yukuai1@huaweicloud.com/ 
> 
Friendly ping ...

Thanks,
Kuai

> 
> Thanks,
> Kuai
> 
> .
> 

Re: [PATCH v3 0/2] blk-mq: fix update nr_requests regressions
Posted by Jens Axboe 4 weeks ago
On 9/5/25 1:20 AM, Yu Kuai wrote:
> Hi, Jens
> 
> ? 2025/08/26 14:27, Yu Kuai ??:
>> Hi, Jens
>>
>> ? 2025/08/21 14:06, Yu Kuai ??:
>>> From: Yu Kuai <yukuai3@huawei.com>
>>>
>>> Changes in v3:
>>>   - call depth_updated() directly in init_sched() method in patch 1;
>>>   - fix typos in patch 2;
>>>   - add review for patch 2;
>>> Changes in v2:
>>>   - instead of refactor and cleanups and fix updating nr_requests
>>>   thoroughly, fix the regression in patch 2 the easy way, and dealy
>>>   refactor and cleanups to next merge window.
>>>
>>> patch 1 fix regression that elevator async_depth is not updated correctly
>>> if nr_requests changes, first from error path and then for mq-deadline,
>>> and recently for bfq and kyber.
>>>
>>> patch 2 fix regression that if nr_requests grow, kernel will panic due
>>> to tags double free.
>>>
>>> Yu Kuai (2):
>>>    blk-mq: fix elevator depth_updated method
>>>    blk-mq: fix blk_mq_tags double free while nr_requests grown
>>>
>>>   block/bfq-iosched.c   | 22 +++++-----------------
>>>   block/blk-mq-sched.h  | 11 +++++++++++
>>>   block/blk-mq-tag.c    |  1 +
>>>   block/blk-mq.c        | 23 ++++++++++++-----------
>>>   block/elevator.h      |  2 +-
>>>   block/kyber-iosched.c | 19 +++++++++----------
>>>   block/mq-deadline.c   | 16 +++-------------
>>>   7 files changed, 42 insertions(+), 52 deletions(-)
>>>
>>
>> Friendly ping, please consider this set in this merge window.
>>
>> BTW, I see that for-6.18/block branch was created, however, I have
>> a pending set[1] for the next merge window that will have conflicts with
>> this set, not sure if you want to rebase for-6.18/block with block-6.17
>> or handle conflicts later for 6.18-rc1.

I think we're just a bit late on this one, given that they'd go into
-rc6 at this point. Going to queue this up for 6.18 and then we just get
it into stable instead, that gives us a lot more time to shake out any
potential issues.

-- 
Jens Axboe