diff mbox series

[v4,3/6] sched/fair: Enable CFS periodic tick to update thermal pressure

Message ID 1571776465-29763-4-git-send-email-thara.gopinath@linaro.org
State New
Headers show
Series Introduce Thermal Pressure | expand

Commit Message

Thara Gopinath Oct. 22, 2019, 8:34 p.m. UTC
Introduce support in CFS periodic tick to trigger the process of
computing average thermal pressure for a cpu.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

---
 kernel/sched/fair.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.1.4

Comments

Peter Zijlstra Oct. 28, 2019, 3:24 p.m. UTC | #1
On Tue, Oct 22, 2019 at 04:34:22PM -0400, Thara Gopinath wrote:
> Introduce support in CFS periodic tick to trigger the process of

> computing average thermal pressure for a cpu.

> 

> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

> ---

>  kernel/sched/fair.c | 5 +++++

>  1 file changed, 5 insertions(+)

> 

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c

> index 682a754..4f9c2cb 100644

> --- a/kernel/sched/fair.c

> +++ b/kernel/sched/fair.c

> @@ -21,6 +21,7 @@

>   *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra

>   */

>  #include "sched.h"

> +#include "thermal.h"

>  

>  #include <trace/events/sched.h>

>  

> @@ -7574,6 +7575,8 @@ static void update_blocked_averages(int cpu)

>  		done = false;

>  

>  	update_blocked_load_status(rq, !done);

> +

> +	trigger_thermal_pressure_average(rq);

>  	rq_unlock_irqrestore(rq, &rf);

>  }


This changes only 1 of the 2 implementations of
update_blocked_averages(). Also, how does this interact with
rq->has_blocked_load ?

> @@ -9933,6 +9936,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)

>  

>  	update_misfit_status(curr, rq);

>  	update_overutilized_status(task_rq(curr));

> +

> +	trigger_thermal_pressure_average(rq);

>  }


This seems to imply all this thermal stuff is fair only, in which case I
could suggest putting those few lines in fair.c. ~45 extra lines on
1e5+ lines really doesn't matter.
Peter Zijlstra Oct. 28, 2019, 3:27 p.m. UTC | #2
On Mon, Oct 28, 2019 at 04:24:21PM +0100, Peter Zijlstra wrote:
> On Tue, Oct 22, 2019 at 04:34:22PM -0400, Thara Gopinath wrote:

> > Introduce support in CFS periodic tick to trigger the process of

> > computing average thermal pressure for a cpu.

> > 

> > Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

> > ---

> >  kernel/sched/fair.c | 5 +++++

> >  1 file changed, 5 insertions(+)

> > 

> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c

> > index 682a754..4f9c2cb 100644

> > --- a/kernel/sched/fair.c

> > +++ b/kernel/sched/fair.c

> > @@ -21,6 +21,7 @@

> >   *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra

> >   */

> >  #include "sched.h"

> > +#include "thermal.h"

> >  

> >  #include <trace/events/sched.h>

> >  

> > @@ -7574,6 +7575,8 @@ static void update_blocked_averages(int cpu)

> >  		done = false;

> >  

> >  	update_blocked_load_status(rq, !done);

> > +

> > +	trigger_thermal_pressure_average(rq);

> >  	rq_unlock_irqrestore(rq, &rf);

> >  }

> 

> This changes only 1 of the 2 implementations of

> update_blocked_averages(). Also, how does this interact with

> rq->has_blocked_load ?


Specifically, I'm thikning this wants a line in others_have_blocked():

+	if (READ_ONCE(rq->avg_thermal.load_avg))
+		return true;
Thara Gopinath Oct. 30, 2019, 9:41 p.m. UTC | #3
On 10/28/2019 11:24 AM, Peter Zijlstra wrote:
> On Tue, Oct 22, 2019 at 04:34:22PM -0400, Thara Gopinath wrote:

>> Introduce support in CFS periodic tick to trigger the process of

>> computing average thermal pressure for a cpu.

>>

>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

>> ---

>>  kernel/sched/fair.c | 5 +++++

>>  1 file changed, 5 insertions(+)

>>

>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c

>> index 682a754..4f9c2cb 100644

>> --- a/kernel/sched/fair.c

>> +++ b/kernel/sched/fair.c

>> @@ -21,6 +21,7 @@

>>   *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra

>>   */

>>  #include "sched.h"

>> +#include "thermal.h"

>>  

>>  #include <trace/events/sched.h>

>>  

>> @@ -7574,6 +7575,8 @@ static void update_blocked_averages(int cpu)

>>  		done = false;

>>  

>>  	update_blocked_load_status(rq, !done);

>> +

>> +	trigger_thermal_pressure_average(rq);

>>  	rq_unlock_irqrestore(rq, &rf);

>>  }

> 

> This changes only 1 of the 2 implementations of

> update_blocked_averages(). Also, how does this interact with

> rq->has_blocked_load ?

I will add it to the other implementation of update_blocked_averages and
will also update others_have_blocked.
> 

>> @@ -9933,6 +9936,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)

>>  

>>  	update_misfit_status(curr, rq);

>>  	update_overutilized_status(task_rq(curr));

>> +

>> +	trigger_thermal_pressure_average(rq);

>>  }

> 

> This seems to imply all this thermal stuff is fair only, in which case I

> could suggest putting those few lines in fair.c. ~45 extra lines on

> 1e5+ lines really doesn't matter.

> 



-- 
Warm Regards
Thara
Dietmar Eggemann Oct. 31, 2019, 4:11 p.m. UTC | #4
On 22.10.19 22:34, Thara Gopinath wrote:
> Introduce support in CFS periodic tick to trigger the process of

> computing average thermal pressure for a cpu.

> 

> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

> ---

>  kernel/sched/fair.c | 5 +++++

>  1 file changed, 5 insertions(+)

> 

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c

> index 682a754..4f9c2cb 100644

> --- a/kernel/sched/fair.c

> +++ b/kernel/sched/fair.c

> @@ -21,6 +21,7 @@

>   *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra

>   */

>  #include "sched.h"

> +#include "thermal.h"

>  

>  #include <trace/events/sched.h>

>  

> @@ -7574,6 +7575,8 @@ static void update_blocked_averages(int cpu)

>  		done = false;

>  

>  	update_blocked_load_status(rq, !done);

> +

> +	trigger_thermal_pressure_average(rq);

>  	rq_unlock_irqrestore(rq, &rf);

>  }


Since you update the thermal pressure signal in CFS's
update_blocked_averages() as well, I guess the patch title has to change.

>  

> @@ -9933,6 +9936,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)

>  

>  	update_misfit_status(curr, rq);

>  	update_overutilized_status(task_rq(curr));

> +

> +	trigger_thermal_pressure_average(rq);

>  }

>  

>  /*

>
Thara Gopinath Oct. 31, 2019, 4:46 p.m. UTC | #5
On 10/31/2019 12:11 PM, Dietmar Eggemann wrote:
> On 22.10.19 22:34, Thara Gopinath wrote:

>> Introduce support in CFS periodic tick to trigger the process of

>> computing average thermal pressure for a cpu.

>>

>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

>> ---

>>  kernel/sched/fair.c | 5 +++++

>>  1 file changed, 5 insertions(+)

>>

>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c

>> index 682a754..4f9c2cb 100644

>> --- a/kernel/sched/fair.c

>> +++ b/kernel/sched/fair.c

>> @@ -21,6 +21,7 @@

>>   *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra

>>   */

>>  #include "sched.h"

>> +#include "thermal.h"

>>  

>>  #include <trace/events/sched.h>

>>  

>> @@ -7574,6 +7575,8 @@ static void update_blocked_averages(int cpu)

>>  		done = false;

>>  

>>  	update_blocked_load_status(rq, !done);

>> +

>> +	trigger_thermal_pressure_average(rq);

>>  	rq_unlock_irqrestore(rq, &rf);

>>  }

> 

> Since you update the thermal pressure signal in CFS's

> update_blocked_averages() as well, I guess the patch title has to change.

Will do. Thanks.
> 

>>  

>> @@ -9933,6 +9936,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)

>>  

>>  	update_misfit_status(curr, rq);

>>  	update_overutilized_status(task_rq(curr));

>> +

>> +	trigger_thermal_pressure_average(rq);

>>  }

>>  

>>  /*

>>



-- 
Warm Regards
Thara
diff mbox series

Patch

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 682a754..4f9c2cb 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -21,6 +21,7 @@ 
  *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
  */
 #include "sched.h"
+#include "thermal.h"
 
 #include <trace/events/sched.h>
 
@@ -7574,6 +7575,8 @@  static void update_blocked_averages(int cpu)
 		done = false;
 
 	update_blocked_load_status(rq, !done);
+
+	trigger_thermal_pressure_average(rq);
 	rq_unlock_irqrestore(rq, &rf);
 }
 
@@ -9933,6 +9936,8 @@  static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
 
 	update_misfit_status(curr, rq);
 	update_overutilized_status(task_rq(curr));
+
+	trigger_thermal_pressure_average(rq);
 }
 
 /*