Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1003193rwb; Wed, 14 Dec 2022 05:34:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf7f/gJVMPhoB0adJkdWSXGprZ9Qi64Dq4DXX3RXkopPIrMUSl983MDavHoC8pHpTsS2oU2D X-Received: by 2002:a17:902:d54f:b0:189:76ef:a1b9 with SMTP id z15-20020a170902d54f00b0018976efa1b9mr27512710plf.5.1671024845247; Wed, 14 Dec 2022 05:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671024845; cv=none; d=google.com; s=arc-20160816; b=TnM9kKvDiEIn+E4JV4pkIpP/6mofoAJxnWJrMOp/ZIrbPwmCZow3Psu6gf1c2WO5vg qpOxbrdULB7Cf+jMXGoj3FWNlpA/X53Qgzxcr7wAwE7PnjpPf9zB/xuzS4GMPuWkZ5Ja 3gLlLorwClbcnKFtnBaVX4XgGeOHzgHBXw2fHK8+ntUvJmLQYLAwLgETzAyilMzNx2pe YnGWfH7Y4ys9i/D/iTobeDhWsBYyeWANkjcYZ/nTZZa6MaFRDVteWYha9a4x6PCzgMNi LbuviBi95G/U5ghOzmaJ99nq+jq1+C7JmbjLbUUXCo0hGxgANM3rysK8TglF+QTzdEbN u/4w== 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=Yc1QbOzDORGaoRGyGig0/w2cuK3MCeo5UhxjCF1vFnE=; b=NcOBZsxSYu7x8rs/zugyVmHht1OoYKDfr4uh84YKHJrVEBKQRWldIXyUcZLFImIqgf xmuEK8ng87XXRSld2v8Fa23B0/m2VPyaTHO1/D8v9BVlJtKQJxWKxZHszBlxbfAuN63U KD0fwLZ1mlKlKL9Z9pcc2daCJirk2Z0I44+kDfr2lLLTaULFUCyPDN1OzgyR27a4EbeY 9hu20GQInqUD6/EHq+x8LlVrkxdnLYzsjBzHhx0P3tY3N4g1oVGFdYGEkqdCQ7MFjjHu y44/ORL7FEJIdnuQjIzNoa86iWFfMjroTMvzCEgjASCBxlMGyEUFxsUnbotoEQsrgIsz J44w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bpOQNBvO; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a1709028a8100b00186ae54007dsi2617162plo.499.2022.12.14.05.33.55; Wed, 14 Dec 2022 05:34:05 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=bpOQNBvO; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238326AbiLNNGa (ORCPT + 69 others); Wed, 14 Dec 2022 08:06:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiLNNG1 (ORCPT ); Wed, 14 Dec 2022 08:06:27 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9772F9FCF for ; Wed, 14 Dec 2022 05:06:26 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 2EEBF61A53 for ; Wed, 14 Dec 2022 13:06:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12022C433EF; Wed, 14 Dec 2022 13:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671023185; bh=lDTCePU+j9rTmUoYes8Iq93CXo/8hTpg8U7Xkcd7nSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bpOQNBvOIxYPP5gha0MzWOwEbjSLjH+Dpxd5pdWy+dq48PGHa0SHi25xqKtlz/dX+ hPakhCKAJZHH7tb/0jzt3zANCux/YV6pzDnuh+4FoDdWqYOtCRFcBlbSw3WcAk5KLx d5iUM1Qg4MyMbe5KaCL78nXlHvtzlEA+5ycESor5Fg1O2ekz1dMvAllkulDvwE1BVs 1FO8mn0hJdG2tMoFZ32AqEpT3KPX4HBWo3jZrkignyxDCJzoUzt5jOGMKndrH9SpcY hhDyLR3BGEDu73I3M7qCEYQkbnhJO9Puq4EBFuQyi8/lfd7YxFQEViYfw/pLHV3mW5 TaYYMklb2IGZA== Date: Wed, 14 Dec 2022 14:06:22 +0100 From: Frederic Weisbecker To: Marcelo Tosatti Cc: atomlin@redhat.com, cl@linux.com, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, pauld@redhat.com, neelx@redhat.com, oleksandr@natalenko.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v9 1/5] mm/vmstat: Add CPU-specific variable to track a vmstat discrepancy Message-ID: <20221214130622.GD1930067@lothringen> References: <20221206161826.698593151@redhat.com> <20221206162416.404740300@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221206162416.404740300@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, Dec 06, 2022 at 01:18:27PM -0300, Marcelo Tosatti wrote: > From: Aaron Tomlin > > Introduce a CPU-specific variable namely vmstat_dirty to indicate > if a vmstat imbalance is present for a given CPU. Therefore, at > the appropriate time, we can fold all the remaining differentials. > This patch also provides trivial helpers for modification and testing. > > Signed-off-by: Aaron Tomlin Your SOB is also missing here and on other patches. Thanks. > --- > mm/vmstat.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > Index: linux-2.6/mm/vmstat.c > =================================================================== > --- linux-2.6.orig/mm/vmstat.c > +++ linux-2.6/mm/vmstat.c > @@ -194,6 +194,22 @@ void fold_vm_numa_events(void) > #endif > > #ifdef CONFIG_SMP > +static DEFINE_PER_CPU_ALIGNED(bool, vmstat_dirty); > + > +static inline void vmstat_mark_dirty(void) > +{ > + this_cpu_write(vmstat_dirty, true); > +} > + > +static inline void vmstat_clear_dirty(void) > +{ > + this_cpu_write(vmstat_dirty, false); > +} > + > +static inline bool is_vmstat_dirty(void) > +{ > + return this_cpu_read(vmstat_dirty); > +} > > int calculate_pressure_threshold(struct zone *zone) > { > >