mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix.patch added to -mm tree
@ 2017-03-09 21:28 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-03-09 21:28 UTC (permalink / raw)
  To: minchan, mhocko, sergey.senozhatsky.work, mm-commits


The patch titled
     Subject: mm: do not use VM_WARN_ON_ONCE as if condition
has been added to the -mm tree.  Its filename is
     mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix.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-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix.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: do not use VM_WARN_ON_ONCE as if condition

Sergey reported VM_WARN_ON_ONCE returns void with !CONFIG_DEBUG_VM
so we cannot use it as if's condition unlike WARN_ON.

This patch fixes it.

Link: http://lkml.kernel.org/r/20170309060226.GB854@bbox
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/rmap.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff -puN mm/rmap.c~mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix mm/rmap.c
--- a/mm/rmap.c~mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix
+++ a/mm/rmap.c
@@ -1413,12 +1413,11 @@ static int try_to_unmap_one(struct page
 			 * Store the swap location in the pte.
 			 * See handle_pte_fault() ...
 			 */
-			if (VM_WARN_ON_ONCE(PageSwapBacked(page) !=
-						PageSwapCache(page))) {
+			if (unlikely(PageSwapBacked(page) != PageSwapCache(page))) {
+				WARN_ON_ONCE(1);
 				ret = SWAP_FAIL;
 				page_vma_mapped_walk_done(&pvmw);
 				break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-09 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 21:28 + mm-fix-lazyfree-bug-on-check-in-try_to_unmap_one-fix.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).