public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "Haoqiang Zheng" <hzheng@cs.columbia.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: linux hangs with printk on schedule()
Date: 04 Feb 2003 01:48:32 +0100	[thread overview]
Message-ID: <p733cn4rhun.fsf@oldwotan.suse.de> (raw)
In-Reply-To: "Haoqiang Zheng"'s message of "4 Feb 2003 01:38:59 +0100"

"Haoqiang Zheng" <hzheng@cs.columbia.edu> writes:

> I found Linux hangs when printk is inserted to the function schedule().
> Sure, it doesn't make much sense to add such a line to schedule(). But Linux
> shouldn't hang anyway, right? It's assumed that printk can be inserted
> safely to anywhere. So, is it a bug of Linux?
> 
> The linux I am running is 2.4.18-14, the same version used by Redhat 8.0.
> The scheduler is Ingo's O(1) scheduler.

printk can call wake_up to wake up the klogd daemon. This will deadlock
on aquiring the scheduler lock of the local run queue.

One way to avoid it is to wrap it like this:

	oops_in_progress++;
	printk(...);
	oops_in_progress--;

And no, it's not a bug in Linux.

-Andi

       reply	other threads:[~2003-02-04  0:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <05db01c2cbe5$4b4c34f0$9c2a3b80@zhengthinkpad.suse.lists.linux.kernel>
2003-02-04  0:48 ` Andi Kleen [this message]
2003-02-05  3:01 linux hangs with printk on schedule() Haoqiang Zheng
2003-02-06  2:18 ` Rick Lindsley
  -- strict thread matches above, loose matches on Subject: below --
2003-02-04  0:35 Haoqiang Zheng
2003-02-04  0:43 ` Robert Love

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=p733cn4rhun.fsf@oldwotan.suse.de \
    --to=ak@suse.de \
    --cc=hzheng@cs.columbia.edu \
    --cc=linux-kernel@vger.kernel.org \
    /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