X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Freadahead.c;h=93d9ee692fd8b193b12ba207f69f900c831e404d;hb=98f85d30ced96ac466f30419de8b3fac341ebe75;hp=c0df5ed05f624a61d7e685d9b5ff9c4bfa4d2f90;hpb=eb991b39385c7b04923d701764a34694ec54b53d;p=linux-2.6 diff --git a/mm/readahead.c b/mm/readahead.c index c0df5ed05f..93d9ee692f 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -13,6 +13,7 @@ #include #include #include +#include #include void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) @@ -151,6 +152,7 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages, put_pages_list(pages); break; } + task_io_account_read(PAGE_CACHE_SIZE); } pagevec_lru_add(&lru_pvec); return ret; @@ -573,10 +575,6 @@ void handle_ra_miss(struct address_space *mapping, */ unsigned long max_sane_readahead(unsigned long nr) { - unsigned long active; - unsigned long inactive; - unsigned long free; - - __get_zone_counts(&active, &inactive, &free, NODE_DATA(numa_node_id())); - return min(nr, (inactive + free) / 2); + return min(nr, (node_page_state(numa_node_id(), NR_INACTIVE) + + node_page_state(numa_node_id(), NR_FREE_PAGES)) / 2); }