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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F7CAECAAA3 for ; Fri, 26 Aug 2022 13:29:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF4406B0074; Fri, 26 Aug 2022 09:29:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA3056B0075; Fri, 26 Aug 2022 09:29:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1C8F940007; Fri, 26 Aug 2022 09:29:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9EEDF6B0074 for ; Fri, 26 Aug 2022 09:29:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 77BCD8069D for ; Fri, 26 Aug 2022 13:29:20 +0000 (UTC) X-FDA: 79841825280.21.7DBE41E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 81013C0011 for ; Fri, 26 Aug 2022 13:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661520559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JyOYiH8iFRFdQ9WUABlh8E7Nflw5YGAiJGOckPykOu4=; b=WGAFlf1930Yu2/U8cOlzpl2MndsTXxZxgviZmofU6H3ZkKUIQGFwjVwL71eQikkf1hDnE9 01uhT8syAEwx1BFrTLhmB4g8SYKetkn462lk1EAnnmjvlyh+kQ0uVt8zqjsc5Zd4UpW9Dx fg+7DFwMEAkYQCUJBMIz4lxxDZnr+hQ= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-301-I92eF6tPO2O1tWsGwOC9SA-1; Fri, 26 Aug 2022 09:29:17 -0400 X-MC-Unique: I92eF6tPO2O1tWsGwOC9SA-1 Received: by mail-wm1-f71.google.com with SMTP id q10-20020a1ce90a000000b003a60123678aso503652wmc.6 for ; Fri, 26 Aug 2022 06:29:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=JyOYiH8iFRFdQ9WUABlh8E7Nflw5YGAiJGOckPykOu4=; b=NWT5U+dIhKPVKjL/f2ZsoBiWjat72/C3mjLxI46qD6VjgcM3VbdFuFxW5siqx1uaVc p7VPak8TwJNA5uP3uY4rQUdnNUqCM/7ogi/5xwggf3dCwdBDkJDaR/eQXlrZkFGdcs/5 rR0V94FwyNzTrPb2FeRmJbopzWwMMWoN2zx6HB3VI9mpsN8ZRySixKroO338pYUIg+qG bYcZ2aTnf5iv6b3ZMO5erA9q+xt/0qcVOpO4J9mJVnK/grmB8T4dCaAu8FZsCykCS06v TYlalSqsDVFenYEATEK8wfK5b83ABUrjpvSH3S59UX0kWr9HzdT9F8ZMUvRxq7pcIVhJ N0GA== X-Gm-Message-State: ACgBeo3vMaEubvf6jfWH6knPVci9aRZfwiOmYjwW5E4u8p0VoBypFgBM 06kRerTvISR1cNEzMrepbdI4gFdMOpvh0H3hdn00kBOYNaSrCr4EcOxgRDYMK+jPo35jqLMUh7K +5K3uvX+4VQ== X-Received: by 2002:a5d:6d07:0:b0:220:68a1:9ecb with SMTP id e7-20020a5d6d07000000b0022068a19ecbmr5276418wrq.116.1661520556691; Fri, 26 Aug 2022 06:29:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SKH8Ic0ZS2D06PiFXVipnW2vE66/mTXlbBQAv87GY61fOpzUZs37CFvoKq6aDOGdy9DEYqg== X-Received: by 2002:a5d:6d07:0:b0:220:68a1:9ecb with SMTP id e7-20020a5d6d07000000b0022068a19ecbmr5276392wrq.116.1661520556403; Fri, 26 Aug 2022 06:29:16 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id bj22-20020a0560001e1600b002251639bfd0sm1928626wrb.59.2022.08.26.06.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 06:29:15 -0700 (PDT) Date: Fri, 26 Aug 2022 14:29:14 +0100 From: Aaron Tomlin To: Andrew Morton Cc: Marcelo Tosatti , frederic@kernel.org, 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 v7 1/3] mm/vmstat: Use per cpu variable to track a vmstat discrepancy Message-ID: <20220826132914.ia77vdzhi7dna6ww@ava.usersys.com> X-PGP-Key: http://pgp.mit.edu/pks/lookup?search=atomlin%40redhat.com X-PGP-Fingerprint: 7906 84EB FA8A 9638 8D1E 6E9B E2DE 9658 19CC 77D6 References: <20220817191346.287594886@redhat.com> <20220817191524.140710201@redhat.com> <20220824132054.54ec0472496db153223282c4@linux-foundation.org> MIME-Version: 1.0 In-Reply-To: <20220824132054.54ec0472496db153223282c4@linux-foundation.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661520560; a=rsa-sha256; cv=none; b=7GizS7dhCUU8vEpulxM/Hh6l7/oyTFQKkp+UfZnpE7gfYkR1W2djVvB6pBsLJ9oEJswVre VuhKVKyzel7HypAp3SkOI5O/ana1Qhn+83x1vouFeXduZhLvFghrioQM0NhNpipSBwuVZ4 Ep6kvPur99gVqTOuRT2svn68csahqSs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WGAFlf19; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of atomlin@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=atomlin@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661520560; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JyOYiH8iFRFdQ9WUABlh8E7Nflw5YGAiJGOckPykOu4=; b=YPe60NaggqDMfmmFypljr3YOLExR3dkAUlr+Qt14iAtPWlAsuam7lP0/2XundLFozE3SEJ 6rtLZZAlcs0d/1HjwoDLdunjdEPaPbmYr1YLf0zeGkqn1S+v4d7dvb4o4n1SlEyewxMSye kdoUuifPU3BIoPv5pJon4EwBfD6p0YQ= Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WGAFlf19; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of atomlin@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=atomlin@redhat.com X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: bqd9ohjcyyj8fs9xw3bjkpyr9d7gddo8 X-Rspamd-Queue-Id: 81013C0011 X-HE-Tag: 1661520559-983457 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 Wed 2022-08-24 13:20 -0700, Andrew Morton wrote: > > --- linux-2.6.orig/mm/vmstat.c > > +++ linux-2.6/mm/vmstat.c > > @@ -195,6 +195,12 @@ void fold_vm_numa_events(void) > > #endif > > > > #ifdef CONFIG_SMP > > +static DEFINE_PER_CPU_ALIGNED(bool, vmstat_dirty); > > + > > +static inline void mark_vmstat_dirty(void) > > +{ > > + this_cpu_write(vmstat_dirty, true); > > +} > > If we're to have a helper for this then how about helpers for clearing > it and reading it? > > Also, vmstat_mark_dirty(), vmstat_clear_dirty() and vmstat_dirty() > would be better identifiers. > > Then those helper functions become good sites for comments explaining > what's going on. > Hi Andrew, Fair enough. I'll work on that. Kind regards, -- Aaron Tomlin