From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 048A41A0130 for ; Sat, 25 Oct 2014 21:30:26 +1100 (AEDT) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 25 Oct 2014 20:30:24 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 338D53578048 for ; Sat, 25 Oct 2014 21:30:18 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9PAWIqd29229218 for ; Sat, 25 Oct 2014 21:32:18 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9PAUGCn021288 for ; Sat, 25 Oct 2014 21:30:17 +1100 From: "Aneesh Kumar K.V" To: David Miller , akpm@linux-foundation.org Subject: Re: [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory In-Reply-To: <20141023.184035.388557314666522484.davem@davemloft.net> References: <1413520687-31729-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20141022160224.9c2268795e55d5a2eff5b94d@linux-foundation.org> <20141023.184035.388557314666522484.davem@davemloft.net> Date: Sat, 25 Oct 2014 16:00:05 +0530 Message-ID: <87ppdg30ia.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Cc: aarcange@redhat.com, linux-arch@vger.kernel.org, steve.capper@linaro.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , David Miller writes: > Hey guys, was looking over the generic GUP while working on a sparc64 > issue and I noticed that you guys do speculative page gets, and after > talking with Johannes Weiner (CC:'d) about this we don't see how it > could be necessary. > > If interrupts are disabled during the page table scan (which they > are), no IPI tlb flushes can arrive. Therefore any removal from the > page tables is guarded by interrupts being re-enabled. And as a > result, page counts of pages we see in the page tables must always > have a count > 0. > > x86 does direct atomic_add() on &page->_count because of this > invariant and I would rather see the generic version do this too. But that won't work with RCU GUP. For example on powerpc the tlb flush doesn't involve an IPI and we can essentially find page count 0. -aneesh