linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Adam Litke <agl@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@ozlabs.org, balbir@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org,
	Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Subject: Re: [BUG] 2.6.25-rc3-mm1 kernel bug while running libhugetlbfs
Date: Tue, 04 Mar 2008 16:01:29 -0600	[thread overview]
Message-ID: <1204668089.14779.92.camel@localhost.localdomain> (raw)
In-Reply-To: <20080304115158.505f33eb.akpm@linux-foundation.org>

On Tue, 2008-03-04 at 11:51 -0800, Andrew Morton wrote:
> hugetlb-correct-page-count-for-surplus-huge-pages.patch adds:
> 
>         if (page) {
>                 /*
>                  * This page is now managed by the hugetlb allocator and has
>                  * no users -- drop the buddy allocator's reference.
>                  */
>                 int page_count = put_page_testzero(page);
>                 BUG_ON(page_count != 0);
> 
> 

Ugh I got bitten by put_page_testzero().  When it returns 1, the page
count is zero (not the page count).

My initial version had a BUG_ON() with side-effects.  When a reviewer
pointed it out, I thought I could fix the patch up on its way out the
door.  I have self-administered my punishment.  This patch will fix it:

Signed-off-by: Adam Litke <agl@us.ibm.com>

--- mm/hugetlb.c.orig	2008-03-04 13:36:30.000000000 -0800
+++ mm/hugetlb.c	2008-03-04 13:39:30.000000000 -0800
@@ -291,8 +291,8 @@ static struct page *alloc_buddy_huge_pag
 		 * This page is now managed by the hugetlb allocator and has
 		 * no users -- drop the buddy allocator's reference.
 		 */
-		int page_count = put_page_testzero(page);
-		BUG_ON(page_count != 0);
+		put_page_testzero(page);
+		VM_BUG_ON(page_count(page));
 		nid = page_to_nid(page);
 		set_compound_page_dtor(page, free_huge_page);
 		/*
 
-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

  reply	other threads:[~2008-03-04 21:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080304011928.e8c82c0c.akpm@linux-foundation.org>
2008-03-04 13:12 ` [BUG] 2.6.25-rc3-mm1 kernel panic while bootup on powerpc () Kamalesh Babulal
2008-03-04 14:40   ` Michael Neuling
2008-03-04 18:33     ` Andrew Morton
2008-03-05  8:23       ` Benjamin Herrenschmidt
2008-03-06  0:03       ` Benjamin Herrenschmidt
2008-03-06  0:44         ` Andrew Morton
2008-03-06  0:52           ` Benjamin Herrenschmidt
2008-03-04 18:36   ` Andrew Morton
2008-03-04 18:47     ` Pekka Enberg
2008-03-04 19:18     ` Pekka Enberg
2008-03-04 19:35       ` Mel Gorman
2008-03-04 19:41         ` Pekka Enberg
2008-03-04 19:56           ` Christoph Lameter
2008-03-04 20:01             ` Pekka J Enberg
2008-03-04 20:02               ` Christoph Lameter
2008-03-04 20:07               ` Christoph Lameter
2008-03-04 20:08                 ` Pekka Enberg
2008-03-05  2:28                   ` Kamalesh Babulal
2008-03-04 20:34                 ` Andrew Morton
2008-03-04 20:44                   ` Pekka Enberg
2008-03-04 21:44                     ` Christoph Lameter
2008-03-05 14:02                   ` Mel Gorman
2008-03-05 14:31                 ` Mel Gorman
2008-03-04 20:01           ` Christoph Lameter
2008-03-05  8:22   ` Benjamin Herrenschmidt
2008-03-04 19:20 ` [BUG] 2.6.25-rc3-mm1 kernel bug while running libhugetlbfs Kamalesh Babulal
2008-03-04 19:51   ` Andrew Morton
2008-03-04 22:01     ` Adam Litke [this message]
2008-03-05  7:52       ` Kamalesh Babulal
2008-03-05 21:34 ` 2.6.25-rc3-mm1 ppc64 boot hang Badari Pulavarty
2008-03-05 21:54   ` Andrew Morton
2008-03-05 22:35     ` Badari Pulavarty
2008-03-05 23:17     ` Stephen Rothwell

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=1204668089.14779.92.camel@localhost.localdomain \
    --to=agl@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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).