All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Jeff Chua <jeff.chua.linux@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Gabriel C <nix.or.die@googlemail.com>,
	Hans Rosenfeld <hans.rosenfeld@amd.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] x86: fix PAE pmd_bad bootup warning
Date: Thu, 8 May 2008 09:07:31 -0700	[thread overview]
Message-ID: <20080508160731.GM23990@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0805062120120.16053@blonde.site>

On 06.05.2008 [21:30:44 +0100], Hugh Dickins wrote:
> On Tue, 6 May 2008, Linus Torvalds wrote:
> > On Tue, 6 May 2008, Hugh Dickins wrote:
> > >
> > > Fix Hans' good observation that follow_page() will never find
> > > pmd_huge() because that would have already failed the pmd_bad
> > > test: test pmd_huge in between the pmd_none and pmd_bad tests.
> > > Tighten x86's pmd_huge() check?  No, once it's a hugepage entry,
> > > it can get quite far from a good pmd: for example, PROT_NONE
> > > leaves it with only ACCESSED of the KERN_PGTABLE bits.
> > 
> > I'd much rather have pdm_bad() etc fixed up instead, so that they do
> > a more proper test (not thinking that a PSE page is bad, since it
> > clearly isn't). And then, make them dependent on DEBUG_VM, because
> > doing the proper test will be more expensive.
> 
> But everywhere we use pmd_bad() etc (most are hidden inside
> pmd_none_or_clear_bad() etc) we are expecting never to encounter
> a pmd_huge, unless there's corruption.  follow_page() is the one
> exception, and even in its case I can't find a current user that
> actually could meet a hugepage.  I'd rather tighten up pmd_bad
> (in the PAE and x86_64 cases), than weaken it so far as to let
> hugepages slip through.  Not that pmd_bad often catches anything:
> just coincidentally that 90909090 one today.

There is one case that seems to the source of Hans' problem, as Dave has
figured out: /proc/pid/pagemap, where we fairly straight-forwardly walk
the pagetables.

In there, we unconditionally call pmd_none_or_clear_bad(pmd). And any
userspace process that maps hugepages and then reads in
/proc/pid/pagemap will invoke that path, I think (at least with 2M
pages).

So I agree, you're fixing a potential issue in follow_page() [might
deserve a comment, so someone doesn't go and combine them back later?],
but Hans' issue is most likely related to the pagemap code?

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Jeff Chua <jeff.chua.linux@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Gabriel C <nix.or.die@googlemail.com>,
	Hans Rosenfeld <hans.rosenfeld@amd.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] x86: fix PAE pmd_bad bootup warning
Date: Thu, 8 May 2008 09:07:31 -0700	[thread overview]
Message-ID: <20080508160731.GM23990@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0805062120120.16053@blonde.site>

On 06.05.2008 [21:30:44 +0100], Hugh Dickins wrote:
> On Tue, 6 May 2008, Linus Torvalds wrote:
> > On Tue, 6 May 2008, Hugh Dickins wrote:
> > >
> > > Fix Hans' good observation that follow_page() will never find
> > > pmd_huge() because that would have already failed the pmd_bad
> > > test: test pmd_huge in between the pmd_none and pmd_bad tests.
> > > Tighten x86's pmd_huge() check?  No, once it's a hugepage entry,
> > > it can get quite far from a good pmd: for example, PROT_NONE
> > > leaves it with only ACCESSED of the KERN_PGTABLE bits.
> > 
> > I'd much rather have pdm_bad() etc fixed up instead, so that they do
> > a more proper test (not thinking that a PSE page is bad, since it
> > clearly isn't). And then, make them dependent on DEBUG_VM, because
> > doing the proper test will be more expensive.
> 
> But everywhere we use pmd_bad() etc (most are hidden inside
> pmd_none_or_clear_bad() etc) we are expecting never to encounter
> a pmd_huge, unless there's corruption.  follow_page() is the one
> exception, and even in its case I can't find a current user that
> actually could meet a hugepage.  I'd rather tighten up pmd_bad
> (in the PAE and x86_64 cases), than weaken it so far as to let
> hugepages slip through.  Not that pmd_bad often catches anything:
> just coincidentally that 90909090 one today.

There is one case that seems to the source of Hans' problem, as Dave has
figured out: /proc/pid/pagemap, where we fairly straight-forwardly walk
the pagetables.

In there, we unconditionally call pmd_none_or_clear_bad(pmd). And any
userspace process that maps hugepages and then reads in
/proc/pid/pagemap will invoke that path, I think (at least with 2M
pages).

So I agree, you're fixing a potential issue in follow_page() [might
deserve a comment, so someone doesn't go and combine them back later?],
but Hans' issue is most likely related to the pagemap code?

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
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:[~2008-05-08 16:07 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06  1:06 Linux 2.6.26-rc1 - pgtable_32.c:178 pmd_bad Jeff Chua
2008-05-06 12:49 ` Ingo Molnar
2008-05-06 13:56   ` Hugh Dickins
2008-05-06 15:04     ` Ingo Molnar
2008-05-06 15:09       ` Linus Torvalds
2008-05-06 15:15         ` Ingo Molnar
2008-05-06 16:16           ` Linus Torvalds
2008-05-06 16:30             ` Ingo Molnar
2008-05-06 15:32         ` Jeremy Fitzhardinge
2008-05-06 16:12           ` Hugh Dickins
2008-05-06 18:39     ` Linus Torvalds
2008-05-06 19:43       ` Hugh Dickins
2008-05-06 19:49       ` [PATCH] x86: fix PAE pmd_bad bootup warning Hugh Dickins
2008-05-06 19:49         ` Hugh Dickins
2008-05-06 20:06         ` Linus Torvalds
2008-05-06 20:06           ` Linus Torvalds
2008-05-06 20:30           ` Hugh Dickins
2008-05-06 20:30             ` Hugh Dickins
2008-05-08 16:07             ` Nishanth Aravamudan [this message]
2008-05-08 16:07               ` Nishanth Aravamudan
2008-05-06 20:22         ` Hans Rosenfeld
2008-05-06 20:22           ` Hans Rosenfeld
2008-05-06 20:36           ` Hugh Dickins
2008-05-06 20:36             ` Hugh Dickins
2008-05-07 23:39             ` Nishanth Aravamudan
2008-05-07 23:39               ` Nishanth Aravamudan
2008-05-06 20:42           ` Dave Hansen
2008-05-06 20:42             ` Dave Hansen
2008-05-08 14:34             ` Hans Rosenfeld
2008-05-08 14:34               ` Hans Rosenfeld
2008-05-08 14:39               ` Hans Rosenfeld
2008-05-08 14:52               ` Dave Hansen
2008-05-08 14:52                 ` Dave Hansen
2008-05-08 15:11                 ` Hans Rosenfeld
2008-05-08 15:11                   ` Hans Rosenfeld
2008-05-08 15:51                   ` Dave Hansen
2008-05-08 15:51                     ` Dave Hansen
2008-05-08 16:19                     ` Hans Rosenfeld
2008-05-08 16:19                       ` Hans Rosenfeld
2008-05-08 16:33                       ` Nishanth Aravamudan
2008-05-08 16:33                         ` Nishanth Aravamudan
2008-05-08 16:51                         ` Hans Rosenfeld
2008-05-08 16:51                           ` Hans Rosenfeld
2008-05-08 17:16                           ` Nishanth Aravamudan
2008-05-08 17:16                             ` Nishanth Aravamudan
2008-05-08 18:42                             ` Dave Hansen
2008-05-08 18:42                               ` Dave Hansen
2008-05-08 18:58                               ` Hugh Dickins
2008-05-08 18:58                                 ` Hugh Dickins
2008-05-08 19:06                                 ` Dave Hansen
2008-05-08 19:06                                   ` Dave Hansen
2008-05-08 18:48                             ` Hugh Dickins
2008-05-08 18:48                               ` Hugh Dickins
2008-05-08 19:49                               ` Matt Mackall
2008-05-08 19:49                                 ` Matt Mackall
2008-05-08 20:08                                 ` Dave Hansen
2008-05-08 20:08                                   ` Dave Hansen
2008-05-08 20:02                               ` Hans Rosenfeld
2008-05-08 20:02                                 ` Hans Rosenfeld
2008-05-08 20:16                                 ` Dave Hansen
2008-05-08 20:16                                   ` Dave Hansen
2008-05-08 23:15                                 ` Dave Hansen
2008-05-08 23:15                                   ` Dave Hansen
2008-05-14 19:01                                   ` Matt Mackall
2008-05-14 19:01                                     ` Matt Mackall
2008-05-09  9:03                                 ` Paul Mundt
2008-05-09  9:03                                   ` Paul Mundt
2008-05-08 16:42                       ` Dave Hansen
2008-05-08 16:42                         ` Dave Hansen
2008-05-08 15:44                 ` Nishanth Aravamudan
2008-05-08 15:44                   ` Nishanth Aravamudan
2008-05-07  4:40         ` Jeff Chua
2008-05-07  4:40           ` Jeff Chua
2008-05-07  5:30           ` Hugh Dickins
2008-05-07  5:30             ` Hugh Dickins

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=20080508160731.GM23990@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=arjan@linux.intel.com \
    --cc=hans.rosenfeld@amd.com \
    --cc=hpa@zytor.com \
    --cc=hugh@veritas.com \
    --cc=jeff.chua.linux@gmail.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=nix.or.die@googlemail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.