linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Sasha Levin <sasha.levin@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] hugetlb: clear PG_reserved before setting PG_head on gigantic pages
Date: Tue, 13 Oct 2015 17:09:52 +0800	[thread overview]
Message-ID: <004e01d10596$eba6de70$c2f49b50$@alibaba-inc.com> (raw)
In-Reply-To: <004b01d10596$60e7eae0$22b7c0a0$@alibaba-inc.com>

> PF_NO_COMPOUND for PG_reserved assumes we don't use PG_reserved for
> compound pages. And we generally don't. But during allocation of
> gigantic pages we set PG_head before clearing PG_reserved and
> __ClearPageReserved() steps on the VM_BUG_ON_PAGE().
> 
> The fix is trivial: set PG_head after PG_reserved.
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Sasha Levin <sasha.levin@oracle.com>
> ---

Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
> 
> Andrew, this patch can be folded into "page-flags: define PG_reserved behavior on compound pages".
> 
> ---
>  mm/hugetlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 6ecf61ffa65d..bd3f3e20313b 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1258,8 +1258,8 @@ static void prep_compound_gigantic_page(struct page *page, unsigned int order)
> 
>  	/* we rely on prep_new_huge_page to set the destructor */
>  	set_compound_order(page, order);
> -	__SetPageHead(page);
>  	__ClearPageReserved(page);
> +	__SetPageHead(page);
>  	for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
>  		/*
>  		 * For gigantic hugepages allocated through bootmem at
> --
> 2.5.3
> 


--
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:[~2015-10-13  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <004b01d10596$60e7eae0$22b7c0a0$@alibaba-inc.com>
2015-10-13  9:09 ` Hillf Danton [this message]
2015-10-06 14:35 Kirill A. Shutemov

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='004e01d10596$eba6de70$c2f49b50$@alibaba-inc.com' \
    --to=hillf.zj@alibaba-inc.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sasha.levin@oracle.com \
    /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