diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-12-14 03:18:58 -0800 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2002-12-14 03:18:58 -0800 |
| commit | 654107b93fcc5a4697e696f6bdb32f5d138d8d47 (patch) | |
| tree | 46166fdcf25948dc75ad75f2f0fae37d34cc6601 /include/linux | |
| parent | d8259d0991a9760e589a37897d547675127d30c4 (diff) | |
[PATCH] madvise_willneed() maximum readahead checking
madvise_willneed() currently has a very strange check on how much readahead
it is prepared to do.
It is based on the user's rss limit. But this is usually enormous, and
the user isn't necessarily going to map all that memory at the same time
anyway.
And the logic is wrong - it is comparing rss (which is in bytes) with
`end - start', which is in pages.
And it returns -EIO on error, which is not mentioned in the Open Group
spec and doesn't make sense.
This patch takes it all out and applies the same upper limit as is used in
sys_readahead() - half the inactive list.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index f2c0f9645de5..7f92f6775eb2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -516,6 +516,7 @@ void page_cache_readaround(struct address_space *mapping, unsigned long offset); void handle_ra_miss(struct address_space *mapping, struct file_ra_state *ra); +unsigned long max_sane_readahead(unsigned long nr); /* Do stack extension */ extern int expand_stack(struct vm_area_struct * vma, unsigned long address); |
