From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268Ab0DLPdd (ORCPT ); Mon, 12 Apr 2010 11:33:33 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:38575 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752058Ab0DLPdc (ORCPT ); Mon, 12 Apr 2010 11:33:32 -0400 Subject: Re: [PATCH -v2] rmap: make anon_vma_prepare link in all the anon_vmas of a mergeable VMA From: Peter Zijlstra To: Minchan Kim Cc: Linus Torvalds , Borislav Petkov , Johannes Weiner , KOSAKI Motohiro , Rik van Riel , Andrew Morton , Linux Kernel Mailing List , Lee Schermerhorn , Nick Piggin , Andrea Arcangeli , Hugh Dickins , sgunderson@bigfoot.com In-Reply-To: References: <20100409191425.GB10780@a1.tnic> <20100410003110.GI28964@cmpxchg.org> <20100410072714.GA9246@liondog.tnic> <20100410112639.GA24708@a1.tnic> <20100410163828.GA25579@a1.tnic> <1271083207.4807.18.camel@twins> Content-Type: text/plain; charset="UTF-8" Date: Mon, 12 Apr 2010 17:33:25 +0200 Message-ID: <1271086405.20295.3382.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2010-04-13 at 00:17 +0900, Minchan Kim wrote: > > Concurrent reclaim/gup/whatever could still have a count out on the page > > delaying the actual free beyond the tlb gather RCU section. > > anon_vma lock is just valid in case of page_mapped. > if reclaim/gup/whatever want to use anon_vma, it should check with page_mapped. > And last put_page doesn't touch anon_vma for freeing the page so I > think it's not a problem. Do I miss something? Hmm, I think you're right. The race I was thinking of makes the page_lock_anon_vma() RCU section overlap with that of the mmu_gather, which ensures the thing is long enough, or hits the !_mapcount case. I'm not sure there are other page->mapping users that are interesting.