From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01CCC4320E for ; Wed, 1 Sep 2021 12:47:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9DDC60232 for ; Wed, 1 Sep 2021 12:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344972AbhIAMsC (ORCPT ); Wed, 1 Sep 2021 08:48:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344774AbhIAMmz (ORCPT ); Wed, 1 Sep 2021 08:42:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5AE25611F2; Wed, 1 Sep 2021 12:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630499879; bh=zSNr8kFULbCxxpVnhaNXWL9K+ZPAtemFX4ANnza/kRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EhcIOcgbybiIkcLfvnhDnyadhSYa802I3KQPnyi2JUTcI5nF3q+nzN5jteMFjrVkZ h8S+hUdixGAKtx86w9qOSMfMbFXHoGOIKWXII4z3uaw+2RzmqyHMFtNmNfvpxCTUbT aqFYyaJVAPSFJQntnkZc2r65eDTkoh+vyR8jeFM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaohe Lin , David Hildenbrand , Oscar Salvador , Naoya Horiguchi , Chris Goldsworthy , Michal Hocko , Minchan Kim , Andrew Morton , Linus Torvalds Subject: [PATCH 5.13 019/113] mm/memory_hotplug: fix potential permanent lru cache disable Date: Wed, 1 Sep 2021 14:27:34 +0200 Message-Id: <20210901122302.620662880@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122301.984263453@linuxfoundation.org> References: <20210901122301.984263453@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaohe Lin 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 --- mm/memory_hotplug.c | 1 + 1 file changed, 1 insertion(+) --- 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",