All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <573C1F1E.4040201@suse.cz>

diff --git a/a/1.txt b/N1/1.txt
index 484a02b..a553f0c 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -49,3 +49,44 @@ On 05/17/2016 08:41 AM, Naoya Horiguchi wrote:
 Ooops, thanks for catching this, wish it was sooner...
 
 ----8<----
+>From f52f5e2a7dd65f2814183d8fd254ace43120b828 Mon Sep 17 00:00:00 2001
+From: Vlastimil Babka <vbabka@suse.cz>
+Date: Wed, 18 May 2016 09:41:01 +0200
+Subject: [PATCH] mm, page_alloc: prevent infinite loop in buffered_rmqueue()
+
+In DEBUG_VM kernel, we can hit infinite loop for order == 0 in
+buffered_rmqueue() when check_new_pcp() returns 1, because the bad page is
+never removed from the pcp list. Fix this by removing the page before retrying.
+Also we don't need to check if page is non-NULL, because we simply grab it from
+the list which was just tested for being non-empty.
+
+Fixes: http://www.ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-defer-debugging-checks-of-freed-pages-until-a-pcp-drain.patch
+Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
+---
+ mm/page_alloc.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 8c81e2e7b172..d5b93e5dd697 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -2641,11 +2641,12 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
+ 				page = list_last_entry(list, struct page, lru);
+ 			else
+ 				page = list_first_entry(list, struct page, lru);
+-		} while (page && check_new_pcp(page));
+ 
+-		__dec_zone_state(zone, NR_ALLOC_BATCH);
+-		list_del(&page->lru);
+-		pcp->count--;
++			__dec_zone_state(zone, NR_ALLOC_BATCH);
++			list_del(&page->lru);
++			pcp->count--;
++
++		} while (check_new_pcp(page));
+ 	} else {
+ 		/*
+ 		 * We most definitely don't want callers attempting to
+-- 
+2.8.2
diff --git a/a/content_digest b/N1/content_digest
index c33712c..ccc0d6e 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -63,6 +63,47 @@
  "\n"
  "Ooops, thanks for catching this, wish it was sooner...\n"
  "\n"
- ----8<----
+ "----8<----\n"
+ ">From f52f5e2a7dd65f2814183d8fd254ace43120b828 Mon Sep 17 00:00:00 2001\n"
+ "From: Vlastimil Babka <vbabka@suse.cz>\n"
+ "Date: Wed, 18 May 2016 09:41:01 +0200\n"
+ "Subject: [PATCH] mm, page_alloc: prevent infinite loop in buffered_rmqueue()\n"
+ "\n"
+ "In DEBUG_VM kernel, we can hit infinite loop for order == 0 in\n"
+ "buffered_rmqueue() when check_new_pcp() returns 1, because the bad page is\n"
+ "never removed from the pcp list. Fix this by removing the page before retrying.\n"
+ "Also we don't need to check if page is non-NULL, because we simply grab it from\n"
+ "the list which was just tested for being non-empty.\n"
+ "\n"
+ "Fixes: http://www.ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-defer-debugging-checks-of-freed-pages-until-a-pcp-drain.patch\n"
+ "Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\n"
+ "Signed-off-by: Vlastimil Babka <vbabka@suse.cz>\n"
+ "---\n"
+ " mm/page_alloc.c | 9 +++++----\n"
+ " 1 file changed, 5 insertions(+), 4 deletions(-)\n"
+ "\n"
+ "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n"
+ "index 8c81e2e7b172..d5b93e5dd697 100644\n"
+ "--- a/mm/page_alloc.c\n"
+ "+++ b/mm/page_alloc.c\n"
+ "@@ -2641,11 +2641,12 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,\n"
+ " \t\t\t\tpage = list_last_entry(list, struct page, lru);\n"
+ " \t\t\telse\n"
+ " \t\t\t\tpage = list_first_entry(list, struct page, lru);\n"
+ "-\t\t} while (page && check_new_pcp(page));\n"
+ " \n"
+ "-\t\t__dec_zone_state(zone, NR_ALLOC_BATCH);\n"
+ "-\t\tlist_del(&page->lru);\n"
+ "-\t\tpcp->count--;\n"
+ "+\t\t\t__dec_zone_state(zone, NR_ALLOC_BATCH);\n"
+ "+\t\t\tlist_del(&page->lru);\n"
+ "+\t\t\tpcp->count--;\n"
+ "+\n"
+ "+\t\t} while (check_new_pcp(page));\n"
+ " \t} else {\n"
+ " \t\t/*\n"
+ " \t\t * We most definitely don't want callers attempting to\n"
+ "-- \n"
+ 2.8.2
 
-de2838a738ccf6abe559826697ae2d3b456840eeb40b6fce89136a526b25d55f
+68f0b4e7cd041425f1c3b3523a38148d587bdc890295eeecc3b9f8866360f2f2

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.