public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jiri Slaby <jslaby@suse.cz>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	Alan Cox <alan@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: uart_startup: GFP_KERNEL allocation with IRQs disabled
Date: Fri, 3 Aug 2012 11:10:32 +0100	[thread overview]
Message-ID: <20120803101032.GD23464@ZenIV.linux.org.uk> (raw)
In-Reply-To: <501B9BF1.2050006@suse.cz>

On Fri, Aug 03, 2012 at 11:37:53AM +0200, Jiri Slaby wrote:
> On 08/03/2012 03:46 AM, Fengguang Wu wrote:
> > Hi all,
> 
> Hi,
> 
> > The IRQ should be disabled somewhere in the path walk, which makes
> > the GFP_KERNEL allocation in uart_startup() no longer valid..
> > 
> > [    0.499537] kworker/u:1 (29) used greatest stack depth: 7156 bytes left
> > [    0.500947] ------------[ cut here ]------------
> > [    0.501445] WARNING: at /c/kernel-tests/src/stable/kernel/lockdep.c:2739 lockdep_trace_alloc+0x86/0xb2()
> > [    0.502413] Modules linked in:
> > [    0.502766] Pid: 1, comm: init Not tainted 3.5.0-01258-g1ade992 #182
> > [    0.503419] Call Trace:
> ...
> > [    0.504381]  [<c1079e7d>] get_zeroed_page+0xd/0xf
> > [    0.504381]  [<c10f976f>] uart_startup.part.8+0x46/0x152
> > [    0.504381]  [<c10f745f>] ? tty_port_tty_set+0x37/0x3c
> > [    0.504381]  [<c10fa175>] uart_open+0xc9/0x10b
> > [    0.504381]  [<c10fa0ac>] ? uart_suspend_port+0x229/0x229
> > [    0.504381]  [<c10f1bc2>] tty_open+0x26b/0x3d3
> > [    0.504381]  [<c109872a>] chrdev_open+0xf7/0x117
> 
> This does not make sense to me. I would not blame TTY/serial for this.
> There is somebody who forgot to enable interrupts somewhere. Could you
> enable DEBUG_ATOMIC_SLEEP? It might trigger earlier revealing us the
> culprit.

That'd be me, I'm afraid.  With changes in signal.git#execve2 we need to set ->flags in
start_thread() on i386 as well, not only on amd64 (where we were already doing that).
Incremental follows, fix folded and repushed...

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 75fcad1..9e84b4f 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -190,6 +190,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	regs->cs		= __USER_CS;
 	regs->ip		= new_ip;
 	regs->sp		= new_sp;
+	regs->flags		= X86_EFLAGS_IF;
 	/*
 	 * Free the old FP and other extended state
 	 */

      parent reply	other threads:[~2012-08-03 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  1:46 uart_startup: GFP_KERNEL allocation with IRQs disabled Fengguang Wu
2012-08-03  9:37 ` Jiri Slaby
2012-08-03  9:51   ` Fengguang Wu
2012-08-03 10:10   ` Al Viro [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=20120803101032.GD23464@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=alan@linux.intel.com \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --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