From: Phil Auld <pauld@redhat.com>
To: Aaron Tomlin <atomlin@redhat.com>
Cc: frederic@kernel.org, tglx@linutronix.de, mingo@kernel.org,
mingo@redhat.com, atomlin@atomlin.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC PATCH] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too
Date: Wed, 16 Feb 2022 16:20:41 -0500 [thread overview]
Message-ID: <Yg1qqbBlHwkInC8O@lorien.usersys.redhat.com> (raw)
In-Reply-To: <20220216143412.dwxjlkq4w2zeweld@ava.usersys.com>
On Wed, Feb 16, 2022 at 02:34:12PM +0000 Aaron Tomlin wrote:
> On Thu 2022-02-03 17:22 -0500, Phil Auld wrote:
> > As I said earlier, I don't think you want to call quiet_vmstat()
> > unconditionally. And I don't think this will catch the cases you are
> > trying to fix. Once the tick is stopped tick_nohz_stop_tick should not be
> > getting called again until it's been restarted.
>
> Phil,
>
> Sorry about the delay. If I understand correctly, I see a scenario by which
> tick_nohz_stop_tick() can be called on transition/or exit from idle (e.g.
> default_idle_call()):
No worries. It's possible that I am misunderstanding the issue still... :)
>
> 1. The idle/or scheduling-clock was previously
> stopped
>
> 2. It is considered safe for the scheduling-clock
> tick to remain "stopped"/or omitted; no need to
> reprogram and enable a periodic tick
> (e.g. no queued/or expired pending timer)
>
> ...
> do_idle
> cpuidle_idle_call
> {
>
> ...
>
> .-- default_idle_call
> | arch_cpu_idle
> | goto exit_idle
> |
> | exit_idle:
> | __current_set_polling()
> |
> | }
> | tick_nohz_idle_exit()
> | {
> |
> | tick_stopped = ts->tick_stopped
> |
> | if (tick_stopped)
> | tick_nohz_idle_update_tick(ts, now)
> | if (tick_nohz_full_cpu(smp_processor_id()))
> | __tick_nohz_full_update_tick(ts, now)
> | {
> | int cpu = smp_processor_id()
> |
> | if (can_stop_full_tick(cpu, ts))
> | tick_nohz_stop_sched_tick(ts, cpu)
> | if (tick_nohz_next_event(ts, cpu))
> '-- tick_nohz_stop_tick(ts, cpu)
> }
> }
>
> If I understand correctly, __tick_nohz_full_update_tick() can return with
> no changes to the current tick (e.g. expire time == KTIME_MAX), no?
>
Yeah, I missed that path, so tick_nohz_stop_tick() can get called with the tick
already stopped. My concern was about calling quiet_vmstat() if the tick was not
stopped as per the comment on that function. But looking more closely at
tick_nohz_stop_tick() it won't be doing that with your patch.
If this is fixing the issue you are seeing (I don't remember if you had a
reproducible case or not) then I think this could be a good way to do it.
It does seem to rely on a few things lining up right to get to the call to
tick_nohz_stop_tick().
Cheers,
Phil
>
> Kind regards,
>
> --
> Aaron Tomlin
>
--
next prev parent reply other threads:[~2022-02-16 21:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 21:43 [RFC PATCH] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
2022-02-03 22:22 ` Phil Auld
2022-02-16 14:34 ` Aaron Tomlin
2022-02-16 21:20 ` Phil Auld [this message]
2022-02-17 12:57 ` Frederic Weisbecker
2022-02-17 14:45 ` Aaron Tomlin
2022-02-17 12:47 ` Frederic Weisbecker
2022-02-17 14:26 ` Aaron Tomlin
2022-02-17 16:32 ` Frederic Weisbecker
2022-02-18 12:54 ` Aaron Tomlin
2022-02-19 15:46 ` Aaron Tomlin
2022-02-24 12:27 ` Marcelo Tosatti
2022-02-24 12:30 ` Marcelo Tosatti
2022-02-24 13:01 ` Aaron Tomlin
2022-02-24 12:37 ` Marcelo Tosatti
2022-02-24 13:00 ` Aaron Tomlin
2022-02-24 13:14 ` Marcelo Tosatti
2022-02-24 13:28 ` Aaron Tomlin
2022-02-24 13:40 ` Marcelo Tosatti
2022-02-24 13:44 ` Aaron Tomlin
2022-03-31 14:33 ` Aaron Tomlin
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=Yg1qqbBlHwkInC8O@lorien.usersys.redhat.com \
--to=pauld@redhat.com \
--cc=atomlin@atomlin.com \
--cc=atomlin@redhat.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).