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>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [rfc] data race in page table setup/walking?
Date: Thu, 1 May 2008 02:35:42 +0200 [thread overview]
Message-ID: <20080501003542.GB11312@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0804301140490.4651@blonde.site>
On Wed, Apr 30, 2008 at 12:14:51PM +0100, Hugh Dickins wrote:
> On Wed, 30 Apr 2008, Nick Piggin wrote:
> >
> > Actually, aside, all those smp_wmb() things in pgtable-3level.h can
> > probably go away if we cared: because we could be sneaky and leverage
> > the assumption that top and bottom will always be in the same cacheline
> > and thus should be shielded from memory consistency problems :)
>
> I've sometimes wondered along those lines. But it would need
> interrupts disabled, wouldn't it? And could SMM mess it up?
> And what about another CPU taking the cacheline to modify it
> in between our two accesses?
Nothing more than could not already happen with the smp_wmb in there,
AFAIKS.
> I don't think we do care in that x86 PAE case, but as a general
> principal, if it can be safely assumed on all architectures (or
> more messily, just on some) under certain conditions, then shouldn't
> we be looking to use that technique (relying on a consistent view of
> separate variables clustered into the same cacheline) in critical
> places, rather than regarding it as sneaky?
>
> But I suspect this is a chimaera, that there's actually no
> safe use to be made of it. I'd be glad to be shown wrong.
Well Linus put a dampener on it... but if it actually did work, then
yeah I guess there are some places it could be used. I suspect that
on some implementations, being in the same cacheline would actually
fully order all transactions of a CPU, so if it did make a big
difference anywhere, we could have smp_*mb_cacheline() or something ;)
--
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-01 0:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 5:00 [rfc] data race in page table setup/walking? Nick Piggin
2008-04-29 5:08 ` Benjamin Herrenschmidt
2008-04-29 5:41 ` Nick Piggin
2008-04-29 10:56 ` David Miller, Nick Piggin
2008-04-29 12:36 ` Hugh Dickins
2008-04-29 21:37 ` Benjamin Herrenschmidt
2008-04-29 22:47 ` Hugh Dickins
2008-04-30 0:09 ` Benjamin Herrenschmidt
2008-04-30 6:03 ` Nick Piggin
2008-04-30 6:05 ` David Miller, Nick Piggin
2008-04-30 6:17 ` Nick Piggin
2008-04-30 11:14 ` Hugh Dickins
2008-05-01 0:35 ` Nick Piggin [this message]
2008-05-01 12:45 ` Hugh Dickins
2008-04-30 15:53 ` Linus Torvalds
2008-05-01 0:29 ` Nick Piggin
2008-05-01 3:24 ` Linus Torvalds
2008-05-02 1:20 ` Nick Piggin
2008-05-02 1:33 ` Linus Torvalds
2008-05-02 1:43 ` 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=20080501003542.GB11312@wotan.suse.de \
--to=npiggin@suse.de \
--cc=benh@kernel.crashing.org \
--cc=hugh@veritas.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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