From: Nick Piggin <npiggin@suse.de>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-arch@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>,
Paul McKenney <paulmck@us.ibm.com>
Subject: Re: [patch 2/2] fix SMP data race in pagetable setup vs walking
Date: Tue, 6 May 2008 11:52:52 +0200 [thread overview]
Message-ID: <20080506095252.GF10141@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0805051751230.11062@blonde.site>
On Mon, May 05, 2008 at 05:57:20PM +0100, Hugh Dickins wrote:
> On Mon, 5 May 2008, Nick Piggin wrote:
> > Index: linux-2.6/mm/memory.c
> > ===================================================================
> > --- linux-2.6.orig/mm/memory.c
> > +++ linux-2.6/mm/memory.c
> > @@ -311,6 +311,37 @@ int __pte_alloc(struct mm_struct *mm, pm
> > if (!new)
> > return -ENOMEM;
> >
> > + /*
> > + * Ensure all pte setup (eg. pte page lock and page clearing) are
> > + * visible before the pte is made visible to other CPUs by being
> > + * put into page tables.
> > + *
> > + * The other side of the story is the pointer chasing in the page
> > + * table walking code (when walking the page table without locking;
> > + * ie. most of the time). Fortunately, these data accesses consist
> > + * of a chain of data-dependent loads, meaning most CPUs (alpha
> > + * being the notable exception) will already guarantee loads are
> > + * seen in-order. x86 has a "reference" implementation of
> > + * smp_read_barrier_depends() barriers in its page table walking
> > + * code, even though that barrier is a simple noop on that architecture.
> > + * Alpha obviously also has the required barriers.
> > + *
> > + * It is debatable whether or not the smp_read_barrier_depends()
> > + * barriers are required for kernel page tables; it could be that
> > + * nowhere in the kernel do we walk those pagetables without taking
> > + * init_mm's page_table_lock.
>
> Just delete "; it could be that ... init_mm's page_table_lock":
> in general (if not everywhere) the architectures do not nowadays
> take init_mm's page_table_lock to walk down those pagetables (blame
> me for removing it, if anyone thinks that was wrong: I stand by it).
OK. That's fine IMO and I'll remove that line.
--
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 prev parent reply other threads:[~2008-05-06 9:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-05 11:20 [patch 1/2] read_barrier_depends fixlets Nick Piggin
2008-05-05 12:12 ` [patch 2/2] fix SMP data race in pagetable setup vs walking Nick Piggin
2008-05-05 14:35 ` Paul E. McKenney
2008-05-06 9:38 ` Nick Piggin
2008-05-06 13:32 ` Paul E. McKenney
2008-05-13 7:55 ` Nick Piggin
2008-05-13 13:26 ` Paul E. McKenney
2008-05-05 15:32 ` Linus Torvalds
2008-05-05 16:37 ` Hugh Dickins
2008-05-06 9:51 ` Nick Piggin
2008-05-06 14:53 ` Linus Torvalds
2008-05-06 19:11 ` Paul E. McKenney
2008-05-14 4:27 ` Nick Piggin
2008-05-13 8:01 ` Nick Piggin
2008-05-13 15:45 ` Linus Torvalds
2008-05-14 0:34 ` Nick Piggin
2008-05-14 0:55 ` Linus Torvalds
2008-05-14 1:18 ` Nick Piggin
2008-05-14 4:35 ` [patch 1/2] read_barrier_depends arch fixlets Nick Piggin
2008-05-14 4:37 ` [patch 2/2] fix SMP data race in pagetable setup vs walking Nick Piggin
2008-05-14 13:26 ` [patch 1/2] read_barrier_depends arch fixlets Paul E. McKenney
2008-05-05 16:57 ` [patch 2/2] fix SMP data race in pagetable setup vs walking Hugh Dickins
2008-05-06 9:52 ` Nick Piggin [this message]
2008-05-06 7:08 ` David Miller, Nick Piggin
2008-05-06 9:56 ` Nick Piggin
2008-05-05 14:27 ` [patch 1/2] read_barrier_depends fixlets Paul E. McKenney
2008-05-06 9:01 ` Nick Piggin
2008-05-06 14:06 ` Paul E. McKenney
2008-05-06 15:29 ` David Howells
2008-05-06 19:09 ` Paul E. McKenney
2008-05-13 8:05 ` Nick Piggin
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=20080506095252.GF10141@wotan.suse.de \
--to=npiggin@suse.de \
--cc=hugh@veritas.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=paulmck@us.ibm.com \
--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 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).