提交 4b20477f 编写于 作者: K KAMEZAWA Hiroyuki 提交者: Linus Torvalds

memory hotplug: fix notifier's return value check

Even if notifier cannot find any pages, it doesn't mean no pages are
available...And, if there are no notifiers registered, this condition will
be always true and memory hotplug will show -EBUSY.

This is a bug but not critical.

In most case, a pageblock which will be offlined is MIGRATE_MOVABLE This
"notifier" is called only when the pageblock is _not_ MIGRATE_MOVABLE.
But if not MIGRATE_MOVABLE, it's common case that memory hotplug will
fail.  So, no one notice this bug.
Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cf608ac1
...@@ -5336,7 +5336,7 @@ int set_migratetype_isolate(struct page *page) ...@@ -5336,7 +5336,7 @@ int set_migratetype_isolate(struct page *page)
*/ */
notifier_ret = memory_isolate_notify(MEM_ISOLATE_COUNT, &arg); notifier_ret = memory_isolate_notify(MEM_ISOLATE_COUNT, &arg);
notifier_ret = notifier_to_errno(notifier_ret); notifier_ret = notifier_to_errno(notifier_ret);
if (notifier_ret || !arg.pages_found) if (notifier_ret)
goto out; goto out;
for (iter = pfn; iter < (pfn + pageblock_nr_pages); iter++) { for (iter = pfn; iter < (pfn + pageblock_nr_pages); iter++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册