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=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 5A471C433E0 for ; Fri, 5 Feb 2021 17:10:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98A0064FCA for ; Fri, 5 Feb 2021 17:10:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98A0064FCA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E15B06B0082; Fri, 5 Feb 2021 12:10:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC6866B0083; Fri, 5 Feb 2021 12:10:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDC296B0085; Fri, 5 Feb 2021 12:10:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id B78A76B0082 for ; Fri, 5 Feb 2021 12:10:32 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7C258180AD830 for ; Fri, 5 Feb 2021 17:10:32 +0000 (UTC) X-FDA: 77784853104.24.994B1E4 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf06.hostedemail.com (Postfix) with ESMTP id D6737C007772 for ; Fri, 5 Feb 2021 17:10:31 +0000 (UTC) Received: by mail-qv1-f52.google.com with SMTP id a1so3754150qvd.13 for ; Fri, 05 Feb 2021 09:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JSYiUbx9lBanOq4tbekqTAf5PAtDklDUpjXB1f72Qrc=; b=tM/dZEUeDe1AgSL5LylGwYfRT5+levhjDv8vOBR8fUAbDaWMIznPnPLamaZYjY3wzT g+cjA6pD7ZjdrM2mng9Mhako+BFslrJzcTyReIW3h3o2QgGnwwDoKQzvWVUktPepuyYF AQpeiGmjpMs3K7CIzmD/iIjPrJfmglw9FOMLa8DMpRqKtFq4n+aJwjjtM6lqRBeHo15z kMc5x+Y/a9DnW6WdEzSjR2PJZoQSYrOzjK7pChRoltFN0rOJYBKH6WVkXPnWme2gn3k3 YwP8eOjnLw8SSf+taDiSenMwKUeZDxhJoWi9lzmTgxWYD8kMQD8Zdwho7ZOxqfsluBcS VKTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JSYiUbx9lBanOq4tbekqTAf5PAtDklDUpjXB1f72Qrc=; b=HsqOf/KojUkHW0+mB0v4Dt3ggP8A82Dkp9x83sSVipVjnCyuD+1VPYzoH6triLB8nX oOshqBYmPOn0sOJx8NaTbCKJdoq9f/VMKkX6e4am+nj5qnJK0Dau+awSF1KQn2FAd+Nu LIG5Y/3JfsMNHFTSL5OVvZqkaXHTbFojKx6+I8Kx7+0sRLyTNk8l954lPZilMSfdHdVD 8n3N0zhw6tsW2xcHS1U6BZe+RLHQPoo0mnadUEJc45wtlLmmNfUUKvl9MHrff1dTMJwj TcjjqQAJuhc5P9pHW3ve37LKCsLXDjUCTGL9pVdum38xU+pkLvMuXCg0Ouurr64jwYdj qHFg== X-Gm-Message-State: AOAM532Y5tFF/BZ5dbjir0L8C0P9qGdLxSYeFwK0R2V2DmSLES013qp4 QXlAySoKwpdXMx6lZiUj65AFFQ== X-Google-Smtp-Source: ABdhPJwfv1gGAdP2jw5xSKMc6JrF213KOE1VJFhtyr1tERfRWP0BI2bHuc1NqNeFBd5A0OMvxYuzDA== X-Received: by 2002:a0c:e8c8:: with SMTP id m8mr5266723qvo.33.1612545031139; Fri, 05 Feb 2021 09:10:31 -0800 (PST) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id c22sm8495640qtp.19.2021.02.05.09.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 09:10:29 -0800 (PST) Date: Fri, 5 Feb 2021 12:10:28 -0500 From: Johannes Weiner To: Michal Hocko Cc: Andrew Morton , Tejun Heo , Roman Gushchin , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 7/7] mm: memcontrol: consolidate lruvec stat flushing Message-ID: References: <20210202184746.119084-1-hannes@cmpxchg.org> <20210202184746.119084-8-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D6737C007772 X-Stat-Signature: jd4twmh4qtj9wjk4xii61rqyhhjaag75 Received-SPF: none (cmpxchg.org>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mail-qv1-f52.google.com; client-ip=209.85.219.52 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1612545031-247950 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: On Fri, Feb 05, 2021 at 04:17:27PM +0100, Michal Hocko wrote: > On Tue 02-02-21 13:47:46, Johannes Weiner wrote: > > There are two functions to flush the per-cpu data of an lruvec into > > the rest of the cgroup tree: when the cgroup is being freed, and when > > a CPU disappears during hotplug. The difference is whether all CPUs or > > just one is being collected, but the rest of the flushing code is the > > same. Merge them into one function and share the common code. > > IIUC the only reason for the cpu == -1 special case is to avoid > zeroying, right? Is this optimization worth the special case? The code > would be slightly easier to follow without this. Hm, it was less about the optimization and more about which CPU(s) need(s) to be handled. But it's pretty silly the way it's written, indeed. I'll move the for_each_online_cpu() to the caller and drop the cpu==-1 special casing, it makes things much simpler and more obvious. > > Signed-off-by: Johannes Weiner > > Anyway the above is not really a fundamental objection. It is more important > to unify the flushing. > > Acked-by: Michal Hocko Thanks. v2 is different, so I'll wait with taking the ack.