From patchwork Fri Apr 8 20:09:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12807186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0A67C4321E for ; Fri, 8 Apr 2022 20:09:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 613626B0072; Fri, 8 Apr 2022 16:09:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C1CF6B0081; Fri, 8 Apr 2022 16:09:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B1416B0082; Fri, 8 Apr 2022 16:09:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 3D5D96B0072 for ; Fri, 8 Apr 2022 16:09:18 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1087220A1A for ; Fri, 8 Apr 2022 20:09:18 +0000 (UTC) X-FDA: 79334801196.07.57ABB1B Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf03.hostedemail.com (Postfix) with ESMTP id 6E36C20005 for ; Fri, 8 Apr 2022 20:09:17 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 09449B82D69; Fri, 8 Apr 2022 20:09:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C6C3C385A3; Fri, 8 Apr 2022 20:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649448554; bh=CqgdUQ8KtmQ/Yioj4EEH5I++u5nh/s1yL09Oz1Ljgus=; h=Date:To:From:In-Reply-To:Subject:From; b=lurkYQeuelUK9MzaQvPWE59Mc2SYGwBMwF5zstmCGj2AAUTY2zxII0D/2B+TR6M+t zGJp1GhQsY6gZYogUUO5cUbUahD0DTXo1pShk8RZSvHH4Wz7RN/Y/QLrLdxRKyBIG8 Cvy8rjaytF8h3A10SHPnJ1U31nUmg3pN3jOf9ZOw= Date: Fri, 08 Apr 2022 13:09:13 -0700 To: songmuchun@bytedance.com,shakeelb@google.com,roman.gushchin@linux.dev,mhocko@suse.com,longman@redhat.com,hannes@cmpxchg.org,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220408130819.a89195e527ce58dfbe0700b9@linux-foundation.org> Subject: [patch 8/9] mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()" Message-Id: <20220408200914.7C6C3C385A3@smtp.kernel.org> X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=lurkYQeu; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6E36C20005 X-Stat-Signature: abq4rhnt1gwo8zzbbjf1j74kps7cffeo X-HE-Tag: 1649448557-209252 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrew Morton Subject: mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()" 405cc51fc1049c73 ("mm/list_lru: optimize memcg_reparent_list_lru_node()") has subtle races which are proving ugly to fix. Revert the original optimization. If quantitative testing indicates that we have a significant problem here then other implementations can be looked at. Fixes: 405cc51fc1049c73 ("mm/list_lru: optimize memcg_reparent_list_lru_node()") Acked-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Michal Hocko Cc: Waiman Long Cc: Roman Gushchin Cc: Johannes Weiner Signed-off-by: Andrew Morton --- mm/list_lru.c | 6 ------ 1 file changed, 6 deletions(-) --- a/mm/list_lru.c~mm-list_lruc-revert-mm-list_lru-optimize-memcg_reparent_list_lru_node +++ a/mm/list_lru.c @@ -395,12 +395,6 @@ static void memcg_reparent_list_lru_node struct list_lru_one *src, *dst; /* - * If there is no lru entry in this nlru, we can skip it immediately. - */ - if (!READ_ONCE(nlru->nr_items)) - return; - - /* * Since list_lru_{add,del} may be called under an IRQ-safe lock, * we have to use IRQ-safe primitives here to avoid deadlock. */