linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [aarcange@redhat.com: [PATCH 00 of 28] Transparent Hugepage support #2]
Date: Wed, 23 Dec 2009 00:50:20 +0100	[thread overview]
Message-ID: <20091222235020.GH6429@random.random> (raw)
In-Reply-To: <20091222153504.5ad9a16d.akpm@linux-foundation.org>

Hi Andrew,

On Tue, Dec 22, 2009 at 03:35:04PM -0800, Andrew Morton wrote:
> : static void clear_huge_page(struct page *page,
> : 			unsigned long addr, unsigned long sz)
> : {
> : 	int i;
> : 
> : 	if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
> : 		clear_gigantic_page(page, addr, sz);
> : 		return;
> : 	}
> : 
> : 	might_sleep();
> : 	for (i = 0; i < sz/PAGE_SIZE; i++) {
> : 		cond_resched();
> : 		clear_user_highpage(page + i, addr + i * PAGE_SIZE);
> : 	}
> : }
> 
> umph.  So we've basically never executed the clear_user_highpage() loop.
> 
> Is there any point in retaining it?  Why not just call
> clear_gigantic_page() all the time, as we've been doing?  All it does
> it to avoid a call to mem_map_next() per clear_page().

My understanding is that not calling gigantic_page is faster by not
having to lookup zone changes, because compound pages created by the
buddy allocator are guaranteed to stay in the same zone or the buddy
couldn't return them. So we can just do page + i, if the compound
order is <= MAX_ORDER_NR_PAGES. It's probably lost in the noise by the
CPU waste of a 2M copy. I guess it's worth to retain given somebody
already bothered to optimize for it.

--
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>

      reply	other threads:[~2009-12-22 23:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091218163058.GT29790@random.random>
     [not found] ` <20091218114236.e883671a.akpm@linux-foundation.org>
     [not found]   ` <20091219160300.GB29790@random.random>
2009-12-22 23:35     ` [aarcange@redhat.com: [PATCH 00 of 28] Transparent Hugepage support #2] Andrew Morton
2009-12-22 23:50       ` Andrea Arcangeli [this message]

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=20091222235020.GH6429@random.random \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@gibson.dropbear.id.au \
    --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;
as well as URLs for NNTP newsgroup(s).