From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx199.postini.com [74.125.245.199]) by kanga.kvack.org (Postfix) with SMTP id E78C66B0070 for ; Thu, 25 Oct 2012 08:20:09 -0400 (EDT) Message-ID: <1351167554.23337.14.camel@twins> Subject: Re: [patch for-3.7] mm, mempolicy: fix printing stack contents in numa_maps From: Peter Zijlstra Date: Thu, 25 Oct 2012 14:19:14 +0200 In-Reply-To: References: <20121008150949.GA15130@redhat.com> <20121017040515.GA13505@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes 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 On Wed, 2012-10-24 at 17:08 -0700, David Rientjes wrote: > Ok, this looks the same but it's actually a different issue:=20 > mpol_misplaced(), which now only exists in linux-next and not in 3.7-rc2,= =20 > calls get_vma_policy() which may take the shared policy mutex. This=20 > happens while holding page_table_lock from do_huge_pmd_numa_page() but= =20 > also from do_numa_page() while holding a spinlock on the ptl, which is= =20 > coming from the sched/numa branch. >=20 > Is there anyway that we can avoid changing the shared policy mutex back= =20 > into a spinlock (it was converted in b22d127a39dd ["mempolicy: fix a race= =20 > in shared_policy_replace()"])? >=20 > Adding Peter, Rik, and Mel to the cc.=20 Urgh, crud I totally missed that. So the problem is that we need to compute if the current page is placed 'right' while holding pte_lock in order to avoid multiple pte_lock acquisitions on the 'fast' path. I'll look into this in a bit, but one thing that comes to mind is having both a spnilock and a mutex and require holding both for modification while either one is sufficient for read. That would allow sp_lookup() to use the spinlock, while insert and replace can hold both. Not sure it will work for this, need to stare at this code a little more. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org