linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Dave Jones <davej@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andre Noll <maan@systemlinux.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org, andrea@suse.de,
	riel@redhat.com
Subject: Re: 2.6.18: Kernel BUG at mm/rmap.c:522
Date: Thu, 05 Oct 2006 16:28:48 +1000	[thread overview]
Message-ID: <4524A620.8020801@yahoo.com.au> (raw)
In-Reply-To: <20061004203935.GB32161@redhat.com>

Dave Jones wrote:
> On Wed, Oct 04, 2006 at 05:49:00PM +0200, Peter Zijlstra wrote:
> 
>  > > > It is also nice if we can work out where the page actually came from. The
>  > > > following attached patch should help out a bit with that, if you could
>  > > > run with it?
>  > > Okay. I'll reboot with your patch and let you know if it crashes again.
>  > enable CONFIG_DEBUG_VM to get that.
> 
> Given this warnings still pops up from time to time, I question whether
> putting that check under DEBUG_VM was such a good idea.  It's not as
> if it's a major performance impact.  This has potential for us to lose
> valuable debugging info for a few nanoseconds performance increase in
> an already costly path.

Frustratingly, it usually doesn't tell us much (without my previous
patch), because it is normally some driver that has stuffed up their
refcounting and the page-> fields don't tell us where the page has
come from.

But..

> This patch brings it back unconditionally, and moves the BUG()
> into the if arm.

... this shouldn't hurt if gcc moves the unlikely code out of the
linear instruction stream, which I think it usually does. It shouldn't
cost _anything_ because we're already doing the branch for the BUG_ON
which you remove.

> Signed-off-by: Dave Jones <davej@redhat.com>

Thanks,
Acked-by: Nick Piggin <npiggin@suse.de>

> 
> --- local-git/mm/rmap.c~	2006-10-04 16:38:06.000000000 -0400
> +++ local-git/mm/rmap.c	2006-10-04 16:38:24.000000000 -0400
> @@ -576,15 +576,14 @@ void page_add_file_rmap(struct page *pag
>  void page_remove_rmap(struct page *page)
>  {
>  	if (atomic_add_negative(-1, &page->_mapcount)) {
> -#ifdef CONFIG_DEBUG_VM
>  		if (unlikely(page_mapcount(page) < 0)) {
>  			printk (KERN_EMERG "Eeek! page_mapcount(page) went negative! (%d)\n", page_mapcount(page));
>  			printk (KERN_EMERG "  page->flags = %lx\n", page->flags);
>  			printk (KERN_EMERG "  page->count = %x\n", page_count(page));
>  			printk (KERN_EMERG "  page->mapping = %p\n", page->mapping);
> +			BUG();
>  		}
> -#endif
> -		BUG_ON(page_mapcount(page) < 0);
> +
>  		/*
>  		 * It would be tidy to reset the PageAnon mapping here,
>  		 * but that might overwrite a racing page_add_anon_rmap


-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

--
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:[~2006-10-05  6:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-04 10:40 Andre Noll
2006-10-04 13:59 ` Nick Piggin
2006-10-04 15:42   ` Andre Noll
2006-10-04 15:49     ` Peter Zijlstra
2006-10-04 16:12       ` Andre Noll
2006-10-04 20:39       ` Dave Jones
2006-10-05  6:28         ` Nick Piggin [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=4524A620.8020801@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andrea@suse.de \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maan@systemlinux.org \
    --cc=riel@redhat.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