From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754303Ab1AKUgU (ORCPT ); Tue, 11 Jan 2011 15:36:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20571 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752569Ab1AKUgS (ORCPT ); Tue, 11 Jan 2011 15:36:18 -0500 Message-ID: <4D2CBF00.1080706@redhat.com> Date: Tue, 11 Jan 2011 15:35:12 -0500 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc13 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: Hugh Dickins CC: Andrew Morton , Mel Gorman , Naoya Horiguchi , "Jun'ichi Nomura" , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: fix migration hangs on anon_vma lock References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2011 02:08 AM, Hugh Dickins wrote: > Increased usage of page migration in mmotm reveals that the anon_vma > locking in unmap_and_move() has been deficient since 2.6.36 (or even > earlier). Review at the time of f18194275c39835cb84563500995e0d503a32d9a > "mm: fix hang on anon_vma->root->lock" missed the issue here: the anon_vma > to which we get a reference may already have been freed back to its slab > (it is in use when we check page_mapped, but that can change), and so its > anon_vma->root may be switched at any moment by reuse in anon_vma_prepare. > > Perhaps we could fix that with a get_anon_vma_unless_zero(), but let's not: > just rely on page_lock_anon_vma() to do all the hard thinking for us, then > we don't need any rcu read locking over here. > > In removing the rcu_unlock label: since PageAnon is a bit in page->mapping, > it's impossible for a !page->mapping page to be anon; but insert VM_BUG_ON > in case the implementation ever changes. > > Signed-off-by: Hugh Dickins > Cc: stable@kernel.org [2.6.37, 2.6.36] Reviewed-by: Rik van Riel -- All rights reversed From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id 059CA6B0092 for ; Tue, 11 Jan 2011 15:35:48 -0500 (EST) Message-ID: <4D2CBF00.1080706@redhat.com> Date: Tue, 11 Jan 2011 15:35:12 -0500 From: Rik van Riel MIME-Version: 1.0 Subject: Re: [PATCH] mm: fix migration hangs on anon_vma lock References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Hugh Dickins Cc: Andrew Morton , Mel Gorman , Naoya Horiguchi , Jun'ichi Nomura , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org List-ID: On 01/11/2011 02:08 AM, Hugh Dickins wrote: > Increased usage of page migration in mmotm reveals that the anon_vma > locking in unmap_and_move() has been deficient since 2.6.36 (or even > earlier). Review at the time of f18194275c39835cb84563500995e0d503a32d9a > "mm: fix hang on anon_vma->root->lock" missed the issue here: the anon_vma > to which we get a reference may already have been freed back to its slab > (it is in use when we check page_mapped, but that can change), and so its > anon_vma->root may be switched at any moment by reuse in anon_vma_prepare. > > Perhaps we could fix that with a get_anon_vma_unless_zero(), but let's not: > just rely on page_lock_anon_vma() to do all the hard thinking for us, then > we don't need any rcu read locking over here. > > In removing the rcu_unlock label: since PageAnon is a bit in page->mapping, > it's impossible for a !page->mapping page to be anon; but insert VM_BUG_ON > in case the implementation ever changes. > > Signed-off-by: Hugh Dickins > Cc: stable@kernel.org [2.6.37, 2.6.36] Reviewed-by: Rik van Riel -- All rights reversed -- 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/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org