From: tip-bot for Peter Zijlstra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, wanpeng.li@hotmail.com,
luca.abeni@unitn.it, tglx@linutronix.de, mingo@kernel.org,
peterz@infradead.org, hpa@zytor.com,
torvalds@linux-foundation.org, efault@gmx.de, juri.lelli@arm.com
Subject: [tip:sched/urgent] sched/core: Add missing lockdep_unpin() annotations
Date: Fri, 23 Oct 2015 03:03:35 -0700 [thread overview]
Message-ID: <tip-0aaafaabfcba8aa991913cd3280a5dbf7f111a2a@git.kernel.org> (raw)
In-Reply-To: <20151023095008.GY17308@twins.programming.kicks-ass.net>
Commit-ID: 0aaafaabfcba8aa991913cd3280a5dbf7f111a2a
Gitweb: http://git.kernel.org/tip/0aaafaabfcba8aa991913cd3280a5dbf7f111a2a
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Fri, 23 Oct 2015 11:50:08 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 23 Oct 2015 12:02:10 +0200
sched/core: Add missing lockdep_unpin() annotations
Luca and Wanpeng reported two missing annotations that led to
false lockdep complaints. Add the missing annotations.
Reported-by: Luca Abeni <luca.abeni@unitn.it>
Reported-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: cbce1a686700 ("sched,lockdep: Employ lock pinning")
Link: http://lkml.kernel.org/r/20151023095008.GY17308@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/core.c | 9 ++++++++-
kernel/sched/deadline.c | 9 ++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5bd7d60..bcd214e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2366,8 +2366,15 @@ void wake_up_new_task(struct task_struct *p)
trace_sched_wakeup_new(p);
check_preempt_curr(rq, p, WF_FORK);
#ifdef CONFIG_SMP
- if (p->sched_class->task_woken)
+ if (p->sched_class->task_woken) {
+ /*
+ * Nothing relies on rq->lock after this, so its fine to
+ * drop it.
+ */
+ lockdep_unpin_lock(&rq->lock);
p->sched_class->task_woken(rq, p);
+ lockdep_pin_lock(&rq->lock);
+ }
#endif
task_rq_unlock(rq, p, &flags);
}
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 142df26..8b0a15e 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -668,8 +668,15 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
* Queueing this task back might have overloaded rq, check if we need
* to kick someone away.
*/
- if (has_pushable_dl_tasks(rq))
+ if (has_pushable_dl_tasks(rq)) {
+ /*
+ * Nothing relies on rq->lock after this, so its safe to drop
+ * rq->lock.
+ */
+ lockdep_unpin_lock(&rq->lock);
push_dl_task(rq);
+ lockdep_pin_lock(&rq->lock);
+ }
#endif
unlock:
next prev parent reply other threads:[~2015-10-23 10:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 13:20 lockdep-related warning in kernel/sched/deadline.c::find_lock_later_rq() Luca Abeni
2015-10-22 5:35 ` Wanpeng Li
2015-10-22 7:06 ` Luca Abeni
2015-10-23 9:50 ` Peter Zijlstra
2015-10-23 10:03 ` tip-bot for Peter Zijlstra [this message]
2015-10-23 20:10 ` Luca Abeni
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=tip-0aaafaabfcba8aa991913cd3280a5dbf7f111a2a@git.kernel.org \
--to=tipbot@zytor.com \
--cc=efault@gmx.de \
--cc=hpa@zytor.com \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luca.abeni@unitn.it \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=wanpeng.li@hotmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.