linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: "Benjamin C.R. LaHaise" <blah@kvack.org>
Cc: tytso@mit.edu, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	MOLNAR Ingo <mingo@chiara.elte.hu>
Subject: Re: [RFC] atomic pte updates for x86 smp
Date: Wed, 11 Oct 2000 23:42:04 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.10.10010112318110.2852-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.3.96.1001011232450.23223A-100000@kanga.kvack.org>


On Thu, 12 Oct 2000, Benjamin C.R. LaHaise wrote:
> 
> Note the fragment above those portions of the patch where the
> pte_xchg_clear is done on the page table: this results in a page fault
> for any other cpu that looks at the pte while it is unavailable.

Ok, I see..

Hmm.. That's a singularly ugly interface, though - it all looks very
x86-specific. Things like "pte_xchg_clear()" look just a bit too obviously
like the name only makes sense due to the x86 implementation. So I'd like
to change the naming to be more about the design and less about the
implementation..

(It also doesn't make sense to me that you call the "clear the write bit"
thing "atomic_pte_wrprotect()", but you call the "clear the dirty bit"
"pte_test_and_clear_dirty()" - why not the same naming scheme for the two 
things?). 

I also have this suspicion that if this was done right, we should be able
to clean up the 64-bit atomic stuff for the x86 PAE case - which does a
cmpxchg8b right now on PAE entries exactly because of atomicity reasons.

With your patch as it stands now, we'd end up basically always doing two
of them.

And looking at the patch I get this nagging feeling that if this was
really done right, we could get rid of that PAE special case for
set_pte(), because the issue with atomic updates on PAE really boils down
to pretty much the same thing as the issue of one atomic bit.

(Instead of doing an atomic 64-bit memory write, we would be doing the
atomic "pte_xchg_clear()" followed by two _non_atomic 32-bit writes where
the second write would set the present bit. Although maybe the erratum
about the PAE pgd entry not honoring the P bit correctly makes this be
unworkable).

Ingo? I'd really like you to take a long look at this patch for sanity,
especially wrt PAE.

After this patch, are there any cases where we do a "set_pte()" where the
PTE wasn't clear before? That might be a good sanity-test to add, just to
make sure. And I'd really like to speed up the PAE set_pte() - as far as I
can tell both set_pte and set_pmd really should be safe without the atomic
64-bit crap with your changes.

Why do I care?

Basically, I'd be a lot happier about this patch if it also solves another
problem - if the "lost dirty bits" patch automagically also solves the
"64-bit atomic PTE" issue for the PAE case, then I will just feel a lot
happier about the fact that the solution is not just a specific hack for
handling "dirty", but a real change that makes conceptual sense for two
unrelated problems.

Because this, as always, is my final test for a "GoodDesign(tm)" patch: if
it solves just one problem it's a bug-fix, but if it solves two problems
it is the "RightThing(tm)" to do. And bug-fixes are a dime a dozen. Good
design is something to be admired.

What do you say, Ben? Do you think your approach really would solve the
PAE atomicity issue too, or am I just expecting too much?

		Linus

--
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.eu.org/Linux-MM/

  parent reply	other threads:[~2000-10-12  6:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200010090419.e994JQT09775@trampoline.thunk.org>
2000-10-10 20:53 ` Updated 2.4 TODO List Rik van Riel
2000-10-11  0:06   ` 2.4.0test9 vm: disappointing streaming i/o under load Chris Evans
2000-10-11 11:38     ` Eric Lowe
2000-10-11 20:59       ` Chris Evans
2000-10-11 22:10         ` Roger Larsson
2000-10-11 22:46           ` Chris Evans
2000-10-13 16:57             ` Rik van Riel
2000-10-11 18:38   ` Updated 2.4 TODO List tytso
2000-10-11 23:52     ` [RFC] atomic pte updates for x86 smp Ben LaHaise
2000-10-12  0:09       ` Linus Torvalds
2000-10-12  4:03         ` Benjamin C.R. LaHaise
2000-10-12  4:06           ` David S. Miller
2000-10-12  4:31             ` Cort Dougan
2000-10-12  4:37             ` Benjamin C.R. LaHaise
2000-10-12  6:42           ` Linus Torvalds [this message]
2000-10-12  8:13             ` Ingo Molnar
2000-10-12  8:56               ` David S. Miller
2000-10-12 10:05                 ` Ingo Molnar
2000-10-12 11:10                   ` Ingo Molnar
2000-10-12 15:10             ` Benjamin C.R. LaHaise

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=Pine.LNX.4.10.10010112318110.2852-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=blah@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@chiara.elte.hu \
    --cc=tytso@mit.edu \
    /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