Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268555

[PATCH 3/3] mm/cma: always check which page cause allocation failure

From Joonsoo Kim <js1304@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] mm/cma: always check which page cause allocation failure
Date 2015-11-13 03:30 +0100
Message-ID <quchI-nf-13@gated-at.bofh.it> (permalink)
References <quchH-nf-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now, we have tracepoint in test_pages_isolated() to notify
pfn which cannot be isolated. But, in alloc_contig_range(),
some error path doesn't call test_pages_isolated() so it's still
hard to know exact pfn that causes allocation failure.

This patch change this situation by calling test_pages_isolated()
in almost error path. In allocation failure case, some overhead
is added by this change, but, allocation failure is really rare
event so it would not matter.

In fatal signal pending case, we don't call test_pages_isolated()
because this failure is intentional one.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 mm/page_alloc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d89960d..e78d78f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6756,8 +6756,12 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 	if (ret)
 		return ret;
 
+	/*
+	 * In case of -EBUSY, we'd like to know which page causes problem.
+	 * So, just fall through. We will check it in test_pages_isolated().
+	 */
 	ret = __alloc_contig_migrate_range(&cc, start, end);
-	if (ret)
+	if (ret && ret != -EBUSY)
 		goto done;
 
 	/*
@@ -6784,8 +6788,8 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 	outer_start = start;
 	while (!PageBuddy(pfn_to_page(outer_start))) {
 		if (++order >= MAX_ORDER) {
-			ret = -EBUSY;
-			goto done;
+			outer_start = start;
+			break;
 		}
 		outer_start &= ~0UL << order;
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] mm/page_isolation: return last tested pfn rather than failure indicator Joonsoo Kim <js1304@gmail.com> - 2015-11-13 03:30 +0100
  [PATCH 2/3] mm/page_isolation: add new tracepoint, test_pages_isolated Joonsoo Kim <js1304@gmail.com> - 2015-11-13 03:30 +0100
    Re: [PATCH 2/3] mm/page_isolation: add new tracepoint,  test_pages_isolated David Rientjes <rientjes@google.com> - 2015-11-14 00:00 +0100
  [PATCH 3/3] mm/cma: always check which page cause allocation failure Joonsoo Kim <js1304@gmail.com> - 2015-11-13 03:30 +0100

csiph-web