summaryrefslogtreecommitdiff
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-05-27 05:14:47 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-05-27 05:14:47 -0700
commitce677ce203cdb7bf92e0c1babcd2322446bb735e (patch)
tree54064ce3ff8db4c3b8a48d2e6dfafba1898088fc /mm/filemap.c
parent9a0bd0e3d5b40e06ae1bc939117d9598bd4af6ba (diff)
[PATCH] move nr_active and nr_inactive into per-CPU page
It might reduce pagemap_lru_lock hold times a little, and is more consistent. I think all global page accounting is now inside page_states[].
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index cf33b0b34e96..14148545163a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1415,16 +1415,19 @@ asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t
return ret;
}
-static ssize_t do_readahead(struct file *file, unsigned long index, unsigned long nr)
+static ssize_t
+do_readahead(struct file *file, unsigned long index, unsigned long nr)
{
struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
unsigned long max;
+ struct page_state ps;
if (!mapping || !mapping->a_ops || !mapping->a_ops->readpage)
return -EINVAL;
/* Limit it to a sane percentage of the inactive list.. */
- max = nr_inactive_pages / 2;
+ get_page_state(&ps);
+ max = ps.nr_inactive / 2;
if (nr > max)
nr = max;