mbox series

[RFC,v2,0/3] Move usages of struct __call_single_data to call_single_data_t

Message ID 20230520052957.798486-1-leobras@redhat.com (mailing list archive)
Headers show
Series Move usages of struct __call_single_data to call_single_data_t | expand

Message

Leonardo Bras May 20, 2023, 5:29 a.m. UTC
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(-)

Comments

Leonardo Bras June 13, 2023, 3:51 a.m. UTC | #1
Friendly ping

On Sat, May 20, 2023 at 2:30 AM Leonardo Bras <leobras@redhat.com> 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
>
Leonardo Bras July 4, 2023, 7:22 a.m. UTC | #2
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@redhat.com> 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
Leonardo Bras Aug. 29, 2023, 12:55 a.m. UTC | #3
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@redhat.com> 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
Chengming Zhou Aug. 29, 2023, 2:29 a.m. UTC | #4
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@redhat.com> 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@bytedance.com>
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@bytedance.com>
    Reviewed-by: Ming Lei <ming.lei@redhat.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Link: https://lore.kernel.org/r/20230717040058.3993930-2-chengming.zhou@linux.dev
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
Leonardo Bras Aug. 30, 2023, 10:29 p.m. UTC | #5
On Tue, 2023-08-29 at 10:29 +0800, Chengming Zhou wrote:
> 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@redhat.com> 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@bytedance.com>
> 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@bytedance.com>
>     Reviewed-by: Ming Lei <ming.lei@redhat.com>
>     Reviewed-by: Christoph Hellwig <hch@lst.de>
>     Link: https://lore.kernel.org/r/20230717040058.3993930-2-chengming.zhou@linux.dev
>     Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 


Oh, thanks for the heads-up!
I will send reviewed version of patch 3.

I suppose it can go on top of block/for-next, since the above patch is there.
Does that work for you Jens Axboe?

Thanks!
Leo
Jens Axboe Aug. 30, 2023, 10:48 p.m. UTC | #6
On 8/30/23 4:29 PM, Leonardo Br?s wrote:
> On Tue, 2023-08-29 at 10:29 +0800, Chengming Zhou wrote:
>> 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@redhat.com> 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@bytedance.com>
>> 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@bytedance.com>
>>     Reviewed-by: Ming Lei <ming.lei@redhat.com>
>>     Reviewed-by: Christoph Hellwig <hch@lst.de>
>>     Link: https://lore.kernel.org/r/20230717040058.3993930-2-chengming.zhou@linux.dev
>>     Signed-off-by: Jens Axboe <axboe@kernel.dk>
>>
> 
> 
> Oh, thanks for the heads-up!
> I will send reviewed version of patch 3.
> 
> I suppose it can go on top of block/for-next, since the above patch is there.
> Does that work for you Jens Axboe?

Just send it against Linus's tree, it's all upstream now.
Leonardo Bras Aug. 31, 2023, 2:04 a.m. UTC | #7
On Wed, 2023-08-30 at 16:48 -0600, Jens Axboe wrote:
> On 8/30/23 4:29 PM, Leonardo Br?s wrote:
> > On Tue, 2023-08-29 at 10:29 +0800, Chengming Zhou wrote:
> > > 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@redhat.com> 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@bytedance.com>
> > > 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@bytedance.com>
> > >     Reviewed-by: Ming Lei <ming.lei@redhat.com>
> > >     Reviewed-by: Christoph Hellwig <hch@lst.de>
> > >     Link: https://lore.kernel.org/r/20230717040058.3993930-2-chengming.zhou@linux.dev
> > >     Signed-off-by: Jens Axboe <axboe@kernel.dk>
> > > 
> > 
> > 
> > Oh, thanks for the heads-up!
> > I will send reviewed version of patch 3.
> > 
> > I suppose it can go on top of block/for-next, since the above patch is there.
> > Does that work for you Jens Axboe?
> 
> Just send it against Linus's tree, it's all upstream now.
> 

Sure,

Thanks!
Leo