From: Juri Lelli <juri.lelli@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v2] sched: Fix broken setscheduler()
Date: Tue, 11 Mar 2014 10:35:45 +0100 [thread overview]
Message-ID: <20140311103545.fc7f0f6b1bf0eb1d3391c85c@gmail.com> (raw)
In-Reply-To: <20140310173731.06d41157@gandalf.local.home>
On Mon, 10 Mar 2014 17:37:31 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 10 Mar 2014 22:18:56 +0100 (CET)
> Thomas Gleixner <tglx@linutronix.de> wrote:
>
>
> > Lemme look at it tomorrow again with an awake brain. This seems to be
> > some forward porting hickup which needs a closer look. Just look at
>
> Yep, I talked with Sebastian on IRC and that seems to be the case.
>
> > the 3.10-rt version of this:
> >
> > @@ -3825,20 +3826,25 @@ static struct task_struct *find_process_by_pid(pid_t pid)
> > return pid ? find_task_by_vpid(pid) : current;
> > }
> >
> > -/* Actually do priority change: must hold rq lock. */
> > -static void
> > -__setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio)
> > +static void __setscheduler_params(struct task_struct *p, int policy, int prio)
> > {
> > p->policy = policy;
> > p->rt_priority = prio;
> > p->normal_prio = normal_prio(p);
> > + set_load_weight(p);
> > +}
> >
> > That code has changed significantly probably due to the EDF merge. We
> > need to figure out whether there is more damage due to that.
>
> Yeah, when I looked at the -rt version, it appeared to have my fix
> already. But in reality, the forward port broke it. Here's the problem
> part of the commit:
>
> + set_load_weight(p);
> +}
>
> - p->normal_prio = normal_prio(p);
> - p->prio = rt_mutex_getprio(p);
>
> Your patch never deleted the above two. And it kept them in the
> locations that I placed them in, in my patch.
>
Oh, and you have to have also something like this
@@ -3271,7 +3271,8 @@ static int __sched_setscheduler(struct task_struct *p,
const struct sched_attr *attr,
bool user)
{
- int newprio = MAX_RT_PRIO - 1 - attr->sched_priority;
+ int newprio = dl_policy(attr->sched_policy) ? MAX_DL_PRIO - 1 :
+ MAX_RT_PRIO - 1 - attr->sched_priority;
int retval, oldprio, oldpolicy = -1, on_rq, running;
int policy = attr->sched_policy;
unsigned long flags;
or you can fail to become DL if you are currently boosted by RT, as
attr->sched_priority == 0 for DL tasks. Then rt_mutex_check_prio ()
returns 1 (just update params) if setting DL params for a task already
boosted by another DL. But this seems to be ok, as we are already
outside enforcement in this situation. (This is going to be trickier
with proxy exec, though :/).
Thanks,
- Juri
> -- Steve
>
>
> +/* Actually do priority change: must hold pi & rq lock. */
> +static void __setscheduler(struct rq *rq, struct task_struct *p,
> + const struct sched_attr *attr)
> +{
>
>
next prev parent reply other threads:[~2014-03-11 9:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 4:29 [PATCH linux-next] " Steven Rostedt
2014-03-06 11:58 ` Peter Zijlstra
2014-03-06 12:20 ` Juri Lelli
2014-03-06 17:04 ` [PATCH v2] " Steven Rostedt
2014-03-06 20:43 ` Thomas Gleixner
2014-03-10 17:29 ` Steven Rostedt
2014-03-10 21:18 ` Thomas Gleixner
2014-03-10 21:37 ` Steven Rostedt
2014-03-11 9:35 ` Juri Lelli [this message]
2014-03-11 10:48 ` Thomas Gleixner
2014-03-11 23:24 ` [PATCH v3] " Steven Rostedt
2014-03-12 10:41 ` Thomas Gleixner
2014-03-12 10:10 ` [tip:sched/core] " tip-bot for 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=20140311103545.fc7f0f6b1bf0eb1d3391c85c@gmail.com \
--to=juri.lelli@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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