summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
commit1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch)
tree357efc7b93f8f5102110d20d293f41360ec212fc /mm
parentaea27b2e18d69af87e673972246e66657b4fa274 (diff)
Merge with Linux 2.3.21.
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c6
-rw-r--r--mm/vmscan.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 5efa9aaf7..51624abcf 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -127,7 +127,7 @@ repeat:
goto repeat;
}
if (page_count(page) != 2)
- printk("hm, busy page invalidated? (not necesserily a bug)\n");
+ printk("hm, busy page invalidated? (not necessarily a bug)\n");
lru_cache_del(page);
remove_page_from_inode_queue(page);
@@ -912,6 +912,8 @@ static void generic_file_readahead(int reada_ok,
ahead = 0;
while (ahead < max_ahead) {
ahead += PAGE_CACHE_SIZE;
+ if ((raend + ahead) >= inode->i_size)
+ break;
page_cache_read(filp, raend + ahead);
}
/*
@@ -1779,6 +1781,7 @@ generic_file_write(struct file *file, const char *buf,
long status;
int err;
+ down(&inode->i_sem);
err = file->f_error;
if (err) {
file->f_error = 0;
@@ -1872,6 +1875,7 @@ repeat_find:
err = written ? written : status;
out:
+ up(&inode->i_sem);
return err;
}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8ee000fc0..1ce37062b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -424,6 +424,14 @@ static int do_try_to_free_pages(unsigned int gfp_mask)
goto done;
}
+ /* don't be too light against the d/i cache since
+ shrink_mmap() almost never fail when there's
+ really plenty of memory free. */
+ count -= shrink_dcache_memory(priority, gfp_mask);
+ count -= shrink_icache_memory(priority, gfp_mask);
+ if (count <= 0)
+ goto done;
+
/* Try to get rid of some shared memory pages.. */
if (gfp_mask & __GFP_IO) {
while (shm_swap(priority, gfp_mask)) {
@@ -437,8 +445,6 @@ static int do_try_to_free_pages(unsigned int gfp_mask)
if (!--count)
goto done;
}
-
- shrink_dcache_memory(priority, gfp_mask);
} while (--priority >= 0);
done: