Re: [PATCH -mm 0/2] mm: page_ext: split page_ext flags

Yafang Shao
2023-01-18T03:16:21Z

On Mon, Jan 16, 2023 at 6:58 PM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> On 12/17/22 11:58, Yafang Shao wrote:
> > On 64bit system, page extension is for debugging purpose only currently,
> > because of its overhead, in particular the memory overhead.
> >
> > Once a page_ext is enabled, at least it will take 0.2% of the total
> > memory because of the page_ext flags, no matter this page_ext uses it or
> > not. Currently this page_ext flags is only used for page_owner on 64bit
> > system. So it doesn't make sense to allocate this flags for all page_ext
> > by default. We'd better move it into page_owner's structure, then when
> > someone wants to introduce a new page_ext which may be memory-overhead
> > sensitive, it will save this unneeded overhead.
> >
> > On 32bit system, there's page_idle running on production envrionment,
> > which also uses this page_ext flags. So it will take another 0.2% of
> > total memory if the user enable both page_idle and page_owner after this
> > change, but considering page_owner is for debugging purpose only, the
> > memory overhead in this case won't be a problem.
> >
> > So, let split the page_ext flags.
>
> Hi,
>
> FYI I think Pasha's solution should work to avoid the waste even without the
> split:
>
> https://lore.kernel.org/all/20230113154253.92480-1-pasha.tatashin@soleen.com/
>

Thanks for the information!

Splitting the flags could make page extensions more clear. We'd
better modularize these page extensions.
Different page extensions should maintain their members in their own
implementations.

But if the maintainer prefers Pasha's solution, I don't have strong
objectation.

Regards
Yafang