From: Peter Zijlstra <peterz@infradead.org>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
mingo@kernel.org, linux-kernel@vger.kernel.org,
morten.rasmussen@foss.arm.com, brendan.jackman@arm.com,
dietmar.eggemann@arm.com
Subject: Re: [PATCH v2 1/3] sched: Stop nohz stats when decayed
Date: Thu, 8 Feb 2018 14:15:22 +0100 [thread overview]
Message-ID: <20180208131522.GG25201@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <780a5b3a-4829-4195-c8fd-95da27248a82@arm.com>
On Thu, Feb 08, 2018 at 12:46:53PM +0000, Valentin Schneider wrote:
> On 02/06/2018 07:23 PM, Vincent Guittot wrote:
> > [...]
> > @@ -7826,8 +7842,8 @@ static inline void update_sg_lb_stats(struct lb_env *env,
> > for_each_cpu_and(i, sched_group_span(group), env->cpus) {
> > struct rq *rq = cpu_rq(i);
> >
> > - if (env->flags & LBF_NOHZ_STATS)
> > - update_nohz_stats(rq);
> > + if ((env->flags & LBF_NOHZ_STATS) && update_nohz_stats(rq))
> > + env->flags |= LBF_NOHZ_AGAIN;
> >
> > /* Bias balancing toward cpus of our domain */
> > if (local_group)
> > @@ -7979,18 +7995,15 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
> > struct sg_lb_stats *local = &sds->local_stat;
> > struct sg_lb_stats tmp_sgs;
> > int load_idx, prefer_sibling = 0;
> > + int has_blocked = READ_ONCE(nohz.has_blocked);
> > bool overload = false;
> >
> > if (child && child->flags & SD_PREFER_SIBLING)
> > prefer_sibling = 1;
> >
> > #ifdef CONFIG_NO_HZ_COMMON
> > - if (env->idle == CPU_NEWLY_IDLE) {
> > + if (env->idle == CPU_NEWLY_IDLE && has_blocked)
> > env->flags |= LBF_NOHZ_STATS;
> > -
> > - if (cpumask_subset(nohz.idle_cpus_mask, sched_domain_span(env->sd)))
> > - nohz.next_stats = jiffies + msecs_to_jiffies(LOAD_AVG_PERIOD);
> > - }
> > #endif
> >
> > load_idx = get_sd_load_idx(env->sd, env->idle);
> > @@ -8046,6 +8059,15 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
> > sg = sg->next;
> > } while (sg != env->sd->groups);
> >
> > +#ifdef CONFIG_NO_HZ_COMMON
> > + if ((env->flags & LBF_NOHZ_AGAIN) &&
> > + cpumask_subset(nohz.idle_cpus_mask, sched_domain_span(env->sd))) {
> > +
> > + WRITE_ONCE(nohz.next_blocked,
> > + jiffies + msecs_to_jiffies(LOAD_AVG_PERIOD));
>
> Here we push the stats update forward if we visited all the nohz CPUs but they
> still have blocked load. IMO we should also clear the nohz.has_blocked flag
> if we visited all the nohz CPUs and none had blocked load left.
You can't, new cpu's can have joined the set. I used to detect that, but
that requires atomic ops.
next prev parent reply other threads:[~2018-02-08 13:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 19:23 [PATCH v2 0/3] Update blocked load Vincent Guittot
2018-02-06 19:23 ` [PATCH v2 1/3] sched: Stop nohz stats when decayed Vincent Guittot
2018-02-08 12:46 ` Valentin Schneider
2018-02-08 13:15 ` Peter Zijlstra [this message]
2018-02-08 13:36 ` Vincent Guittot
2018-02-08 19:21 ` Valentin Schneider
2018-02-09 11:41 ` Vincent Guittot
2018-02-09 12:16 ` Valentin Schneider
2018-02-08 14:00 ` Peter Zijlstra
2018-02-08 14:04 ` Peter Zijlstra
2018-02-08 15:05 ` Vincent Guittot
2018-02-08 15:44 ` Peter Zijlstra
2018-02-08 16:52 ` Vincent Guittot
2018-02-09 12:00 ` Peter Zijlstra
2018-02-08 15:30 ` Will Deacon
2018-02-08 15:46 ` Peter Zijlstra
2018-02-08 16:03 ` Will Deacon
2018-02-09 9:51 ` Andrea Parri
2018-02-06 19:23 ` [PATCH v2 2/3] sched: reduce the periodic update duration Vincent Guittot
2018-02-06 19:23 ` [PATCH v2 3/3] sched: update blocked load when newly idle Vincent Guittot
2018-02-06 21:25 ` [PATCH v2 0/3] Update blocked load Peter Zijlstra
2018-02-06 21:46 ` Vincent Guittot
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=20180208131522.GG25201@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=brendan.jackman@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@foss.arm.com \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/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
Powered by JetHome