All of lore.kernel.org
 help / color / mirror / Atom feed
* smbd_max_receive_size == 8192?
@ 2022-08-24 15:44 Tom Talpey
  2022-08-31  2:04 ` Tom Talpey
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Talpey @ 2022-08-24 15:44 UTC (permalink / raw)
  To: Long Li, CIFS

Long, I notice that smbdirect.c sets the max receive size to 8192.
It's tunable, but I'm curious why the default is so large. The
SMBDirect protocol normally limits its packets to 1364 bytes.

With an SMBDirect credit limit of 255, the present default allocates
over 500 pages/connection, in O(2) granularity, when 85 O(1) pages
would suffice. Kernel virtual mapping would also be greatly reduced
as buffers can be arranged to share, and never extend beyond, a page.

Any insight into the 8192? Thanks.

Tom.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: smbd_max_receive_size == 8192?
  2022-08-24 15:44 smbd_max_receive_size == 8192? Tom Talpey
@ 2022-08-31  2:04 ` Tom Talpey
  2022-09-03  2:11   ` Long Li
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Talpey @ 2022-08-31  2:04 UTC (permalink / raw)
  To: Long Li; +Cc: CIFS

...ping?

I have since noticed that the smbdirect default max send size is 1364,
so I'm even more confused on the 8192. And, ksmbd sets both sizes
to 8192.

On 8/24/2022 11:44 AM, Tom Talpey wrote:
> Long, I notice that smbdirect.c sets the max receive size to 8192.
> It's tunable, but I'm curious why the default is so large. The
> SMBDirect protocol normally limits its packets to 1364 bytes.
> 
> With an SMBDirect credit limit of 255, the present default allocates
> over 500 pages/connection, in O(2) granularity, when 85 O(1) pages
> would suffice. Kernel virtual mapping would also be greatly reduced
> as buffers can be arranged to share, and never extend beyond, a page.
> 
> Any insight into the 8192? Thanks.
> 
> Tom.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: smbd_max_receive_size == 8192?
  2022-08-31  2:04 ` Tom Talpey
@ 2022-09-03  2:11   ` Long Li
  2022-09-03 11:24     ` Tom Talpey
  0 siblings, 1 reply; 4+ messages in thread
From: Long Li @ 2022-09-03  2:11 UTC (permalink / raw)
  To: tom; +Cc: CIFS

> Subject: Re: smbd_max_receive_size == 8192?
> 
> ...ping?
> 
> I have since noticed that the smbdirect default max send size is 1364, so I'm
> even more confused on the 8192. And, ksmbd sets both sizes to 8192.

Yes, it seems it can be reduced to a smaller value. I don't remember the reason why it was set to 8192 initially.

This value is further override by the preferred_send_size in SMBD negotiation response from the server. In practice, it could be much lower than 8192.

> 
> On 8/24/2022 11:44 AM, Tom Talpey wrote:
> > Long, I notice that smbdirect.c sets the max receive size to 8192.
> > It's tunable, but I'm curious why the default is so large. The
> > SMBDirect protocol normally limits its packets to 1364 bytes.
> >
> > With an SMBDirect credit limit of 255, the present default allocates
> > over 500 pages/connection, in O(2) granularity, when 85 O(1) pages
> > would suffice. Kernel virtual mapping would also be greatly reduced as
> > buffers can be arranged to share, and never extend beyond, a page.
> >
> > Any insight into the 8192? Thanks.
> >
> > Tom.
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: smbd_max_receive_size == 8192?
  2022-09-03  2:11   ` Long Li
@ 2022-09-03 11:24     ` Tom Talpey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Talpey @ 2022-09-03 11:24 UTC (permalink / raw)
  To: Long Li; +Cc: CIFS

Thanks. As part of my "too_many_sges" branch I'm experimenting with smaller buffers, with very good results. Using standard 1364-byte segments and 6 SGEs on both sides, it passes connectathon tests and normal workloads over both softiwarp and softroce. I have another patch to use fragmentation to further reduce SGEs that should improve performance on hardware adapters.

It bothers me that there are two implementations of smbdirect in the code, fs/cifs/smbdirect.c and fs/ksmbd/transport_rdma.c. Because smbdirect is purely a framing protocol and therefore peer-to-peer, this seems to be unnecessary duplication. I plan to experiment with refactoring them and split out the common code later.

Tom.

Sep 2, 2022 10:17:32 PM Long Li <longli@microsoft.com>:

>> Subject: Re: smbd_max_receive_size == 8192?
>> 
>> ...ping?
>> 
>> I have since noticed that the smbdirect default max send size is 1364, so I'm
>> even more confused on the 8192. And, ksmbd sets both sizes to 8192.
> 
> Yes, it seems it can be reduced to a smaller value. I don't remember the reason why it was set to 8192 initially.
> 
> This value is further override by the preferred_send_size in SMBD negotiation response from the server. In practice, it could be much lower than 8192.
> 
>> 
>> On 8/24/2022 11:44 AM, Tom Talpey wrote:
>>> Long, I notice that smbdirect.c sets the max receive size to 8192.
>>> It's tunable, but I'm curious why the default is so large. The
>>> SMBDirect protocol normally limits its packets to 1364 bytes.
>>> 
>>> With an SMBDirect credit limit of 255, the present default allocates
>>> over 500 pages/connection, in O(2) granularity, when 85 O(1) pages
>>> would suffice. Kernel virtual mapping would also be greatly reduced as
>>> buffers can be arranged to share, and never extend beyond, a page.
>>> 
>>> Any insight into the 8192? Thanks.
>>> 
>>> Tom.
>>> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-03 11:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 15:44 smbd_max_receive_size == 8192? Tom Talpey
2022-08-31  2:04 ` Tom Talpey
2022-09-03  2:11   ` Long Li
2022-09-03 11:24     ` Tom Talpey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.