Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381405 > unrolled thread

Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load accounting

Started byByungchul Park <byungchul.park@lge.com>
First post2016-04-18 11:20 +0200
Last post2016-04-19 16:10 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load  accounting Byungchul Park <byungchul.park@lge.com> - 2016-04-18 11:20 +0200
    Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load  accounting Frederic Weisbecker <fweisbec@gmail.com> - 2016-04-18 15:40 +0200
      Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load  accounting Byungchul Park <byungchul.park@lge.com> - 2016-04-19 02:10 +0200
        Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load  accounting Frederic Weisbecker <fweisbec@gmail.com> - 2016-04-19 16:10 +0200

#1381405 — Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load accounting

FromByungchul Park <byungchul.park@lge.com>
Date2016-04-18 11:20 +0200
SubjectRe: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load accounting
Message-ID<rpdvB-2TT-13@gated-at.bofh.it>
On Wed, Apr 13, 2016 at 03:56:51PM +0200, Frederic Weisbecker wrote:
> @@ -4645,11 +4674,11 @@ void cpu_load_update_nohz(int active)
>  void cpu_load_update_active(struct rq *this_rq)
>  {
>  	unsigned long load = weighted_cpuload(cpu_of(this_rq));
> -	/*
> -	 * See the mess around cpu_load_update_idle() / cpu_load_update_nohz().
> -	 */
> -	this_rq->last_load_update_tick = jiffies;
> -	__cpu_load_update(this_rq, load, 1, 1);
> +
> +	if (tick_nohz_tick_stopped())
> +		cpu_load_update_nohz(this_rq, READ_ONCE(jiffies), load);
> +	else
> +		cpu_load_update_periodic(this_rq, load);

Considering it further, I wonder if needing it.
(Sorry if I missed something.)

Case 1. tickless -> (scheduler_tick) -> tickless

	I am not sure for this case if the rq's load can be changed or not,
	especially, if the rq's load can be changed *at this point*.
	Please remind that the load[0] is set here.

Case 2. tickless -> (scheduler_tick) -> restart tick

	Will be done by the tick restart routine when exiting irq.
	-> no problem.

Case 3. tick -> (scheduler_tick) -> tickless

	Same as before.
	-> no problem.

Case 4. tick -> (scheduler_tick) -> tick

	We can rely on regular schedule_tick().
	-> no problem.

[toc] | [next] | [standalone]


#1381701

FromFrederic Weisbecker <fweisbec@gmail.com>
Date2016-04-18 15:40 +0200
Message-ID<rphzb-6pz-1@gated-at.bofh.it>
In reply to#1381405
On Mon, Apr 18, 2016 at 06:17:21PM +0900, Byungchul Park wrote:
> On Wed, Apr 13, 2016 at 03:56:51PM +0200, Frederic Weisbecker wrote:
> > @@ -4645,11 +4674,11 @@ void cpu_load_update_nohz(int active)
> >  void cpu_load_update_active(struct rq *this_rq)
> >  {
> >  	unsigned long load = weighted_cpuload(cpu_of(this_rq));
> > -	/*
> > -	 * See the mess around cpu_load_update_idle() / cpu_load_update_nohz().
> > -	 */
> > -	this_rq->last_load_update_tick = jiffies;
> > -	__cpu_load_update(this_rq, load, 1, 1);
> > +
> > +	if (tick_nohz_tick_stopped())
> > +		cpu_load_update_nohz(this_rq, READ_ONCE(jiffies), load);
> > +	else
> > +		cpu_load_update_periodic(this_rq, load);
> 
> Considering it further, I wonder if needing it.
> (Sorry if I missed something.)
> 
> Case 1. tickless -> (scheduler_tick) -> tickless
> 
> 	I am not sure for this case if the rq's load can be changed or not,
> 	especially, if the rq's load can be changed *at this point*.
> 	Please remind that the load[0] is set here.

load[0] won't change because it's set by cpu_load_update_nohz_start().
But all the other load[idx] need to be decayed further.

> 
> Case 2. tickless -> (scheduler_tick) -> restart tick
> 
> 	Will be done by the tick restart routine when exiting irq.
> 	-> no problem.
> 
> Case 3. tick -> (scheduler_tick) -> tickless
> 
> 	Same as before.
> 	-> no problem.
> 
> Case 4. tick -> (scheduler_tick) -> tick
> 
> 	We can rely on regular schedule_tick().
> 	-> no problem.
> 

Thanks for your review!

[toc] | [prev] | [next] | [standalone]


#1382107

FromByungchul Park <byungchul.park@lge.com>
Date2016-04-19 02:10 +0200
Message-ID<rproR-6cI-3@gated-at.bofh.it>
In reply to#1381701
On Mon, Apr 18, 2016 at 03:35:06PM +0200, Frederic Weisbecker wrote:
> On Mon, Apr 18, 2016 at 06:17:21PM +0900, Byungchul Park wrote:
> > On Wed, Apr 13, 2016 at 03:56:51PM +0200, Frederic Weisbecker wrote:
> > > @@ -4645,11 +4674,11 @@ void cpu_load_update_nohz(int active)
> > >  void cpu_load_update_active(struct rq *this_rq)
> > >  {
> > >  	unsigned long load = weighted_cpuload(cpu_of(this_rq));
> > > -	/*
> > > -	 * See the mess around cpu_load_update_idle() / cpu_load_update_nohz().
> > > -	 */
> > > -	this_rq->last_load_update_tick = jiffies;
> > > -	__cpu_load_update(this_rq, load, 1, 1);
> > > +
> > > +	if (tick_nohz_tick_stopped())
> > > +		cpu_load_update_nohz(this_rq, READ_ONCE(jiffies), load);
> > > +	else
> > > +		cpu_load_update_periodic(this_rq, load);
> > 
> > Considering it further, I wonder if needing it.
> > (Sorry if I missed something.)
> > 
> > Case 1. tickless -> (scheduler_tick) -> tickless
> > 
> > 	I am not sure for this case if the rq's load can be changed or not,
> > 	especially, if the rq's load can be changed *at this point*.
> > 	Please remind that the load[0] is set here.
> 
> load[0] won't change because it's set by cpu_load_update_nohz_start().
> But all the other load[idx] need to be decayed further.

Ah. Right. Sched tick will be handled even in the case 1...

I like your patches. But I am still wondering if the sched tick handling is
necessary even in the case 1. Of course it's another problem though.

Thanks anyway,
Byungchul

> 
> > 
> > Case 2. tickless -> (scheduler_tick) -> restart tick
> > 
> > 	Will be done by the tick restart routine when exiting irq.
> > 	-> no problem.
> > 
> > Case 3. tick -> (scheduler_tick) -> tickless
> > 
> > 	Same as before.
> > 	-> no problem.
> > 
> > Case 4. tick -> (scheduler_tick) -> tick
> > 
> > 	We can rely on regular schedule_tick().
> > 	-> no problem.
> > 
> 
> Thanks for your review!

[toc] | [prev] | [next] | [standalone]


#1382547

FromFrederic Weisbecker <fweisbec@gmail.com>
Date2016-04-19 16:10 +0200
Message-ID<rpEvN-87k-25@gated-at.bofh.it>
In reply to#1382107
On Tue, Apr 19, 2016 at 09:01:00AM +0900, Byungchul Park wrote:
> On Mon, Apr 18, 2016 at 03:35:06PM +0200, Frederic Weisbecker wrote:
> > On Mon, Apr 18, 2016 at 06:17:21PM +0900, Byungchul Park wrote:
> > > On Wed, Apr 13, 2016 at 03:56:51PM +0200, Frederic Weisbecker wrote:
> > > > @@ -4645,11 +4674,11 @@ void cpu_load_update_nohz(int active)
> > > >  void cpu_load_update_active(struct rq *this_rq)
> > > >  {
> > > >  	unsigned long load = weighted_cpuload(cpu_of(this_rq));
> > > > -	/*
> > > > -	 * See the mess around cpu_load_update_idle() / cpu_load_update_nohz().
> > > > -	 */
> > > > -	this_rq->last_load_update_tick = jiffies;
> > > > -	__cpu_load_update(this_rq, load, 1, 1);
> > > > +
> > > > +	if (tick_nohz_tick_stopped())
> > > > +		cpu_load_update_nohz(this_rq, READ_ONCE(jiffies), load);
> > > > +	else
> > > > +		cpu_load_update_periodic(this_rq, load);
> > > 
> > > Considering it further, I wonder if needing it.
> > > (Sorry if I missed something.)
> > > 
> > > Case 1. tickless -> (scheduler_tick) -> tickless
> > > 
> > > 	I am not sure for this case if the rq's load can be changed or not,
> > > 	especially, if the rq's load can be changed *at this point*.
> > > 	Please remind that the load[0] is set here.
> > 
> > load[0] won't change because it's set by cpu_load_update_nohz_start().
> > But all the other load[idx] need to be decayed further.
> 
> Ah. Right. Sched tick will be handled even in the case 1...
> 
> I like your patches. But I am still wondering if the sched tick handling is
> necessary even in the case 1. Of course it's another problem though.

Right, we could indeed ignore those ticks happening in dynticks/idle and just wait
for the end of the dynticks frame that calls cpu_load_update_stop(). In fact
the first version of this patchset did that but Thomas didn't seem to like it.

That said more local updates means less need for remote updates through
cpu_load_update_idle().

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web