linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dave Liu <r63238@freescale.com>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>,
	Paul Mackerras <paulus@samba.org>,
	Kumar Gala <galak@gate.crashing.org>
Subject: Re: fsl booke MM vs. SMP questions
Date: Tue, 22 May 2007 13:09:27 +1000	[thread overview]
Message-ID: <1179803367.32247.785.camel@localhost.localdomain> (raw)
In-Reply-To: <1179785273.32247.742.camel@localhost.localdomain>


> > > Now, the tlb invalidation code (which can use a batch to be even more
> > > efficient, see how 64 bits or x86 use batching for TLB invalidations)
> > > can then use the fact that the mm carries a cpu bitmask of all CPUs that
> > > ever touched that mm and thus can do, after a PTE has changed and before
> > > broadcasting an invalidation:
> > 
> > How to interlock this PTE change with the PTE change of tlb miss?
> 
> Look at pgtables-ppc32.h. PTE changes done by linux are atomic. If you
> use the procedure I outlined above, you will also have PTE modifications
> done by the TLB miss handler be atomic, though you also skip the atomic
> bit when not necessary (when _PAGE_ACCESSED is already set for example).
> 
> Thus, the situation is basically that linux PTE changes need to

Note that overall, my method requires at least those barriers:

	- setting the flag to 1 vs. reading the PTE
	- writing the TLB entry vs. setting the flag to 0

Which means two barriers in the TLB refill handler. I'm not 100%
familiar with the barriers you have on fsl BookE and their exact
semantics and performance issues but you may need to closely look at the
impact of taking those.

In the end, the best solution might still be to simply not do any of
this and instead send an IPI on invalidations. That's the method used by
most architectures in linux (if not all) that do software TLB load on
SMP. Basically, the invalidate code path then does:

	- Update the linux PTE
	- write barrier
	- send IPI interrupt to all CPUs in mm->cpu_vm_mask
	- local TLB flush

And the IPI does a local TLB flush on all affected CPUs.

Ben.

  reply	other threads:[~2007-05-22  3:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-21  7:06 fsl booke MM vs. SMP questions Benjamin Herrenschmidt
     [not found] ` <1179741447.3660.7.camel@localhost.localdomain>
     [not found]   ` <1179742083.32247.689.camel@localhost.localdomain>
2007-05-21 11:37     ` Dave Liu
2007-05-21 22:07       ` Benjamin Herrenschmidt
2007-05-22  3:09         ` Benjamin Herrenschmidt [this message]
2007-05-22 10:56           ` Dave Liu
2007-05-22 22:42             ` Benjamin Herrenschmidt
2007-05-23  2:38               ` Dave Liu
2007-05-23  3:08                 ` Benjamin Herrenschmidt
2007-05-28  9:05                   ` Liu Dave-r63238
2007-05-28  9:24                     ` Benjamin Herrenschmidt
2007-05-28  9:37                       ` Liu Dave-r63238
2007-05-28 10:00                         ` Benjamin Herrenschmidt
2007-05-28 10:23                           ` Gabriel Paubert
2007-05-28 10:28                             ` Benjamin Herrenschmidt
2007-05-22  8:46         ` Gabriel Paubert
2007-05-22  9:14           ` Benjamin Herrenschmidt
2007-05-22 10:02             ` Gabriel Paubert
2007-05-22 10:05               ` Benjamin Herrenschmidt
2007-05-23  9:12                 ` Gabriel Paubert
2007-05-22  3:03 ` Kumar Gala

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=1179803367.32247.785.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=galak@gate.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=r63238@freescale.com \
    /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).