Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992673Ab2JYUWG (ORCPT ); Thu, 25 Oct 2012 16:22:06 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:44994 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992660Ab2JYUWC (ORCPT ); Thu, 25 Oct 2012 16:22:02 -0400 Date: Thu, 25 Oct 2012 13:22:00 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Peter Zijlstra cc: Sasha Levin , Mel Gorman , Rik van Riel , Dave Jones , Andrew Morton , Linus Torvalds , KOSAKI Motohiro , bhutchings@solarflare.com, Konstantin Khlebnikov , Naoya Horiguchi , Hugh Dickins , KAMEZAWA Hiroyuki , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch for-3.7] mm, mempolicy: fix printing stack contents in numa_maps In-Reply-To: <1351175972.12171.14.camel@twins> Message-ID: References: <20121008150949.GA15130@redhat.com> <20121017040515.GA13505@redhat.com> <1351167554.23337.14.camel@twins> <1351175972.12171.14.camel@twins> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 25 On Thu, 25 Oct 2012, Peter Zijlstra wrote: > So I think the below should work, we hold the spinlock over both rb-tree > modification as sp free, this makes mpol_shared_policy_lookup() which > returns the policy with an incremented refcount work with just the > spinlock. > > Comments? > It's rather unfortunate that we need to protect modification with a spinlock and a mutex but since sharing was removed in commit 869833f2c5c6 ("mempolicy: remove mempolicy sharing") it requires that sp_alloc() is blockable to do the whole mpol_new() and rebind if necessary, which could require mm->mmap_sem; it's not as simple as just converting all the allocations to GFP_ATOMIC. It looks as though there is no other alternative other than protecting modification with both the spinlock and mutex, which is a clever solution, so it looks good to me, thanks! -- 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/