Linux Power Management development
 help / color / mirror / Atom feed
* Prevent RT-throttling for idle-injection threads
@ 2023-08-08 11:25 Atul Pant
  2023-08-11 15:17 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Atul Pant @ 2023-08-08 11:25 UTC (permalink / raw)
  To: rafael, daniel.lezcano, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, rostedt, bsegall, mgorman,
	bristot, vschneid
  Cc: Atul Pant, linux-pm, linux-kernel, quic_ashayj, quic_rgottimu,
	quic_shashim

Hi all,
We are trying to implement a solution for thermal mitigation by using idle injection on CPUs. However we face some limitations with the current idle-inject framework.
As per our need, we want to start injecting idle cycles on a CPU for indefinite time (until the temperature/power of the CPU falls below a threshold). This will help
to keep the hot CPUs in the sleep state until we see improvement in temperature/power. If we set the idle duration to a large value or have an idle-injection ratio of 100%,
then the idle-inject RT thread suffers from RT throttling. This results in the CPU exiting from the sleep state and consuming some power.

The above situation can be avoided, if we can prevent RT throttling on the injected CPU. With the currently available sysctl parameters, sched_rt_runtime_us and sched_rt_period_us,
we can prevent RT throttling by either setting sched_rt_runtime_us equal to sched_rt_period_us or, setting sched_rt_runtime_us to -1. Since these parameters are system wide,
so it will affect the RT tasks on non idle-injected CPUs as well. To overcome this, will it be feasible to have these two parameters on a per CPU basis? This will allow to selectively
disable RT throttling on idle-injected CPUs.


Thanks & Regards
Atul

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

* Re: Prevent RT-throttling for idle-injection threads
  2023-08-08 11:25 Prevent RT-throttling for idle-injection threads Atul Pant
@ 2023-08-11 15:17 ` Steven Rostedt
  2023-09-08  9:55   ` Atul Kumar Pant
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2023-08-11 15:17 UTC (permalink / raw)
  To: Atul Pant
  Cc: rafael, daniel.lezcano, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, bsegall, mgorman, bristot,
	vschneid, linux-pm, linux-kernel, quic_ashayj, quic_rgottimu,
	quic_shashim

On Tue,  8 Aug 2023 16:55:23 +0530
Atul Pant <quic_atulpant@quicinc.com> wrote:

> Hi all,
> We are trying to implement a solution for thermal mitigation by using
> idle injection on CPUs. However we face some limitations with the current
> idle-inject framework. As per our need, we want to start injecting idle
> cycles on a CPU for indefinite time (until the temperature/power of the
> CPU falls below a threshold). This will help to keep the hot CPUs in the
> sleep state until we see improvement in temperature/power. If we set the
> idle duration to a large value or have an idle-injection ratio of 100%,
> then the idle-inject RT thread suffers from RT throttling. This results
> in the CPU exiting from the sleep state and consuming some power.
> 
> The above situation can be avoided, if we can prevent RT throttling on
> the injected CPU. With the currently available sysctl parameters,
> sched_rt_runtime_us and sched_rt_period_us, we can prevent RT throttling
> by either setting sched_rt_runtime_us equal to sched_rt_period_us or,
> setting sched_rt_runtime_us to -1. Since these parameters are system
> wide, so it will affect the RT tasks on non idle-injected CPUs as well.
> To overcome this, will it be feasible to have these two parameters on a
> per CPU basis? This will allow to selectively disable RT throttling on
> idle-injected CPUs.

I wonder if the deadline scheduler that Daniel is working on would help in this case?

-- Steve


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

* Re: Prevent RT-throttling for idle-injection threads
  2023-08-11 15:17 ` Steven Rostedt
@ 2023-09-08  9:55   ` Atul Kumar Pant
  2023-09-08 12:22     ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 4+ messages in thread
From: Atul Kumar Pant @ 2023-09-08  9:55 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: rafael, daniel.lezcano, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, bsegall, mgorman, bristot,
	vschneid, linux-pm, linux-kernel, quic_ashayj, quic_rgottimu,
	quic_shashim

On Fri, Aug 11, 2023 at 11:17:19AM -0400, Steven Rostedt wrote:
> On Tue,  8 Aug 2023 16:55:23 +0530
> Atul Pant <quic_atulpant@quicinc.com> wrote:
> 
> > Hi all,
> > We are trying to implement a solution for thermal mitigation by using
> > idle injection on CPUs. However we face some limitations with the current
> > idle-inject framework. As per our need, we want to start injecting idle
> > cycles on a CPU for indefinite time (until the temperature/power of the
> > CPU falls below a threshold). This will help to keep the hot CPUs in the
> > sleep state until we see improvement in temperature/power. If we set the
> > idle duration to a large value or have an idle-injection ratio of 100%,
> > then the idle-inject RT thread suffers from RT throttling. This results
> > in the CPU exiting from the sleep state and consuming some power.
> > 
> > The above situation can be avoided, if we can prevent RT throttling on
> > the injected CPU. With the currently available sysctl parameters,
> > sched_rt_runtime_us and sched_rt_period_us, we can prevent RT throttling
> > by either setting sched_rt_runtime_us equal to sched_rt_period_us or,
> > setting sched_rt_runtime_us to -1. Since these parameters are system
> > wide, so it will affect the RT tasks on non idle-injected CPUs as well.
> > To overcome this, will it be feasible to have these two parameters on a
> > per CPU basis? This will allow to selectively disable RT throttling on
> > idle-injected CPUs.
> 
> I wonder if the deadline scheduler that Daniel is working on would help in this case?

		Are you referring to this thread regarding SCHED_DEADLINE server?
		https://lore.kernel.org/all/cover.1686239016.git.bristot@kernel.org/T/#u

> 
> -- Steve
> 

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

* Re: Prevent RT-throttling for idle-injection threads
  2023-09-08  9:55   ` Atul Kumar Pant
@ 2023-09-08 12:22     ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Bristot de Oliveira @ 2023-09-08 12:22 UTC (permalink / raw)
  To: Atul Kumar Pant, Steven Rostedt
  Cc: rafael, daniel.lezcano, mingo, peterz, juri.lelli,
	vincent.guittot, dietmar.eggemann, bsegall, mgorman, vschneid,
	linux-pm, linux-kernel, quic_ashayj, quic_rgottimu, quic_shashim

On 9/8/23 11:55, Atul Kumar Pant wrote:
> On Fri, Aug 11, 2023 at 11:17:19AM -0400, Steven Rostedt wrote:
>> On Tue,  8 Aug 2023 16:55:23 +0530
>> Atul Pant <quic_atulpant@quicinc.com> wrote:
>>
>>> Hi all,
>>> We are trying to implement a solution for thermal mitigation by using
>>> idle injection on CPUs. However we face some limitations with the current
>>> idle-inject framework. As per our need, we want to start injecting idle
>>> cycles on a CPU for indefinite time (until the temperature/power of the
>>> CPU falls below a threshold). This will help to keep the hot CPUs in the
>>> sleep state until we see improvement in temperature/power. If we set the
>>> idle duration to a large value or have an idle-injection ratio of 100%,
>>> then the idle-inject RT thread suffers from RT throttling. This results
>>> in the CPU exiting from the sleep state and consuming some power.
>>>
>>> The above situation can be avoided, if we can prevent RT throttling on
>>> the injected CPU. With the currently available sysctl parameters,
>>> sched_rt_runtime_us and sched_rt_period_us, we can prevent RT throttling
>>> by either setting sched_rt_runtime_us equal to sched_rt_period_us or,
>>> setting sched_rt_runtime_us to -1. Since these parameters are system
>>> wide, so it will affect the RT tasks on non idle-injected CPUs as well.
>>> To overcome this, will it be feasible to have these two parameters on a
>>> per CPU basis? This will allow to selectively disable RT throttling on
>>> idle-injected CPUs.
>> I wonder if the deadline scheduler that Daniel is working on would help in this case?
> 		Are you referring to this thread regarding SCHED_DEADLINE server?
> 		https://lore.kernel.org/all/cover.1686239016.git.bristot@kernel.org/T/#u
> 

Yep, but the v4... this will replace rt throttling, and it already has per-cpu arguments.

https://lore.kernel.org/lkml/20230906082952.GB38741@noisy.programming.kicks-ass.net/t/

-- Daniel


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

end of thread, other threads:[~2023-09-08 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 11:25 Prevent RT-throttling for idle-injection threads Atul Pant
2023-08-11 15:17 ` Steven Rostedt
2023-09-08  9:55   ` Atul Kumar Pant
2023-09-08 12:22     ` Daniel Bristot de Oliveira

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