Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1224978pxb; Fri, 1 Apr 2022 07:52:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGinmCWuIz0C+ILOyI/Y2MkHH1gDg4hc05xWCGfLagJPzNmAMtB+71kgvwRMjLs5qTnmxw X-Received: by 2002:a17:906:4783:b0:6d0:9b6e:b5a5 with SMTP id cw3-20020a170906478300b006d09b6eb5a5mr169609ejc.526.1648824729364; Fri, 01 Apr 2022 07:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648824729; cv=none; d=google.com; s=arc-20160816; b=xQqwoQ6ek0rkCSowl/7+bxdd/cDsbUIWKjxH3eU2MaUGmdDx34QBH2l2FVjPiI6q+g M0G8h/G4wOGLNDPYAX6vAR7Pfh9hj3pTjV91IQHPN3NACdCprryAUnMeP6VAnAtUzSzM klVroGxW8ysRg0JfkS6w4pMq7alQXOkBfaIsUuFUQYycMymu2ZZLYi7RpNwTHrAF5mLl DXk3Y0MJHG0FkbL7Ejf3FOW/QdgnnouUZC/RCGIMiVKLAkeztoynAYvnqY+suQLd1vOD 4wMkK8Y+KPW9fSp73d2+xzAePvKHhcXwiv+pPkEs2+UgYlptcizvVDBEZqPkrizYvA2g n6VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qjcJFY+K3TS1eivpm/IZvtXBuodt+btawh7qCwUG148=; b=p0cdEGyjpH+NlUMqDaeQQckEh5fmvZitaRQtznbbrQvsNzY9z7hLA//zSb70uXV0po 1BIUZmX5/Ge5Op1Qp/W+CrEyqPE14LSRtN6UTtpepDk4LQdFnvC15N7cC2gs6ckwhSM8 U9Fa1V9MDFwC2Nv6ca3rVs110VDN4q55hz68vItbHwjxL1BHY8XMxOtKv8DN4OhifsVr Lp1w3MHXbjnO+j9Pma3Wf8JajmfRRjU9xXggwD9kP8YqB6Xuj4CQzm9Bd63q/w5DYnr5 9JxqXujrZEH7c/jRGmFNsMb/XCP7EziAI+TzSonriCXsYuMnIg62r1Og4B8ZmGDQXD4H c0lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aLfcYTpe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q25-20020a1709064c9900b006df76385cf1si1707222eju.401.2022.04.01.07.51.42; Fri, 01 Apr 2022 07:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aLfcYTpe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244826AbiDAEZ3 (ORCPT + 99 others); Fri, 1 Apr 2022 00:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233783AbiDAEZ1 (ORCPT ); Fri, 1 Apr 2022 00:25:27 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4156721A5 for ; Thu, 31 Mar 2022 21:23:38 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id o68-20020a17090a0a4a00b001c686a48263so4236329pjo.1 for ; Thu, 31 Mar 2022 21:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qjcJFY+K3TS1eivpm/IZvtXBuodt+btawh7qCwUG148=; b=aLfcYTperTFQ/2tIbR+mHV20JN2Ns3yu+0srEpm/ziN5iNA3nwDh/0a63A7jV0YZD2 RSIczCBgkTPHHw+nmH4qZCanrtegxWXh3L2ZbAUo9+Pwxn4VJ+0xGrtwE/98y8QArRz3 MnHReWthknARksAttkLna0sBombylCuqXwVSP106ZPGjfuk36DtCNYSZxxaxrLIU/vvF qR86VCq6VIqAIDQ0eN5sqsr9+4Hiv5rZKnZwdECrNMv3hFrFfNRIGNvY8p+7BXN1ipAe bBZF6rm/yPLifumYjyvulSPNmIpHmGHg6+JSZluoG9sqOhrITKSJpicWb2GOtXLhukIA z/7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qjcJFY+K3TS1eivpm/IZvtXBuodt+btawh7qCwUG148=; b=Q9oQv3CcIiwn+qadTX7UJ1Y6kBa6c4fkuVmSDukaT35SHq8HadJg5t1RXBtxI6YEs8 Ubhnj+PEpYEnR0b3ZOLkRtOt6mnRl6UtwDdqjDjc6UG3MVRyaLHxpsZaOfc54aaZ5U0l waBRXr+hpT9T7CCCv1SNhy78fffS6cCpuOV0o4WQgizfTcbGQmmY7kOyzxwjPV/ZQfbP JSUat9moyCRMqa9cYdMNPlPue/CKzM1w6X6DZmCMOKIx6V9UruCoFHmh7omoUdxaLlqI XriHdFpPdOYGH+EhrLeyNnyr2l9JYY1F44t+y7du9sx7254Jo5Q0gHQM1zGc9nA9KY9F UQqw== X-Gm-Message-State: AOAM533ZSZMGE2B5ObYrhmKuqbH4atsz/DB0XyMErqgfKoSIZHYcZJ3n xckKkkv8aABJdlMw8uyO5jaRR8evCEopYhZSbHF5VQ== X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr43980317plk.172.1648787017568; Thu, 31 Mar 2022 21:23:37 -0700 (PDT) MIME-Version: 1.0 References: <20220330191440.1cc1b2de2b849d1ba93d2ba7@linux-foundation.org> <89B53D3A-FCC5-4107-8D49-81D5B9AE5172@linux.dev> <20220331063956.5uqnab64cqnmcwyr@google.com> <20220331181126.815cfe2b05b4281d32b7bf49@linux-foundation.org> In-Reply-To: <20220331181126.815cfe2b05b4281d32b7bf49@linux-foundation.org> From: Shakeel Butt Date: Thu, 31 Mar 2022 21:23:26 -0700 Message-ID: Subject: Re: [PATCH v2] mm/list_lru: Fix possible race in memcg_reparent_list_lru_node() To: Andrew Morton Cc: Michal Hocko , Roman Gushchin , Waiman Long , Linux MM , LKML , Muchun Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 31, 2022 at 6:11 PM Andrew Morton w= rote: > > On Thu, 31 Mar 2022 09:46:52 +0200 Michal Hocko wrote: > > > On Thu 31-03-22 06:39:56, Shakeel Butt wrote: > > > On Wed, Mar 30, 2022 at 07:48:45PM -0700, Roman Gushchin wrote: > > > > > > > > > > > [...] > > > > > > > > > > > > But honestly, I=E2=80=99d drop the original optimization together w= ith > > > > the fix, if only there is no _real world_ data on the problem and > > > > the improvement. It seems like it has started as a nice simple > > > > improvement, but the race makes it complex and probably not worth > > > > the added complexity and fragility. > > > > > > I agree with dropping the original optimization as it is not really > > > fixing an observed issue which may justify adding some complexity. > > > > Completely agreed. The patch as it is proposed is not really acceptable > > IMHO and I have to say I am worried that this is not the first time we > > are in a situation when a follow up fixes or unrelated patches are > > growing in complexity to fit on top of a performance optimizations whic= h > > do not refer to any actual numbers. > > Yup. I did this: > > 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_n= ode()") > Cc: Waiman Long > Cc: Roman Gushchin > Cc: Muchun Song > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: Shakeel Butt > Signed-off-by: Andrew Morton Acked-by: Shakeel Butt