[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0cf44936-57ef-42f2-a484-7f69b87b2520@uls.co.za>
Date: Wed, 2 Apr 2025 10:52:52 +0200
From: Jaco Kroon <jaco@....co.za>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: bernd.schubert@...tmail.fm, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, christophe.jaillet@...adoo.fr,
joannelkoong@...il.com, rdunlap@...radead.org, trapexit@...wn.link,
david.laight.linux@...il.com
Subject: Re: [PATCH 2/2] fuse: Adjust readdir() buffer to requesting buffer
size.
Hi,
On 2025/04/02 10:18, Miklos Szeredi wrote:
> On Wed, 2 Apr 2025 at 09:55, Jaco Kroon <jaco@....co.za> wrote:
>> Hi,
>>
>> I can definitely build on that, thank you.
>>
>> What's the advantage of kvmalloc over folio's here, why should it be
>> preferred?
> It offers the best of both worlds: first tries plain malloc (which
> just does a folio alloc internally for size > PAGE_SIZE) and if that
> fails, falls back to vmalloc, which should always succeed since it
> uses order 0 pages.
So basically assigns the space, but doesn't commit physical pages for
the allocation, meaning first access will cause a page fault, and single
page allocation at that point in time? Or is it merely the fact that
vmalloc may return a virtual contiguous block that's not physically
contiguous?
Sorry if I'm asking notoriously dumb questions, I've got a VERY BASIC
grasp of memory management at kernel level, I work much more in
userspace, and I know there usually first access generates a page fault
which will then result in memory being physically allocated by the
kernel. Generally I ignore these complexities and just assume that the
"lower down" layers know what they're doing and I've got a "flat,
contiguous" memory space, and that malloc knows what it's doing and will
communicate with the kernel regarding which regions of virtual space
should be mapped. Love the learning though, so appreciate the feedback
very much.
>
> This saves the trouble of iterating the folio alloc until it succeeds,
> which is both undeterministic and complex, neither of which is
> desirable.
Agreed.
>
> Thanks,
> Miklos
Powered by blists - more mailing lists