diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-25 18:51:06 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-25 18:51:06 +0100 |
commit | d632fe76c2fe1897fb60da84e42612a32bbaccd6 (patch) | |
tree | 38945611422ab63ec74511ea22eff38d11229ef1 | |
parent | c0857fe328522644cddd3d2379066593486e5981 (diff) | |
download | queue-3.18-d632fe76c2fe1897fb60da84e42612a32bbaccd6.tar.gz |
another patch
-rw-r--r-- | mm-ksm.c-don-t-warn-if-page-is-still-mapped-in-remove_stable_node.patch | 63 | ||||
-rw-r--r-- | series | 1 |
2 files changed, 64 insertions, 0 deletions
diff --git a/mm-ksm.c-don-t-warn-if-page-is-still-mapped-in-remove_stable_node.patch b/mm-ksm.c-don-t-warn-if-page-is-still-mapped-in-remove_stable_node.patch new file mode 100644 index 0000000..debe954 --- /dev/null +++ b/mm-ksm.c-don-t-warn-if-page-is-still-mapped-in-remove_stable_node.patch @@ -0,0 +1,63 @@ +From 9a63236f1ad82d71a98aa80320b6cb618fb32f44 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin <aryabinin@virtuozzo.com> +Date: Thu, 21 Nov 2019 17:54:01 -0800 +Subject: mm/ksm.c: don't WARN if page is still mapped in remove_stable_node() + +From: Andrey Ryabinin <aryabinin@virtuozzo.com> + +commit 9a63236f1ad82d71a98aa80320b6cb618fb32f44 upstream. + +It's possible to hit the WARN_ON_ONCE(page_mapped(page)) in +remove_stable_node() when it races with __mmput() and squeezes in +between ksm_exit() and exit_mmap(). + + WARNING: CPU: 0 PID: 3295 at mm/ksm.c:888 remove_stable_node+0x10c/0x150 + + Call Trace: + remove_all_stable_nodes+0x12b/0x330 + run_store+0x4ef/0x7b0 + kernfs_fop_write+0x200/0x420 + vfs_write+0x154/0x450 + ksys_write+0xf9/0x1d0 + do_syscall_64+0x99/0x510 + entry_SYSCALL_64_after_hwframe+0x49/0xbe + +Remove the warning as there is nothing scary going on. + +Link: http://lkml.kernel.org/r/20191119131850.5675-1-aryabinin@virtuozzo.com +Fixes: cbf86cfe04a6 ("ksm: remove old stable nodes more thoroughly") +Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> +Acked-by: Hugh Dickins <hughd@google.com> +Cc: Andrea Arcangeli <aarcange@redhat.com> +Cc: <stable@vger.kernel.org> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + mm/ksm.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/mm/ksm.c ++++ b/mm/ksm.c +@@ -713,13 +713,13 @@ static int remove_stable_node(struct sta + return 0; + } + +- if (WARN_ON_ONCE(page_mapped(page))) { +- /* +- * This should not happen: but if it does, just refuse to let +- * merge_across_nodes be switched - there is no need to panic. +- */ +- err = -EBUSY; +- } else { ++ /* ++ * Page could be still mapped if this races with __mmput() running in ++ * between ksm_exit() and exit_mmap(). Just refuse to let ++ * merge_across_nodes/max_page_sharing be switched. ++ */ ++ err = -EBUSY; ++ if (!page_mapped(page)) { + /* + * The stable node did not yet appear stale to get_ksm_page(), + * since that allows for an unmapped ksm page to be recognized @@ -2,3 +2,4 @@ net-mlx4_en-fix-mlx4-ethtool-n-insertion.patch sfc-only-cancel-the-pps-workqueue-if-it-exists.patch net-sched-act_pedit-fix-warn-in-the-traffic-path.patch net-rtnetlink-prevent-underflows-in-do_setvfinfo.patch +mm-ksm.c-don-t-warn-if-page-is-still-mapped-in-remove_stable_node.patch |