From 56fcb65c7941bdd6824bb090d4a7731af102771d Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Thu, 19 Jul 2007 01:47:58 -0700 Subject: [PATCH] --- yaml --- r: 61567 b: refs/heads/master c: f615bfca468c9b80ed2d09be5fdbaf470a32c045 h: refs/heads/master i: 61565: 78d809193bb46918642745a128a790302c911b9a 61563: a569e77b3915d744e0b93a93dfc1b82ec232a199 61559: c5712bfaaa32c0594bd7162d87ff3b6ebd334a06 61551: 94823edf3317a8a6e8f15559f0d9e1981546a77f 61535: 8fe5d1eace4ba3347471d6da58aa7c95e4f3b31f 61503: 46bc74b55a6e9132736d27e26689f17587237f21 61439: aaeee93866c1bace2aa06b5b76955ea24433af55 v: v3 --- [refs] | 2 +- trunk/mm/readahead.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 826ba05f8c40..d8e3967082c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46fc3e7b4e7233a0ac981ac9084b55217318d04d +refs/heads/master: f615bfca468c9b80ed2d09be5fdbaf470a32c045 diff --git a/trunk/mm/readahead.c b/trunk/mm/readahead.c index 88ea0f29aac8..7f9bf588c936 100644 --- a/trunk/mm/readahead.c +++ b/trunk/mm/readahead.c @@ -21,8 +21,16 @@ void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) } EXPORT_SYMBOL(default_unplug_io_fn); +/* + * Convienent macros for min/max read-ahead pages. + * Note that MAX_RA_PAGES is rounded down, while MIN_RA_PAGES is rounded up. + * The latter is necessary for systems with large page size(i.e. 64k). + */ +#define MAX_RA_PAGES (VM_MAX_READAHEAD*1024 / PAGE_CACHE_SIZE) +#define MIN_RA_PAGES DIV_ROUND_UP(VM_MIN_READAHEAD*1024, PAGE_CACHE_SIZE) + struct backing_dev_info default_backing_dev_info = { - .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE, + .ra_pages = MAX_RA_PAGES, .state = 0, .capabilities = BDI_CAP_MAP_COPY, .unplug_io_fn = default_unplug_io_fn, @@ -51,7 +59,7 @@ static inline unsigned long get_max_readahead(struct file_ra_state *ra) static inline unsigned long get_min_readahead(struct file_ra_state *ra) { - return (VM_MIN_READAHEAD * 1024) / PAGE_CACHE_SIZE; + return MIN_RA_PAGES; } static inline void reset_ahead_window(struct file_ra_state *ra)