linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, Nitin Gupta <ngupta@vflare.org>,
	Dave Hansen <dave@linux.vnet.ibm.com>
Subject: Re: tlb flushing on Power
Date: Fri, 17 Feb 2012 07:31:41 +1100	[thread overview]
Message-ID: <1329424301.2892.23.camel@pasglop> (raw)
In-Reply-To: <4F3D38D3.4020903@linux.vnet.ibm.com>

On Thu, 2012-02-16 at 11:11 -0600, Seth Jennings wrote:

> Just wanted to bump you again about this.  You mentioned that if I wanted to
> do a cpu-local flush of a single tlb entry, that there would have to be a new
> hook.  Is that right?
> 
> I've been looking through the powerpc arch and I thought that I might have
> found the power analog to __flush_tlb_one() for x86 in local_flush_tlb_page()
> with a NULL vma argument.  This doesn't seem to work though, as indicated
> by a crash when I tried it.  After looking in tlbflush.h again, it seems
> that local_flush_tlb_page() is a no-op when CONFIG_PPC_STD_MMU_64 is set,
> as are almost ALL of the tlb flushing functions... which makes no sense to
> me.
> 
> Any help you (or anyone) can give me would be greatly appreciated.

On ppc64 with hash-table MMU, we handle the flushes very differently.
PTEs that are modified are added to a list at the time of the
modification and either flushed immediately if no lazy tlb batching is
in progress or flushed when leaving the lazy tlb op.

This is to avoid a problem where we might otherwise, under some
circumstances, create a new TLB which can be hashed in to the hash table
before the previous one has been flushed out. That would lead to a dup
in the hash table which is architecturally illegal.

This happens via the call to hpte_need_flush() in pte_update().

Unfortunately, it will always consider all kernel mappings as global,
so the per-cpu "optimization" won't be usable in this case, at least
not until we add some kind of additional argument to that function.

Cheers,
Ben.

  reply	other threads:[~2012-02-16 20:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4F2160B3.60708@linux.vnet.ibm.com>
2012-01-26 14:41 ` tlb flushing on Power Brian King
2012-01-26 21:39   ` Benjamin Herrenschmidt
2012-01-26 22:30     ` Dave Hansen
2012-01-27  2:40       ` Benjamin Herrenschmidt
2012-02-08 17:39     ` Seth Jennings
2012-02-08 21:04       ` Benjamin Herrenschmidt
2012-02-10 19:14         ` Seth Jennings
2012-02-16 17:11           ` Seth Jennings
2012-02-16 20:31             ` Benjamin Herrenschmidt [this message]
2012-03-05 17:56               ` Seth Jennings
2012-03-07  5:28                 ` Michael Neuling
2012-03-07 21:18                   ` Seth Jennings

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=1329424301.2892.23.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ngupta@vflare.org \
    --cc=rcj@linux.vnet.ibm.com \
    --cc=sjenning@linux.vnet.ibm.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).