* [PATCH 0/2] [GIT PULL][v3.0] sched: various fixes
@ 2011-06-14 22:36 Steven Rostedt
2011-06-14 22:36 ` [PATCH 1/2] sched: Fix need_resched() when checking peempt Steven Rostedt
2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt
0 siblings, 2 replies; 7+ messages in thread
From: Steven Rostedt @ 2011-06-14 22:36 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton
Ingo,
Please pull the latest tip/sched/urgent tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-rt.git
tip/sched/urgent
Head SHA1: 349d467dc2c8d22df6a891562843bb7d8409f93f
Hillf Danton (1):
sched: Fix need_resched() when checking peempt
Steven Rostedt (1):
sched: Check if lowest_mask is initialized in find_lowest_rq
----
kernel/sched_rt.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/2] sched: Fix need_resched() when checking peempt 2011-06-14 22:36 [PATCH 0/2] [GIT PULL][v3.0] sched: various fixes Steven Rostedt @ 2011-06-14 22:36 ` Steven Rostedt 2011-06-15 9:50 ` [tip:sched/urgent] " tip-bot for Hillf Danton 2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt 1 sibling, 1 reply; 7+ messages in thread From: Steven Rostedt @ 2011-06-14 22:36 UTC (permalink / raw) To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Hillf Danton, Yong Zhang [-- Attachment #1: 0001-sched-Fix-need_resched-when-checking-peempt.patch --] [-- Type: text/plain, Size: 1065 bytes --] From: Hillf Danton <dhillf@gmail.com> The RT preempt check tests the wrong task if NEED_RESCHED is set. It currently checks the local CPU task. It is suppose to check the task that is running on the run queue we are about to wake another task on. Signed-off-by: Hillf Danton <dhillf@gmail.com> Link: http://lkml.kernel.org/r/BANLkTi=e=69xvJZ1+56xzuFyhmdN0hZHRQ@mail.gmail.com Reviewed-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> --- kernel/sched_rt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 88725c9..9b8d5dc 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -1096,7 +1096,7 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flag * to move current somewhere else, making room for our non-migratable * task. */ - if (p->prio == rq->curr->prio && !need_resched()) + if (p->prio == rq->curr->prio && !test_tsk_need_resched(rq->curr)) check_preempt_equal_prio(rq, p); #endif } -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [tip:sched/urgent] sched: Fix need_resched() when checking peempt 2011-06-14 22:36 ` [PATCH 1/2] sched: Fix need_resched() when checking peempt Steven Rostedt @ 2011-06-15 9:50 ` tip-bot for Hillf Danton 0 siblings, 0 replies; 7+ messages in thread From: tip-bot for Hillf Danton @ 2011-06-15 9:50 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, hpa, mingo, dhillf, rostedt, yong.zhang0, tglx, mingo Commit-ID: 8dd0de8be31b4b966d17750a0b10df2f575c91ac Gitweb: http://git.kernel.org/tip/8dd0de8be31b4b966d17750a0b10df2f575c91ac Author: Hillf Danton <dhillf@gmail.com> AuthorDate: Tue, 14 Jun 2011 18:36:24 -0400 Committer: Ingo Molnar <mingo@elte.hu> CommitDate: Wed, 15 Jun 2011 09:50:32 +0200 sched: Fix need_resched() when checking peempt The RT preempt check tests the wrong task if NEED_RESCHED is set. It currently checks the local CPU task. It is supposed to check the task that is running on the runqueue we are about to wake another task on. Signed-off-by: Hillf Danton <dhillf@gmail.com> Reviewed-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20110614223657.450239027@goodmis.org Signed-off-by: Ingo Molnar <mingo@elte.hu> --- kernel/sched_rt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 88725c9..9b8d5dc 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -1096,7 +1096,7 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flag * to move current somewhere else, making room for our non-migratable * task. */ - if (p->prio == rq->curr->prio && !need_resched()) + if (p->prio == rq->curr->prio && !test_tsk_need_resched(rq->curr)) check_preempt_equal_prio(rq, p); #endif } ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq 2011-06-14 22:36 [PATCH 0/2] [GIT PULL][v3.0] sched: various fixes Steven Rostedt 2011-06-14 22:36 ` [PATCH 1/2] sched: Fix need_resched() when checking peempt Steven Rostedt @ 2011-06-14 22:36 ` Steven Rostedt 2011-06-15 0:40 ` Paul E. McKenney ` (2 more replies) 1 sibling, 3 replies; 7+ messages in thread From: Steven Rostedt @ 2011-06-14 22:36 UTC (permalink / raw) To: linux-kernel Cc: Ingo Molnar, Andrew Morton, Peter Zijlstra, Paul McKenney, Andrew Theurer [-- Attachment #1: 0002-sched-Check-if-lowest_mask-is-initialized-in-find_lo.patch --] [-- Type: text/plain, Size: 1269 bytes --] From: Steven Rostedt <rostedt@goodmis.org> On system boot up, the lowest_mask is initialized with early_initcall. But RT tasks may wake up on other early_initcall callers before the lowest_mask is initialized, causing a system crash. The commit d72bce0e67 rcu: Cure load woes was the first commit to wake up RT tasks in early init. Before this commit this bug should not happen. Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Reported-by: Andrew Theurer <habanero@linux.vnet.ibm.com> Tested-by: Andrew Theurer <habanero@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1308014683.9218.107.camel@gandalf.stny.rr.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> --- kernel/sched_rt.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 9b8d5dc..10d0182 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -1239,6 +1239,10 @@ static int find_lowest_rq(struct task_struct *task) int this_cpu = smp_processor_id(); int cpu = task_cpu(task); + /* Make sure the mask is initialized first */ + if (unlikely(!lowest_mask)) + return -1; + if (task->rt.nr_cpus_allowed == 1) return -1; /* No other targets possible */ -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq 2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt @ 2011-06-15 0:40 ` Paul E. McKenney 2011-06-15 8:17 ` Peter Zijlstra 2011-06-15 9:50 ` [tip:sched/urgent] sched: Check if lowest_mask is initialized in find_lowest_rq() tip-bot for Steven Rostedt 2 siblings, 0 replies; 7+ messages in thread From: Paul E. McKenney @ 2011-06-15 0:40 UTC (permalink / raw) To: Steven Rostedt Cc: linux-kernel, Ingo Molnar, Andrew Morton, Peter Zijlstra, Andrew Theurer On Tue, Jun 14, 2011 at 06:36:25PM -0400, Steven Rostedt wrote: > From: Steven Rostedt <rostedt@goodmis.org> > > On system boot up, the lowest_mask is initialized with early_initcall. > But RT tasks may wake up on other early_initcall callers before the > lowest_mask is initialized, causing a system crash. > > The commit d72bce0e67 rcu: Cure load woes > was the first commit to wake up RT tasks in early init. Before this > commit this bug should not happen. I never was able to reproduce this, but after adding Shaohua's patch, I need this one too on some systems. So: Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> > Reported-by: Andrew Theurer <habanero@linux.vnet.ibm.com> > Tested-by: Andrew Theurer <habanero@linux.vnet.ibm.com> > Link: http://lkml.kernel.org/r/1308014683.9218.107.camel@gandalf.stny.rr.com > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> > --- > kernel/sched_rt.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c > index 9b8d5dc..10d0182 100644 > --- a/kernel/sched_rt.c > +++ b/kernel/sched_rt.c > @@ -1239,6 +1239,10 @@ static int find_lowest_rq(struct task_struct *task) > int this_cpu = smp_processor_id(); > int cpu = task_cpu(task); > > + /* Make sure the mask is initialized first */ > + if (unlikely(!lowest_mask)) > + return -1; > + > if (task->rt.nr_cpus_allowed == 1) > return -1; /* No other targets possible */ > > -- > 1.7.4.4 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq 2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt 2011-06-15 0:40 ` Paul E. McKenney @ 2011-06-15 8:17 ` Peter Zijlstra 2011-06-15 9:50 ` [tip:sched/urgent] sched: Check if lowest_mask is initialized in find_lowest_rq() tip-bot for Steven Rostedt 2 siblings, 0 replies; 7+ messages in thread From: Peter Zijlstra @ 2011-06-15 8:17 UTC (permalink / raw) To: Steven Rostedt Cc: linux-kernel, Ingo Molnar, Andrew Morton, Paul McKenney, Andrew Theurer On Tue, 2011-06-14 at 18:36 -0400, Steven Rostedt wrote: > plain text document attachment > (0002-sched-Check-if-lowest_mask-is-initialized-in-find_lo.patch) > From: Steven Rostedt <rostedt@goodmis.org> > > On system boot up, the lowest_mask is initialized with early_initcall. > But RT tasks may wake up on other early_initcall callers before the > lowest_mask is initialized, causing a system crash. > > The commit d72bce0e67 rcu: Cure load woes > was the first commit to wake up RT tasks in early init. Before this > commit this bug should not happen. > Acked-by: Peter Zijlstra <peterz@infradead.org> > Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> > Reported-by: Andrew Theurer <habanero@linux.vnet.ibm.com> > Tested-by: Andrew Theurer <habanero@linux.vnet.ibm.com> > Link: http://lkml.kernel.org/r/1308014683.9218.107.camel@gandalf.stny.rr.com > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> > --- > kernel/sched_rt.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c > index 9b8d5dc..10d0182 100644 > --- a/kernel/sched_rt.c > +++ b/kernel/sched_rt.c > @@ -1239,6 +1239,10 @@ static int find_lowest_rq(struct task_struct *task) > int this_cpu = smp_processor_id(); > int cpu = task_cpu(task); > > + /* Make sure the mask is initialized first */ > + if (unlikely(!lowest_mask)) > + return -1; > + > if (task->rt.nr_cpus_allowed == 1) > return -1; /* No other targets possible */ > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:sched/urgent] sched: Check if lowest_mask is initialized in find_lowest_rq() 2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt 2011-06-15 0:40 ` Paul E. McKenney 2011-06-15 8:17 ` Peter Zijlstra @ 2011-06-15 9:50 ` tip-bot for Steven Rostedt 2 siblings, 0 replies; 7+ messages in thread From: tip-bot for Steven Rostedt @ 2011-06-15 9:50 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, hpa, mingo, peterz, paulmck, rostedt, habanero, tglx, mingo Commit-ID: 0da938c44921cfb690283d3b0c9c48a10375db2c Gitweb: http://git.kernel.org/tip/0da938c44921cfb690283d3b0c9c48a10375db2c Author: Steven Rostedt <rostedt@goodmis.org> AuthorDate: Tue, 14 Jun 2011 18:36:25 -0400 Committer: Ingo Molnar <mingo@elte.hu> CommitDate: Wed, 15 Jun 2011 11:44:48 +0200 sched: Check if lowest_mask is initialized in find_lowest_rq() On system boot up, the lowest_mask is initialized with an early_initcall(). But RT tasks may wake up on other early_initcall() callers before the lowest_mask is initialized, causing a system crash. Commit "d72bce0e67 rcu: Cure load woes" was the first commit to wake up RT tasks in early init. Before this commit this bug should not happen. Reported-by: Andrew Theurer <habanero@linux.vnet.ibm.com> Tested-by: Andrew Theurer <habanero@linux.vnet.ibm.com> Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20110614223657.824872966@goodmis.org Signed-off-by: Ingo Molnar <mingo@elte.hu> --- kernel/sched_rt.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 9b8d5dc..10d0182 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -1239,6 +1239,10 @@ static int find_lowest_rq(struct task_struct *task) int this_cpu = smp_processor_id(); int cpu = task_cpu(task); + /* Make sure the mask is initialized first */ + if (unlikely(!lowest_mask)) + return -1; + if (task->rt.nr_cpus_allowed == 1) return -1; /* No other targets possible */ ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-06-15 9:51 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-06-14 22:36 [PATCH 0/2] [GIT PULL][v3.0] sched: various fixes Steven Rostedt 2011-06-14 22:36 ` [PATCH 1/2] sched: Fix need_resched() when checking peempt Steven Rostedt 2011-06-15 9:50 ` [tip:sched/urgent] " tip-bot for Hillf Danton 2011-06-14 22:36 ` [PATCH 2/2] sched: Check if lowest_mask is initialized in find_lowest_rq Steven Rostedt 2011-06-15 0:40 ` Paul E. McKenney 2011-06-15 8:17 ` Peter Zijlstra 2011-06-15 9:50 ` [tip:sched/urgent] sched: Check if lowest_mask is initialized in find_lowest_rq() tip-bot for Steven Rostedt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox