linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Van Brunt <avanbrunt@nvidia.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Ashish Mhetre <amhetre@nvidia.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	Sachin Nikam <Snikam@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit
Date: Sat, 8 Dec 2018 00:05:44 +0000	[thread overview]
Message-ID: <BYAPR12MB271295B398729E07F31082A7CFAA0@BYAPR12MB2712.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20181207175330.GC11430@edgewater-inn.cambridge.arm.com>

> > > My problem with that is it's not really much different to just skipping the
> > > page table update entirely. Skipping the DSB is closer to what is done on
> > > x86, where we bound the stale entry time to the next context-switch.
> >  
> > Which of the three implementations is the "that" and "it" in the first sentence?
>
> that = it = skipping the whole invalidation + the DSB

The TLB is tiny compared to the size of the inactive list. Somehow a TLB has to
not be evicted during the page's life in the inactive list. That is not an easy
feat except for the hottest of pages.

If there is a context-switch, most of the original thread's TLBs will be
evicted because TLBs have a hard time to hold two thread's working sets. So, in
practice, that is almost the same as the x86 guarantee.

The worst case cannot have a large impact because the maximum number of pages
that will not have the TLB evicted is the number of pages in the TLB. For
example, a 1024 entry TLB can at worst result in 4 MB of pages erroneously
reclaimed. That is not bad on a system with 4+ GB of memory.

We did benchmark the extreme case where half the pages accessed where not
evicted from the TLB. In the read case, skipping the DSB was ~10% faster than
skipping the invalidate or doing the invalidate and the DSB.

Compared to the improvement in the average performance and variability in the
other cases we tested, the 10% loss in a carefully crafted test is not as
important.

  reply	other threads:[~2018-12-08  0:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29  9:25 [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit Ashish Mhetre
2018-10-29  9:57 ` Jon Hunter
2018-10-29 10:55 ` Will Deacon
2018-10-29 15:13   ` Alexander Van Brunt
2018-12-03 21:20     ` Alexander Van Brunt
2018-12-06 19:18       ` Will Deacon
     [not found]         ` <BYAPR12MB271239AAF4A0B79D756850C6CFA90@BYAPR12MB2712.namprd12.prod.outlook.com>
2018-12-06 20:42           ` Alexander Van Brunt
2018-12-07 17:53             ` Will Deacon
2018-12-08  0:05               ` Alexander Van Brunt [this message]
     [not found]   ` <4bac3ba7-a005-213d-5ae4-c0e2ee589d5d@nvidia.com>
2018-10-30 11:50     ` Will Deacon

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=BYAPR12MB271295B398729E07F31082A7CFAA0@BYAPR12MB2712.namprd12.prod.outlook.com \
    --to=avanbrunt@nvidia.com \
    --cc=Snikam@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.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).