[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YyhnlHcIsQyaUScf@hyeyoo>
Date: Mon, 19 Sep 2022 21:59:00 +0900
From: Hyeonggon Yoo <42.hyeyoo@...il.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Vlastimil Babka <vbabka@...e.cz>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Naoya Horiguchi <naoya.horiguchi@....com>,
Miaohe Lin <linmiaohe@...wei.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Minchan Kim <minchan@...nel.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Andrea Arcangeli <aarcange@...hat.com>,
Dan Williams <dan.j.williams@...el.com>,
Hugh Dickins <hughd@...gle.com>,
Muchun Song <songmuchun@...edance.com>,
David Hildenbrand <david@...hat.com>,
Andrey Konovalov <andreyknvl@...il.com>,
Marco Elver <elver@...gle.com>
Subject: Re: [RFC PATCH] mm: move PG_slab flag to page_type
On Mon, Sep 19, 2022 at 09:57:08PM +0900, Hyeonggon Yoo wrote:
> For now, only SLAB uses _mapcount field as a number of active objects in
> a slab, and other slab allocators do not use it. As 16 bits are enough
> for that, use remaining 16 bits of _mapcount as page_type even when
> SLAB is used. And then move PG_slab flag to page_type!
>
> Note that page_type is always placed in upper 16 bits of _mapcount to
> avoid confusing normal _mapcount as page_type. As underflow (actually
> I mean, yeah, overflow) is not a concern anymore, use more lower bits
> except bit zero.
>
> Add more folio helpers for PAGE_TYPE_OPS() not to break existing
> slab implementations.
>
> Remove PG_slab check from PAGE_FLAGS_CHECK_AT_FREE. buddy will still
> check if _mapcount is properly set at free.
>
> Exclude PG_slab from hwpoison and show_page_flags() for now.
>
> Note that with this patch, page_mapped() and folio_mapped() always return
> false for slab page.
>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: Pekka Enberg <penberg@...nel.org>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Roman Gushchin <roman.gushchin@...ux.dev>
> Cc: Naoya Horiguchi <naoya.horiguchi@....com>
> Cc: Miaohe Lin <linmiaohe@...wei.com>
> Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>
> Cc: Minchan Kim <minchan@...nel.org>
> Cc: Mel Gorman <mgorman@...hsingularity.net>
> Cc: Andrea Arcangeli <aarcange@...hat.com>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Hugh Dickins <hughd@...gle.com>
> Cc: Muchun Song <songmuchun@...edance.com>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Andrey Konovalov <andreyknvl@...il.com>
> Cc: Marco Elver <elver@...gle.com>
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
> ---
>
> I think this gives us two benefits:
> - it frees a bit in flags field
> - it makes it simpler to distinguish user-mapped pages and
> not-user-mapped pages.
>
> Plus I'm writing a bit more of code including:
> 0) a few cleanup for code that checks
> !PageSlab() && page_mapped() or that does similar thing
> 1) provide human-readale string of page_type in dump_page
> 2) add show_page_types() for tracepoint
> 3) fix hwpoison ...etc.
>
> Anyway This is an early RFC, I will very appreciate feedbacks!
Looks like I forgot to add RFC in subject :)
Powered by blists - more mailing lists