linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix rq->lock vs logbuf_lock unlock race
@ 2013-02-18 12:53 Bu, Yitian
  2013-02-18 14:17 ` [tip:core/printk] printk: Fix rq-> lock vs logbuf_lock unlock lock inversion tip-bot for Bu, Yitian
  2013-02-20  8:45 ` [PATCH] Fix rq->lock vs logbuf_lock unlock race Peter Zijlstra
  0 siblings, 2 replies; 6+ messages in thread
From: Bu, Yitian @ 2013-02-18 12:53 UTC (permalink / raw)
  To: tglx, a.p.zijlstra; +Cc: linux-kernel, mingo

This patch is for kernel V3.7.9

>From 8796f4a2175a323aaa49ea8dd0fe68678dd5dccd Mon Sep 17 00:00:00 2001
From: ybu <ybu@qti.qualcomm.com>
Date: Mon, 18 Feb 2013 19:52:01 +0800
Subject: [PATCH] Fix rq->lock vs logbuf_lock unlock race

fix up the fallout from commit 07354eb1a74d1 ("locking printk:
Annotate logbuf_lock as raw")
Release console_sem after unlocking the logbuf_lock avoids some lock
inversion troubles between logbuf_lock and rq->lock.

Change-Id: I782c1d16e0e82bd156699f0f205f19781c4819e0
Signed-off-by: ybu <ybu@qti.qualcomm.com>
---
 kernel/printk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index f8e0b5a..3a49454 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1356,9 +1356,9 @@ static int console_trylock_for_printk(unsigned int cpu)
 		}
 	}
 	logbuf_cpu = UINT_MAX;
+	raw_spin_unlock(&logbuf_lock);
 	if (wake)
 		up(&console_sem);
-	raw_spin_unlock(&logbuf_lock);
 	return retval;
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-20 11:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18 12:53 [PATCH] Fix rq->lock vs logbuf_lock unlock race Bu, Yitian
2013-02-18 14:17 ` [tip:core/printk] printk: Fix rq-> lock vs logbuf_lock unlock lock inversion tip-bot for Bu, Yitian
2013-02-20  8:45 ` [PATCH] Fix rq->lock vs logbuf_lock unlock race Peter Zijlstra
2013-02-20  9:38   ` Bu, Yitian
2013-02-20 10:19     ` Peter Zijlstra
2013-02-20 11:24       ` Bu, Yitian

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).