linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bu, Yitian" <ybu@qti.qualcomm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@kernel.org" <mingo@kernel.org>
Subject: RE: [PATCH] Fix rq->lock vs logbuf_lock unlock race
Date: Wed, 20 Feb 2013 11:24:36 +0000	[thread overview]
Message-ID: <E807E903FE6CBE4D95E420FBFCC273B827526E@nasanexd01h.na.qualcomm.com> (raw)
In-Reply-To: <1361355555.10155.14.camel@laptop>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1352 bytes --]

> Unfortunately that's not quite possible, rq->lock is really out of bounds. At
> one point I tried 'fixing' this but there's a whole bunch of nasty that's not
> going to go away.
> 
> I've since forgotten most of the details, but aside from logbuf problems
> there's a whole host of issues with the console drivers themselves as well.
> 
> If you really want to do this, use early_printk.

Hi Peter:

The patch  0b5e1c5255e("printk: Release console_sem after logbuf_lock" )
is as below:

			console_locked = 0;
-			up(&console_sem);
+			wake = 1;
 			retval = 0;
 		}
 	}
 	printk_cpu = UINT_MAX;
 	spin_unlock(&logbuf_lock);
+	if (wake)
+		up(&console_sem);
 	return retval;

the patch 07354eb1a74d1("locking, printk: Annotate logbuf_lock as raw ")
is as below:

	printk_cpu = UINT_MAX;
-	spin_unlock(&logbuf_lock);
 	if (wake)
 		up(&console_sem);
+	raw_spin_unlock(&logbuf_lock);
 	return retval;
 }

Note that the purpose of patch 07354eb1a74d1 is to use raw_spin_unlock
instead of spin_unlock, it is not supposed to change any lock sequences.

What I do is to revert this change to 0b5e1c5255e, and it is nothing to do with
how people use printk. It is just to recover a merge mistake.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

      reply	other threads:[~2013-02-20 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=E807E903FE6CBE4D95E420FBFCC273B827526E@nasanexd01h.na.qualcomm.com \
    --to=ybu@qti.qualcomm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.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;
as well as URLs for NNTP newsgroup(s).