From: Ingo Molnar <mingo@kernel.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: raistlin@linux.it, juri.lelli@gmail.com,
Peter Zijlstra <peterz@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] [ tip/sched/core ] System unresponsive after booting
Date: Wed, 15 Jan 2014 10:22:45 +0100 [thread overview]
Message-ID: <20140115092245.GA15190@gmail.com> (raw)
In-Reply-To: <52D64676.4040000@linaro.org>
* Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> Hi all,
>
> I use the tip/sched/core branch.
>
> After git pulling yesterday, my host is unresponsive after booting the OS.
>
> * It boots normally
> * It sends info to the console
> * The graphics does not work
> * The terminals show the prompt, I can enter the username but after
> pressing enter, it does not give the password prompt
> * sysrq works more or less, I can't get the process stack but it
> receives the command
>
> It is like no new process can be created.
>
> I have a dual Xeon processor E5325 (2 x 4 cores).
>
> After git bisecting, the following patch seems to introduce the bug.
>
> commit d50dde5a10f305253cbc3855307f608f8a3c5f73
> Author: Dario Faggioli <raistlin@linux.it>
> Date: Thu Nov 7 14:43:36 2013 +0100
>
> sched: Add new scheduler syscalls to support an extended
> scheduling parameters ABI
>
> Add the syscalls needed for supporting scheduling algorithms
> with extended scheduling parameters (e.g., SCHED_DEADLINE).
>
>
> [ ... ]
>
>
> Signed-off-by: Dario Faggioli <raistlin@linux.it>
> [ Rewrote to use sched_attr. ]
> Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
> [ Removed sched_setscheduler2() for now. ]
> Signed-off-by: Peter Zijlstra <peterz@infradead.org>
> Link: http://lkml.kernel.org/r/1383831828-15501-3-git-send-email-juri.lelli@gmail.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
I checked this patch again, and noticed a few oddities:
1)
There's this change to __setscheduler():
-__setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio)
+/* Actually do priority change: must hold pi & rq lock. */
+static void __setscheduler(struct rq *rq, struct task_struct *p,
+ const struct sched_attr *attr)
{
+ int policy = attr->sched_policy;
+
p->policy = policy;
- p->rt_priority = prio;
+
+ if (rt_policy(policy))
+ p->rt_priority = attr->sched_priority;
+ else
+ p->static_prio = NICE_TO_PRIO(attr->sched_nice);
+
doesnt this change keep p->rt_priority uninitialized in the
normalize_task() case?
I.e. rt_priority should still be set unconditionally. In the
SCHED_NORMAL case that will be a zero initialization.
2)
It's not clear why this change to __setscheduler() was done:
/*
* Allow unprivileged RT tasks to decrease priority:
*/
if (user && !capable(CAP_SYS_NICE)) {
+ if (fair_policy(policy)) {
+ if (!can_nice(p, attr->sched_nice))
+ return -EPERM;
+ }
+
if (rt_policy(policy)) {
3)
On ARM:
-#define __NR_syscalls (380)
+#define __NR_syscalls (384)
but:
#define __NR_finit_module (__NR_SYSCALL_BASE+379)
+#define __NR_sched_setattr (__NR_SYSCALL_BASE+380)
+#define __NR_sched_getattr (__NR_SYSCALL_BASE+381)
/*
Why is the syscall table increased by 4, while we only add 2 new
syscalls?
4)
In hindsight this patch should have been 3 patches or so:
- one that just mechanically extends __setscheduler() with an 'attr'
way to pass parameters
- one that adds whatever other desired changes to __setscheduler(),
with an explanation.
- one that adds the new syscalls.
Which would ease the debugging of such bugs.
Thanks,
Ingo
next prev parent reply other threads:[~2014-01-15 9:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 8:27 [BUG] [ tip/sched/core ] System unresponsive after booting Daniel Lezcano
2014-01-15 9:22 ` Ingo Molnar [this message]
2014-01-15 10:39 ` Peter Zijlstra
2014-01-15 11:00 ` Peter Zijlstra
2014-01-15 14:05 ` Peter Zijlstra
2014-01-15 9:25 ` Michael wang
2014-01-15 11:30 ` Peter Zijlstra
2014-01-15 13:28 ` Daniel Lezcano
2014-01-16 13:40 ` [tip:sched/core] sched: Preserve the nice level over sched_setscheduler() and sched_setparam() calls tip-bot for Peter Zijlstra
2014-01-15 13:27 ` [BUG] [ tip/sched/core ] System unresponsive after booting Daniel Lezcano
2014-01-15 12:04 ` Peter Zijlstra
2014-01-15 12:24 ` Ingo Molnar
2014-01-15 13:45 ` Daniel Lezcano
2014-01-15 13:09 ` Daniel Lezcano
2014-01-16 13:48 ` Daniel Lezcano
2014-01-16 14:17 ` Peter Zijlstra
2014-01-16 14:20 ` Daniel Lezcano
2014-01-16 14:25 ` Peter Zijlstra
2014-01-16 14:30 ` Daniel Lezcano
2014-01-16 15:42 ` Peter Zijlstra
2014-01-16 15:50 ` Daniel Lezcano
2014-01-16 16:54 ` [PATCH] sched: Fix __sched_setscheduler() nice test Peter Zijlstra
2014-01-16 18:33 ` Peter Zijlstra
2014-01-16 18:39 ` [tip:sched/core] " tip-bot for Peter Zijlstra
2014-01-16 15:28 ` [BUG] [ tip/sched/core ] System unresponsive after booting Daniel Lezcano
2014-01-16 15:48 ` Peter Zijlstra
2014-01-16 15:51 ` Daniel Lezcano
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=20140115092245.GA15190@gmail.com \
--to=mingo@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=juri.lelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=raistlin@linux.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;
as well as URLs for NNTP newsgroup(s).