From: Miaohe Lin Date: Wed, 25 Aug 2021 19:17:55 +0000 (-0700) Subject: mm/memory_hotplug: fix potential permanent lru cache disable X-Git-Tag: v5.13.14~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbce1780abeb4236a94378bca2ba9f60700280d8;p=thirdparty%2Fkernel%2Fstable.git mm/memory_hotplug: fix potential permanent lru cache disable commit 946746d1ad921e5f493b536533dda02ea22ca609 upstream. 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: d479960e44f2 ("mm: disable LRU pagevec during the migration temporarily") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Reviewed-by: Naoya Horiguchi Cc: Chris Goldsworthy Cc: Michal Hocko Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 70620d0dd923a..1bf3f86812509 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1854,6 +1854,7 @@ failed_removal_isolated: undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE); memory_notify(MEM_CANCEL_OFFLINE, &arg); failed_removal_pcplists_disabled: + lru_cache_enable(); zone_pcp_enable(zone); failed_removal: pr_debug("memory offlining [mem %#010llx-%#010llx] failed due to %s\n",