[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: On TLB flushing
From:       Russell King - ARM Linux <linux () arm ! linux ! org ! uk>
Date:       2004-04-16 18:57:14
Message-ID: 20040416195714.P29891 () flint ! arm ! linux ! org ! uk
[Download RAW message or body]

On Fri, Apr 16, 2004 at 08:48:01PM +0200, Matthias Welwarsky wrote:
> On Friday 16 April 2004 17:18, Marc Singer wrote:
> > On Fri, Apr 16, 2004 at 04:10:52PM +0100, Russell King - ARM Linux wrote:
> > > Don't confuse the hardware PTE being cleared by act of clearing the
> > > young bit vs the page being unmapped.  These are two completely
> > > different operations.
> >
> > I don't think I am.  In the set_pte code, if the young bit is clear
> > then the hardware PTE is cleared.  At any point after this, a read to
> > that page should generate a fault, but that won't happen unless the
> > TLB is cleared.
> 
> Uh, interesting. In the 2.4 kernel, is the hardware PTE also being cleared 
> together with the YOUNG bit? Having a page fault on the next read (and the 
> YOUNG bit being set again) would be a great help in low memory situations, to 
> avoid executable pages from being discarded if they were in use recently.

If you look at it from the short-term point of view then yes, this
may help.  However, if you really are down to that sort of low memory
situation, you'll be thrashing pages and probably won't make much
progress.

If you did flush the PTE when you cleared the young bit, you'd increase
the number of page faults dramatically in such a situation, maybe to
the point where you'd get worse performance than freeing up the page
and re-reading it from flash or disk.

Remember - the young/old bit is a hint, nothing more.

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic