linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] use compounding to speed up readdir()
@ 2019-12-04 22:54 Ronnie Sahlberg
  2019-12-04 22:54 ` [PATCH 1/3] cifs: prepare SMB2_query_directory to be used with compounding Ronnie Sahlberg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ronnie Sahlberg @ 2019-12-04 22:54 UTC (permalink / raw)
  To: linux-cifs

Steve, List

This three patches are the first step in using compounding to speed up
readdir() which currently takes a minimum of 4 roundtrips for any non-empty
directory.
With these patches we reduce one roundtrip and we can list a directory
in just 3, instead of 4, roundtrips which will benefit use-cases where
latency to the server is high.

I.e. this changes the sequence of operations for a small directory from
1, Open
2, Query and get data
3, Query loop until we get STATUS_NO_MORE_FILES
4, Close

To be the slightly better
1, Open + Query and get data
2, Query and get STATUS_NO_MORE_FILES
3, Close


In later patches we can do even better and drive this down to just 2 roundtrips
for a small nonempty directory by using
1, Open + Query + Query
2, Close
for the case where we get STATUS_NO_MORE_FILES for the second Query.
And bring it down to just two roundtrips.

That is probably the best we can do for Windows based servers since without
support for the SMB2_INDEX_SPECIFIED flag in the QueryDirectory request
we can not put the Close() as part of the compound.


IF we had SMB2_INDEX_SPECIFIED support on some server (Azure?) and IF we
had a way to reliably detect if the server supports this flag or not then
we could change the sequence to be
Open + Query + Query + Close
and if the second Query returned STATUS_NO_MORE_FILES we would have finished thereaddir() in a single roundtrip.
If the directory is large and the second query did not return this error then
we could just continue and use this compound instead to loop until we get to the end :
Open() + Query(SMB2_INDEX_SPECIFIED, Index) + Close()


regards
Ronnie Sahlberg



^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/3] WIP start using compounding for readdir()
@ 2019-12-02  7:28 Ronnie Sahlberg
  2019-12-02  7:29 ` [PATCH 3/3] cifs: use compounding for open and first query-dir " Ronnie Sahlberg
  0 siblings, 1 reply; 7+ messages in thread
From: Ronnie Sahlberg @ 2019-12-02  7:28 UTC (permalink / raw)
  To: linux-cifs

Steve, All

Please see a WIP for the initial steps of using compounds for readdir()
These patches only combine the initial open and the first query-dir
into a compound.
It cuts the number of roundtrips for small directories from 4 to 3
but can do better.

The patches need more work on how to clean up the handling of the response
vectors  but is an initial WIP for review/comments.


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

end of thread, other threads:[~2020-01-08  3:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 22:54 [PATCH 0/3] use compounding to speed up readdir() Ronnie Sahlberg
2019-12-04 22:54 ` [PATCH 1/3] cifs: prepare SMB2_query_directory to be used with compounding Ronnie Sahlberg
2019-12-23 23:48   ` Pavel Shilovsky
2020-01-08  3:09     ` ronnie sahlberg
2019-12-04 22:54 ` [PATCH 2/3] cifs: create a helper function to parse the query-directory response buffer Ronnie Sahlberg
2019-12-04 22:54 ` [PATCH 3/3] cifs: use compounding for open and first query-dir for readdir() Ronnie Sahlberg
  -- strict thread matches above, loose matches on Subject: below --
2019-12-02  7:28 [PATCH 0/3] WIP start using compounding " Ronnie Sahlberg
2019-12-02  7:29 ` [PATCH 3/3] cifs: use compounding for open and first query-dir " Ronnie Sahlberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).