public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] sched/deadline: nanoseconds clarifications
@ 2024-08-13 14:43 Christian Loehle
  2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Christian Loehle @ 2024-08-13 14:43 UTC (permalink / raw)
  To: linux-pm, linux-kernel, rafael
  Cc: vincent.guittot, qyousef, peterz, daniel.lezcano, rostedt,
	juri.lelli, dietmar.eggemann, Christian Loehle

A couple of clarifications about the time units for the deadline
parameters uncovered in the discussion around
https://lore.kernel.org/lkml/3c726cf5-0c94-4cc6-aff0-a453d840d452@arm.com/

While at it I changed the documentation example to chrt instead
of the schedtool fork.

No functional changes.

Christian Loehle (4):
  sched/deadline: Convert schedtool example to chrt
  sched/deadline: Clarify nanoseconds in uapi
  cpufreq/cppc: Use NSEC_PER_MSEC for deadline task
  sched/cpufreq: Use NSEC_PER_MSEC for deadline task

 Documentation/scheduler/sched-deadline.rst | 14 ++++++--------
 drivers/cpufreq/cppc_cpufreq.c             |  6 +++---
 include/uapi/linux/sched/types.h           |  6 +++---
 kernel/sched/cpufreq_schedutil.c           |  6 +++---
 4 files changed, 15 insertions(+), 17 deletions(-)

--
2.34.1


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

* [PATCH 1/4] sched/deadline: Convert schedtool example to chrt
  2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
@ 2024-08-13 14:43 ` Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2024-08-13 14:43 ` [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi Christian Loehle
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: Christian Loehle @ 2024-08-13 14:43 UTC (permalink / raw)
  To: linux-pm, linux-kernel, rafael
  Cc: vincent.guittot, qyousef, peterz, daniel.lezcano, rostedt,
	juri.lelli, dietmar.eggemann, Christian Loehle

chrt has SCHED_DEADLINE support so convert the example instead of
relying on a schedtool fork. While at it fix the wrong mentioning
of microseconds, it was nanoseconds for both schedtool and chrt.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 Documentation/scheduler/sched-deadline.rst | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/sched-deadline.rst
index 9fe4846079bb..22838ed8e13a 100644
--- a/Documentation/scheduler/sched-deadline.rst
+++ b/Documentation/scheduler/sched-deadline.rst
@@ -749,21 +749,19 @@ Appendix A. Test suite
  of the command line options. Please refer to rt-app documentation for more
  details (`<rt-app-sources>/doc/*.json`).
 
- The second testing application is a modification of schedtool, called
- schedtool-dl, which can be used to setup SCHED_DEADLINE parameters for a
- certain pid/application. schedtool-dl is available at:
- https://github.com/scheduler-tools/schedtool-dl.git.
+ The second testing application is done using chrt which has support
+ for SCHED_DEADLINE.
 
  The usage is straightforward::
 
-  # schedtool -E -t 10000000:100000000 -e ./my_cpuhog_app
+  # chrt -d -T 10000000 -D 100000000 0 ./my_cpuhog_app
 
  With this, my_cpuhog_app is put to run inside a SCHED_DEADLINE reservation
- of 10ms every 100ms (note that parameters are expressed in microseconds).
- You can also use schedtool to create a reservation for an already running
+ of 10ms every 100ms (note that parameters are expressed in nanoseconds).
+ You can also use chrt to create a reservation for an already running
  application, given that you know its pid::
 
-  # schedtool -E -t 10000000:100000000 my_app_pid
+  # chrt -d -T 10000000 -D 100000000 -p 0 my_app_pid
 
 Appendix B. Minimal main()
 ==========================
-- 
2.34.1


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

* [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi
  2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
  2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
@ 2024-08-13 14:43 ` Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2024-08-13 14:43 ` [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task Christian Loehle
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: Christian Loehle @ 2024-08-13 14:43 UTC (permalink / raw)
  To: linux-pm, linux-kernel, rafael
  Cc: vincent.guittot, qyousef, peterz, daniel.lezcano, rostedt,
	juri.lelli, dietmar.eggemann, Christian Loehle

Specify the time values of the deadline parameters of deadline,
runtime, and period as being in nanoseconds explicitly as they always
have been.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 include/uapi/linux/sched/types.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h
index 90662385689b..bf6e9ae031c1 100644
--- a/include/uapi/linux/sched/types.h
+++ b/include/uapi/linux/sched/types.h
@@ -58,9 +58,9 @@
  *
  * This is reflected by the following fields of the sched_attr structure:
  *
- *  @sched_deadline	representative of the task's deadline
- *  @sched_runtime	representative of the task's runtime
- *  @sched_period	representative of the task's period
+ *  @sched_deadline	representative of the task's deadline in nanoseconds
+ *  @sched_runtime	representative of the task's runtime in nanoseconds
+ *  @sched_period	representative of the task's period in nanoseconds
  *
  * Given this task model, there are a multiplicity of scheduling algorithms
  * and policies, that can be used to ensure all the tasks will make their
-- 
2.34.1


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

* [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
  2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
  2024-08-13 14:43 ` [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi Christian Loehle
@ 2024-08-13 14:43 ` Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
  2024-08-13 16:02 ` [PATCH 0/4] sched/deadline: nanoseconds clarifications Juri Lelli
  4 siblings, 2 replies; 18+ messages in thread
From: Christian Loehle @ 2024-08-13 14:43 UTC (permalink / raw)
  To: linux-pm, linux-kernel, rafael
  Cc: vincent.guittot, qyousef, peterz, daniel.lezcano, rostedt,
	juri.lelli, dietmar.eggemann, Christian Loehle

Convert the cppc deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index bafa32dd375d..aff25b598ec4 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -224,9 +224,9 @@ static void __init cppc_freq_invariance_init(void)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	= 1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSER_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	int ret;
 
-- 
2.34.1


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

* [PATCH 4/4] sched/cpufreq: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
                   ` (2 preceding siblings ...)
  2024-08-13 14:43 ` [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task Christian Loehle
@ 2024-08-13 14:43 ` Christian Loehle
  2024-09-09 13:38   ` Vincent Guittot
                     ` (2 more replies)
  2024-08-13 16:02 ` [PATCH 0/4] sched/deadline: nanoseconds clarifications Juri Lelli
  4 siblings, 3 replies; 18+ messages in thread
From: Christian Loehle @ 2024-08-13 14:43 UTC (permalink / raw)
  To: linux-pm, linux-kernel, rafael
  Cc: vincent.guittot, qyousef, peterz, daniel.lezcano, rostedt,
	juri.lelli, dietmar.eggemann, Christian Loehle

Convert the sugov deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 kernel/sched/cpufreq_schedutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index eece6244f9d2..43111a515a28 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -654,9 +654,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	=  1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSEC_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC,
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	struct cpufreq_policy *policy = sg_policy->policy;
 	int ret;
-- 
2.34.1


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

* Re: [PATCH 0/4] sched/deadline: nanoseconds clarifications
  2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
                   ` (3 preceding siblings ...)
  2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
@ 2024-08-13 16:02 ` Juri Lelli
  2024-09-09 13:01   ` Christian Loehle
  4 siblings, 1 reply; 18+ messages in thread
From: Juri Lelli @ 2024-08-13 16:02 UTC (permalink / raw)
  To: Christian Loehle
  Cc: linux-pm, linux-kernel, rafael, vincent.guittot, qyousef, peterz,
	daniel.lezcano, rostedt, dietmar.eggemann

Hi,

On 13/08/24 15:43, Christian Loehle wrote:
> A couple of clarifications about the time units for the deadline
> parameters uncovered in the discussion around
> https://lore.kernel.org/lkml/3c726cf5-0c94-4cc6-aff0-a453d840d452@arm.com/
> 
> While at it I changed the documentation example to chrt instead
> of the schedtool fork.
> 
> No functional changes.

Looks good to me!

At least for docs/uapi,

Acked-by: Juri Lelli <juri.lelli@redhat.com>

Thanks,
Juri


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

* Re: [PATCH 0/4] sched/deadline: nanoseconds clarifications
  2024-08-13 16:02 ` [PATCH 0/4] sched/deadline: nanoseconds clarifications Juri Lelli
@ 2024-09-09 13:01   ` Christian Loehle
  2024-09-09 13:25     ` Peter Zijlstra
  0 siblings, 1 reply; 18+ messages in thread
From: Christian Loehle @ 2024-09-09 13:01 UTC (permalink / raw)
  To: Peter Zijlstra, Rafael J. Wysocki
  Cc: linux-pm, linux-kernel, rafael, vincent.guittot, qyousef, peterz,
	daniel.lezcano, rostedt, dietmar.eggemann, Juri Lelli

On 8/13/24 17:02, Juri Lelli wrote:
> Hi,
> 
> On 13/08/24 15:43, Christian Loehle wrote:
>> A couple of clarifications about the time units for the deadline
>> parameters uncovered in the discussion around
>> https://lore.kernel.org/lkml/3c726cf5-0c94-4cc6-aff0-a453d840d452@arm.com/
>>
>> While at it I changed the documentation example to chrt instead
>> of the schedtool fork.
>>
>> No functional changes.
> 
> Looks good to me!
> 
> At least for docs/uapi,
> 
> Acked-by: Juri Lelli <juri.lelli@redhat.com>

(gentle ping)
Peter, do you want to take {1,2} and Rafael {3,4}?

Thanks,
Christian

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

* Re: [PATCH 0/4] sched/deadline: nanoseconds clarifications
  2024-09-09 13:01   ` Christian Loehle
@ 2024-09-09 13:25     ` Peter Zijlstra
  2024-09-09 16:39       ` Rafael J. Wysocki
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Zijlstra @ 2024-09-09 13:25 UTC (permalink / raw)
  To: Christian Loehle
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, vincent.guittot,
	qyousef, daniel.lezcano, rostedt, dietmar.eggemann, Juri Lelli

On Mon, Sep 09, 2024 at 02:01:38PM +0100, Christian Loehle wrote:
> On 8/13/24 17:02, Juri Lelli wrote:
> > Hi,
> > 
> > On 13/08/24 15:43, Christian Loehle wrote:
> >> A couple of clarifications about the time units for the deadline
> >> parameters uncovered in the discussion around
> >> https://lore.kernel.org/lkml/3c726cf5-0c94-4cc6-aff0-a453d840d452@arm.com/
> >>
> >> While at it I changed the documentation example to chrt instead
> >> of the schedtool fork.
> >>
> >> No functional changes.
> > 
> > Looks good to me!
> > 
> > At least for docs/uapi,
> > 
> > Acked-by: Juri Lelli <juri.lelli@redhat.com>
> 
> (gentle ping)
> Peter, do you want to take {1,2} and Rafael {3,4}?

I'll queue the lot if that is okay with Rafael.

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

* Re: [PATCH 4/4] sched/cpufreq: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
@ 2024-09-09 13:38   ` Vincent Guittot
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2 siblings, 0 replies; 18+ messages in thread
From: Vincent Guittot @ 2024-09-09 13:38 UTC (permalink / raw)
  To: Christian Loehle
  Cc: linux-pm, linux-kernel, rafael, qyousef, peterz, daniel.lezcano,
	rostedt, juri.lelli, dietmar.eggemann

On Tue, 13 Aug 2024 at 16:44, Christian Loehle <christian.loehle@arm.com> wrote:
>
> Convert the sugov deadline task attributes to use the available
> definitions to make them more readable.
> No functional change.
>
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>

I missed this new version and your ping to Peter brought it back to visibility

Reviewed-by Vincent Guittot <vincent.guittot@linaro.org>

> ---
>  kernel/sched/cpufreq_schedutil.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index eece6244f9d2..43111a515a28 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -654,9 +654,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
>                  * Fake (unused) bandwidth; workaround to "fix"
>                  * priority inheritance.
>                  */
> -               .sched_runtime  =  1000000,
> -               .sched_deadline = 10000000,
> -               .sched_period   = 10000000,
> +               .sched_runtime  = NSEC_PER_MSEC,
> +               .sched_deadline = 10 * NSEC_PER_MSEC,
> +               .sched_period   = 10 * NSEC_PER_MSEC,
>         };
>         struct cpufreq_policy *policy = sg_policy->policy;
>         int ret;
> --
> 2.34.1
>

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

* Re: [PATCH 0/4] sched/deadline: nanoseconds clarifications
  2024-09-09 13:25     ` Peter Zijlstra
@ 2024-09-09 16:39       ` Rafael J. Wysocki
  0 siblings, 0 replies; 18+ messages in thread
From: Rafael J. Wysocki @ 2024-09-09 16:39 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Christian Loehle, Rafael J. Wysocki, linux-pm, linux-kernel,
	vincent.guittot, qyousef, daniel.lezcano, rostedt,
	dietmar.eggemann, Juri Lelli

On Mon, Sep 9, 2024 at 3:25 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Sep 09, 2024 at 02:01:38PM +0100, Christian Loehle wrote:
> > On 8/13/24 17:02, Juri Lelli wrote:
> > > Hi,
> > >
> > > On 13/08/24 15:43, Christian Loehle wrote:
> > >> A couple of clarifications about the time units for the deadline
> > >> parameters uncovered in the discussion around
> > >> https://lore.kernel.org/lkml/3c726cf5-0c94-4cc6-aff0-a453d840d452@arm.com/
> > >>
> > >> While at it I changed the documentation example to chrt instead
> > >> of the schedtool fork.
> > >>
> > >> No functional changes.
> > >
> > > Looks good to me!
> > >
> > > At least for docs/uapi,
> > >
> > > Acked-by: Juri Lelli <juri.lelli@redhat.com>
> >
> > (gentle ping)
> > Peter, do you want to take {1,2} and Rafael {3,4}?
>
> I'll queue the lot if that is okay with Rafael.

It is, thank you!

And please feel free to add my ACKs to the patches.

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

* [tip: sched/core] sched/cpufreq: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
  2024-09-09 13:38   ` Vincent Guittot
@ 2024-09-10  8:09   ` tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2 siblings, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-10  8:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Vincent Guittot,
	Juri Lelli, Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     6cbbb91711c6b17da3802a3cf072d3311828ca33
Gitweb:        https://git.kernel.org/tip/6cbbb91711c6b17da3802a3cf072d3311828ca33
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:48 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 10 Sep 2024 09:51:16 +02:00

sched/cpufreq: Use NSEC_PER_MSEC for deadline task

Convert the sugov deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-5-christian.loehle@arm.com
---
 kernel/sched/cpufreq_schedutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index eece624..43111a5 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -654,9 +654,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	=  1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSEC_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC,
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	struct cpufreq_policy *policy = sg_policy->policy;
 	int ret;

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

* [tip: sched/core] sched/deadline: Clarify nanoseconds in uapi
  2024-08-13 14:43 ` [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi Christian Loehle
@ 2024-09-10  8:09   ` tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-10  8:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     478b58152034395024b692ea94af0d01810a6522
Gitweb:        https://git.kernel.org/tip/478b58152034395024b692ea94af0d01810a6522
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:46 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 10 Sep 2024 09:51:16 +02:00

sched/deadline: Clarify nanoseconds in uapi

Specify the time values of the deadline parameters of deadline,
runtime, and period as being in nanoseconds explicitly as they always
have been.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-3-christian.loehle@arm.com
---
 include/uapi/linux/sched/types.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h
index 9066238..bf6e9ae 100644
--- a/include/uapi/linux/sched/types.h
+++ b/include/uapi/linux/sched/types.h
@@ -58,9 +58,9 @@
  *
  * This is reflected by the following fields of the sched_attr structure:
  *
- *  @sched_deadline	representative of the task's deadline
- *  @sched_runtime	representative of the task's runtime
- *  @sched_period	representative of the task's period
+ *  @sched_deadline	representative of the task's deadline in nanoseconds
+ *  @sched_runtime	representative of the task's runtime in nanoseconds
+ *  @sched_period	representative of the task's period in nanoseconds
  *
  * Given this task model, there are a multiplicity of scheduling algorithms
  * and policies, that can be used to ensure all the tasks will make their

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

* [tip: sched/core] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 ` [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task Christian Loehle
@ 2024-09-10  8:09   ` tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-10  8:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     b3a47ff095544af206b8885391a7bad662d06a57
Gitweb:        https://git.kernel.org/tip/b3a47ff095544af206b8885391a7bad662d06a57
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:47 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 10 Sep 2024 09:51:16 +02:00

cpufreq/cppc: Use NSEC_PER_MSEC for deadline task

Convert the cppc deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-4-christian.loehle@arm.com
---
 drivers/cpufreq/cppc_cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index bafa32d..aff25b5 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -224,9 +224,9 @@ static void __init cppc_freq_invariance_init(void)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	= 1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSER_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	int ret;
 

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

* [tip: sched/core] sched/deadline: Convert schedtool example to chrt
  2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
@ 2024-09-10  8:09   ` tip-bot2 for Christian Loehle
  2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-10  8:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     e031b586326f7d3d6be70dd1d69ed3045d9506ca
Gitweb:        https://git.kernel.org/tip/e031b586326f7d3d6be70dd1d69ed3045d9506ca
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:45 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 10 Sep 2024 09:51:16 +02:00

sched/deadline: Convert schedtool example to chrt

chrt has SCHED_DEADLINE support so convert the example instead of
relying on a schedtool fork. While at it fix the wrong mentioning
of microseconds, it was nanoseconds for both schedtool and chrt.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-2-christian.loehle@arm.com
---
 Documentation/scheduler/sched-deadline.rst | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/sched-deadline.rst
index 9fe4846..22838ed 100644
--- a/Documentation/scheduler/sched-deadline.rst
+++ b/Documentation/scheduler/sched-deadline.rst
@@ -749,21 +749,19 @@ Appendix A. Test suite
  of the command line options. Please refer to rt-app documentation for more
  details (`<rt-app-sources>/doc/*.json`).
 
- The second testing application is a modification of schedtool, called
- schedtool-dl, which can be used to setup SCHED_DEADLINE parameters for a
- certain pid/application. schedtool-dl is available at:
- https://github.com/scheduler-tools/schedtool-dl.git.
+ The second testing application is done using chrt which has support
+ for SCHED_DEADLINE.
 
  The usage is straightforward::
 
-  # schedtool -E -t 10000000:100000000 -e ./my_cpuhog_app
+  # chrt -d -T 10000000 -D 100000000 0 ./my_cpuhog_app
 
  With this, my_cpuhog_app is put to run inside a SCHED_DEADLINE reservation
- of 10ms every 100ms (note that parameters are expressed in microseconds).
- You can also use schedtool to create a reservation for an already running
+ of 10ms every 100ms (note that parameters are expressed in nanoseconds).
+ You can also use chrt to create a reservation for an already running
  application, given that you know its pid::
 
-  # schedtool -E -t 10000000:100000000 my_app_pid
+  # chrt -d -T 10000000 -D 100000000 -p 0 my_app_pid
 
 Appendix B. Minimal main()
 ==========================

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

* [tip: sched/core] sched/cpufreq: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
  2024-09-09 13:38   ` Vincent Guittot
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
@ 2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  2 siblings, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-11  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Vincent Guittot,
	Juri Lelli, Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     bc9057da1a220ff2cb6c8885fd5352558aceba2c
Gitweb:        https://git.kernel.org/tip/bc9057da1a220ff2cb6c8885fd5352558aceba2c
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:48 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 11 Sep 2024 11:25:22 +02:00

sched/cpufreq: Use NSEC_PER_MSEC for deadline task

Convert the sugov deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-5-christian.loehle@arm.com
---
 kernel/sched/cpufreq_schedutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index eece624..43111a5 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -654,9 +654,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	=  1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSEC_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC,
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	struct cpufreq_policy *policy = sg_policy->policy;
 	int ret;

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

* [tip: sched/core] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task
  2024-08-13 14:43 ` [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
@ 2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-11  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     4eb71e3b4550593d9a862cc0aa754fad98679783
Gitweb:        https://git.kernel.org/tip/4eb71e3b4550593d9a862cc0aa754fad98679783
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:47 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 11 Sep 2024 11:25:10 +02:00

cpufreq/cppc: Use NSEC_PER_MSEC for deadline task

Convert the cppc deadline task attributes to use the available
definitions to make them more readable.
No functional change.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-4-christian.loehle@arm.com
---
 drivers/cpufreq/cppc_cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index bafa32d..1a5ad18 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -224,9 +224,9 @@ static void __init cppc_freq_invariance_init(void)
 		 * Fake (unused) bandwidth; workaround to "fix"
 		 * priority inheritance.
 		 */
-		.sched_runtime	= 1000000,
-		.sched_deadline = 10000000,
-		.sched_period	= 10000000,
+		.sched_runtime	= NSEC_PER_MSEC,
+		.sched_deadline = 10 * NSEC_PER_MSEC,
+		.sched_period	= 10 * NSEC_PER_MSEC,
 	};
 	int ret;
 

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

* [tip: sched/core] sched/deadline: Clarify nanoseconds in uapi
  2024-08-13 14:43 ` [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
@ 2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-11  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     6ebf2d021a13a77b495b4de15c6834e26b80d08e
Gitweb:        https://git.kernel.org/tip/6ebf2d021a13a77b495b4de15c6834e26b80d08e
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:46 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 11 Sep 2024 11:23:56 +02:00

sched/deadline: Clarify nanoseconds in uapi

Specify the time values of the deadline parameters of deadline,
runtime, and period as being in nanoseconds explicitly as they always
have been.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-3-christian.loehle@arm.com
---
 include/uapi/linux/sched/types.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h
index 9066238..bf6e9ae 100644
--- a/include/uapi/linux/sched/types.h
+++ b/include/uapi/linux/sched/types.h
@@ -58,9 +58,9 @@
  *
  * This is reflected by the following fields of the sched_attr structure:
  *
- *  @sched_deadline	representative of the task's deadline
- *  @sched_runtime	representative of the task's runtime
- *  @sched_period	representative of the task's period
+ *  @sched_deadline	representative of the task's deadline in nanoseconds
+ *  @sched_runtime	representative of the task's runtime in nanoseconds
+ *  @sched_period	representative of the task's period in nanoseconds
  *
  * Given this task model, there are a multiplicity of scheduling algorithms
  * and policies, that can be used to ensure all the tasks will make their

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

* [tip: sched/core] sched/deadline: Convert schedtool example to chrt
  2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
  2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
@ 2024-09-11  9:32   ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Christian Loehle @ 2024-09-11  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Peter Zijlstra (Intel), Juri Lelli,
	Rafael J. Wysocki, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     8bee4ca5bd64afa6a08c40db621d3c6336685bcf
Gitweb:        https://git.kernel.org/tip/8bee4ca5bd64afa6a08c40db621d3c6336685bcf
Author:        Christian Loehle <christian.loehle@arm.com>
AuthorDate:    Tue, 13 Aug 2024 15:43:45 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 11 Sep 2024 11:23:56 +02:00

sched/deadline: Convert schedtool example to chrt

chrt has SCHED_DEADLINE support so convert the example instead of
relying on a schedtool fork. While at it fix the wrong mentioning
of microseconds, it was nanoseconds for both schedtool and chrt.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240813144348.1180344-2-christian.loehle@arm.com
---
 Documentation/scheduler/sched-deadline.rst | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/sched-deadline.rst
index 9fe4846..22838ed 100644
--- a/Documentation/scheduler/sched-deadline.rst
+++ b/Documentation/scheduler/sched-deadline.rst
@@ -749,21 +749,19 @@ Appendix A. Test suite
  of the command line options. Please refer to rt-app documentation for more
  details (`<rt-app-sources>/doc/*.json`).
 
- The second testing application is a modification of schedtool, called
- schedtool-dl, which can be used to setup SCHED_DEADLINE parameters for a
- certain pid/application. schedtool-dl is available at:
- https://github.com/scheduler-tools/schedtool-dl.git.
+ The second testing application is done using chrt which has support
+ for SCHED_DEADLINE.
 
  The usage is straightforward::
 
-  # schedtool -E -t 10000000:100000000 -e ./my_cpuhog_app
+  # chrt -d -T 10000000 -D 100000000 0 ./my_cpuhog_app
 
  With this, my_cpuhog_app is put to run inside a SCHED_DEADLINE reservation
- of 10ms every 100ms (note that parameters are expressed in microseconds).
- You can also use schedtool to create a reservation for an already running
+ of 10ms every 100ms (note that parameters are expressed in nanoseconds).
+ You can also use chrt to create a reservation for an already running
  application, given that you know its pid::
 
-  # schedtool -E -t 10000000:100000000 my_app_pid
+  # chrt -d -T 10000000 -D 100000000 -p 0 my_app_pid
 
 Appendix B. Minimal main()
 ==========================

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

end of thread, other threads:[~2024-09-11  9:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 14:43 [PATCH 0/4] sched/deadline: nanoseconds clarifications Christian Loehle
2024-08-13 14:43 ` [PATCH 1/4] sched/deadline: Convert schedtool example to chrt Christian Loehle
2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
2024-09-11  9:32   ` tip-bot2 for Christian Loehle
2024-08-13 14:43 ` [PATCH 2/4] sched/deadline: Clarify nanoseconds in uapi Christian Loehle
2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
2024-09-11  9:32   ` tip-bot2 for Christian Loehle
2024-08-13 14:43 ` [PATCH 3/4] cpufreq/cppc: Use NSEC_PER_MSEC for deadline task Christian Loehle
2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
2024-09-11  9:32   ` tip-bot2 for Christian Loehle
2024-08-13 14:43 ` [PATCH 4/4] sched/cpufreq: " Christian Loehle
2024-09-09 13:38   ` Vincent Guittot
2024-09-10  8:09   ` [tip: sched/core] " tip-bot2 for Christian Loehle
2024-09-11  9:32   ` tip-bot2 for Christian Loehle
2024-08-13 16:02 ` [PATCH 0/4] sched/deadline: nanoseconds clarifications Juri Lelli
2024-09-09 13:01   ` Christian Loehle
2024-09-09 13:25     ` Peter Zijlstra
2024-09-09 16:39       ` Rafael J. Wysocki

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