lkml.org 
[lkml]   [2013]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 10/12] mm, thp, tmpfs: only alloc small pages in shmem_file_splice_read
We just hope this is not a common case path. The huge page can't be
added without completely refactoring the code.

Signed-off-by: Ning Qu <quning@gmail.com>
---
mm/shmem.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index cbf01ce..75c0ac6 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1973,6 +1973,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
index += spd.nr_pages;
error = 0;

+ i_split_down_read(inode);
while (spd.nr_pages < nr_pages) {
error = shmem_getpage(inode, index, &page, SGP_CACHE, gfp,
0, NULL);
@@ -2042,6 +2043,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
*ppos += error;
file_accessed(in);
}
+ i_split_up_read(inode);
return error;
}

--
1.8.4



\
 
 \ /
  Last update: 2013-10-15 02:41    [W:0.033 / U:1.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site