Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2019-01-11 10:43:24 +0000
committerMel Gorman <mgorman@suse.de>2019-01-11 10:43:24 +0000
commit9cb10ef9d877a214330508cebbb14f3f6059ad03 (patch)
treecd84f3b90116db5a7a4c06feb342d49b09161967
parent3661279fcb0fee2132751f6be333e593ff10ffa7 (diff)
mm, fault_around: do not take a reference to a locked page
(VM Performance filemap (bsc#1121581)).
-rw-r--r--patches.suse/mm-fault_around-do-not-take-a-reference-to-a-locked-page.patch50
-rw-r--r--series.conf1
2 files changed, 51 insertions, 0 deletions
diff --git a/patches.suse/mm-fault_around-do-not-take-a-reference-to-a-locked-page.patch b/patches.suse/mm-fault_around-do-not-take-a-reference-to-a-locked-page.patch
new file mode 100644
index 0000000000..860fde792f
--- /dev/null
+++ b/patches.suse/mm-fault_around-do-not-take-a-reference-to-a-locked-page.patch
@@ -0,0 +1,50 @@
+From: Michal Hocko <mhocko@suse.com>
+Date: Fri, 28 Dec 2018 00:38:36 -0800
+Subject: [PATCH] mm, fault_around: do not take a reference to a locked page
+
+References: VM Performance filemap (bsc#1121581)
+Patch-mainline: v5.0
+Git-commit: e0975b2aae0e669f995f7d5f11db25c3080ae11c
+
+filemap_map_pages takes a speculative reference to each page in the range
+before it tries to lock that page. While this is correct it also can
+influence page migration which will bail out when seeing an elevated
+reference count. The faultaround code would bail on seeing a locked page
+so we can pro-actively check the PageLocked bit before
+page_cache_get_speculative and prevent from pointless reference count
+churn.
+
+Link: http://lkml.kernel.org/r/20181211142741.2607-4-mhocko@kernel.org
+Signed-off-by: Michal Hocko <mhocko@suse.com>
+Suggested-by: Jan Kara <jack@suse.cz>
+Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Reviewed-by: David Hildenbrand <david@redhat.com>
+Acked-by: Hugh Dickins <hughd@google.com>
+Reviewed-by: William Kucharski <william.kucharski@oracle.com>
+Cc: Oscar Salvador <osalvador@suse.de>
+Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ mm/filemap.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/mm/filemap.c b/mm/filemap.c
+index 162c940910d4..8c42cebe54d3 100644
+--- a/mm/filemap.c
++++ b/mm/filemap.c
+@@ -2639,6 +2639,13 @@ void filemap_map_pages(struct vm_fault *vmf,
+ }
+
+ head = compound_head(page);
++
++ /*
++ * Check for a locked page first, as a speculative
++ * reference may adversely influence page migration.
++ */
++ if (PageLocked(head))
++ goto next;
+ if (!page_cache_get_speculative(head))
+ goto repeat;
+
diff --git a/series.conf b/series.conf
index 7096db016c..524b0e1da7 100644
--- a/series.conf
+++ b/series.conf
@@ -41988,6 +41988,7 @@
patches.suse/mm-reclaim-small-amounts-of-memory-when-an-external-fragmentation-event-occurs.patch
patches.fixes/mm-put_and_wait_on_page_locked-while-page-is-migrated.patch
patches.fixes/0001-hwpoison-memory_hotplug-allow-hwpoisoned-pages-to-be.patch
+ patches.suse/mm-fault_around-do-not-take-a-reference-to-a-locked-page.patch
patches.drivers/gpiolib-Fix-return-value-of-gpio_to_desc-stub-if-GPI.patch
patches.drivers/gpio-raspberrypi-exp-decrease-refcount-on-firmware-dt-node.patch
patches.drivers/power-supply-olpc_battery-correct-the-temperature-un.patch