Hi,
I've just noticed that it is possible to evict ramfs pages from the page
cache using 'echo 3 > /proc/sys/vm/drop_caches', when these pages have
been used to provide shared memory via shmget(2) on NOMMU systems.
It looks like these pages are never marked dirty or whatever is
necessary to keep them. When I add SetPageDirty(page) in
ramfs_nommu_expand_for_mapping(), the shared memory will no longer be
trashed by drop_caches. But I have no clue if this is the right thing to
do ...
Maybe anyone can shed some more light on this and provide a real fix.
Thanks,
Enrik
---
fs/ramfs/file-nommu.c | 1 +
1 file changed, 1 insertion(+)
Index: fs/ramfs/file-nommu.c
===================================================================
--- fs/ramfs/file-nommu.c.orig 2009-03-10 09:08:48.000000000 +0100
+++ fs/ramfs/file-nommu.c 2009-03-10 09:09:05.000000000 +0100
@@ -114,6 +114,7 @@ int ramfs_nommu_expand_for_mapping(struc
if (!pagevec_add(&lru_pvec, page))
__pagevec_lru_add_file(&lru_pvec);
+ SetPageDirty(page);
unlock_page(page);
}
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev