From: Marcelo Tosatti <mtosatti@redhat.com>
To: Frederic Weisbecker <frederic@kernel.org>
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 3/5] mm/vmstat: manage per-CPU stats from CPU context when NOHZ full
Date: Fri, 16 Dec 2022 13:16:09 -0300 [thread overview]
Message-ID: <Y5yZyd0gd7M3M2+j@tpad> (raw)
In-Reply-To: <20221214133302.GA1931356@lothringen>
On Wed, Dec 14, 2022 at 02:33:02PM +0100, Frederic Weisbecker wrote:
> On Tue, Dec 06, 2022 at 01:18:29PM -0300, Marcelo Tosatti wrote:
> > static inline void vmstat_mark_dirty(void)
> > {
> > + int cpu = smp_processor_id();
> > +
> > + if (tick_nohz_full_cpu(cpu) && !this_cpu_read(vmstat_dirty)) {
> > + struct delayed_work *dw;
> > +
> > + dw = &per_cpu(vmstat_work, cpu);
> > + if (!delayed_work_pending(dw)) {
> > + unsigned long delay;
> > +
> > + delay = round_jiffies_relative(sysctl_stat_interval);
> > + queue_delayed_work_on(cpu, mm_percpu_wq, dw, delay);
>
> Currently the vmstat_work is flushed on cpu_hotplug (CPUHP_AP_ONLINE_DYN).
> vmstat_shepherd makes sure to not rearm it afterward. But now it looks
> possible for the above to do that mistake?
Don't think the mistake is an issue. In case of a
queue_delayed_work_on being called after cancel_delayed_work_sync,
either vmstat_update executes on the local CPU, or on a
different CPU (after the bound kworkers have been moved).
Each case is fine (see vmstat_update).
> > + }
> > + }
> > this_cpu_write(vmstat_dirty, true);
> > }
> > @@ -2009,6 +2028,10 @@ static void vmstat_shepherd(struct work_
> > for_each_online_cpu(cpu) {
> > struct delayed_work *dw = &per_cpu(vmstat_work, cpu);
> >
> > + /* NOHZ full CPUs manage their own vmstat flushing */
> > + if (tick_nohz_full_cpu(smp_processor_id()))
>
> It should be the remote CPU instead of the current one.
Fixed.
next prev parent reply other threads:[~2022-12-16 16:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 16:18 [PATCH v9 0/5] Ensure quiet_vmstat() is called when the idle tick was stopped too Marcelo Tosatti
2022-12-06 16:18 ` [PATCH v9 1/5] mm/vmstat: Add CPU-specific variable to track a vmstat discrepancy Marcelo Tosatti
2022-12-14 13:06 ` Frederic Weisbecker
2022-12-06 16:18 ` [PATCH v9 2/5] mm/vmstat: Use vmstat_dirty to track CPU-specific vmstat discrepancies Marcelo Tosatti
2022-12-06 16:18 ` [PATCH v9 3/5] mm/vmstat: manage per-CPU stats from CPU context when NOHZ full Marcelo Tosatti
2022-12-14 13:18 ` Frederic Weisbecker
2022-12-14 13:33 ` Frederic Weisbecker
2022-12-16 16:16 ` Marcelo Tosatti [this message]
2022-12-16 22:47 ` Frederic Weisbecker
2022-12-06 16:18 ` [PATCH v9 4/5] tick/nohz_full: Ensure quiet_vmstat() is called on exit to user-mode when the idle tick is stopped Marcelo Tosatti
2022-12-14 12:49 ` Frederic Weisbecker
2022-12-14 13:00 ` Frederic Weisbecker
2022-12-06 16:18 ` [PATCH v9 5/5] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too 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=Y5yZyd0gd7M3M2+j@tpad \
--to=mtosatti@redhat.com \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.