mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] sched: make update_cpu_load_active care more than one tick
@ 2015-08-13  9:35 byungchul.park
  2015-08-17 23:39 ` Byungchul Park
  2015-09-09  7:02 ` Peter Zijlstra
  0 siblings, 2 replies; 6+ messages in thread
From: byungchul.park @ 2015-08-13  9:35 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, Byungchul Park

From: Byungchul Park <byungchul.park@lge.com>

i found do_timer accounts other than one tick, so i made
update_cpu_load_active care that.

is it intended because of its overhead?

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/sched/fair.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ffa70dc..cd3d98f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4506,12 +4506,15 @@ void update_cpu_load_nohz(void)
  */
 void update_cpu_load_active(struct rq *this_rq)
 {
+	unsigned long curr_jiffies = READ_ONCE(jiffies);
+	unsigned long pending_updates;
 	unsigned long load = this_rq->cfs.runnable_load_avg;
 	/*
 	 * See the mess around update_idle_cpu_load() / update_cpu_load_nohz().
 	 */
-	this_rq->last_load_update_tick = jiffies;
-	__update_cpu_load(this_rq, load, 1);
+	pending_updates = curr_jiffies - this_rq->last_load_update_tick;
+	this_rq->last_load_update_tick = curr_jiffies;
+	__update_cpu_load(this_rq, load, pending_updates);
 }
 
 /* Used instead of source_load when we know the type == 0 */
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] sched: make update_cpu_load_active care more than one tick
  2015-08-13  9:35 [RFC] sched: make update_cpu_load_active care more than one tick byungchul.park
@ 2015-08-17 23:39 ` Byungchul Park
  2015-09-09  6:00   ` Byungchul Park
  2015-09-09  7:02 ` Peter Zijlstra
  1 sibling, 1 reply; 6+ messages in thread
From: Byungchul Park @ 2015-08-17 23:39 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

On Thu, Aug 13, 2015 at 06:35:24PM +0900, byungchul.park@lge.com wrote:
> From: Byungchul Park <byungchul.park@lge.com>
> 
> i found do_timer accounts other than one tick, so i made
> update_cpu_load_active care that.
> 
> is it intended because of its overhead?

hello,

is there anyone who can tell me any opinion about this concern?

> 
> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>  kernel/sched/fair.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ffa70dc..cd3d98f 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4506,12 +4506,15 @@ void update_cpu_load_nohz(void)
>   */
>  void update_cpu_load_active(struct rq *this_rq)
>  {
> +	unsigned long curr_jiffies = READ_ONCE(jiffies);
> +	unsigned long pending_updates;
>  	unsigned long load = this_rq->cfs.runnable_load_avg;
>  	/*
>  	 * See the mess around update_idle_cpu_load() / update_cpu_load_nohz().
>  	 */
> -	this_rq->last_load_update_tick = jiffies;
> -	__update_cpu_load(this_rq, load, 1);
> +	pending_updates = curr_jiffies - this_rq->last_load_update_tick;
> +	this_rq->last_load_update_tick = curr_jiffies;
> +	__update_cpu_load(this_rq, load, pending_updates);
>  }
>  
>  /* Used instead of source_load when we know the type == 0 */
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] sched: make update_cpu_load_active care more than one tick
  2015-08-17 23:39 ` Byungchul Park
@ 2015-09-09  6:00   ` Byungchul Park
  0 siblings, 0 replies; 6+ messages in thread
From: Byungchul Park @ 2015-09-09  6:00 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

On Tue, Aug 18, 2015 at 08:39:27AM +0900, Byungchul Park wrote:
> On Thu, Aug 13, 2015 at 06:35:24PM +0900, byungchul.park@lge.com wrote:
> > From: Byungchul Park <byungchul.park@lge.com>
> > 
> > i found do_timer accounts other than one tick, so i made
> > update_cpu_load_active care that.
> > 
> > is it intended because of its overhead?
> 
> hello,
> 
> is there anyone who can tell me any opinion about this concern?
> 
> > 
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  kernel/sched/fair.c |    7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index ffa70dc..cd3d98f 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -4506,12 +4506,15 @@ void update_cpu_load_nohz(void)
> >   */
> >  void update_cpu_load_active(struct rq *this_rq)
> >  {
> > +	unsigned long curr_jiffies = READ_ONCE(jiffies);
> > +	unsigned long pending_updates;
> >  	unsigned long load = this_rq->cfs.runnable_load_avg;
> >  	/*
> >  	 * See the mess around update_idle_cpu_load() / update_cpu_load_nohz().
> >  	 */
> > -	this_rq->last_load_update_tick = jiffies;
> > -	__update_cpu_load(this_rq, load, 1);
> > +	pending_updates = curr_jiffies - this_rq->last_load_update_tick;

is it expensive to deal with this correction here?

in my QEMU machine, pending_updates appears to be more than 10, however
current code assumes it to be 1 unconditionally.

if this correction is valid, i will resend this with adding commit msg.

> > +	this_rq->last_load_update_tick = curr_jiffies;
> > +	__update_cpu_load(this_rq, load, pending_updates);
> >  }
> >  
> >  /* Used instead of source_load when we know the type == 0 */
> > -- 
> > 1.7.9.5
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] sched: make update_cpu_load_active care more than one tick
  2015-08-13  9:35 [RFC] sched: make update_cpu_load_active care more than one tick byungchul.park
  2015-08-17 23:39 ` Byungchul Park
@ 2015-09-09  7:02 ` Peter Zijlstra
  2015-09-09  7:31   ` Byungchul Park
  2015-09-09  7:47   ` Byungchul Park
  1 sibling, 2 replies; 6+ messages in thread
From: Peter Zijlstra @ 2015-09-09  7:02 UTC (permalink / raw)
  To: byungchul.park; +Cc: mingo, linux-kernel

On Thu, Aug 13, 2015 at 06:35:24PM +0900, byungchul.park@lge.com wrote:
> From: Byungchul Park <byungchul.park@lge.com>
> 
> i found do_timer accounts other than one tick, so i made
> update_cpu_load_active care that.
> 
> is it intended because of its overhead?

I think the idea was that the NO_HZ bits would deal with the other
cases.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] sched: make update_cpu_load_active care more than one tick
  2015-09-09  7:02 ` Peter Zijlstra
@ 2015-09-09  7:31   ` Byungchul Park
  2015-09-09  7:47   ` Byungchul Park
  1 sibling, 0 replies; 6+ messages in thread
From: Byungchul Park @ 2015-09-09  7:31 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: mingo, linux-kernel

On Wed, Sep 09, 2015 at 09:02:40AM +0200, Peter Zijlstra wrote:
> On Thu, Aug 13, 2015 at 06:35:24PM +0900, byungchul.park@lge.com wrote:
> > From: Byungchul Park <byungchul.park@lge.com>
> > 
> > i found do_timer accounts other than one tick, so i made
> > update_cpu_load_active care that.
> > 
> > is it intended because of its overhead?
> 
> I think the idea was that the NO_HZ bits would deal with the other
> cases.

in the case of NO_HZ (including FULL NO_HZ), NO problem. it would be dealt
by update_idle_cpu_load() or update_cpu_load_nohz() in this case.

however, we expect that update_cpu_load_active() is called every tick, but
it is not true. that's why i suggested this. actually it did not happen
a stop tick routine when i found that update_cpu_load_active() was called
with interval which is several ticks, furthermore, more than 10 ticks.
i checked this with debugger.

is there anything i missed?

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] sched: make update_cpu_load_active care more than one tick
  2015-09-09  7:02 ` Peter Zijlstra
  2015-09-09  7:31   ` Byungchul Park
@ 2015-09-09  7:47   ` Byungchul Park
  1 sibling, 0 replies; 6+ messages in thread
From: Byungchul Park @ 2015-09-09  7:47 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: mingo, linux-kernel

On Wed, Sep 09, 2015 at 09:02:40AM +0200, Peter Zijlstra wrote:
> On Thu, Aug 13, 2015 at 06:35:24PM +0900, byungchul.park@lge.com wrote:
> > From: Byungchul Park <byungchul.park@lge.com>
> > 
> > i found do_timer accounts other than one tick, so i made
> > update_cpu_load_active care that.
> > 
> > is it intended because of its overhead?
> 
> I think the idea was that the NO_HZ bits would deal with the other
> cases.

watchers of this mail might have considered i didn't know about nohz;;
because i did not explaned it in detail. it's my fault.

i mentioned the global load update in the case of periodic tick..

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-09  7:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13  9:35 [RFC] sched: make update_cpu_load_active care more than one tick byungchul.park
2015-08-17 23:39 ` Byungchul Park
2015-09-09  6:00   ` Byungchul Park
2015-09-09  7:02 ` Peter Zijlstra
2015-09-09  7:31   ` Byungchul Park
2015-09-09  7:47   ` Byungchul Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®