Skip to contentSkip to conversation

mm, thp, tmpfs: only alloc small pages in shmem_file_splice_read

PATCH New Ning Qu 1 participant 1 message Oct 21, 2013

Subsystems (3)
lore
Share & tools
lore

Ning Qu

author
#0 lore raw

PATCH v2 11/13 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.

---
 mm/shmem.c | 2 ++
 1 file changed, 2 insertions(+)
mm/shmem.c +2 -0
index 48b1d84..c42331a 100644
@@ -1950,6 +1950,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);
@@ -2019,6 +2020,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;
 }
 
Signature · 7 lines
1.8.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>