From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752238AbZJKIKA (ORCPT ); Sun, 11 Oct 2009 04:10:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751787AbZJKIJ6 (ORCPT ); Sun, 11 Oct 2009 04:09:58 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:49411 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbZJKIJz (ORCPT ); Sun, 11 Oct 2009 04:09:55 -0400 Date: Sun, 11 Oct 2009 01:09:10 -0700 From: Andrew Morton To: Alexey Dobriyan Cc: linux-kernel@vger.kernel.org, KOSAKI Motohiro Subject: Re: 2.6.32-rc2-xxx: bdev_lock: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage Message-Id: <20091011010910.7fdf357c.akpm@linux-foundation.org> In-Reply-To: <20091007035310.GA30833@x200> References: <20091007035310.GA30833@x200> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Oct 2009 07:53:10 +0400 Alexey Dobriyan wrote: > Happened during page allocation failure: > > ... > > [] print_usage_bug+0x190/0x1f0 > [] mark_lock+0x48f/0x690 > [] ? check_usage_forwards+0x0/0x110 > [] __lock_acquire+0x6e4/0x1cf0 > [] ? vprintk+0x2e2/0x530 > [] ? _spin_unlock+0x30/0x50 > [] ? trace_hardirqs_off+0xd/0x10 > [] ? netpoll_send_skb+0x213/0x260 > [] ? printk+0x67/0x69 > [] lock_acquire+0x5c/0x80 > [] ? nr_blockdev_pages+0x17/0x80 > [] _spin_lock+0x36/0x50 > [] ? nr_blockdev_pages+0x17/0x80 > [] nr_blockdev_pages+0x17/0x80 > [] show_free_areas+0x99/0x7f0 > [] ? trace_hardirqs_off+0xd/0x10 > [] ? _spin_unlock_irqrestore+0x42/0x70 > [] ? release_console_sem+0x1e5/0x230 > [] ? vprintk+0x2e2/0x530 > [] ? __module_text_address+0xd/0x70 > [] ? print_context_stack+0x81/0xf0 > [] ? printk+0x67/0x69 > [] ? dump_trace+0x128/0x300 > [] ? show_trace_log_lvl+0x57/0x70 > [] show_mem+0x24/0x1e0 > [] ? dump_stack+0x72/0x7b > [] __alloc_pages_nodemask+0x628/0x6c0 > [] ? _spin_unlock+0x30/0x50 > [] __slab_alloc+0x57b/0x710 > [] ? mark_held_locks+0x6c/0x90 > [] ? __netdev_alloc_skb+0x1f/0x40 > [] ? kmem_cache_alloc+0xc5/0x110 > [] __kmalloc_track_caller+0x117/0x150 > [] ? __netdev_alloc_skb+0x1f/0x40 > [] __alloc_skb+0x6e/0x170 > [] __netdev_alloc_skb+0x1f/0x40 > [] ? rtl8139_poll+0x4b/0x400 > [] rtl8139_poll+0x146/0x400 > [] net_rx_action+0x183/0x260 > [] ? net_rx_action+0xfc/0x260 > [] __do_softirq+0xd0/0x180 > [] call_softirq+0x1c/0x30 > [] do_softirq+0x7d/0xc0 > [] irq_exit+0x8d/0xb0 > [] do_IRQ+0x77/0xf0 > [] ret_from_intr+0x0/0xf > [] ? _spin_unlock_irqrestore+0x68/0x70 > [] ? debug_check_no_obj_freed+0x17c/0x1f0 > [] ? free_hot_cold_page+0xd1/0x320 > [] ? __pagevec_free+0x39/0x50 > [] ? release_pages+0x228/0x240 > [] ? free_pages_and_swap_cache+0x8d/0xb0 > [] ? exit_mmap+0x188/0x1a0 > [] ? mmput+0x57/0xe0 > [] ? exit_mm+0xfc/0x140 > [] ? do_exit+0x6f0/0x780 > [] ? up_read+0x26/0x30 > [] ? retint_swapgs+0xe/0x13 > [] ? do_group_exit+0x41/0xc0 > [] ? sys_exit_group+0x12/0x20 > [] ? system_call_fastpath+0x16/0x1b Yep, we knew about that but appear to have forgotten about it. Let's just revert: From: Andrew Morton Revert commit 71de1ccbe1fb40203edd3beb473f8580d917d2ca Author: KOSAKI Motohiro AuthorDate: Mon Sep 21 17:01:31 2009 -0700 Commit: Linus Torvalds CommitDate: Tue Sep 22 07:17:27 2009 -0700 mm: oom analysis: add buffer cache information to show_free_areas() show_free_areas() is called during page allocation failures, and page allocation failures can occur in any calling context. But nr_blockdev_pages() takes VFS locks which should not be taken from hard IRQ context (at least). The result is lockdep warnings (and deadlockability) during page allocation failures. Cc: KOSAKI Motohiro Cc: Wu Fengguang Cc: Rik van Riel Cc: David Rientjes Cc: Alexey Dobriyan Signed-off-by: Andrew Morton --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -puN mm/page_alloc.c~revert-mm-oom-analysis-add-buffer-cache-information-to-show_free_areas mm/page_alloc.c --- a/mm/page_alloc.c~revert-mm-oom-analysis-add-buffer-cache-information-to-show_free_areas +++ a/mm/page_alloc.c @@ -2183,7 +2183,7 @@ void show_free_areas(void) printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n" " active_file:%lu inactive_file:%lu isolated_file:%lu\n" " unevictable:%lu" - " dirty:%lu writeback:%lu unstable:%lu buffer:%lu\n" + " dirty:%lu writeback:%lu unstable:%lu\n" " free:%lu slab_reclaimable:%lu slab_unreclaimable:%lu\n" " mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n", global_page_state(NR_ACTIVE_ANON), @@ -2196,7 +2196,6 @@ void show_free_areas(void) global_page_state(NR_FILE_DIRTY), global_page_state(NR_WRITEBACK), global_page_state(NR_UNSTABLE_NFS), - nr_blockdev_pages(), global_page_state(NR_FREE_PAGES), global_page_state(NR_SLAB_RECLAIMABLE), global_page_state(NR_SLAB_UNRECLAIMABLE), _