[PATCH 0/3] net/ceph/messenger: micro-optimizations for out_msg

Max Kellermann posted 3 patches 1 month, 4 weeks ago
include/linux/ceph/messenger.h |   6 +-
net/ceph/messenger.c           |  12 +--
net/ceph/messenger_v1.c        |  59 ++++++------
net/ceph/messenger_v2.c        | 160 ++++++++++++++++-----------------
4 files changed, 119 insertions(+), 118 deletions(-)
[PATCH 0/3] net/ceph/messenger: micro-optimizations for out_msg
Posted by Max Kellermann 1 month, 4 weeks ago
These patches reduce reloads of con->out_msg by passing pointers that
we already have in local variables (i.e. registers) as parameters.

Access to con->out_queue is now gone completely from v1/v2 and only
few references to con->out_msg remain.  In the long run, I'd like to
get rid of con->out_msg completely and instead send the whole
con->out_queue in one kernel_sendmsg() call.  This patch series helps
with preparing that.

Max Kellermann (3):
  net/ceph/messenger: ceph_con_get_out_msg() returns the message pointer
  net/ceph/messenger_v[12]: pass ceph_msg* instead of loading
    con->out_msg
  net/ceph/messenger: add empty check to ceph_con_get_out_msg()

 include/linux/ceph/messenger.h |   6 +-
 net/ceph/messenger.c           |  12 +--
 net/ceph/messenger_v1.c        |  59 ++++++------
 net/ceph/messenger_v2.c        | 160 ++++++++++++++++-----------------
 4 files changed, 119 insertions(+), 118 deletions(-)

-- 
2.47.2
Re: [PATCH 0/3] net/ceph/messenger: micro-optimizations for out_msg
Posted by Viacheslav Dubeyko 1 month, 3 weeks ago
On Wed, 2025-08-06 at 11:48 +0200, Max Kellermann wrote:
> These patches reduce reloads of con->out_msg by passing pointers that
> we already have in local variables (i.e. registers) as parameters.
> 
> Access to con->out_queue is now gone completely from v1/v2 and only
> few references to con->out_msg remain.  In the long run, I'd like to
> get rid of con->out_msg completely and instead send the whole
> con->out_queue in one kernel_sendmsg() call.  This patch series helps
> with preparing that.
> 
> Max Kellermann (3):
>   net/ceph/messenger: ceph_con_get_out_msg() returns the message pointer
>   net/ceph/messenger_v[12]: pass ceph_msg* instead of loading
>     con->out_msg
>   net/ceph/messenger: add empty check to ceph_con_get_out_msg()
> 
>  include/linux/ceph/messenger.h |   6 +-
>  net/ceph/messenger.c           |  12 +--
>  net/ceph/messenger_v1.c        |  59 ++++++------
>  net/ceph/messenger_v2.c        | 160 ++++++++++++++++-----------------
>  4 files changed, 119 insertions(+), 118 deletions(-)

Unexpectedly, I can see xfstests failures with applied patchset:

Failures: generic/633 generic/644 generic/645 generic/689 generic/696
generic/697
Failed 6 of 610 tests

I will repeat xfestests run with and without patchset. Maybe, it is the glitch
on my side.

Thanks,
Slava.
RE: [PATCH 0/3] net/ceph/messenger: micro-optimizations for out_msg
Posted by Viacheslav Dubeyko 1 month, 3 weeks ago
On Mon, 2025-08-11 at 17:05 +0000, Viacheslav Dubeyko wrote:
> On Wed, 2025-08-06 at 11:48 +0200, Max Kellermann wrote:
> > These patches reduce reloads of con->out_msg by passing pointers that
> > we already have in local variables (i.e. registers) as parameters.
> > 
> > Access to con->out_queue is now gone completely from v1/v2 and only
> > few references to con->out_msg remain.  In the long run, I'd like to
> > get rid of con->out_msg completely and instead send the whole
> > con->out_queue in one kernel_sendmsg() call.  This patch series helps
> > with preparing that.
> > 
> > Max Kellermann (3):
> >   net/ceph/messenger: ceph_con_get_out_msg() returns the message pointer
> >   net/ceph/messenger_v[12]: pass ceph_msg* instead of loading
> >     con->out_msg
> >   net/ceph/messenger: add empty check to ceph_con_get_out_msg()
> > 
> >  include/linux/ceph/messenger.h |   6 +-
> >  net/ceph/messenger.c           |  12 +--
> >  net/ceph/messenger_v1.c        |  59 ++++++------
> >  net/ceph/messenger_v2.c        | 160 ++++++++++++++++-----------------
> >  4 files changed, 119 insertions(+), 118 deletions(-)
> 
> Unexpectedly, I can see xfstests failures with applied patchset:
> 
> Failures: generic/633 generic/644 generic/645 generic/689 generic/696
> generic/697
> Failed 6 of 610 tests
> 
> I will repeat xfestests run with and without patchset. Maybe, it is the glitch
> on my side.
> 
> 

I double checked the xfstests run. Everything works well. It was glitch on my
side.

Thanks,
Slava.

Re: [PATCH 0/3] net/ceph/messenger: micro-optimizations for out_msg
Posted by Viacheslav Dubeyko 1 month, 3 weeks ago
On Wed, 2025-08-06 at 11:48 +0200, Max Kellermann wrote:
> These patches reduce reloads of con->out_msg by passing pointers that
> we already have in local variables (i.e. registers) as parameters.
> 
> Access to con->out_queue is now gone completely from v1/v2 and only
> few references to con->out_msg remain.  In the long run, I'd like to
> get rid of con->out_msg completely and instead send the whole
> con->out_queue in one kernel_sendmsg() call.  This patch series helps
> with preparing that.
> 
> Max Kellermann (3):
>   net/ceph/messenger: ceph_con_get_out_msg() returns the message pointer
>   net/ceph/messenger_v[12]: pass ceph_msg* instead of loading
>     con->out_msg
>   net/ceph/messenger: add empty check to ceph_con_get_out_msg()
> 
>  include/linux/ceph/messenger.h |   6 +-
>  net/ceph/messenger.c           |  12 +--
>  net/ceph/messenger_v1.c        |  59 ++++++------
>  net/ceph/messenger_v2.c        | 160 ++++++++++++++++-----------------
>  4 files changed, 119 insertions(+), 118 deletions(-)

I will apply this patchset on testing branch and do the testing today.

Thanks,
Slava.