From: Andrew Morton <akpm@linux-foundation.org>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: atomlin@redhat.com, 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
Date: Wed, 24 Aug 2022 13:20:54 -0700 [thread overview]
Message-ID: <20220824132054.54ec0472496db153223282c4@linux-foundation.org> (raw)
In-Reply-To: <20220817191524.140710201@redhat.com>
On Wed, 17 Aug 2022 16:13:47 -0300 Marcelo Tosatti <mtosatti@redhat.com> wrote:
> From: Aaron Tomlin <atomlin@redhat.com>
>
> Add 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 speeds up quiet_vmstat in case no per-CPU differentials exist.
>
> Based on
> https://lore.kernel.org/lkml/20220204173554.763888172@fedora.localdomain/
>
> Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> ---
> mm/vmstat.c | 54 ++++++++++++++++++++----------------------------------
> 1 file changed, 20 insertions(+), 34 deletions(-)
>
> Index: linux-2.6/mm/vmstat.c
> ===================================================================
> --- 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.
next prev parent reply other threads:[~2022-08-24 20:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 19:13 [PATCH v7 0/3] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Marcelo Tosatti
2022-08-17 19:13 ` [PATCH v7 1/3] mm/vmstat: Use per cpu variable to track a vmstat discrepancy Marcelo Tosatti
2022-08-24 20:20 ` Andrew Morton [this message]
2022-08-26 13:29 ` Aaron Tomlin
2022-08-17 19:13 ` [PATCH v7 2/3] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Marcelo Tosatti
2022-08-24 20:20 ` Andrew Morton
2022-09-09 12:12 ` Frederic Weisbecker
2022-09-09 19:35 ` Marcelo Tosatti
2022-09-12 14:38 ` Aaron Tomlin
2022-09-14 11:04 ` Frederic Weisbecker
2022-08-17 19:13 ` [PATCH v7 3/3] mm/vmstat: do not queue vmstat_update if tick is stopped Marcelo Tosatti
-- strict thread matches above, loose matches on Subject: below --
2022-08-17 19:01 [patch 0/3] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Marcelo Tosatti
2022-08-17 19:01 ` [patch 1/3] mm/vmstat: Use per cpu variable to track a vmstat discrepancy Marcelo Tosatti
2022-08-17 19:01 ` [PATCH v7 " Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220824132054.54ec0472496db153223282c4@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=atomlin@redhat.com \
--cc=cl@linux.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=neelx@redhat.com \
--cc=oleksandr@natalenko.name \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox