linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: aneesh.kumar@linux.vnet.ibm.com, npiggin@gmail.com
Subject: Re: [PATCH 5/6] powerpc/mm: Optimize detection of thread local mm's
Date: Fri, 25 Aug 2017 00:44:39 -0700	[thread overview]
Message-ID: <1503647079.3814.34.camel@kernel.crashing.org> (raw)
In-Reply-To: <54852db7-d0aa-2a3e-c8bd-c4977163c4ee@linux.vnet.ibm.com>

On Fri, 2017-08-25 at 06:53 +0200, Frederic Barrat wrote:
> 
> Le 24/08/2017 à 20:47, Benjamin Herrenschmidt a écrit :
> > On Thu, 2017-08-24 at 18:40 +0200, Frederic Barrat wrote:
> > > 
> > > The decrementing part is giving me troubles, and I think it makes sense:
> > > if I decrement the counter when detaching the context from the capi
> > > card, then the next TLBIs for the memory context may be back to local.
> > 
> > Yes, you need to flush the CAPI TLB first.
> > 
> > > So when the process exits, the NPU wouldn't get the associated TLBIs,
> > > which spells trouble the next time the same memory context ID is reused.
> > > I believe this the cause of the problem I'm seeing. As soon as I keep
> > > the TLBIs global, even after I detach from the capi adapter, everything
> > > is fine.
> > > 
> > > Does it sound right?
> > > 
> > > So to keep the checks minimal in mm_is_thread_local(), to just checking
> > > the active_cpus count, I'm thinking of introducing a "copro enabled" bit
> > > on the context, so that we can increment active_cpus only once. And
> > > never decrement it.
> > 
> > You can decrement if you flush. Don't you have MMIOs to do directed
> > flushes ?
> 
> That's for the nMMU. Last I heard, we don't have MMIOs to flush anything 
> on the nMMU.
> 
> Side note: for the PSL, we do have MMIOs to flush, but they were 
> perceived as useful only for debug and we don't rely on them, precisely 
> because the nMMU would fall out of sync, so we have to rely on broadcast.

Well, you can always do a broadcast tlbi to flush the whole PID if you
decrement... that shouldn't be a very frequent operation.

Ben.

  reply	other threads:[~2017-08-25  7:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24  4:27 [PATCH 1/6] powerpc/mm: Move pgdir setting into a helper Benjamin Herrenschmidt
2017-07-24  4:27 ` [PATCH 2/6] powerpc/mm: Avoid double irq save/restore in activate_mm Benjamin Herrenschmidt
2017-07-24  4:28 ` [PATCH 3/6] powerpc/mm: Ensure cpumask update is ordered Benjamin Herrenschmidt
2017-07-24 11:20   ` Nicholas Piggin
2017-07-24 20:54     ` Benjamin Herrenschmidt
2017-08-11 11:06     ` Nicholas Piggin
2017-08-11 22:40       ` Benjamin Herrenschmidt
2017-08-17 12:58       ` Michael Ellerman
2017-08-23 12:01   ` [3/6] " Michael Ellerman
2017-07-24  4:28 ` [PATCH 4/6] powerpc/mm: Use mm_is_thread_local() instread of open-coding Benjamin Herrenschmidt
2017-07-24  4:28 ` [PATCH 5/6] powerpc/mm: Optimize detection of thread local mm's Benjamin Herrenschmidt
2017-07-24 11:25   ` Nicholas Piggin
2017-07-24 13:46     ` Michael Ellerman
2017-07-25  0:34       ` Nicholas Piggin
2017-07-25 12:00         ` Michael Ellerman
2017-07-24 20:58     ` Benjamin Herrenschmidt
2017-07-25  0:44       ` Nicholas Piggin
2017-07-25  1:03         ` Benjamin Herrenschmidt
2017-07-25 10:55           ` Nicholas Piggin
2017-08-04 12:06   ` Frederic Barrat
2017-08-04 12:58     ` Benjamin Herrenschmidt
2017-08-21 17:27   ` Frederic Barrat
2017-08-21 17:35     ` Benjamin Herrenschmidt
2017-08-22 13:18       ` Frederic Barrat
2017-08-22 16:55         ` Benjamin Herrenschmidt
2017-08-24 16:40       ` Frederic Barrat
2017-08-24 18:47         ` Benjamin Herrenschmidt
2017-08-25  4:53           ` Frederic Barrat
2017-08-25  7:44             ` Benjamin Herrenschmidt [this message]
2017-08-25  8:03               ` Frederic Barrat
2017-08-22  4:28     ` Michael Ellerman
2017-07-24  4:28 ` [PATCH 6/6] powerpc/mm: Make switch_mm_irqs_off() out of line Benjamin Herrenschmidt
2017-08-24 12:37 ` [1/6] powerpc/mm: Move pgdir setting into a helper Michael Ellerman

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=1503647079.3814.34.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.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).