All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ashish Mhetre <amhetre@nvidia.com>
Cc: vdumpa@nvidia.com, avanbrunt@nvidia.com, Snikam@nvidia.com,
	praithatha@nvidia.com, Shaohua Li <shli@kernel.org>,
	Shaohua Li <shli@fusionio.com>,
	linux-mm@kvack.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] x86/mm: In the PTE swapout page reclaim case clear the accessed bit instead of flushing the TLB
Date: Tue, 9 Oct 2018 00:20:58 -0700	[thread overview]
Message-ID: <296A2DAD-8859-4CA0-8D04-3AFA13FEEBE9@gmail.com> (raw)
In-Reply-To: <20181009071637.GF5663@hirez.programming.kicks-ass.net>

[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]

at 12:16 AM, Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Oct 09, 2018 at 10:02:50AM +0530, Ashish Mhetre wrote:
>> From: Shaohua Li <shli@kernel.org>
>> 
>> We use the accessed bit to age a page at page reclaim time,
>> and currently we also flush the TLB when doing so.
>> 
>> But in some workloads TLB flush overhead is very heavy. In my
>> simple multithreaded app with a lot of swap to several pcie
>> SSDs, removing the tlb flush gives about 20% ~ 30% swapout
>> speedup.
>> 
>> Fortunately just removing the TLB flush is a valid optimization:
>> on x86 CPUs, clearing the accessed bit without a TLB flush
>> doesn't cause data corruption.
>> 
>> It could cause incorrect page aging and the (mistaken) reclaim of
>> hot pages, but the chance of that should be relatively low.
>> 
>> So as a performance optimization don't flush the TLB when
>> clearing the accessed bit, it will eventually be flushed by
>> a context switch or a VM operation anyway. [ In the rare
>> event of it not getting flushed for a long time the delay
>> shouldn't really matter because there's no real memory
>> pressure for swapout to react to. ]
> 
> Note that context switches (and here I'm talking about switch_mm(), not
> the cheaper switch_to()) do not unconditionally imply a TLB invalidation
> these days (on PCID enabled hardware).
> 
> So in that regards, the Changelog (and the comment) is a little
> misleading.
> 
> I don't see anything fundamentally wrong with the patch though; just the
> wording.

What am I missing? This is a patch from 2014, no? b13b1d2d8692b ?


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-09  7:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09  4:32 [PATCH] x86/mm: In the PTE swapout page reclaim case clear the accessed bit instead of flushing the TLB Ashish Mhetre
2018-10-09  7:16 ` Peter Zijlstra
2018-10-09  7:20   ` Nadav Amit [this message]
2018-10-09  7:47     ` Peter Zijlstra
2018-10-09  7:25   ` Ashish Mhetre

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=296A2DAD-8859-4CA0-8D04-3AFA13FEEBE9@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=Snikam@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=avanbrunt@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=praithatha@nvidia.com \
    --cc=shli@fusionio.com \
    --cc=shli@kernel.org \
    --cc=vdumpa@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.