From: Ying Han <yinghan@google.com>
To: Hugh Dickins <hughd@google.com>
Cc: Nick Piggin <npiggin@gmail.com>, Rik van Riel <riel@redhat.com>,
Ken Chen <kenchen@google.com>,
linux-mm@kvack.org, Minchan Kim <minchan.kim@gmail.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: don't flush TLB when propagate PTE access bit to struct page.
Date: Wed, 27 Oct 2010 13:35:02 -0700 [thread overview]
Message-ID: <AANLkTim9NBXrAWkMW7C5C6=1sh52OJm=u5HT7ShyC7hv@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1010271144540.5039@tigran.mtv.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]
On Wed, Oct 27, 2010 at 12:13 PM, Hugh Dickins <hughd@google.com> wrote:
> On Wed, 27 Oct 2010, Nick Piggin wrote:
> > On Wed, Oct 27, 2010 at 12:22 PM, Nick Piggin <npiggin@gmail.com> wrote:
> > > On Wed, Oct 27, 2010 at 12:05 PM, Rik van Riel <riel@redhat.com>
> wrote:
> > >> On 10/27/2010 01:21 PM, Ying Han wrote:
> > >>>
> > >>> kswapd's use case of hardware PTE accessed bit is to approximate page
> LRU.
> > >>> The
> > >>> ActiveLRU demotion to InactiveLRU are not base on accessed bit, while
> it
> > >>> is only
> > >>> used to promote when a page is on inactive LRU list. All of the
> state
> > >>> transitions
> > >>> are triggered by memory pressure and thus has weak relationship with
> > >>> respect to
> > >>> time. In addition, hardware already transparently flush tlb whenever
> CPU
> > >>> context
> > >>> switch processes and given limited hardware TLB resource, the time
> period
> > >>> in
> > >>> which a page is accessed but not yet propagated to struct page is
> very
> > >>> small
> > >>> in practice. With the nature of approximation, kernel really don't
> need to
> > >>> flush TLB
> > >>> for changing PTE's access bit. This commit removes the flush
> operation
> > >>> from it.
>
> It should at least add a comment there in page_referenced_one(), that
> a TLB flush ought to be done, but is now judged not worth the effort.
>
I will make the change here.
>
> (I'd expect architectures to differ on whether it's worth the effort.)
>
Right :) I would like hear from upstream if the problem is general enough
to solve, and thus
we can plan put further effort into it.
> >>>
> > >>> Signed-off-by: Ying Han<yinghan@google.com>
> > >>> Singed-off-by: Ken Chen<kenchen@google.com>
>
> Hey, Ken, switch off those curling tongs :)
>
> > However, it's a scary change -- higher chance of reclaiming a TLB covered
> page.
>
> Yes, I was often tempted to make such a change in the past;
> but ran away when it appeared to be in danger of losing the pte
> referenced bit of precisely the most intensively referenced pages.
>
> Ying's point (about what the pte referenced bit is being used for in our
> current implementation) is interesting, and might have tipped the balance;
> but that's not clear to me - and the flush is only done when mm is on CPU.
>
The initial patch is from Ken, and I am helping out here to get feedback
from
upstream and further improvement. :)
>
> > I had a vague memory of this problem biting someone when this flush
> wasn't
> > actually done properly... maybe powerpc.
> >
> > But anyway, same solution could be possible, by flushing every N pages
> scanned.
>
> Yes, batching seems safer.
>
I might be able to take a look at it.
--Ying
>
> Hugh
[-- Attachment #2: Type: text/html, Size: 4346 bytes --]
next prev parent reply other threads:[~2010-10-27 20:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 17:21 Ying Han
2010-10-27 18:05 ` Rik van Riel
2010-10-27 18:22 ` Nick Piggin
2010-10-27 18:37 ` Nick Piggin
2010-10-27 19:13 ` Hugh Dickins
2010-10-27 20:35 ` Ying Han [this message]
2010-10-28 0:11 ` KAMEZAWA Hiroyuki
2010-10-29 1:30 ` Ken Chen
2010-10-29 2:45 ` KAMEZAWA Hiroyuki
2010-10-29 3:43 ` Rik van Riel
2010-10-29 4:27 ` Minchan Kim
2010-10-29 12:31 ` Rik van Riel
2010-10-29 13:03 ` Minchan Kim
2010-10-29 13:15 ` Rik van Riel
2010-10-30 0:20 ` Minchan Kim
2010-10-27 20:19 ` Ying Han
2010-10-28 11:53 ` Rik van Riel
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='AANLkTim9NBXrAWkMW7C5C6=1sh52OJm=u5HT7ShyC7hv@mail.gmail.com' \
--to=yinghan@google.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kenchen@google.com \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=npiggin@gmail.com \
--cc=riel@redhat.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