mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Julien Desfossez <jdesfossez@efficios.com>
Cc: peterz@infradead.org, rostedt@goodmis.org, mingo@redhat.com,
	daolivei@redhat.com, mathieu.desnoyers@efficios.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/6] sched/fair: check_preempt_wakeup: Fix assumption on the default policy
Date: Tue, 20 Sep 2016 22:49:12 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1609202236430.5476@nanos> (raw)
In-Reply-To: <1474060148-13171-1-git-send-email-jdesfossez@efficios.com>

On Fri, 16 Sep 2016, Julien Desfossez wrote:

> Tasks with RT or deadline scheduling class may inherit from a task with
> a "fair" scheduling class.

This makes no sense. A RT/DL task can never inherit anything from a sched
fair task. That would be inverted priority inheritance.

> This priority inheritance changes the scheduling class, but not the task
> "policy" field.
>
> Therefore, the fair scheduler should not assume that policy !=
> SCHED_NORMAL is the same as (policy == SCHED_BATCH || policy ==
> SCHED_IDLE), because the policy could also be SCHED_RR, SCHED_FIFO, or
> SCHED_DEADLINE.
> 
> The incorrect comparison in check_preempt_wakeup makes RR, FIFO and
> DEADLINE tasks which inherit from a fair task behave as if they were
> IDLE or BATCH tasks, thus awaiting the following tick before preempting
> the current task.

This is just wrong.

Priority/deadline inheritance elevates a fair task to RR/FIFO/DL, i.e. to
the scheduling class of the task which is blocked on a resource held by the
fair task.

The check_preempt_curr() callback of a scheduling class is only invoked
when the freshly woken task is in the same scheduling class as the task
which is currently on the cpu.

So which problem are you actually solving?

> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>

Who wrote the patch? 

Thanks,

	tglx

  parent reply	other threads:[~2016-09-20 20:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 21:09 Julien Desfossez
2016-09-16 21:09 ` [RFC PATCH 2/6] sched: get effective policy and rt_prio Julien Desfossez
2016-09-16 21:09 ` [RFC PATCH 3/6] tracing: add sched_update_prio Julien Desfossez
2016-09-16 21:09 ` [RFC PATCH 4/6] tracing: add TRACE_EVENT_MAP Julien Desfossez
2016-09-16 21:09 ` [RFC PATCH 5/6] tracing: extend scheduling tracepoints Julien Desfossez
2016-09-16 21:09 ` [RFC PATCH 6/6] tracing: extend sched_pi_setprio Julien Desfossez
2016-09-20 20:49 ` Thomas Gleixner [this message]
2016-09-20 22:04   ` [RFC PATCH 1/6] sched/fair: check_preempt_wakeup: Fix assumption on the default policy Mathieu Desnoyers
2016-09-20 22:56     ` Thomas Gleixner
2016-09-21  0:09       ` Julien Desfossez

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=alpine.DEB.2.20.1609202236430.5476@nanos \
    --to=tglx@linutronix.de \
    --cc=daolivei@redhat.com \
    --cc=jdesfossez@efficios.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®