From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702Ab1DNUz1 (ORCPT ); Thu, 14 Apr 2011 16:55:27 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:48642 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281Ab1DNUzZ convert rfc822-to-8bit (ORCPT ); Thu, 14 Apr 2011 16:55:25 -0400 MIME-Version: 1.0 In-Reply-To: <20110414202445.GA6173@liondog.tnic> References: <20110414202445.GA6173@liondog.tnic> From: Linus Torvalds Date: Thu, 14 Apr 2011 13:55:02 -0700 Message-ID: Subject: Re: Linux 2.6.39-rc3 To: Borislav Petkov , Jens Axboe , Linus Torvalds , Linux Kernel Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2011 at 1:24 PM, Borislav Petkov wrote: > > Yep, I had to hit a buglet too. Looks like block layer, ->request_fn > (do_ide_request) called in IRQ disabled region. Process is blkid, i.e. > some udev helper. Kernel is -rc3 + Joerg's USB quirk fix which should be > unrelated. I think this particular backtrace should be fixed by commit 6631e635c65d ("block: don't flush plugged IO on forced preemtion scheduling"), although even without preempt scheduling, I don't think it's at all ok to sleep inside __blk_run_queue. Jens? Even from a _regular_ schedule, it would not be ok if we end up sleeping - we're caching things like the request-queue, and we have preempt_disable() inside the scheduler for a very good reason. So if the unplugging can cause sleeping, that's a problem. See the /* HLD do_request() callback might sleep, make sure it's okay */ might_sleep(); comment in drivers/ide/ide-io.c. Hmm? Linus --- > Happens when I put a cd in the drive. More info upon request. > > [20933.365059] BUG: sleeping function called from invalid context at drivers/ide/ide-io.c:468 > [20933.365113] in_atomic(): 1, irqs_disabled(): 0, pid: 5817, name: blkid > [20933.365166] no locks held by blkid/5817. > [20933.365193] Pid: 5817, comm: blkid Not tainted 2.6.39-rc3-00001-g1b521ee #9 > [20933.365228] Call Trace: > [20933.365282]  [] __might_sleep+0x103/0x108 > [20933.365312]  [] do_ide_request+0x4a/0x58e > [20933.365362]  [] ? cfq_prio_tree_add+0xb3/0xc2 > [20933.365390]  [] ? cfq_add_rq_rb+0xb1/0xc5 > [20933.365437]  [] ? cfq_insert_request+0x72/0x433 > [20933.365465]  [] __blk_run_queue+0x80/0xee > [20933.365511]  [] flush_plug_list+0xfb/0x139 > [20933.365540]  [] ? sleep_on_page+0x12/0x12 > [20933.365586]  [] __blk_flush_plug+0x1a/0x3a > [20933.365613]  [] schedule+0x3d2/0xb4b > [20933.365663]  [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [20933.365692]  [] ? do_softirq+0x77/0x85 > [20933.365739]  [] ? retint_restore_args+0xe/0xe > [20933.365767]  [] ? sleep_on_page+0x12/0x12 > [20933.365812]  [] preempt_schedule+0x37/0x4b > [20933.365839]  [] _raw_spin_unlock_irqrestore+0x64/0x69 > [20933.365878]  [] prepare_to_wait_exclusive+0x6c/0x77 > [20933.365925]  [] __wait_on_bit_lock+0x34/0x8f > [20933.365953]  [] __lock_page_killable+0x66/0x6d > [20933.366000]  [] ? autoremove_wake_function+0x3d/0x3d > [20933.366090]  [] generic_file_aio_read+0x491/0x67c > [20933.366123]  [] do_sync_read+0xcb/0x108 > [20933.366183]  [] ? trace_hardirqs_on+0xd/0xf > [20933.366217]  [] vfs_read+0xb3/0x13b > [20933.366270]  [] sys_read+0x4d/0x77 > [20933.366303]  [] system_call_fastpath+0x16/0x1b > > Thanks. > > -- > Regards/Gruss, >    Boris. >