All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20160122152049.GA24420@node.shutemov.name>

diff --git a/a/1.txt b/N1/1.txt
index 96c7b00..82cc4e1 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -32,3 +32,41 @@ On Fri, Jan 22, 2016 at 03:31:27PM +0100, Andrea Arcangeli wrote:
 > 	return split ? : list_empty(&pgdat->split_queue) ? SPLIT_STOP : 0;
 
 Ughh. Shrinker interface is confusing.
+
+>From ed85b527b2ea5c0b8ed93d9d212f9f0d25cae3ab Mon Sep 17 00:00:00 2001
+From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
+Date: Fri, 22 Jan 2016 18:10:59 +0300
+Subject: [PATCH] thp: deferred_split_scan(): stop shrinker if the queue is
+ empty
+
+If pages on queue were freed under us, deferred_split_scan() would
+return zero. It makes caller keep calling deferred_split_scan() without
+any result.
+
+Let's return SHRINK_STOP in this situation.
+
+Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
+---
+ mm/huge_memory.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c
+index 298dbc001b07..2ea5e26ce069 100644
+--- a/mm/huge_memory.c
++++ b/mm/huge_memory.c
+@@ -3508,6 +3508,12 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
+ 	list_splice_tail(&list, &pgdata->split_queue);
+ 	spin_unlock_irqrestore(&pgdata->split_queue_lock, flags);
+ 
++	/*
++	 * Stop shrinker, if we didn't split any page, but the queue is empty.
++	 * This can happen if pages were freed under us.
++	 */
++	if (!split && list_empty(&pgdata->split_queue))
++		return SHRINK_STOP;
+ 	return split;
+ }
+ 
+-- 
+ Kirill A. Shutemov
diff --git a/a/content_digest b/N1/content_digest
index 074de41..374f4c8 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -58,6 +58,44 @@
  "> \n"
  "> \treturn split ? : list_empty(&pgdat->split_queue) ? SPLIT_STOP : 0;\n"
  "\n"
- Ughh. Shrinker interface is confusing.
+ "Ughh. Shrinker interface is confusing.\n"
+ "\n"
+ ">From ed85b527b2ea5c0b8ed93d9d212f9f0d25cae3ab Mon Sep 17 00:00:00 2001\n"
+ "From: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\n"
+ "Date: Fri, 22 Jan 2016 18:10:59 +0300\n"
+ "Subject: [PATCH] thp: deferred_split_scan(): stop shrinker if the queue is\n"
+ " empty\n"
+ "\n"
+ "If pages on queue were freed under us, deferred_split_scan() would\n"
+ "return zero. It makes caller keep calling deferred_split_scan() without\n"
+ "any result.\n"
+ "\n"
+ "Let's return SHRINK_STOP in this situation.\n"
+ "\n"
+ "Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n"
+ "Suggested-by: Andrea Arcangeli <aarcange@redhat.com>\n"
+ "---\n"
+ " mm/huge_memory.c | 6 ++++++\n"
+ " 1 file changed, 6 insertions(+)\n"
+ "\n"
+ "diff --git a/mm/huge_memory.c b/mm/huge_memory.c\n"
+ "index 298dbc001b07..2ea5e26ce069 100644\n"
+ "--- a/mm/huge_memory.c\n"
+ "+++ b/mm/huge_memory.c\n"
+ "@@ -3508,6 +3508,12 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,\n"
+ " \tlist_splice_tail(&list, &pgdata->split_queue);\n"
+ " \tspin_unlock_irqrestore(&pgdata->split_queue_lock, flags);\n"
+ " \n"
+ "+\t/*\n"
+ "+\t * Stop shrinker, if we didn't split any page, but the queue is empty.\n"
+ "+\t * This can happen if pages were freed under us.\n"
+ "+\t */\n"
+ "+\tif (!split && list_empty(&pgdata->split_queue))\n"
+ "+\t\treturn SHRINK_STOP;\n"
+ " \treturn split;\n"
+ " }\n"
+ " \n"
+ "-- \n"
+  Kirill A. Shutemov
 
-951dad6ec49fc172dbdf3492a03faa7cb443c932fd8f31c37ac91a2f16e3f63e
+da7d736a79a413db9dfa0760d721cd0085bb7e785acfaa7fffedcbea3dc4566a

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.