提交 946746d1 编写于 作者: M Miaohe Lin 提交者: Linus Torvalds

mm/memory_hotplug: fix potential permanent lru cache disable

If offline_pages failed after lru_cache_disable(), it forgot to do
lru_cache_enable() in error path.  So we would have lru cache disabled
permanently in this case.

Link: https://lkml.kernel.org/r/20210821094246.10149-3-linmiaohe@huawei.com
Fixes: d479960e ("mm: disable LRU pagevec during the migration temporarily")
Signed-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Reviewed-by: NOscar Salvador <osalvador@suse.de>
Reviewed-by: NNaoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6e764bcd
...@@ -1731,6 +1731,7 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages) ...@@ -1731,6 +1731,7 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages)
undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE); undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
memory_notify(MEM_CANCEL_OFFLINE, &arg); memory_notify(MEM_CANCEL_OFFLINE, &arg);
failed_removal_pcplists_disabled: failed_removal_pcplists_disabled:
lru_cache_enable();
zone_pcp_enable(zone); zone_pcp_enable(zone);
failed_removal: failed_removal:
pr_debug("memory offlining [mem %#010llx-%#010llx] failed due to %s\n", pr_debug("memory offlining [mem %#010llx-%#010llx] failed due to %s\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册