mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Juri Lelli <juri.lelli@gmail.com>
Cc: Kirill Tkhai <ktkhai@parallels.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	tkhai@yandex.ru
Subject: Re: [PATCH]sched/core: Return possibility to set RT and DL classes back
Date: Mon, 3 Mar 2014 10:35:58 +0100	[thread overview]
Message-ID: <20140303093558.GP27965@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140301191838.d15d03112b2598a671dac22c@gmail.com>

On Sat, Mar 01, 2014 at 07:18:38PM +0100, Juri Lelli wrote:
> From 73bae0ad978db6e75f492eea9adff12ec9d6d2a3 Mon Sep 17 00:00:00 2001
> From: Juri Lelli <juri.lelli@gmail.com>
> Date: Sat, 1 Mar 2014 16:43:30 +0100
> Subject: [PATCH] sched/core: restore __setscheduler() behavior
> 
> Commit c365c29 introduced __setscheduler_params(), that is now used
> to only store a task's new scheduling parameters in the case it is
> priority boosted.
> 
> Before this change, __setscheduler() was in charge of changing tasks
> normal_prio and prio, and the latter is used to actually perform
> sched_class change. Unfortunately, the commit above broke this
> behavior, causing tasks to remain in fair_sched_class.
> 
> Restore the old behaviour setting normal_prio and prio to the right
> values after the __setscheduler_params() call.

Please also add a Fixes: tag when appropriate, and add to Cc all those
two were involved with the original patch.

Fixes: c365c292d059 ("sched: Consider pi boosting in setscheduler()")
> Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
> ---
>  kernel/sched/core.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index ee8004c..04ae20d 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3206,6 +3206,13 @@ static void __setscheduler(struct rq *rq, struct task_struct *p,
>  {
>  	__setscheduler_params(p, attr);
>  
> +	/*
> +	 * Since we checked before with rt_mutex_check_prio(),
> +	 * we don't have pi waiters or our top waiter has lower
> +	 * priority (user space view) than what we got.
> +	 */
> +	p->prio = p->normal_prio = normal_prio(p);
> +
>  	if (dl_prio(p->prio))
>  		p->sched_class = &dl_sched_class;
>  	else if (rt_prio(p->prio))

So there is one more caller of this: normalize_task() but since that is
only used to force set all tasks to SCHED_NORMAL ignoring the PI stuff
seems perfectly fine.

      reply	other threads:[~2014-03-03  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 10:24 Kirill Tkhai
2014-02-28 10:50 ` Kirill Tkhai
2014-03-01 18:18   ` Juri Lelli
2014-03-03  9:35     ` Peter Zijlstra [this message]

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=20140303093558.GP27965@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=juri.lelli@gmail.com \
    --cc=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tkhai@yandex.ru \
    /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

Powered by JetHome