public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: R.Oehler@GDImbH.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 2.4.10: printk() deadlocks
Date: Thu, 25 Oct 2001 10:23:12 -0700	[thread overview]
Message-ID: <3BD84A80.BB08EBD8@zip.com.au> (raw)
In-Reply-To: <XFMail.20011025144450.R.Oehler@GDImbH.com>

R.Oehler@GDImbH.com wrote:
> 
> Hi, andrew,
> 
> currently I'm porting our WORM filesystem (OWFS) from kernel
> 2.4.0 to kernel 2.4.10. I'm used to rely on printk() to be callable
> from every place in the kernel, but now I experience deadlocks
> when calling it from some places within our filesystem.
> (I'm writing a ~600 lines in 2 seconds and I enlarged the buffer size
> to 1MB, what worked perfectly in the past.)
> The call-chain is:
> ...

But it isn't deadlocked.  The EIP points at this statement

                spin_unlock_irqrestore(&logbuf_lock, flags);
-->             console_may_schedule = 0;
                release_console_sem();

in printk().  So the output is about to come out to
the console device(s).

> A diff between printk.c of the two kernels shows:
>  * Rewrote bits to get rid of console_lock
>  *      01Mar01 Andrew Morton <andrewm@uow.edu.au>
> 
> Please could you tell me a workaround or some possibility to get out
> of this situation? I think printk() should be an absolutely reliable
> function which never schedules.

printk() doesn't schedule.  However, userspace processes which
write to /dev/ttyX *do* schedule, and the two paths use the same
code and have to lock against each other, etc.  That's why it's all
rather unclear.

Sorry, but I think you must be doing something strange to make this
happen - can you please diagnose a little further?  Investigate
further with kdb?  Can you send me the wherewithals to reproduce
it?  Are you running SMP?

-

  reply	other threads:[~2001-10-25 17:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-25 12:44 Linux 2.4.10: printk() deadlocks R.Oehler
2001-10-25 17:23 ` Andrew Morton [this message]
2001-10-26  7:05   ` R.Oehler

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=3BD84A80.BB08EBD8@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=R.Oehler@GDImbH.com \
    --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