From: Andy Whitcroft <apw@shadowen.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org
Subject: Re: virtual memmap sparsity: Dealing with fragmented MAX_ORDER blocks
Date: Tue, 26 Sep 2006 13:11:05 +0100 [thread overview]
Message-ID: <451918D9.4080001@shadowen.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0609251721140.25322@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
> On Mon, 25 Sep 2006, Christoph Lameter wrote:
>
>> Looking through the i386 commands I see a VERR mnemonic that
>> I guess will do what you need on i386 and x86_64 in order to do
>> what we need without a page table walk.
>
> I think I guessed wrong VERR does something with segments???
>
> We could sidestep the issue by not marking the huge page
> non present but pointing it to a pte page with all pointers to the
> zero page.
Well we'd really want it to be a page of page*'s marked as in
PG_reserved and probabally in an invalid zone or some such to prevent
them coelesing with logically adjacent buddies.
>
> All page flags will be cleared of the page structs in the zero page and
> thus we cannot reference an invalid address. Therefore:
>
> static inline int page_is_buddy(struct page *page, struct page *buddy,
> int order)
> {
> #ifdef CONFIG_HOLES_IN_ZONE
> if (!pfn_valid(page_to_pfn(buddy)))
> return 0;
> #endif
>
> if (page_zone_id(page) != page_zone_id(buddy))
> return 0;
>
> if (PageBuddy(buddy) && page_order(buddy) == order) {
> BUG_ON(page_count(buddy) != 0);
> return 1;
> }
> return 0;
> }
>
> can become
>
> static inline int page_is_buddy(struct page *page, struct page *buddy,
> int order)
> {
> if (page_zone_id(page) != page_zone_id(buddy))
> return 0;
>
> if (PageBuddy(buddy) && page_order(buddy) == order) {
> BUG_ON(page_count(buddy) != 0);
> return 1;
> }
> return 0;
> }
>
> for all cases.
>
> Also note that page_zone_id(page) no longer needs to be using a lookup of
> page->flags. We just need to insure that both pages are in the same
> MAX_ORDER group. For that to be true the upper portion of the addresses
> must match.
>
> int page_zone_id(struct page *page)
> {
> return pfn_page >> MAX_ORDER;
> }
I don't think this is correct. Zones are not guarenteed to be max order
aligned, and we cannot allow pages in different zones be coelesced.
Indeed, as often they are properly aligned we looked at taking this test
out very recently. The complexity and risk was deemed to great. It is
after all a simple check against a cache line which is about to be used
and checked in the very next statement. So the cost is very small.
-apw
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-09-26 12:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-24 16:59 virtual mmap basics Christoph Lameter
2006-09-25 12:28 ` Andy Whitcroft
2006-09-25 16:27 ` Christoph Lameter
2006-09-25 17:11 ` Christoph Lameter
2006-09-25 21:05 ` Christoph Lameter
2006-09-25 22:22 ` Andy Whitcroft
2006-09-25 23:37 ` Christoph Lameter
2006-09-26 12:06 ` Andy Whitcroft
2006-09-25 18:09 ` Andy Whitcroft
2006-09-25 21:00 ` Christoph Lameter
2006-09-25 23:54 ` virtual memmap sparsity: Dealing with fragmented MAX_ORDER blocks Christoph Lameter
2006-09-26 0:31 ` Christoph Lameter
2006-09-26 12:11 ` Andy Whitcroft [this message]
2006-09-26 15:23 ` Christoph Lameter
2006-09-26 8:16 ` Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=451918D9.4080001@shadowen.org \
--to=apw@shadowen.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox