From: Vincent Guittot <vincent.guittot@linaro.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Yuyang Du <yuyang.du@intel.com>,
mingo@kernel.org, linux-kernel@vger.kernel.org,
bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com,
dietmar.eggemann@arm.com, lizefan@huawei.com,
umgwanakikbuti@gmail.com
Subject: Re: [PATCH v3 5/6] sched/fair: Rename scale_load() and scale_load_down()
Date: Thu, 28 Apr 2016 13:18:00 +0200 [thread overview]
Message-ID: <20160428111800.GA30218@vingu-laptop> (raw)
In-Reply-To: <20160428091919.GW3430@twins.programming.kicks-ass.net>
Le Thursday 28 Apr 2016 à 11:19:19 (+0200), Peter Zijlstra a écrit :
> On Tue, Apr 05, 2016 at 12:12:30PM +0800, Yuyang Du wrote:
> > Rename scale_load() and scale_load_down() to user_to_kernel_load()
> > and kernel_to_user_load() respectively, to allow the names to bear
> > what they are really about.
>
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -189,7 +189,7 @@ static void __update_inv_weight(struct load_weight *lw)
> > if (likely(lw->inv_weight))
> > return;
> >
> > - w = scale_load_down(lw->weight);
> > + w = kernel_to_user_load(lw->weight);
> >
> > if (BITS_PER_LONG > 32 && unlikely(w >= WMULT_CONST))
> > lw->inv_weight = 1;
> > @@ -213,7 +213,7 @@ static void __update_inv_weight(struct load_weight *lw)
> > */
> > static u64 __calc_delta(u64 delta_exec, unsigned long weight, struct load_weight *lw)
> > {
> > - u64 fact = scale_load_down(weight);
> > + u64 fact = kernel_to_user_load(weight);
> > int shift = WMULT_SHIFT;
> >
> > __update_inv_weight(lw);
> > @@ -6952,10 +6952,11 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
> > */
> > if (busiest->group_type == group_overloaded &&
> > local->group_type == group_overloaded) {
> > + unsigned long min_cpu_load =
> > + kernel_to_user_load(NICE_0_LOAD) * busiest->group_capacity;
> > load_above_capacity = busiest->sum_nr_running * NICE_0_LOAD;
> > - if (load_above_capacity > scale_load(busiest->group_capacity))
> > - load_above_capacity -=
> > - scale_load(busiest->group_capacity);
> > + if (load_above_capacity > min_cpu_load)
> > + load_above_capacity -= min_cpu_load;
> > else
> > load_above_capacity = ~0UL;
> > }
>
> Except these 3 really are not about user/kernel visible fixed point
> ranges _at_all_... :/
While trying to optimize the calcultaion of min_cpu_load, i have broken evrything
it should be :
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0b6659d..3411eb7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6953,7 +6953,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
if (busiest->group_type == group_overloaded &&
local->group_type == group_overloaded) {
unsigned long min_cpu_load =
- kernel_to_user_load(NICE_0_LOAD) * busiest->group_capacity;
+ busiest->group_capacity * NICE_0_LOAD / SCHED_CAPACITY_SCALE;
load_above_capacity = busiest->sum_nr_running * NICE_0_LOAD;
if (load_above_capacity > min_cpu_load)
load_above_capacity -= min_cpu_load;
>
>
next prev parent reply other threads:[~2016-04-28 11:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 4:12 [PATCH v3 0/6] sched/fair: Clean up sched metric definitions Yuyang Du
2016-04-05 4:12 ` [PATCH v3 1/6] sched/fair: Generalize the load/util averages resolution definition Yuyang Du
2016-05-05 9:39 ` [tip:sched/core] " tip-bot for Yuyang Du
2016-04-05 4:12 ` [PATCH v3 2/6] sched/fair: Remove SCHED_LOAD_SHIFT and SCHED_LOAD_SCALE Yuyang Du
2016-05-05 9:40 ` [tip:sched/core] sched/fair: Rename SCHED_LOAD_SHIFT to NICE_0_LOAD_SHIFT and remove SCHED_LOAD_SCALE tip-bot for Yuyang Du
2016-04-05 4:12 ` [PATCH v3 3/6] sched/fair: Add introduction to the sched load avg metrics Yuyang Du
2016-05-05 9:41 ` [tip:sched/core] sched/fair: Add detailed description " tip-bot for Yuyang Du
2016-04-05 4:12 ` [PATCH v3 4/6] sched/fair: Remove scale_load_down() for load_avg Yuyang Du
2016-04-28 10:25 ` Peter Zijlstra
2016-04-28 3:01 ` Yuyang Du
2016-04-28 19:29 ` Yuyang Du
2016-04-05 4:12 ` [PATCH v3 5/6] sched/fair: Rename scale_load() and scale_load_down() Yuyang Du
2016-04-28 9:19 ` Peter Zijlstra
2016-04-28 11:18 ` Vincent Guittot [this message]
2016-04-28 20:30 ` Yuyang Du
2016-04-05 4:12 ` [PATCH v3 6/6] sched/fair: Move (inactive) option from code to config Yuyang Du
2016-04-28 9:37 ` Peter Zijlstra
2016-04-28 9:45 ` Ingo Molnar
2016-04-28 20:34 ` Yuyang Du
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=20160428111800.GA30218@vingu-laptop \
--to=vincent.guittot@linaro.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=umgwanakikbuti@gmail.com \
--cc=yuyang.du@intel.com \
/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