Thread (40 messages) 40 messages, 6 authors, 2016-08-10

[PATCHv1, RFC 16/33] filemap: handle huge pages in filemap_fdatawait_range()

From: Kirill A. Shutemov <hidden>
Date: 2016-07-26 00:35:18
Also in: linux-block, linux-fsdevel, linux-mm, lkml
Subsystem: memory management, page cache, the rest · Maintainers: Andrew Morton, Matthew Wilcox, Linus Torvalds

We writeback whole huge page a time.

Signed-off-by: Kirill A. Shutemov <redacted>
---
 mm/filemap.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/mm/filemap.c b/mm/filemap.c
index ad73b99c5ba7..3d46db277e73 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -371,9 +371,14 @@ static int __filemap_fdatawait_range(struct address_space *mapping,
 			if (page->index > end)
 				continue;
 
+			page = compound_head(page);
 			wait_on_page_writeback(page);
 			if (TestClearPageError(page))
 				ret = -EIO;
+			if (PageTransHuge(page)) {
+				index = page->index + HPAGE_PMD_NR;
+				i += index - pvec.pages[i]->index - 1;
+			}
 		}
 		pagevec_release(&pvec);
 		cond_resched();
-- 
2.8.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help