lkml.org 
[lkml]   [2023]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC v2 1/3] mm: Add TAIL_MAPPING_REUSED_MAX
On Mon, Aug 14, 2023 at 08:08:57PM +0100, Matthew Wilcox wrote:
> On Mon, Aug 14, 2023 at 02:44:09PM -0400, Peter Xu wrote:
> > +/*
> > + * This macro defines the maximum tail pages (of a folio) that can have the
> > + * page->mapping field reused (offset 12 for 32bits, or 24 for 64bits).
>
> No, don't say how many bytes into the structure something is. It'll
> only get out of date. If somebody needs to know, use pahole.

OK.

>
> > + * When the tail page's mapping field reused, it'll be exempted from
> > + * ->mapping poisoning and checks. Also see the macro TAIL_MAPPING.
> > + */
> > +#define TAIL_MAPPING_REUSED_MAX (2)
>
> More importantly, I think this is over-parametrisation. If you start to
> use extra fields in struct folio, just change the code in page_alloc.c
> directly.

One should at least also need to change __split_huge_page_tail() on the
BUG_ON() with the hard-coded "tail > 2"?

I wanted to link all these pieces together, and the use case is when anyone
would like to e.g. reuse tail page 3 of a folio, hence put the macro here.

--
Peter Xu

\
 
 \ /
  Last update: 2023-08-14 21:54    [W:0.053 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site