* + mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch added to -mm tree
@ 2017-03-07 22:56 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-03-07 22:56 UTC (permalink / raw)
To: minchan, hannes, hillf.zj, hughd, mgorman, mhocko, riel, shli,
mm-commits
The patch titled
Subject: mm: fix lazyfree BUG_ON check in try_to_unmap_one()
has been added to the -mm tree. Its filename is
mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Minchan Kim <minchan@kernel.org>
Subject: mm: fix lazyfree BUG_ON check in try_to_unmap_one()
If a page is swapbacked, it means it should be in swapcache in
try_to_unmap_one's path.
If a page is !swapbacked, it mean it shouldn't be in swapcache in
try_to_unmap_one's path.
Check both two cases all at once and if it fails, warn and return
SWAP_FAIL. Such bug never mean we should shut down the kernel.
Link: http://lkml.kernel.org/r/20170307055551.GC29458@bbox
Signed-off-by: Minchan Kim <minchan@kernel.org>
Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shaohua Li <shli@fb.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/rmap.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff -puN mm/rmap.c~mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one mm/rmap.c
--- a/mm/rmap.c~mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one
+++ a/mm/rmap.c
@@ -1413,8 +1413,13 @@ static int try_to_unmap_one(struct page
* Store the swap location in the pte.
* See handle_pte_fault() ...
*/
- VM_BUG_ON_PAGE(!PageSwapCache(page) && PageSwapBacked(page),
- page);
+ if (VM_WARN_ON_ONCE(PageSwapBacked(page) !=
+ PageSwapCache(page))) {
+ ret = SWAP_FAIL;
+ page_vma_mapped_walk_done(&pvmw);
+ break;
+
+ }
/* MADV_FREE page check */
if (!PageSwapBacked(page)) {
_
Patches currently in -mm which might be from minchan@kernel.org are
mm-reclaim-madv_free-pages-fix.patch
mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-07 23:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 22:56 + mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).