Re: [RFC PATCH v2 0/3] Move usages of struct __call_single_data to call_single_data_t

From: Chengming Zhou
Date: Mon Aug 28 2023 - 22:32:48 EST


On 2023/8/29 08:55, Leonardo Brás wrote:
> On Tue, 2023-07-04 at 04:22 -0300, Leonardo Brás wrote:
>> On Tue, 2023-06-13 at 00:51 -0300, Leonardo Bras Soares Passos wrote:
>>> Friendly ping
>>>
>>> On Sat, May 20, 2023 at 2:30 AM Leonardo Bras <leobras@xxxxxxxxxx> wrote:
>>>>
>>>> Changes since RFCv1:
>>>> - request->csd moved to the middle of the struct, without size impact
>>>> - type change happens in a different patch (thanks Jens Axboe!)
>>>> - Improved the third patch to also update the .h file.
>>>>
>>>> Leonardo Bras (3):
>>>> blk-mq: Move csd inside struct request so it's 32-byte aligned
>>>> blk-mq: Change request->csd type to call_single_data_t
>>>> smp: Change signatures to use call_single_data_t
>>>>
>>>> include/linux/blk-mq.h | 10 +++++-----
>>>> include/linux/smp.h | 2 +-
>>>> kernel/smp.c | 4 ++--
>>>> kernel/up.c | 2 +-
>>>> 4 files changed, 9 insertions(+), 9 deletions(-)
>>>>
>>>> --
>>>> 2.40.1
>>>>
>>
>> Hello Jens,
>>
>> I still want your feedback on this series :)
>>
>> I think I addressed every issue of RFCv1, but if you have any other feedback,
>> please let me know.
>>
>> Thanks!
>> Leo
>
> Hello Jens Axboe,
>
> Please provide feedback on this series!
>
> Are you ok with those changes?
> What's your opinion on them?
>
> Thanks!
> Leo
>

Hello,

FYI, there is no csd in struct request anymore in block/for-next branch,
which is deleted by this commit:

commit 660e802c76c89e871c29cd3174c07c8d23e39c35
Author: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
Date: Mon Jul 17 12:00:55 2023 +0800

blk-mq: use percpu csd to remote complete instead of per-rq csd

If request need to be completed remotely, we insert it into percpu llist,
and smp_call_function_single_async() if llist is empty previously.

We don't need to use per-rq csd, percpu csd is enough. And the size of
struct request is decreased by 24 bytes.

This way is cleaner, and looks correct, given block softirq is guaranteed
to be scheduled to consume the list if one new request is added to this
percpu list, either smp_call_function_single_async() returns -EBUSY or 0.

Signed-off-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Link: https://lore.kernel.org/r/20230717040058.3993930-2-chengming.zhou@xxxxxxxxx
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>