linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* PTE aging, ptep_test_and_clear_young() and TLB
@ 2004-04-17 20:15 Russell King
  2004-04-17 20:43 ` William Lee Irwin III
  2004-04-17 22:27 ` Hugh Dickins
  0 siblings, 2 replies; 17+ messages in thread
From: Russell King @ 2004-04-17 20:15 UTC (permalink / raw)
  To: linux-mm

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>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-04-18 23:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-17 20:15 PTE aging, ptep_test_and_clear_young() and TLB Russell King
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox