On Fri, Aug 09, 2013 at 03:49:43PM -0700, Andrew Morton wrote: > On Tue, 6 Aug 2013 18:44:09 -0400 Johannes Weiner <hannes@xxxxxxxxxxx> wrote: > > > To accomplish this, a per-zone counter is increased every time a page > > is evicted and a snapshot of that counter is stored as shadow entry in > > the page's now empty page cache radix tree slot. > > How do you handle wraparound of that counter on 32-bit machines? The distance between two time stamps is an unsigned subtraction, so it's accurate even when the counter has wrapped between them. The per-zone counter lapping shadow entries is possible but not very likely because the shadow pages are reclaimed when more than 2*global_dirtyable_memory() of them exist. And usually they are refaulted or reclaimed along with the inode before that happens. There is an unlikely case where some shadow entries make it into an inode and then that same inode is evicting and refaulting pages in another area, which increases the counter while not producing an excess of shadow entries. Should the counter lap these inactive shadow entries, the worst case is that a refault will incorrectly interpret them as recently evicted and deactivate a page for every such entry. Which would at worst be a "regression" to how the code was for a long time, where every reclaim run also always deactivated some pages. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>