public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Arch list <linux-arch@vger.kernel.org>
Subject: Re: Changing  update_mmu_cache() or set_pte() ?
Date: Wed, 23 Feb 2005 16:35:42 +1100	[thread overview]
Message-ID: <1109136942.5412.198.camel@gaston> (raw)
In-Reply-To: <1109047997.5327.70.camel@gaston>

On Tue, 2005-02-22 at 15:53 +1100, Benjamin Herrenschmidt wrote:
> Hi !
> 
> I'm doing some work on the ppc32 MMU stuff and I'm faced to a problem
> related to HIGHMEM, and more specifically to PTE pages in HIGHMEM: 
> 
> update_mmu_cache() currently doesn't take the pte pointer. This means it
> has to look it up on ppc, and eventually map the pte page (gack !). But
> if you look at all the call sites for update_mmu_cache, they all have
> the pte pointer and the PTE page already kmap'ed either just before or
> around the call to update_mmu_cache().
> .../...

Ok, the story gets more complicated... While digging around, I found an
SMP race on ppc32 with the dcache/icache sync that could get a simple
fix if set_pte() and update_mmu_cache could be made "atomic" (that is,
if set_pte() was told "put that PTE in your cache too" in places where
update_mmu_cache would normally be called just after set_pte).

What do you guys thing about this ? It's relatively trivial to fix
everybody to add that argument to set_pte() ... It would be constant at
compile time anyway, so totally optimized away (0 or 1 depending on the
call site). And we would then kill update_mmu_cache() completely.

Or maybe the simpler is to define a set_pte_cache() that takes all 3
arguments and is overridable by the architecture ? With a default in
asm-generic that just does set_pte() and update_mmu_cache() ?

The only "special case" that prevents just changing set_pte() as is and
be done with update_mmu_cache() completely is ptep_set_access_flags()
which has an update_mmu_cache() right after it too. But I wonder...
arches that do care about update_mmu_cache() could just have their own
ptep_set_access_flags() that does the right thing..

Or somebody has a better idea ?

(There _is_ a complicated fix which is to do the dcache/icache flush
from the hash fault handler, thus impacting the performance of all hash
faults, and it's all in asm etc..., but I've always disliked the
set_pte/update_mmu_cache separation so ...)

Ben.

  parent reply	other threads:[~2005-02-23  5:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22  4:53 Changing update_mmu_cache() Benjamin Herrenschmidt
2005-02-22  5:43 ` David S. Miller
2005-02-22  9:07 ` Russell King
2005-02-22 18:08   ` David S. Miller
2005-02-25 20:15     ` Russell King
2005-02-25 21:43       ` Andrew Morton
2005-02-25 21:46         ` William Lee Irwin III
2005-02-25 22:48         ` Russell King
2005-02-25 22:59           ` William Lee Irwin III
2005-02-25 23:07           ` Andrew Morton
2005-02-26  1:09       ` David S. Miller
2005-02-27 18:55         ` Paul Mundt
2005-02-28  4:12           ` David S. Miller
2005-02-28  9:18             ` Paul Mundt
2005-03-06  5:15               ` David S. Miller
2005-02-27 19:27         ` Russell King
2005-02-26  1:10       ` Benjamin Herrenschmidt
2005-02-22 20:51   ` Benjamin Herrenschmidt
2005-02-23  5:35 ` Benjamin Herrenschmidt [this message]
2005-02-23  5:47   ` Changing update_mmu_cache() or set_pte() ? Benjamin Herrenschmidt

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=1109136942.5412.198.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=linux-arch@vger.kernel.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