Skip to content

Commit fea85cf

Browse files
JoonsooKimtorvalds
authored andcommitted
mm/page_isolation.c: return last tested pfn rather than failure indicator
This is preparation step to report test failed pfn in new tracepoint to analyze cma allocation failure problem. There is no functional change in this patch. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Cc: Minchan Kim <minchan@kernel.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4a8c7bb commit fea85cf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mm/page_isolation.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
212212
*
213213
* Returns 1 if all pages in the range are isolated.
214214
*/
215-
static int
215+
static unsigned long
216216
__test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
217217
bool skip_hwpoisoned_pages)
218218
{
@@ -237,9 +237,8 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
237237
else
238238
break;
239239
}
240-
if (pfn < end_pfn)
241-
return 0;
242-
return 1;
240+
241+
return pfn;
243242
}
244243

245244
int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
@@ -248,7 +247,6 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
248247
unsigned long pfn, flags;
249248
struct page *page;
250249
struct zone *zone;
251-
int ret;
252250

253251
/*
254252
* Note: pageblock_nr_pages != MAX_ORDER. Then, chunks of free pages
@@ -266,10 +264,11 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
266264
/* Check all pages are free or marked as ISOLATED */
267265
zone = page_zone(page);
268266
spin_lock_irqsave(&zone->lock, flags);
269-
ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
267+
pfn = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
270268
skip_hwpoisoned_pages);
271269
spin_unlock_irqrestore(&zone->lock, flags);
272-
return ret ? 0 : -EBUSY;
270+
271+
return pfn < end_pfn ? -EBUSY : 0;
273272
}
274273

275274
struct page *alloc_migrate_target(struct page *page, unsigned long private,

0 commit comments

Comments
 (0)