From: Russell King <rmk@arm.linux.org.uk>
To: linux-mm@kvack.org
Subject: PTE aging, ptep_test_and_clear_young() and TLB
Date: Sat, 17 Apr 2004 21:15:06 +0100 [thread overview]
Message-ID: <20040417211506.C21974@flint.arm.linux.org.uk> (raw)
Hi,
Marc Singer has been investigating some issues with ARM where we
appear to unmap pages which are in active use by the application.
While Bill Irwin has been looking at them (see
<http://marc.theaimsgroup.com/?l=linux-mm&m=108218227006508&w=2>),
I'm a little concerned about the page aging.
We implement the page age tracking by causing faults when the page is
marked "old". It turns out that the implementation is "lazy" because
ptep_test_and_clear_young() does not flush the TLB to get rid of the
existing entry. This means that even though we update the PTE to cause
a fault on the next access, the MMU doesn't see the change until:
(1) the next context switch which change user space mappings, or
(2) there is sufficient TLB replacement to cause older entries to
be evicted. (where older does not depend on use of that entry.)
This same issue came up with 2.4 kernels, where it appears to be less
of a problem. IIRC it was decided that the TLB flush when we mark
PTEs "old" was not necessary, even for systems which maintain the page
age state by software means, since we won't evict the page even after
unmapping it until we have unmapped it from all processes.
However, I'm led to believe that the current 2.6 VM is more agressive,
and needs the young bit to prevent pages being thrown out and needing
to be re-read from disk/network. Essentially, I'm led to believe that
when a page is marked "old", it is up for eviction on the very next
rescan if it hasn't been marked "young".
So, it seems to me that maintaining the PTE age state is far more
important, and a lazy approach is no longer possible.
This in turn means that we need to replace ptep_test_and_clear_young()
with ptep_clear_flush_young(), which in turn means we need the VMA and
address. However, this implies introducing more code into
page_referenced().
Comments?
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
--
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:"aart@kvack.org"> aart@kvack.org </a>
next reply other threads:[~2004-04-17 20:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-17 20:15 Russell King [this message]
2004-04-17 20:43 ` William Lee Irwin III
2004-04-18 9:36 ` Russell King
2004-04-18 9:39 ` William Lee Irwin III
2004-04-18 10:58 ` Hugh Dickins
2004-04-18 11:23 ` Russell King
2004-04-18 12:36 ` Hugh Dickins
2004-04-18 12:42 ` Russell King
2004-04-18 19:55 ` Russell King
2004-04-18 20:01 ` Russell King
2004-04-18 23:14 ` Hugh Dickins
2004-04-18 23:34 ` Russell King
2004-04-18 15:52 ` William Lee Irwin III
2004-04-18 10:42 ` Russell King
2004-04-18 15:12 ` William Lee Irwin III
2004-04-17 22:27 ` Hugh Dickins
2004-04-17 23:47 ` Anton Blanchard
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=20040417211506.C21974@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=linux-mm@kvack.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