mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Julien Desfossez <jdesfossez@efficios.com>,
	Peter Zijlstra <peterz@infradead.org>,
	rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>,
	daolivei <daolivei@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/6] sched/fair: check_preempt_wakeup: Fix assumption on the default policy
Date: Wed, 21 Sep 2016 00:56:32 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1609210042330.5476@nanos> (raw)
In-Reply-To: <342487362.26930.1474409041257.JavaMail.zimbra@efficios.com>

On Tue, 20 Sep 2016, Mathieu Desnoyers wrote:
> So what is then puzzling us is this:
> 
> rt_mutex_setprio()
> 
>         if (dl_prio(prio)) {
>                 struct task_struct *pi_task = rt_mutex_get_top_task(p);
>                 if (!dl_prio(p->normal_prio) ||
>                     (pi_task && dl_entity_preempt(&pi_task->dl, &p->dl))) {
>                         p->dl.dl_boosted = 1;
>                         queue_flag |= ENQUEUE_REPLENISH;
>                 } else
>                         p->dl.dl_boosted = 0;
>                 p->sched_class = &dl_sched_class;
>         } else if (rt_prio(prio)) {
>                 if (dl_prio(oldprio))
>                         p->dl.dl_boosted = 0;
>                 if (oldprio < prio)
>                         queue_flag |= ENQUEUE_HEAD;
>                 p->sched_class = &rt_sched_class;
>         } else {
>                 if (dl_prio(oldprio))
>                         p->dl.dl_boosted = 0;
>                 if (rt_prio(oldprio))
>                         p->rt.timeout = 0;
>                 p->sched_class = &fair_sched_class;
>         }
> 
> So in the 3rd block, this is the case where we inherit a
> new prio which is neither LD nor RT, so it's "fair".
> 
> If we try to assign a fair prio to a task of DL or RT
> prio, the dl_boosted is set to 0, or the rt timeout is
> set to 0. However, we do change the sched_class of the
> target task to &fair_sched_class.
> 
> This code path seems to imply that a RT or DL task can
> change sched_class to "fair". Indeed, it makes no sense,
> so I have the feeling we're missing something important
> here.

Yes. Look at the call site of this. This is called in two cases:

 - The task blocked on a lock pushes the task owning the lock and in that
   case it is guaranteed that the blocked task is in the same or in a
   higher scheduling class. We have no support for inverse PI (yet).

 - The task which got boosted deboosts itself after releasing the lock. In
   that case it falls back to its original class/priority/bandwidth.

Hope that helps.

> >> 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?
> 
> Julien is the author.

So the SOB chain is wrong because you neither authored the patch nor you
conveyed it.

Thanks,

	tglx

  reply	other threads:[~2016-09-20 22:59 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 ` [RFC PATCH 1/6] sched/fair: check_preempt_wakeup: Fix assumption on the default policy Thomas Gleixner
2016-09-20 22:04   ` Mathieu Desnoyers
2016-09-20 22:56     ` Thomas Gleixner [this message]
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.1609210042330.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®