From: Hugh Dickins <hughd@google.com>
To: Alex Shi <alex.shi@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>, "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: Sat, 26 May 2012 11:46:53 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1205261140570.2173@eggly.anvils> (raw)
In-Reply-To: <4FBC2A23.9080605@intel.com>
On Wed, 23 May 2012, Alex Shi wrote:
> On 05/23/2012 12:37 AM, Andi Kleen wrote:
> > 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)
Yes.
> >>>
> >>> 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?
We have always simply assumed that mprotecting an entirely empty range
is too uncommon to bother with the slight complication of optimizing it.
Our assumption might be very wrong.
Hugh
> >>>
> >>
> >>
> >> 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
>
>
> Sure, functionality is fundamental.
prev parent reply other threads:[~2012-05-26 18:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 8:30 Alex Shi
2012-05-22 1:08 ` Alex Shi
2012-05-22 16:37 ` Andi Kleen
2012-05-23 0:06 ` Alex Shi
2012-05-26 18:46 ` Hugh Dickins [this message]
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=alpine.LSU.2.00.1205261140570.2173@eggly.anvils \
--to=hughd@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=ak@linux.intel.com \
--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
all inboxes | Powered by JetHome®