[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xy45wh2y55oinrvkhea36yxtnqmsoikp7eawaa2b5ejivfv4ku@ob72fvbkj4uh>
Date: Tue, 13 Feb 2024 22:05:54 +0100
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
mcgrof@...nel.org, gost.dev@...sung.com, akpm@...ux-foundation.org,
kbusch@...nel.org, chandan.babu@...cle.com, p.raghav@...sung.com,
linux-kernel@...r.kernel.org, hare@...e.de, willy@...radead.org, linux-mm@...ck.org,
david@...morbit.com
Subject: Re: [RFC v2 01/14] fs: Allow fine-grained control of folio sizes
On Tue, Feb 13, 2024 at 08:34:31AM -0800, Darrick J. Wong wrote:
> On Tue, Feb 13, 2024 at 10:37:00AM +0100, Pankaj Raghav (Samsung) wrote:
> > From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
> >
> > Some filesystems want to be able to limit the maximum size of folios,
> > and some want to be able to ensure that folios are at least a certain
> > size. Add mapping_set_folio_orders() to allow this level of control.
> > The max folio order parameter is ignored and it is always set to
> > MAX_PAGECACHE_ORDER.
>
> Why? If MAX_PAGECACHE_ORDER is 8 and I instead pass in max==3, I'm
> going to be surprised by my constraint being ignored. Maybe I said that
> because I'm not prepared to handle an order-7 folio; or some customer
> will have some weird desire to twist this knob to make their workflow
> faster.
>
> --D
Maybe I should have been explicit. We are planning to add support
for min order in the first round, and we want to add support for max order
once the min order support is upstreamed. It was done mainly to reduce
the scope and testing of this series.
I definitely agree there are usecases for setting the max order. It is
also the feedback we got from LPC.
So one idea would be not to expose max option until we add the support
for max order? So filesystems can only set the min_order with the
initial support?
> > +static inline void mapping_set_folio_orders(struct address_space *mapping,
> > + unsigned int min, unsigned int max)
> > +{
> > + if (min == 1)
> > + min = 2;
> > + if (max < min)
> > + max = min;
> > + if (max > MAX_PAGECACHE_ORDER)
> > + max = MAX_PAGECACHE_ORDER;
> > +
> > + /*
> > + * XXX: max is ignored as only minimum folio order is supported
> > + * currently.
> > + */
> > + mapping->flags = (mapping->flags & ~AS_FOLIO_ORDER_MASK) |
> > + (min << AS_FOLIO_ORDER_MIN) |
> > + (MAX_PAGECACHE_ORDER << AS_FOLIO_ORDER_MAX);
> > +}
> > +
Powered by blists - more mailing lists