Received: by 2002:a05:6520:2f93:b029:af:d4db:7a05 with SMTP id 19csp2382158lkf; Fri, 5 Feb 2021 11:41:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxWJZLNTz2F3FJq4UktpqP2OxzDpqP4kbvEp6SYNZEUu+49PLv1xRcnj0vAozTptR2zro2 X-Received: by 2002:a17:906:145b:: with SMTP id q27mr5636222ejc.432.1612554060552; Fri, 05 Feb 2021 11:41:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612554060; cv=none; d=google.com; s=arc-20160816; b=FQUUtDHQ93I1QE0JRodHcM0gITx9BFB+iHSDVwKF1gia8kqDIWvffSNjpg0q51ADcf o/FQga0zdQPHebQb9aE0YLsgVP59V2gCUETvO1Sq+h4PxbhOtdmRHhihl1jjVTQNuEsd KgSskBf+Aoc9sCXwcA4R4kr/JlO0EQ/6Wc++aazUMiHMPJd7Cw0+j5owVOvkq/J93Q93 N0oFaRnQG7C82WRLhFrY6UzeHfuvHY9Ewn/jO4uYM6iOmUaturW3DpsrKZbqmkMJD7MR CWTHROs++Cwt+Esd+7tE+I/nvfM4vzBg9IDicJi6ApHBlYhsO4h0tCguRazrDUTBwr14 hMIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JSYiUbx9lBanOq4tbekqTAf5PAtDklDUpjXB1f72Qrc=; b=GDlJtiESySeZ5q72b2b5ceBY2/oE3OrO1a3u/61L7wpBvNsf+YXEJOMev/ZKDQMSoB Mp40KB46CO+gWid+fdnynxFxhqMvUEZVPxNPI+U2StyZ23oGxQQQ7vO8XY55152nmR3Z 6MPAxB8bit742lu+3DenjKBqiaHoHZPlrMICrxr64vVHSHMNr57gLOHKKv+i4H9SkXw/ xo1LsH9k4J+e/uzBYG5IOXQSWgaIansT7ds23rZzhTzWRkH2f2mAVUisF75ySgLbjXZL nRZaa30607DAOyUVGMshXtgCq1wFZTMo2mGAankzzsjLgFFj963KOVBRj4NBeW6EUX1g QpZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="tM/dZEUe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs15si5912592ejb.717.2021.02.05.11.40.36; Fri, 05 Feb 2021 11:41:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="tM/dZEUe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233147AbhBER4L (ORCPT + 99 others); Fri, 5 Feb 2021 12:56:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbhBEP2u (ORCPT ); Fri, 5 Feb 2021 10:28:50 -0500 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD14CC06178A for ; Fri, 5 Feb 2021 09:10:31 -0800 (PST) Received: by mail-qv1-xf2c.google.com with SMTP id w11so3764498qvz.12 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=dmPr4nDIfQMnv7f72jn3lyOtl261nyS7YUv77sgFO/H6KTMvyXhaGltJYyNVbg5U0u M/w9OqbELy1a1I5B7wzYd/O0fvD98wxbIILOEdwU5MSW9ZAU7qEirqFSDKNfOD2OHvLG Od9Miu7wC2zv+4XQzXeHw5SJq4kJXAocIJdC3tau7KH0HBhXuAkEPXmMmVPk0UAnQ1mk dEHAeILhGZ0pALgPRDW1Vl/2QaGG6hSVkLWPZP2htEMMIua4x+68Gu3kLpkt+USiWdwm 6XWuiWVBndfoByeqUl9+/kLsvY9nkS9VFLbBEx2b0NALIOU15T8Itu1qijP7Ua2WPKh8 C7wg== X-Gm-Message-State: AOAM5328dWOlU+dNFcr9AWL1NhWjoJrHARfunVim+tDBIujPzkPLLzdO dVx0JafbzHO25n/o2jnnCeoj0A== 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.