linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Daniel Bristot de Oliveira <daniel@bristot.me>
Cc: Christoph Lameter <cl@linux.com>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/rt: RT_RUNTIME_GREED sched feature
Date: Mon, 7 Nov 2016 15:44:01 -0500	[thread overview]
Message-ID: <20161107154401.16f0214e@gandalf.local.home> (raw)
In-Reply-To: <c46a03ef-89f5-b0c1-5886-e77266dc9a40@bristot.me>

On Mon, 7 Nov 2016 21:33:02 +0100
Daniel Bristot de Oliveira <daniel@bristot.me> wrote:

> On 11/07/2016 09:16 PM, Steven Rostedt wrote:
> > I'm confused? Are you saying that RR tasks don't get throttled in the
> > current code? That sounds like a bug to me.  
> 
> If the RT_RUNTIME_SHARING is enabled, the CPU in which the RR tasks are
> running (and pinned) will borrow RT runtime from another CPU, allowing
> the RR tasks to run forever. For example:
> 
> [root@kiron debug]# cat /proc/sched_debug | grep rt_runtime
>   .rt_runtime                    : 950.000000
>   .rt_runtime                    : 950.000000
>   .rt_runtime                    : 950.000000
>   .rt_runtime                    : 950.000000
> [root@kiron debug]# echo RT_RUNTIME_SHARE > sched_features
> [root@kiron debug]# taskset -c 2 chrt -r 5 /home/bristot/f &
> [1] 23908
> [root@kiron debug]# taskset -c 2 chrt -r 5 /home/bristot/f &
> [2] 23915
> [root@kiron debug]# cat /proc/sched_debug | grep rt_runtime
>   .rt_runtime                    : 900.000000
>   .rt_runtime                    : 950.000000
>   .rt_runtime                    : 1000.000000
>   .rt_runtime                    : 950.000000
> 
> You see? the rt_runtime of the CPU 2 was borrowed time from CPU 0.
> 
> It is not a BUG but a feature (no jokes haha). With RT_RUNTIME_SHARE,
> the rt_runtime is such a global runtime. It works fine for tasks that
> can migrate... but that is not the case for per-cpu kworkers.

This still looks like a bug, or not the expected result. Perhaps we
shouldn't share when tasks are pinned. It doesn't make sense. It's like
pinning two deadline tasks to the same CPU and giving them 100% of that
CPU and saying that it's really just 1/nr_cpus of usage, which would
have the same effect.

OK, it appears this is specific to RT_RUNTIME_SHARE which is what
causes this strange behavior, and even more rational to make this a
default option and perhaps even turn RT_RUNTIME_SHARE off by default.

-- Steve

  reply	other threads:[~2016-11-07 20:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07  8:17 [PATCH] sched/rt: RT_RUNTIME_GREED sched feature Daniel Bristot de Oliveira
2016-11-07 10:31 ` Tommaso Cucinotta
2016-11-07 13:51   ` Daniel Bristot de Oliveira
2016-11-07 18:03     ` Tommaso Cucinotta
2016-11-07 18:06       ` Luca Abeni
2016-11-08  7:55     ` luca abeni
2016-11-08 10:30     ` Juri Lelli
2016-11-07 16:55 ` Christoph Lameter
2016-11-07 18:32   ` Steven Rostedt
2016-11-07 18:49     ` Daniel Bristot de Oliveira
2016-11-07 19:16       ` Steven Rostedt
2016-11-07 19:30     ` Christoph Lameter
2016-11-07 19:47       ` Steven Rostedt
2016-11-07 19:54         ` Christoph Lameter
2016-11-07 20:00           ` Steven Rostedt
2016-11-07 20:06             ` Daniel Bristot de Oliveira
2016-11-07 20:16               ` Steven Rostedt
2016-11-07 20:33                 ` Daniel Bristot de Oliveira
2016-11-07 20:44                   ` Steven Rostedt [this message]
2016-11-08  9:22                     ` [PATCH] sched/rt: Change default setup for RT THROTTLING Daniel Bristot de Oliveira
2016-11-08 23:42                 ` [PATCH] sched/rt: RT_RUNTIME_GREED sched feature Christoph Lameter
2016-11-07 18:22 ` Clark Williams
2016-11-07 18:30   ` Steven Rostedt
2016-11-07 18:38     ` Daniel Bristot de Oliveira
2016-11-07 18:39     ` Clark Williams
2016-11-08 11:59 ` Peter Zijlstra
2016-11-08 14:07   ` Steven Rostedt
2016-11-08 16:51     ` Peter Zijlstra
2016-11-08 17:17       ` Steven Rostedt
2016-11-08 18:05         ` Peter Zijlstra
2016-11-08 19:29           ` Daniel Bristot de Oliveira
2016-11-08 19:50             ` Peter Zijlstra
2016-11-09 13:33               ` Daniel Bristot de Oliveira
     [not found]                 ` <CAA7rmPF0nQb9721MQWurRCy7E3X46hAy2qV=joK=z5U-t70NOg@mail.gmail.com>
2016-11-11 18:46                   ` Christoph Lameter
2016-11-11 22:53                     ` Peter Zijlstra
2016-11-13 18:53                       ` Christoph Lameter
2016-11-14  9:20                         ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161107154401.16f0214e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=cl@linux.com \
    --cc=daniel@bristot.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).