All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20170309060226.GB854@bbox>

diff --git a/a/1.txt b/N1/1.txt
index 9291710..596d9d1 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -27,14 +27,14 @@ On Thu, Mar 09, 2017 at 01:29:08PM +0900, Sergey Senozhatsky wrote:
 > In file included from ./include/linux/mmdebug.h:4:0,
 >                  from ./include/linux/mm.h:8,
 >                  from mm/rmap.c:48:
-> mm/rmap.c: In function a??try_to_unmap_onea??:
+> mm/rmap.c: In function ‘try_to_unmap_one’:
 > ./include/linux/bug.h:45:33: error: void value not ignored as it ought to be
 >  #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
 >                                  ^
-> ./include/linux/mmdebug.h:49:31: note: in expansion of macro a??BUILD_BUG_ON_INVALIDa??
+> ./include/linux/mmdebug.h:49:31: note: in expansion of macro ‘BUILD_BUG_ON_INVALID’
 >  #define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
 >                                ^~~~~~~~~~~~~~~~~~~~
-> mm/rmap.c:1416:8: note: in expansion of macro a??VM_WARN_ON_ONCEa??
+> mm/rmap.c:1416:8: note: in expansion of macro ‘VM_WARN_ON_ONCE’
 >     if (VM_WARN_ON_ONCE(PageSwapBacked(page) !=
 >         ^~~~~~~~~~~~~~~
 > 
@@ -43,3 +43,40 @@ On Thu, Mar 09, 2017 at 01:29:08PM +0900, Sergey Senozhatsky wrote:
 
 Thanks for the report, Sergey!
 If others are not against, I want to go this.
+
+>From 38b10e560d066c2cef8f9d028e14008cefdaa3e0 Mon Sep 17 00:00:00 2001
+From: Minchan Kim <minchan@kernel.org>
+Date: Thu, 9 Mar 2017 14:58:23 +0900
+Subject: [PATCH] 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.
+
+Signed-off-by: Minchan Kim <minchan@kernel.org>
+---
+ mm/rmap.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/mm/rmap.c b/mm/rmap.c
+index 1d82057144ba..7d24bb93445b 100644
+--- a/mm/rmap.c
++++ b/mm/rmap.c
+@@ -1413,12 +1413,11 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
+ 			 * 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;
+-
+ 			}
+ 
+ 			/* MADV_FREE page check */
+-- 
+2.7.4
diff --git a/a/content_digest b/N1/content_digest
index 5c74a40..8fb6f27 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -6,6 +6,7 @@
  " Andrew Morton <akpm@linux-foundation.org>\0"
  "Cc\0Johannes Weiner <hannes@cmpxchg.org>"
   Michal Hocko <mhocko@suse.com>
+  Andrew Morton <akpm@linux-foundation.org>
   linux-kernel@vger.kernel.org
  " linux-mm@kvack.org\0"
  "\00:1\0"
@@ -39,14 +40,14 @@
  "> In file included from ./include/linux/mmdebug.h:4:0,\n"
  ">                  from ./include/linux/mm.h:8,\n"
  ">                  from mm/rmap.c:48:\n"
- "> mm/rmap.c: In function a??try_to_unmap_onea??:\n"
+ "> mm/rmap.c: In function \342\200\230try_to_unmap_one\342\200\231:\n"
  "> ./include/linux/bug.h:45:33: error: void value not ignored as it ought to be\n"
  ">  #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))\n"
  ">                                  ^\n"
- "> ./include/linux/mmdebug.h:49:31: note: in expansion of macro a??BUILD_BUG_ON_INVALIDa??\n"
+ "> ./include/linux/mmdebug.h:49:31: note: in expansion of macro \342\200\230BUILD_BUG_ON_INVALID\342\200\231\n"
  ">  #define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)\n"
  ">                                ^~~~~~~~~~~~~~~~~~~~\n"
- "> mm/rmap.c:1416:8: note: in expansion of macro a??VM_WARN_ON_ONCEa??\n"
+ "> mm/rmap.c:1416:8: note: in expansion of macro \342\200\230VM_WARN_ON_ONCE\342\200\231\n"
  ">     if (VM_WARN_ON_ONCE(PageSwapBacked(page) !=\n"
  ">         ^~~~~~~~~~~~~~~\n"
  "> \n"
@@ -54,6 +55,43 @@
  "> \n"
  "\n"
  "Thanks for the report, Sergey!\n"
- If others are not against, I want to go this.
+ "If others are not against, I want to go this.\n"
+ "\n"
+ ">From 38b10e560d066c2cef8f9d028e14008cefdaa3e0 Mon Sep 17 00:00:00 2001\n"
+ "From: Minchan Kim <minchan@kernel.org>\n"
+ "Date: Thu, 9 Mar 2017 14:58:23 +0900\n"
+ "Subject: [PATCH] mm: do not use VM_WARN_ON_ONCE as if condition\n"
+ "\n"
+ "Sergey reported VM_WARN_ON_ONCE returns void with !CONFIG_DEBUG_VM\n"
+ "so we cannot use it as if's condition unlike WARN_ON.\n"
+ "\n"
+ "This patch fixes it.\n"
+ "\n"
+ "Signed-off-by: Minchan Kim <minchan@kernel.org>\n"
+ "---\n"
+ " mm/rmap.c | 5 ++---\n"
+ " 1 file changed, 2 insertions(+), 3 deletions(-)\n"
+ "\n"
+ "diff --git a/mm/rmap.c b/mm/rmap.c\n"
+ "index 1d82057144ba..7d24bb93445b 100644\n"
+ "--- a/mm/rmap.c\n"
+ "+++ b/mm/rmap.c\n"
+ "@@ -1413,12 +1413,11 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,\n"
+ " \t\t\t * Store the swap location in the pte.\n"
+ " \t\t\t * See handle_pte_fault() ...\n"
+ " \t\t\t */\n"
+ "-\t\t\tif (VM_WARN_ON_ONCE(PageSwapBacked(page) !=\n"
+ "-\t\t\t\t\t\tPageSwapCache(page))) {\n"
+ "+\t\t\tif (unlikely(PageSwapBacked(page) != PageSwapCache(page))) {\n"
+ "+\t\t\t\tWARN_ON_ONCE(1);\n"
+ " \t\t\t\tret = SWAP_FAIL;\n"
+ " \t\t\t\tpage_vma_mapped_walk_done(&pvmw);\n"
+ " \t\t\t\tbreak;\n"
+ "-\n"
+ " \t\t\t}\n"
+ " \n"
+ " \t\t\t/* MADV_FREE page check */\n"
+ "-- \n"
+ 2.7.4
 
-e82cdecb617614bbb04120ef88234f5f94e3e11cc800084a092bd7f90bfed085
+cd41c55e58211f43140ad7d99d0489de853b376f94ed86b57e9d6b2ecc006852

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.