From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>,
linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@arm.com>,
Tommaso Cucinotta <tommaso.cucinotta@sssup.it>,
Luca Abeni <luca.abeni@santannapisa.it>,
Steven Rostedt <rostedt@goodmis.org>,
Mike Galbraith <efault@gmx.de>,
Romulo Silva de Oliveira <romulo.deoliveira@ufsc.br>
Subject: Re: [PATCH V2 2/2] sched/deadline: Throttle a constrained deadline task activated after the deadline
Date: Tue, 14 Feb 2017 18:31:02 +0100 [thread overview]
Message-ID: <22506896-8746-0b32-13eb-a2c1c2e783a9@redhat.com> (raw)
In-Reply-To: <501277c7-d7b2-e1c2-4f10-eda9b6624956@santannapisa.it>
On 02/14/2017 04:54 PM, Tommaso Cucinotta wrote:
> On 13/02/2017 20:05, Daniel Bristot de Oliveira wrote:
>> To avoid this problem, in the activation of a constrained deadline
>> task after the deadline but before the next period, throttle the
>> task and set the replenishing timer to the begin of the next period,
>> unless it is boosted.
>
> my only comment is that, by throttling on (dl < wakeuptime < period), we
> force the app to sync its activation time with the kernel, and the cbs
> doesn't self-sync anymore with the app own periodicity, which is what
> normally happens with dl=period. With dl=period, we loose the cbs
> self-sync and we force the app to sync with the kernel periodic timer
> only if we use explicitly yield(), but now this becomes also implicit
> just if we set dl<period.
I see your point. However, that will happen only if, for some external
fact or imprecision, the task wakes up with a minimum inter-arrival time
smaller than the dl_period. In such case, IMHO the user must be aware of
the miss behavior or imprecision of the task/method which activates the
task and set an appropriate/safer smaller dl_period.
Furthermore, (correct me if I am wrong...) CBS will self-sync implicit
deadline tasks which did not consume all its previous runtime. Because,
if the runtime was consumed, the wake-up will fall in the same case I am
making constrained tasks to fall - the task will be throttled until the
next replenishment, after the next period.
The idea is to simulate sched_yield(). By suspending itself further than
the deadline, the task either has timing problems, or it wants to
suspend itself until the next activation, like calling sched_yeild(),
but allowing itself to be sporadic (to be activated after the minimum
inter-arrival time).
>
>> attr.sched_policy = SCHED_DEADLINE;
>> attr.sched_runtime = 2 * 1000 * 1000; /* 2 ms */
>> attr.sched_deadline = 2 * 1000 * 1000; /* 2 ms */
>> attr.sched_period = 2 * 1000 * 1000 * 1000; /* 2 s */
> ...
>> On my box, this reproducer uses almost 50% of the CPU time, which is
>> obviously wrong for a task with 2/2000 reservation.
>
> just a note here: in this example of runtime=deadline=2ms, shall we rely
> on a utilization-based test, then we should assume the task is taking 100%.
> More precise tests for EDF with deadline<period would properly count the
> 1998ms/2000ms free space, instead.
Yeah, it is taking 100% for runtime/deadline. But the admission is
runtime/period, so it will pass. The idea of runtime=deadline is to
avoid the task being throttled. If the task is throttle we would not be
able to demonstrate this bug. Anyway, we can set runtime = (0.95 *
deadline), it will also reproduce the problem, as long as the task is
put to sleep before being throttled.
Thanks!
-- Daniel
next prev parent reply other threads:[~2017-02-14 17:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 19:05 [PATCH V2 0/2] sched/deadline: Fixes for constrained deadline tasks Daniel Bristot de Oliveira
2017-02-13 19:05 ` [PATCH V2 1/2] sched/deadline: Replenishment timer should fire in the next period Daniel Bristot de Oliveira
2017-02-13 19:05 ` [PATCH V2 2/2] sched/deadline: Throttle a constrained deadline task activated after the deadline Daniel Bristot de Oliveira
2017-02-14 15:54 ` Tommaso Cucinotta
2017-02-14 17:31 ` Daniel Bristot de Oliveira [this message]
2017-02-14 19:33 ` Steven Rostedt
2017-02-14 19:28 ` [PATCH 3/2] sched/deadline: Use deadline instead of period when calculating overflow Steven Rostedt (VMware)
2017-02-14 22:49 ` luca abeni
2017-02-15 0:14 ` Steven Rostedt
2017-02-15 7:40 ` Luca Abeni
2017-02-15 10:29 ` Juri Lelli
2017-02-15 11:32 ` Peter Zijlstra
2017-02-15 12:31 ` Luca Abeni
2017-02-15 12:59 ` Juri Lelli
2017-02-15 13:13 ` Luca Abeni
2017-02-15 14:15 ` Juri Lelli
2017-02-15 13:33 ` Daniel Bristot de Oliveira
2017-02-15 13:42 ` Daniel Bristot de Oliveira
2017-02-15 14:09 ` Steven Rostedt
2017-02-15 14:16 ` Juri Lelli
2017-02-16 16:36 ` Tommaso Cucinotta
2017-02-16 16:47 ` Steven Rostedt
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=22506896-8746-0b32-13eb-a2c1c2e783a9@redhat.com \
--to=bristot@redhat.com \
--cc=efault@gmx.de \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=romulo.deoliveira@ufsc.br \
--cc=rostedt@goodmis.org \
--cc=tommaso.cucinotta@santannapisa.it \
--cc=tommaso.cucinotta@sssup.it \
/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
all inboxes | Powered by JetHome®