From: Chuck Ebbert Always mark page as accessed when reading multiple times. Original idea and patch by Ashif Harji Signed-off-by: Chuck Ebbert --- 2.6.20.2-t.orig/mm/filemap.c +++ 2.6.20.2-t/mm/filemap.c @@ -887,7 +887,6 @@ unsigned long offset; unsigned long last_index; unsigned long next_index; - unsigned long prev_index; loff_t isize; struct page *cached_page; int error; @@ -896,7 +895,6 @@ cached_page = NULL; index = *ppos >> PAGE_CACHE_SHIFT; next_index = index; - prev_index = ra.prev_page; last_index = (*ppos + desc->count + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT; offset = *ppos & ~PAGE_CACHE_MASK; @@ -945,11 +943,9 @@ /* * When (part of) the same page is read multiple times - * in succession, only mark it as accessed the first time. + * in succession, always mark it accessed. */ - if (prev_index != index) - mark_page_accessed(page); - prev_index = index; + mark_page_accessed(page); /* * Ok, we have the page, and it's up-to-date, so