From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: Jaco Kroon <jaco@uls.co.za>, Miklos Szeredi <miklos@szeredi.hu>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fuse: enable larger read buffers for readdir.
Date: Wed, 26 Jul 2023 17:30:44 +0200 [thread overview]
Message-ID: <4470a31c-802e-51e2-75b0-362c05fecfb8@fastmail.fm> (raw)
In-Reply-To: <7d762c95-e4ca-d612-f70f-64789d4624cf@uls.co.za>
On 7/26/23 17:26, Jaco Kroon wrote:
> Hi,
>
> On 2023/07/26 15:53, Bernd Schubert wrote:
>>
>>
>> On 7/26/23 12:59, Jaco Kroon wrote:
>>> Signed-off-by: Jaco Kroon <jaco@uls.co.za>
>>> ---
>>> fs/fuse/Kconfig | 16 ++++++++++++++++
>>> fs/fuse/readdir.c | 42 ++++++++++++++++++++++++------------------
>>> 2 files changed, 40 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/fs/fuse/Kconfig b/fs/fuse/Kconfig
>>> index 038ed0b9aaa5..0783f9ee5cd3 100644
>>> --- a/fs/fuse/Kconfig
>>> +++ b/fs/fuse/Kconfig
>>> @@ -18,6 +18,22 @@ config FUSE_FS
>>> If you want to develop a userspace FS, or if you want to use
>>> a filesystem based on FUSE, answer Y or M.
>>> +config FUSE_READDIR_ORDER
>>> + int
>>> + range 0 5
>>> + default 5
>>> + help
>>> + readdir performance varies greatly depending on the size of
>>> the read.
>>> + Larger buffers results in larger reads, thus fewer reads and
>>> higher
>>> + performance in return.
>>> +
>>> + You may want to reduce this value on seriously constrained
>>> memory
>>> + systems where 128KiB (assuming 4KiB pages) cache pages is
>>> not ideal.
>>> +
>>> + This value reprents the order of the number of pages to
>>> allocate (ie,
>>> + the shift value). A value of 0 is thus 1 page (4KiB) where
>>> 5 is 32
>>> + pages (128KiB).
>>> +
>>
>> I like the idea of a larger readdir size, but shouldn't that be a
>> server/daemon/library decision which size to use, instead of kernel
>> compile time? So should be part of FUSE_INIT negotiation?
>
> Yes sure, but there still needs to be a default. And one page at a time
> doesn't cut it.
>
> -- snip --
>
>>> - page = alloc_page(GFP_KERNEL);
>>> + page = alloc_pages(GFP_KERNEL, READDIR_PAGES_ORDER);
>>
>> I guess that should become folio alloc(), one way or the other. Now I
>> think order 0 was chosen before to avoid risk of allocation failure. I
>> guess it might work to try a large size and to fall back to 0 when
>> that failed. Or fail back to the slower vmalloc.
>
> If this varies then a bunch of other code will become somewhat more
> complex, especially if one alloc succeeds, and then a follow-up succeeds.
Yeah, the better choice is kvmalloc/kvfree which handles it internally.
>
> I'm not familiar with the differences between the different mechanisms
> available for allocation.
>
> -- snip --
>
>> Thanks,
> My pleasure,
> Jaco
next prev parent reply other threads:[~2023-07-26 15:30 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 10:59 [PATCH] fuse: enable larger read buffers for readdir Jaco Kroon
2023-07-26 11:43 ` Jaco Kroon
2023-07-26 13:53 ` Bernd Schubert
2023-07-26 15:26 ` Jaco Kroon
2023-07-26 15:30 ` Bernd Schubert [this message]
2023-07-26 15:45 ` Bernd Schubert
2023-07-26 17:23 ` Antonio SJ Musumeci
2023-07-26 18:25 ` Jaco Kroon
2023-07-27 15:21 ` Miklos Szeredi
2023-07-27 19:21 ` Miklos Szeredi
2023-07-27 19:43 ` Bernd Schubert
2023-07-28 8:42 ` Miklos Szeredi
2023-07-26 15:19 ` Randy Dunlap
2023-07-27 8:12 ` [PATCH] fuse: enable larger read buffers for readdir [v2] Jaco Kroon
2023-07-27 15:35 ` Miklos Szeredi
2023-07-27 16:58 ` Jaco Kroon
2023-07-27 19:17 ` Miklos Szeredi
2023-07-27 19:16 ` Bernd Schubert
2023-07-27 20:35 ` Bernd Schubert
2023-07-28 5:05 ` Jaco Kroon
2025-03-14 22:16 ` fuse: increase readdir() buffer size Jaco Kroon
2025-03-14 22:16 ` [PATCH 1/2] fs: Supply dir_context.count as readdir buffer size hint Jaco Kroon
2025-03-29 9:20 ` Christophe JAILLET
2025-03-30 14:27 ` Jaco Kroon
2025-03-14 22:16 ` [PATCH 2/2] fuse: Adjust readdir() buffer to requesting buffer size Jaco Kroon
2025-03-31 16:41 ` Joanne Koong
2025-03-31 20:43 ` Jaco Kroon
2025-03-31 21:48 ` Joanne Koong
2025-03-31 23:01 ` Joanne Koong
2025-03-28 10:15 ` fuse: increase readdir() " Jaco Kroon
2025-03-28 10:16 ` Bernd Schubert
2025-03-28 19:40 ` David Laight
2025-03-29 8:59 ` Jaco Kroon
2025-04-01 14:18 ` fuse: increase readdir() buffer size [v4] Jaco Kroon
2025-04-01 14:18 ` [PATCH 1/2] fs: Supply dir_context.count as readdir buffer size hint Jaco Kroon
2025-04-01 14:18 ` [PATCH 2/2] fuse: Adjust readdir() buffer to requesting buffer size Jaco Kroon
2025-04-01 14:40 ` Miklos Szeredi
2025-04-01 15:03 ` Jaco Kroon
2025-04-01 15:33 ` Miklos Szeredi
2025-04-02 7:54 ` Jaco Kroon
2025-04-02 8:18 ` Miklos Szeredi
2025-04-02 8:52 ` Jaco Kroon
2025-04-02 9:10 ` Bernd Schubert
2025-04-02 11:13 ` Jaco Kroon
2025-04-02 11:35 ` Miklos Szeredi
2025-04-02 11:59 ` Bernd Schubert
2025-04-08 14:19 ` Bernd Schubert
2025-04-09 7:12 ` Jaco Kroon
2025-04-09 8:31 ` Bernd Schubert
2025-04-09 15:03 ` Jaco Kroon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4470a31c-802e-51e2-75b0-362c05fecfb8@fastmail.fm \
--to=bernd.schubert@fastmail.fm \
--cc=jaco@uls.co.za \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.