linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it
@ 2016-11-15 10:39 Daniel Bristot de Oliveira
  2016-11-15 10:39 ` [PATCH 1/2] sched/rt: Disable RT_RUNTIME_SHARE by default Daniel Bristot de Oliveira
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Daniel Bristot de Oliveira @ 2016-11-15 10:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Steven Rostedt, Clark Williams, Luis Claudio R . Goncalves, linux-kernel

Disable RT_RUNTIME_SHARE by default and document it.

Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Cc: linux-kernel@vger.kernel.org

Daniel Bristot de Oliveira (2):
  sched/rt: Disable RT_RUNTIME_SHARE by default
  sched/rt: Document RT_RUNTIME_SHARE sched feature

 kernel/sched/features.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

-- 
2.7.4

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

* [PATCH 1/2] sched/rt: Disable RT_RUNTIME_SHARE by default
  2016-11-15 10:39 [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Daniel Bristot de Oliveira
@ 2016-11-15 10:39 ` Daniel Bristot de Oliveira
  2016-11-15 10:39 ` [PATCH 2/2] sched/rt: Document RT_RUNTIME_SHARE sched feature Daniel Bristot de Oliveira
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel Bristot de Oliveira @ 2016-11-15 10:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Steven Rostedt, Clark Williams, Luis Claudio R . Goncalves, linux-kernel

The RT_RUNTIME_SHARE sched feature enables the sharing of rt_runtime
between CPUs, allowing a CPU to run a real-time task up to 100% of the
time while leaving more space for non-real-time tasks to run on the CPU
that lend rt_runtime.

The problem is that a CPU can easily borrow enough rt_runtime to allow
a spinning rt-task to run forever, starving per-cpu tasks like kworkers,
which are non-real-time by design.

This patch disables RT_RUNTIME_SHARE by default, avoiding this problem.
The feature will still be present for users that want to enable it,
though.

Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Cc: linux-kernel@vger.kernel.org

diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index 69631fa..5fffebfe 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -65,7 +65,7 @@ SCHED_FEAT(RT_PUSH_IPI, true)
 #endif
 
 SCHED_FEAT(FORCE_SD_OVERLAP, false)
-SCHED_FEAT(RT_RUNTIME_SHARE, true)
+SCHED_FEAT(RT_RUNTIME_SHARE, false)
 SCHED_FEAT(LB_MIN, false)
 SCHED_FEAT(ATTACH_AGE_LOAD, true)
 
-- 
2.7.4

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

* [PATCH 2/2] sched/rt: Document RT_RUNTIME_SHARE sched feature
  2016-11-15 10:39 [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Daniel Bristot de Oliveira
  2016-11-15 10:39 ` [PATCH 1/2] sched/rt: Disable RT_RUNTIME_SHARE by default Daniel Bristot de Oliveira
@ 2016-11-15 10:39 ` Daniel Bristot de Oliveira
  2016-11-15 13:01 ` [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Luis Claudio R. Goncalves
  2016-11-15 15:27 ` Steven Rostedt
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel Bristot de Oliveira @ 2016-11-15 10:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Steven Rostedt, Clark Williams, Luis Claudio R . Goncalves, linux-kernel

Add a comment explaining the RT_RUNTIME_SHARE sched feature.

Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Cc: linux-kernel@vger.kernel.org

diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index 5fffebfe..531c4bb 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -65,7 +65,17 @@ SCHED_FEAT(RT_PUSH_IPI, true)
 #endif
 
 SCHED_FEAT(FORCE_SD_OVERLAP, false)
+
+/*
+ * Enables the sharing of rt_runtime between CPUs, allowing a CPU to
+ * run a real-time task up to 100% of the time while leaving more
+ * space for non-real-time tasks to run on the CPU that lend rt_runtime.
+ *
+ * WARNING: This may allow the starvation of non-real-time tasks pinned
+ * to the CPU in which a spinning rt-task runs forever.
+ */
 SCHED_FEAT(RT_RUNTIME_SHARE, false)
+
 SCHED_FEAT(LB_MIN, false)
 SCHED_FEAT(ATTACH_AGE_LOAD, true)
 
-- 
2.7.4

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

* Re: [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it
  2016-11-15 10:39 [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Daniel Bristot de Oliveira
  2016-11-15 10:39 ` [PATCH 1/2] sched/rt: Disable RT_RUNTIME_SHARE by default Daniel Bristot de Oliveira
  2016-11-15 10:39 ` [PATCH 2/2] sched/rt: Document RT_RUNTIME_SHARE sched feature Daniel Bristot de Oliveira
@ 2016-11-15 13:01 ` Luis Claudio R. Goncalves
  2016-11-15 15:27 ` Steven Rostedt
  3 siblings, 0 replies; 6+ messages in thread
From: Luis Claudio R. Goncalves @ 2016-11-15 13:01 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira
  Cc: Ingo Molnar, Peter Zijlstra, Steven Rostedt, Clark Williams,
	linux-kernel

On Tue, Nov 15, 2016 at 11:39:09AM +0100, Daniel Bristot de Oliveira wrote:
> Disable RT_RUNTIME_SHARE by default and document it.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Clark Williams <williams@redhat.com>
> Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
> Cc: linux-kernel@vger.kernel.org
> 
> Daniel Bristot de Oliveira (2):
>   sched/rt: Disable RT_RUNTIME_SHARE by default
>   sched/rt: Document RT_RUNTIME_SHARE sched feature
> 
>  kernel/sched/features.h | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Acked-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>

In light of the discussion about "sched/rt: RT_RUNTIME_GREED sched
feature", disabling RT_RUNTIME_SHARE by default restores a portion
of determinism we gave away by using the clever mechanism behind
RT_RUNTIME_SHARE. (I should have prefaced that with a IMHO).

Luis

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

* Re: [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it
  2016-11-15 10:39 [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Daniel Bristot de Oliveira
                   ` (2 preceding siblings ...)
  2016-11-15 13:01 ` [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Luis Claudio R. Goncalves
@ 2016-11-15 15:27 ` Steven Rostedt
  2016-11-15 16:57   ` Daniel Bristot de Oliveira
  3 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2016-11-15 15:27 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira
  Cc: Ingo Molnar, Peter Zijlstra, Clark Williams,
	Luis Claudio R . Goncalves, linux-kernel

On Tue, 15 Nov 2016 11:39:09 +0100
Daniel Bristot de Oliveira <bristot@redhat.com> wrote:

> Disable RT_RUNTIME_SHARE by default and document it.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Clark Williams <williams@redhat.com>
> Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
> Cc: linux-kernel@vger.kernel.org
> 
> Daniel Bristot de Oliveira (2):
>   sched/rt: Disable RT_RUNTIME_SHARE by default
>   sched/rt: Document RT_RUNTIME_SHARE sched feature
> 
>  kernel/sched/features.h | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 

I don't see why this is two patches. A change and a comment can go
together, and probably should, especially since the comment explains
the change as well.

With a folded patch...

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

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

* Re: [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it
  2016-11-15 15:27 ` Steven Rostedt
@ 2016-11-15 16:57   ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Bristot de Oliveira @ 2016-11-15 16:57 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Peter Zijlstra, Clark Williams,
	Luis Claudio R . Goncalves, linux-kernel

On 11/15/2016 04:27 PM, Steven Rostedt wrote:
> I don't see why this is two patches. A change and a comment can go
> together, and probably should, especially since the comment explains
> the change as well.
> 
> With a folded patch...

I will cook a v2 in a single patch!

Thanks!

-- Daniel

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

end of thread, other threads:[~2016-11-15 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 10:39 [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Daniel Bristot de Oliveira
2016-11-15 10:39 ` [PATCH 1/2] sched/rt: Disable RT_RUNTIME_SHARE by default Daniel Bristot de Oliveira
2016-11-15 10:39 ` [PATCH 2/2] sched/rt: Document RT_RUNTIME_SHARE sched feature Daniel Bristot de Oliveira
2016-11-15 13:01 ` [PATCH 0/2] sched/rt: disable RT_RUNTIME_SHARE by default and document it Luis Claudio R. Goncalves
2016-11-15 15:27 ` Steven Rostedt
2016-11-15 16:57   ` 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;
as well as URLs for NNTP newsgroup(s).