lkml.org 
[lkml]   [2023]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 01/23] fs: Allow fine-grained control of folio sizes
On Fri, Sep 15, 2023 at 08:38:26PM +0200, Pankaj Raghav wrote:
> +static inline void mapping_set_folio_orders(struct address_space *mapping,
> + unsigned int min, unsigned int max)
> +{
> + /*
> + * XXX: max is ignored as only minimum folio order is supported
> + * currently.
> + */

I think we need some sanity checking ...

if (min == 1)
min = 2;
if (max < min)
max = min;
if (max > MAX_PAGECACHE_ORDER)
max = MAX_PAGECACHE_ORDER;

> + mapping->flags = (mapping->flags & ~AS_FOLIO_ORDER_MASK) |
> + (min << AS_FOLIO_ORDER_MIN) |
> + (MAX_PAGECACHE_ORDER << AS_FOLIO_ORDER_MAX);
> +}

\
 
 \ /
  Last update: 2023-09-15 21:05    [W:0.445 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site