public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Alex Shi <alex.shi@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	cl@linux-foundation.org, Peter Zijlstra <a.p.zijlstra@chello.nl>,
	mgorman@suse.de, Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mm@vger.kernel.org
Subject: Re: unnecessary tlb flush in mprotect
Date: Tue, 22 May 2012 09:37:35 -0700	[thread overview]
Message-ID: <20120522163735.GB1906@tassilo.jf.intel.com> (raw)
In-Reply-To: <4FBAE71F.5000801@intel.com>

On Tue, May 22, 2012 at 09:08:47AM +0800, Alex Shi wrote:
> On 05/21/2012 04:30 PM, Alex Shi wrote:
> 
> > when mprotect just change prots of non-present pages, current mprotect
> > still do the tlb flush in check_protection().
> > but according to 4.10.2.3 Intel SDM V3A (
> > www.intel.com/Assets/ja_JP/PDF/manual/253668.pdf ) at that time, TLB has
> > no this lines for this page. So, tlb flush is just waste time. (for cr3
> > rewrite, flush all tlb, or invlpg, like a 'nop' in intel cpu)
> > 
> > Do we need to add the pte_present similar check here to prevent the
> > unnecessary tlb flushing? I mean, are there real case in word, User like
> > to change page prots before assign a physical page to it?
> > 
> 
> 
> Any comments from linux-mm emailing list?

I would be careful with TLB optimizations if it's not a clear performance
wins. A lot of these interactions are tricky and it's very easy to break
things in subtle and hard to debug ways.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only

  reply	other threads:[~2012-05-22 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21  8:30 unnecessary tlb flush in mprotect Alex Shi
2012-05-22  1:08 ` Alex Shi
2012-05-22 16:37   ` Andi Kleen [this message]
2012-05-23  0:06     ` Alex Shi
2012-05-26 18:46       ` Hugh Dickins

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=20120522163735.GB1906@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@intel.com \
    --cc=cl@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=mgorman@suse.de \
    /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