From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by kanga.kvack.org (Postfix) with ESMTP id D88876B0069 for ; Sat, 25 Oct 2014 06:30:31 -0400 (EDT) Received: by mail-pd0-f174.google.com with SMTP id p10so2833455pdj.33 for ; Sat, 25 Oct 2014 03:30:31 -0700 (PDT) Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com. [202.81.31.142]) by mx.google.com with ESMTPS id et10si6182234pad.131.2014.10.25.03.30.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Oct 2014 03:30:30 -0700 (PDT) Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 25 Oct 2014 20:30:26 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 8BF5F2BB0051 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 d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9PAU2U236569240 for ; Sat, 25 Oct 2014 21:30:03 +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 s9PAUGCh021288 for ; Sat, 25 Oct 2014 21:30:17 +1100 From: "Aneesh Kumar K.V" 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 Sender: owner-linux-mm@kvack.org List-ID: To: David Miller , akpm@linux-foundation.org Cc: steve.capper@linaro.org, aarcange@redhat.com, benh@kernel.crashing.org, mpe@ellerman.id.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org, hannes@cmpxchg.org 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 -- 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