* 2.6.11-rc1: mark-page-accessed in filemap.c not quite right
@ 2005-01-12 22:48 Miquel van Smoorenburg
0 siblings, 0 replies; only message in thread
From: Miquel van Smoorenburg @ 2005-01-12 22:48 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
I just discovered there's a thinko in the mark-page-accessed
change in do_generic_mapping_read() in 2.6.11-rc1. ra.prev_page
is compared to index to see if we read from this page before -
except that prev_page is actually set to the recent page or
even a page in front of the current page.
So we should store ra.prev_page in a seperate variable at the
start of do_generic_mapping_read().
This patch does just that:
--- linux-2.6.11-rc1/mm/filemap.c.ORIG 2005-01-12 05:02:10.000000000 +0100
+++ linux-2.6.11-rc1/mm/filemap.c 2005-01-12 23:06:23.643039416 +0100
@@ -693,6 +693,7 @@
unsigned long offset;
unsigned long req_size;
unsigned long next_index;
+ unsigned long prev_index;
loff_t isize;
struct page *cached_page;
int error;
@@ -701,6 +702,7 @@
cached_page = NULL;
index = *ppos >> PAGE_CACHE_SHIFT;
next_index = index;
+ prev_index = ra.prev_page;
req_size = (desc->count + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
offset = *ppos & ~PAGE_CACHE_MASK;
@@ -754,8 +756,9 @@
* When (part of) the same page is read multiple times
* in succession, only mark it as accessed the first time.
*/
- if (ra.prev_page != index)
+ if (prev_index != index)
mark_page_accessed(page);
+ prev_index = index;
/*
* Ok, we have the page, and it's up-to-date, so
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-12 22:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 22:48 2.6.11-rc1: mark-page-accessed in filemap.c not quite right Miquel van Smoorenburg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome