From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
Rik van Riel <riel@surriel.com>, Andrew Morton <akpm@osdl.org>,
Andrea Arcangeli <andrea@suse.de>
Subject: Re: Page aging broken in 2.6
Date: Sat, 27 Dec 2003 12:03:48 +1100 [thread overview]
Message-ID: <1072487027.15476.105.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.58.0312261649070.14874@home.osdl.org>
On Sat, 2003-12-27 at 11:53, Linus Torvalds wrote:
> On Sat, 27 Dec 2003, Benjamin Herrenschmidt wrote:
> > >
> > > The dirty handling already does the TLB flush (in that case it's a
> > > correctness issue, not a hint). So it's only ptep_test_and_clear_young()
> > > that matters.
> >
> > Yes, but it would be possible to optimize it some way on our
> > beloved hash tables ;) (By marking the entry read-only in the
> > hash instead of evicting it). Maybe not worth the pain though...
>
> I don't think you should evict it, since
> - you know the value it should have
> - if you do the hash lookup anyway, you might as well just update the
> entry.
Yup, that is my point.
> And it's not "read-only" - it's the "A" bit, not the "W" bit you should be
> clearing in "ptep_test_and_clear_young()".
In the above I was talking about dirty.
For accessed, we currently do not use the HW bit neither. Accessed = in
the hash, not accessed = not in the hash. A bit basic, but the cost of
faulting them back in isn't that bad. Still, I always found it a bit
stupid that we end up having the harvesting of accessed bits actually
evict pages that _are_ accessed, and thus potentially here to be
accessed again ;)
Paul did some experiments using the HW bits and didn't see a great
perf increase (or what is even a decrease ?), but I should try that
again on ppc64 since there, we can much more quickly hit the proper
hash slot (we store its index in one group within the PTE).
Another problem with using real A & D hash bits is that we may evict
entries from the hash table (because both groups are full for a given
hash value). In this case, we need to go back to the linux PTE to
update the bits in there before we lose the A/D information from the
hash. But I don't think the overhead here matters much, we only rarely
do evicts.
> I'll let Rik and Andrea argue that part - it's entirely possible that
> getting lots of positive results is a _good_ thing, if the same page is
> mapped multiple times. That would just make us less eager to unmap it,
> which sounds like potentially the right thign to do (it's also how the old
> non-rmap code worked, and I know Rik thought it was "unfair", but
> whatever).
>
> > Ok, right now, Anton is testing a patch from paulus where we do our
> > own flush batching and do the flush inside ptep_test_and_clear_* That
> > will at least fix the problem for us now.
>
> Yeah, and it's unlikely to be a performance problem anyway. That function
> should be called only when we're low on memory..
>
> Linus
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>
next prev parent reply other threads:[~2003-12-27 1:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-26 7:28 Page aging broken in 2.6 Benjamin Herrenschmidt
2003-12-26 7:40 ` Andrew Morton
2003-12-26 9:21 ` Arjan van de Ven
2003-12-26 9:58 ` Benjamin Herrenschmidt
2003-12-26 19:44 ` Davide Libenzi
2003-12-26 9:33 ` Russell King
2003-12-26 10:07 ` Benjamin Herrenschmidt
2003-12-26 17:59 ` Linus Torvalds
2003-12-26 23:55 ` Benjamin Herrenschmidt
2003-12-27 0:35 ` Linus Torvalds
2003-12-27 0:44 ` Benjamin Herrenschmidt
2003-12-27 0:53 ` Linus Torvalds
2003-12-27 0:59 ` Linus Torvalds
2003-12-27 1:03 ` Benjamin Herrenschmidt [this message]
2003-12-27 2:37 ` Andrea Arcangeli
2003-12-27 5:02 ` Benjamin Herrenschmidt
2003-12-27 10:16 ` William Lee Irwin III
2003-12-27 2:47 ` Rik van Riel
2003-12-27 3:00 ` Andrew Morton
2003-12-27 3:31 ` Rik van Riel
2003-12-27 3:54 ` Linus Torvalds
2003-12-27 16:34 ` Martin J. Bligh
2003-12-27 23:07 ` Roger Luethi
2003-12-27 23:55 ` William Lee Irwin III
2003-12-28 11:23 ` Roger Luethi
2003-12-28 16:35 ` William Lee Irwin III
2003-12-28 17:15 ` Roger Luethi
2003-12-28 0:04 ` Andrew Morton
2003-12-28 11:58 ` Roger Luethi
2003-12-27 1:41 ` Andrea Arcangeli
-- strict thread matches above, loose matches on Subject: below --
2003-12-26 10:45 Manfred Spraul
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=1072487027.15476.105.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@surriel.com \
--cc=torvalds@osdl.org \
/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