[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bc22b4d0-ba63-4559-88d9-a510da233cad@suse.cz>
Date: Mon, 27 Sep 2021 19:48:15 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Kent Overstreet <kent.overstreet@...il.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: Johannes Weiner <hannes@...xchg.org>,
Matthew Wilcox <willy@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Darrick J. Wong" <djwong@...nel.org>,
Christoph Hellwig <hch@...radead.org>,
David Howells <dhowells@...hat.com>
Subject: Re: Struct page proposal
On 9/23/21 03:21, Kent Overstreet wrote:
> So if we have this:
>
> struct page {
> unsigned long allocator;
> unsigned long allocatee;
> };
>
> The allocator field would be used for either a pointer to slab/slub's state, if
> it's a slab page, or if it's a buddy allocator page it'd encode the order of the
> allocation - like compound order today, and probably whether or not the
> (compound group of) pages is free.
The "free page in buddy allocator" case will be interesting to implement.
What the buddy allocator uses today is:
- PageBuddy - determine if page is free; a page_type (part of mapcount
field) today, could be a bit in "allocator" field that would have to be 0 in
all other "page is allocated" contexts.
- nid/zid - to prevent merging accross node/zone boundaries, now part of
page flags
- buddy order
- a list_head (reusing the "lru") to hold the struct page on the appropriate
free list, which has to be double-linked so page can be taken from the
middle of the list instantly
Won't be easy to cram all that into two unsigned long's, or even a single
one. We should avoid storing anything in the free page itself. Allocating
some external structures to track free pages is going to have funny
bootstrap problems. Probably a major redesign would be needed...
Powered by blists - more mailing lists