From: Shaohua Li <shli@kernel.org>
To: Rik van Riel <riel@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, mingo@redhat.com, hughd@google.com
Subject: Re: [RFC]x86: clearing access bit don't flush tlb
Date: Tue, 15 Jan 2013 09:41:15 +0800 [thread overview]
Message-ID: <20130115014115.GA1497@kernel.org> (raw)
In-Reply-To: <50EBC4BD.7010700@redhat.com>
On Tue, Jan 08, 2013 at 02:03:25AM -0500, Rik van Riel wrote:
> On 01/08/2013 12:09 AM, H. Peter Anvin wrote:
> >On 01/07/2013 09:08 PM, Rik van Riel wrote:
> >>On 01/08/2013 12:03 AM, H. Peter Anvin wrote:
> >>>On 01/07/2013 08:55 PM, Shaohua Li wrote:
> >>>>
> >>>>I searched a little bit, the change (doing TLB flush to clear access
> >>>>bit) is
> >>>>made between 2.6.7 - 2.6.8, I can't find the changelog, but I found a
> >>>>patch:
> >>>>http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.7-rc2/2.6.7-rc2-mm2/broken-out/mm-flush-tlb-when-clearing-young.patch
> >>>>
> >>>>
> >>>>The changelog declaims this is for arm/ppc/ppc64.
> >>>>
> >>>
> >>>Not really. It says that those have stumbled over it already. It is
> >>>true in general that this change will make very frequently used pages
> >>>(which stick in the TLB) candidates for eviction.
> >>
> >>That is only true if the pages were to stay in the TLB for a
> >>very very long time. Probably multiple seconds.
> >>
> >>>x86 would seem to be just as affected, although possibly with a
> >>>different frequency.
> >>>
> >>>Do we have any actual metrics on anything here?
> >>
> >>I suspect that if we do need to force a TLB flush for page
> >>reclaim purposes, it may make sense to do that TLB flush
> >>asynchronously. For example, kswapd could kick off a TLB
> >>flush of every CPU in the system once a second, when the
> >>system is under pageout pressure.
> >>
> >>We would have to do this in a smart way, so the kswapds
> >>from multiple nodes do not duplicate the work.
> >>
> >>If people want that kind of functionality, I would be
> >>happy to cook up an RFC patch.
> >>
> >
> >So it sounds like you're saying that this patch should never have been
> >applied in the first place?
>
> It made sense at the time.
So you agreed the patch is safe, right?
> However, with larger SMP systems, we may need a different
> mechanism to get the TLB flushes done after we clear a bunch
> of accessed bits.
>
> One thing we could do is mark bits in a bitmap, keeping track
> of which CPUs should have their TLB flushed due to accessed bit
> scanning.
>
> Then we could set a timer for eg. a 1 second timeout, after
> which the TLB flush IPIs get sent. If the timer is already
> pending, we do not start it, but piggyback on the invocation
> that is already scheduled to happen.
>
> Does something like that make sense?
I don't understand why larger SMP system matters here. Only if there are enough
TLB entries in CPU matters to me. And if the system is larger, memory is
larger. TLB entries will not be sufficient. Or you are worrying about future
larger SMP system can have very big TLB entries?
Thanks,
Shaohua
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-01-15 1:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 8:12 [RFC]x86: clearing access bit don't flush tlb Shaohua Li
2013-01-07 15:14 ` Rik van Riel
2013-01-07 22:31 ` H. Peter Anvin
2013-01-08 4:55 ` Shaohua Li
2013-01-08 5:03 ` H. Peter Anvin
2013-01-08 5:08 ` Rik van Riel
2013-01-08 5:09 ` H. Peter Anvin
2013-01-08 7:03 ` Rik van Riel
2013-01-15 1:41 ` Shaohua Li [this message]
2013-01-08 3:14 ` Simon Jeons
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=20130115014115.GA1497@kernel.org \
--to=shli@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.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;
as well as URLs for NNTP newsgroup(s).