Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2019-01-14 10:07:57 +0100
committerVlastimil Babka <vbabka@suse.cz>2019-01-14 10:08:42 +0100
commit72c8f7d578b852107ebb4e959c8e9605dd2de893 (patch)
treefa94df77700f1ba9bc91abe67251e8738e14bd8a
parent505e1da509cf17ada6de41736bcf4c6086505512 (diff)
mm/khugepaged: collapse_shmem() remember to clear holes (VM
Functionality, bsc#1121599).
-rw-r--r--patches.fixes/mm-khugepaged-collapse_shmem-remember-to-clear-holes.patch59
-rw-r--r--series.conf1
2 files changed, 60 insertions, 0 deletions
diff --git a/patches.fixes/mm-khugepaged-collapse_shmem-remember-to-clear-holes.patch b/patches.fixes/mm-khugepaged-collapse_shmem-remember-to-clear-holes.patch
new file mode 100644
index 0000000000..9651bc93ce
--- /dev/null
+++ b/patches.fixes/mm-khugepaged-collapse_shmem-remember-to-clear-holes.patch
@@ -0,0 +1,59 @@
+From: Hugh Dickins <hughd@google.com>
+Date: Fri, 30 Nov 2018 14:10:35 -0800
+Subject: mm/khugepaged: collapse_shmem() remember to clear holes
+Git-commit: 2af8ff291848cc4b1cce24b6c943394eb2c761e8
+Patch-mainline: v4.20-rc5
+References: VM Functionality, bsc#1121599
+
+Huge tmpfs testing reminds us that there is no __GFP_ZERO in the gfp
+flags khugepaged uses to allocate a huge page - in all common cases it
+would just be a waste of effort - so collapse_shmem() must remember to
+clear out any holes that it instantiates.
+
+The obvious place to do so, where they are put into the page cache tree,
+is not a good choice: because interrupts are disabled there. Leave it
+until further down, once success is assured, where the other pages are
+copied (before setting PageUptodate).
+
+Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1811261525080.2275@eggly.anvils
+Fixes: f3f0e1d2150b2 ("khugepaged: add support of collapse for tmpfs/shmem pages")
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Cc: Jerome Glisse <jglisse@redhat.com>
+Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
+Cc: Matthew Wilcox <willy@infradead.org>
+Cc: <stable@vger.kernel.org> [4.8+]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
+---
+ mm/khugepaged.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/mm/khugepaged.c
++++ b/mm/khugepaged.c
+@@ -1497,7 +1497,12 @@ tree_unlocked:
+ * Replacing old pages with new one has succeed, now we need to
+ * copy the content and free old pages.
+ */
++ index = start;
+ list_for_each_entry_safe(page, tmp, &pagelist, lru) {
++ while (index < page->index) {
++ clear_highpage(new_page + (index % HPAGE_PMD_NR));
++ index++;
++ }
+ copy_highpage(new_page + (page->index % HPAGE_PMD_NR),
+ page);
+ list_del(&page->lru);
+@@ -1507,6 +1512,11 @@ tree_unlocked:
+ ClearPageActive(page);
+ ClearPageUnevictable(page);
+ put_page(page);
++ index++;
++ }
++ while (index < end) {
++ clear_highpage(new_page + (index % HPAGE_PMD_NR));
++ index++;
+ }
+
+ local_irq_save(flags);
diff --git a/series.conf b/series.conf
index 802bb7634a..358921c1f3 100644
--- a/series.conf
+++ b/series.conf
@@ -19368,6 +19368,7 @@
patches.fixes/mm-huge_memory-fix-lockdep-complaint-on-32-bit-i_size_read.patch
patches.fixes/mm-khugepaged-collapse_shmem-stop-if-punched-or-truncated.patch
patches.fixes/mm-khugepaged-fix-crashes-due-to-misaccounted-holes.patch
+ patches.fixes/mm-khugepaged-collapse_shmem-remember-to-clear-holes.patch
patches.drivers/pci-imx6-fix-link-training-status-detection-in-link-up-check
patches.fixes/fs-fix-lost-error-code-in-dio_complete.patch
patches.fixes/nvme-free-ctrl-device-name-on-init-failure.patch