Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753663Ab2E2Lof (ORCPT ); Tue, 29 May 2012 07:44:35 -0400 Received: from shutemov.name ([176.9.204.213]:43030 "EHLO shutemov.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062Ab2E2Lod (ORCPT ); Tue, 29 May 2012 07:44:33 -0400 Date: Tue, 29 May 2012 14:45:54 +0300 From: "Kirill A. Shutemov" To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter Subject: Re: [PATCH 23/35] autonuma: core Message-ID: <20120529114554.GA7017@shutemov.name> References: <1337965359-29725-1-git-send-email-aarcange@redhat.com> <1337965359-29725-24-git-send-email-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1337965359-29725-24-git-send-email-aarcange@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2795 Lines: 88 On Fri, May 25, 2012 at 07:02:27PM +0200, Andrea Arcangeli wrote: > +static int knumad_do_scan(void) > +{ ... > + if (knumad_test_exit(mm) || !vma) { > + mm_autonuma = mm->mm_autonuma; > + if (mm_autonuma->mm_node.next != &knumad_scan.mm_head) { > + mm_autonuma = list_entry(mm_autonuma->mm_node.next, > + struct mm_autonuma, mm_node); > + knumad_scan.mm = mm_autonuma->mm; > + atomic_inc(&knumad_scan.mm->mm_count); > + knumad_scan.address = 0; > + knumad_scan.mm->mm_autonuma->numa_fault_pass++; > + } else > + knumad_scan.mm = NULL; knumad_scan.mm should be nulled only after list_del otherwise you will have race with autonuma_exit(): [ 22.905208] ------------[ cut here ]------------ [ 23.003620] WARNING: at /home/kas/git/public/linux/lib/list_debug.c:50 __list_del_entry+0x63/0xd0() [ 23.003621] Hardware name: QSSC-S4R [ 23.003624] list_del corruption, ffff880771a49300->next is LIST_POISON1 (dead000000100100) [ 23.003626] Modules linked in: megaraid_sas [ 23.003629] Pid: 569, comm: udevd Not tainted 3.4.0+ #31 [ 23.003630] Call Trace: [ 23.003640] [] warn_slowpath_common+0x7f/0xc0 [ 23.003643] [] warn_slowpath_fmt+0x46/0x50 [ 23.003645] [] __list_del_entry+0x63/0xd0 [ 23.003648] [] list_del+0x11/0x40 [ 23.003654] [] autonuma_exit+0x5f/0xb0 [ 23.003657] [] mmput+0x7b/0x120 [ 23.003663] [] exit_mm+0x108/0x130 [ 23.003674] [] ? _raw_spin_unlock_irq+0x2b/0x40 [ 23.003677] [] do_exit+0x14a/0x8d0 [ 23.003682] [] ? mntput+0x26/0x40 [ 23.003688] [] ? fput+0x1c9/0x270 [ 23.003693] [] ? lockdep_sys_exit_thunk+0x35/0x67 [ 23.003696] [] do_group_exit+0x4f/0xc0 [ 23.003698] [] sys_exit_group+0x17/0x20 [ 23.003703] [] system_call_fastpath+0x16/0x1b [ 23.003705] ---[ end trace 8b21c7adb0af191b ]--- > + > + if (knumad_test_exit(mm)) > + list_del(&mm->mm_autonuma->mm_node); > + else > + mm_numa_fault_flush(mm); > + > + mmdrop(mm); > + } > + > + return progress; > +} ... > + > +static int knuma_scand(void *none) > +{ ... > + mm = knumad_scan.mm; > + knumad_scan.mm = NULL; The same problem here. > + if (mm) > + list_del(&mm->mm_autonuma->mm_node); > + mutex_unlock(&knumad_mm_mutex); > + > + if (mm) > + mmdrop(mm); > + > + return 0; > +} -- Kirill A. Shutemov -- 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/