Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759652AbZAHOi2 (ORCPT ); Thu, 8 Jan 2009 09:38:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752690AbZAHOiO (ORCPT ); Thu, 8 Jan 2009 09:38:14 -0500 Received: from e1.ny.us.ibm.com ([32.97.182.141]:41710 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbZAHOiM (ORCPT ); Thu, 8 Jan 2009 09:38:12 -0500 Subject: Re: "BUG: scheduling while atomic: pdflush/30/0x00000002" in latest git From: Dave Kleikamp To: Grissiom Cc: linux-kernel@vger.kernel.org, Arjan van de Ven , linux-fsdevel In-Reply-To: References: Content-Type: text/plain Date: Thu, 08 Jan 2009 08:37:52 -0600 Message-Id: <1231425472.21528.13.camel@norville.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2795 Lines: 74 Adding cc:lix-fsdevel On Thu, 2009-01-08 at 16:07 +0800, Grissiom wrote: > When I using the latest git version, I occasionally got this in dmesg: > > [ 2008.237234] BUG: scheduling while atomic: pdflush/30/0x00000002 > [ 2008.237240] 2 locks held by pdflush/30: > [ 2008.237244] #0: (mutex){--..}, at: [] sync_filesystems+0x11/0x120 > [ 2008.237258] #1: (sb_lock){--..}, at: [] > sync_filesystems+0x1b/0x120 > [ 2008.237277] Modules linked in: fuse ricoh_mmc b43 > [ 2008.237288] Pid: 30, comm: pdflush Not tainted > 2.6.28-g14-rfkill-nophy-ledon-07485-g9e42d0c #62 > [ 2008.237294] Call Trace: > [ 2008.237303] [] schedule+0x326/0x8e0 > [ 2008.237311] [] __lock_acquire+0x293/0xa20 > [ 2008.237321] [] mark_held_locks+0x67/0x80 > [ 2008.237330] [] _spin_unlock_irqrestore+0x4c/0x60 > [ 2008.237339] [] trace_hardirqs_on_caller+0x149/0x1a0 > [ 2008.237351] [] async_synchronize_cookie_special+0xb5/0x140 > [ 2008.237362] [] autoremove_wake_function+0x0/0x40 > [ 2008.237372] [] sync_filesystems+0x6c/0x120 > [ 2008.237381] [] pdflush+0x0/0x1e0 > [ 2008.237392] [] do_sync+0x20/0x60 > [ 2008.237402] [] sys_sync+0xa/0x10 > [ 2008.237412] [] pdflush+0x10e/0x1e0 > [ 2008.237420] [] trace_hardirqs_on_caller+0x149/0x1a0 > [ 2008.237429] [] laptop_flush+0x0/0x10 > [ 2008.237437] [] kthread+0x42/0x70 > [ 2008.237444] [] kthread+0x0/0x70 > [ 2008.237452] [] kernel_thread_helper+0x7/0x14 > (repeat some times) > The offender is http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=efaee192 async_synchronize_full_special() shouldn't be called while holding a spinlock, sb_lock. I think this patch should fix it. Arjan, would this work? Signed-off-by: Dave Kleikamp diff --git a/fs/super.c b/fs/super.c index cb20744..7d67387 100644 --- a/fs/super.c +++ b/fs/super.c @@ -458,7 +458,6 @@ void sync_filesystems(int wait) if (sb->s_flags & MS_RDONLY) continue; sb->s_need_sync_fs = 1; - async_synchronize_full_special(&sb->s_async_list); } restart: @@ -471,6 +470,7 @@ restart: sb->s_count++; spin_unlock(&sb_lock); down_read(&sb->s_umount); + async_synchronize_full_special(&sb->s_async_list); if (sb->s_root && (wait || sb->s_dirt)) sb->s_op->sync_fs(sb, wait); up_read(&sb->s_umount); -- David Kleikamp IBM Linux Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/