aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2014-01-03 10:47:00 -0800
committerZiyan <jaraidaniel@gmail.com>2016-05-01 23:35:38 +0200
commit8feeacad19e37641f244beaa7f65da88fcf2758f (patch)
treeb11211613a4e16bd4ff52384fb5cca9ea669dfb4 /fs
parentc2792ae7c95038de243c7587baa6b02ed40c329f (diff)
downloadkernel_samsung_tuna-8feeacad19e37641f244beaa7f65da88fcf2758f.zip
kernel_samsung_tuna-8feeacad19e37641f244beaa7f65da88fcf2758f.tar.gz
kernel_samsung_tuna-8feeacad19e37641f244beaa7f65da88fcf2758f.tar.bz2
fs: fuse: Add replacment for CMA pages into the LRU cache
CMA pages are currently replaced in the FUSE file system since FUSE may hold on to CMA pages for a long time, preventing migration. The replacement page is added to the file cache but not the LRU cache. This may prevent the page from being properly aged and dropped, creating poor performance under tight memory condition. Fix this by adding the new page to the LRU cache after creation. Change-Id: Ib349abf1024d48386b835335f3fbacae040b6241 CRs-Fixed: 586855 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fuse/file.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index b075ed8..bcd6fd9 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -14,6 +14,10 @@
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/compat.h>
+#ifdef CONFIG_CMA
+/* Needed for lru_cache_add_lru() */
+#include <linux/swap.h>
+#endif
static const struct file_operations fuse_direct_io_file_operations;
@@ -689,6 +693,10 @@ static int fuse_readpages_fill(void *_data, struct page *page)
*/
put_page(newpage);
+#ifdef CONFIG_CMA
+ lru_cache_add_lru(newpage, LRU_ACTIVE_FILE);
+#endif
+
/* finally release the old page and swap pointers */
unlock_page(oldpage);
page_cache_release(oldpage);