From: Andrew Morton <akpm@linux-foundation.org>
To: Andrea Arcangeli <aarcange@redhat.com>
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: Tue, 22 Dec 2009 15:35:04 -0800 [thread overview]
Message-ID: <20091222153504.5ad9a16d.akpm@linux-foundation.org> (raw)
In-Reply-To: <20091219160300.GB29790@random.random>
On Sat, 19 Dec 2009 17:03:00 +0100
Andrea Arcangeli <aarcange@redhat.com> wrote:
> Subject: clear_huge_page fix
> From: Andrea Arcangeli <aarcange@redhat.com>
>
> sz is in bytes, MAX_ORDER_NR_PAGES is in pages.
>
> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
> ---
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -401,7 +401,7 @@ static void clear_huge_page(struct page
> {
> int i;
>
> - if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
> + if (unlikely(sz/PAGE_SIZE > MAX_ORDER_NR_PAGES)) {
> clear_gigantic_page(page, addr, sz);
> return;
> }
: 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().
--
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 parent reply other threads:[~2009-12-22 23:35 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 ` Andrew Morton [this message]
2009-12-22 23:50 ` Andrea Arcangeli
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=20091222153504.5ad9a16d.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aarcange@redhat.com \
--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