Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044Ab2FRIU7 (ORCPT ); Mon, 18 Jun 2012 04:20:59 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:55696 "EHLO mail-qa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748Ab2FRIU5 (ORCPT ); Mon, 18 Jun 2012 04:20:57 -0400 Message-ID: <4FDEE4E6.6030205@gmail.com> Date: Mon, 18 Jun 2012 04:20:54 -0400 From: KOSAKI Motohiro User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: David Mackey CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com, Andi Kleen , penberg@kernel.org, cl@linux.com, kosaki.motohiro@gmail.com Subject: Re: [PATCH v5] slab/mempolicy: always use local policy from interrupt context References: <1338438844-5022-1-git-send-email-andi@firstfloor.org> <1339234803-21106-1-git-send-email-tdmackey@twitter.com> In-Reply-To: <1339234803-21106-1-git-send-email-tdmackey@twitter.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 40 (6/9/12 5:40 AM), David Mackey wrote: > From: Andi Kleen > > From: Andi Kleen > > slab_node() could access current->mempolicy from interrupt context. > However there's a race condition during exit where the mempolicy > is first freed and then the pointer zeroed. > > Using this from interrupts seems bogus anyways. The interrupt > will interrupt a random process and therefore get a random > mempolicy. Many times, this will be idle's, which noone can change. > > Just disable this here and always use local for slab > from interrupts. I also cleaned up the callers of slab_node a bit > which always passed the same argument. > > I believe the original mempolicy code did that in fact, > so it's likely a regression. > > v2: send version with correct logic > v3: simplify. fix typo. > Reported-by: Arun Sharma > Cc: penberg@kernel.org > Cc: cl@linux.com > Signed-off-by: Andi Kleen > [tdmackey@twitter.com: Rework control flow based on feedback from > cl@linux.com, fix logic, and cleanup current task_struct reference] > Signed-off-by: David Mackey Acked-by: KOSAKI Motohiro -- 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/