mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-30 10:55:03 +00:00
mm, memory hotplug: print debug message in the proper way for online_pages
online_pages() simply returns an error value if memory_notify(MEM_GOING_ONLINE, &arg) return a value that is not what we want for successfully onlining target pages. This patch arms to print more failure information like offline_pages() in online_pages. This patch also converts printk(KERN_<LEVEL>) to pr_<level>(), and moves __offline_pages() to not print failure information with KERN_INFO according to David Rientjes's suggestion[1]. [1] https://lkml.org/lkml/2016/2/24/1094 Signed-off-by: Chen Yucong <slaoub@gmail.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0f352e5392
commit
e33e33b4d1
1 changed files with 16 additions and 16 deletions
|
@ -1059,10 +1059,9 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
|
|
||||||
ret = memory_notify(MEM_GOING_ONLINE, &arg);
|
ret = memory_notify(MEM_GOING_ONLINE, &arg);
|
||||||
ret = notifier_to_errno(ret);
|
ret = notifier_to_errno(ret);
|
||||||
if (ret) {
|
if (ret)
|
||||||
memory_notify(MEM_CANCEL_ONLINE, &arg);
|
goto failed_addition;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* If this zone is not populated, then it is not in zonelist.
|
* If this zone is not populated, then it is not in zonelist.
|
||||||
* This means the page allocator ignores this zone.
|
* This means the page allocator ignores this zone.
|
||||||
|
@ -1080,12 +1079,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
if (need_zonelists_rebuild)
|
if (need_zonelists_rebuild)
|
||||||
zone_pcp_reset(zone);
|
zone_pcp_reset(zone);
|
||||||
mutex_unlock(&zonelists_mutex);
|
mutex_unlock(&zonelists_mutex);
|
||||||
printk(KERN_DEBUG "online_pages [mem %#010llx-%#010llx] failed\n",
|
goto failed_addition;
|
||||||
(unsigned long long) pfn << PAGE_SHIFT,
|
|
||||||
(((unsigned long long) pfn + nr_pages)
|
|
||||||
<< PAGE_SHIFT) - 1);
|
|
||||||
memory_notify(MEM_CANCEL_ONLINE, &arg);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zone->present_pages += onlined_pages;
|
zone->present_pages += onlined_pages;
|
||||||
|
@ -1118,6 +1112,13 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
if (onlined_pages)
|
if (onlined_pages)
|
||||||
memory_notify(MEM_ONLINE, &arg);
|
memory_notify(MEM_ONLINE, &arg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
failed_addition:
|
||||||
|
pr_debug("online_pages [mem %#010llx-%#010llx] failed\n",
|
||||||
|
(unsigned long long) pfn << PAGE_SHIFT,
|
||||||
|
(((unsigned long long) pfn + nr_pages) << PAGE_SHIFT) - 1);
|
||||||
|
memory_notify(MEM_CANCEL_ONLINE, &arg);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
|
#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
|
||||||
|
|
||||||
|
@ -1529,8 +1530,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_DEBUG_VM
|
#ifdef CONFIG_DEBUG_VM
|
||||||
printk(KERN_ALERT "removing pfn %lx from LRU failed\n",
|
pr_alert("removing pfn %lx from LRU failed\n", pfn);
|
||||||
pfn);
|
|
||||||
dump_page(page, "failed to remove from LRU");
|
dump_page(page, "failed to remove from LRU");
|
||||||
#endif
|
#endif
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
@ -1858,7 +1858,7 @@ repeat:
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto failed_removal;
|
goto failed_removal;
|
||||||
}
|
}
|
||||||
printk(KERN_INFO "Offlined Pages %ld\n", offlined_pages);
|
pr_info("Offlined Pages %ld\n", offlined_pages);
|
||||||
/* Ok, all of our target is isolated.
|
/* Ok, all of our target is isolated.
|
||||||
We cannot do rollback at this point. */
|
We cannot do rollback at this point. */
|
||||||
offline_isolated_pages(start_pfn, end_pfn);
|
offline_isolated_pages(start_pfn, end_pfn);
|
||||||
|
@ -1895,9 +1895,9 @@ repeat:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
failed_removal:
|
failed_removal:
|
||||||
printk(KERN_INFO "memory offlining [mem %#010llx-%#010llx] failed\n",
|
pr_debug("memory offlining [mem %#010llx-%#010llx] failed\n",
|
||||||
(unsigned long long) start_pfn << PAGE_SHIFT,
|
(unsigned long long) start_pfn << PAGE_SHIFT,
|
||||||
((unsigned long long) end_pfn << PAGE_SHIFT) - 1);
|
((unsigned long long) end_pfn << PAGE_SHIFT) - 1);
|
||||||
memory_notify(MEM_CANCEL_OFFLINE, &arg);
|
memory_notify(MEM_CANCEL_OFFLINE, &arg);
|
||||||
/* pushback to free area */
|
/* pushback to free area */
|
||||||
undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
|
undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue