readahead: make mmap_miss an unsigned int
authorWu Fengguang <fengguang.wu@intel.com>
Tue, 16 Jun 2009 22:31:19 +0000 (15:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:28 +0000 (19:47 -0700)
This makes the performance impact of possible mmap_miss wrap around to be
temporary and tolerable: i.e.  MMAP_LOTSAMISS=100 extra readarounds.

Otherwise if ever mmap_miss wraps around to negative, it takes INT_MAX
cache misses to bring it back to normal state.  During the time mmap
readaround will be _enabled_ for whatever wild random workload.  That's
almost permanent performance impact.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/fs.h

index ede84fa7da5d07dacaeafdaf104107a06a4aa7fa..8146e0264ef9107fb2f3747f084871c5eeddfa11 100644 (file)
@@ -879,7 +879,7 @@ struct file_ra_state {
                                           there are only # of pages ahead */
 
        unsigned int ra_pages;          /* Maximum readahead window */
-       int mmap_miss;                  /* Cache miss stat for mmap accesses */
+       unsigned int mmap_miss;         /* Cache miss stat for mmap accesses */
        loff_t prev_pos;                /* Cache last read() position */
 };