From patchwork Thu Oct 16 09:25:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 400257 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 737BF1400BE for ; Thu, 16 Oct 2014 21:41:23 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 61DBB1A1793 for ; Thu, 16 Oct 2014 21:41:23 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 5E4D11A0290 for ; Thu, 16 Oct 2014 20:25:41 +1100 (AEDT) Received: by mail-wg0-f46.google.com with SMTP id l18so3240396wgh.17 for ; Thu, 16 Oct 2014 02:25:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=OK2oYS8V4d0hYJR5DjH8SM2FP8hLb/9/PUy0EGmhvYg=; b=ix5+6xjyc/Uov8PJyh19Grg7PHlRHIH5XPdqIhJyyZCt8/2k6imZuiEEIXm9tn3nzf sT24E+ESPMBHzILzQBSd6YbzET2z784wz2ZsUynEzpxZ7S8bqEO07UJrbkkCpZ2/gl+A U0JlqcvwdDgo+ck0Q9wT3DOw+gGDoIONybp/s+/4z4Oz2bpR63zrOTjhjpNmVp16gT1r iLymhPT5YDE750n3IBFtVwIFXD8MgZ/oR/qk9KkpWfzSufy9wXTHtjlTzmL0hFi2w7Y7 VpVNoI1QgiQOxC0ItX/MkLYKhaDuFwlVeEpEkfSSMoV7IMD2D7igYPZm6x9Zu5zxkBVN KxXg== X-Gm-Message-State: ALoCoQkYuuc0NKy4uBllF9YA5vZ1yhC0Dj51QSR/PWDOu/B35sVrUFJiEvNPhsYxT5w9UObVSinM X-Received: by 10.180.11.227 with SMTP id t3mr4199023wib.45.1413451536929; Thu, 16 Oct 2014 02:25:36 -0700 (PDT) Received: from linaro.org (marmot.wormnet.eu. [2a03:9800:10:2d:3203:b3a5:8bdc:5b68]) by mx.google.com with ESMTPSA id hr10sm1282332wib.9.2014.10.16.02.25.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Oct 2014 02:25:36 -0700 (PDT) Date: Thu, 16 Oct 2014 10:25:30 +0100 From: Steve Capper To: "Aneesh Kumar K.V" Subject: Re: [PATCH 1/2] mm: Update generic gup implementation to handle hugepage directory Message-ID: <20141016092529.GA1524@linaro.org> References: <1413390888-4934-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1413390888-4934-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Thu, 16 Oct 2014 21:40:05 +1100 Cc: Andrea Arcangeli , linux-arch@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@arm.linux.org.uk, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Oct 15, 2014 at 10:04:47PM +0530, Aneesh Kumar K.V wrote: > Update generic gup implementation with powerpc specific details. > On powerpc at pmd level we can have hugepte, normal pmd pointer > or a pointer to the hugepage directory. > > Signed-off-by: Aneesh Kumar K.V Hi, This patch causes compiler errors on arm and arm64 due to pgd_huge being undefined. I've attached a fixup below, this fixup will require that #define pgd_huge(pgd) 0 be added back into: arch/powerpc/include/asm/page.h For the second patch in this series. Another avenue would be to do something like: #ifndef pgd_huge #define pgd_huge(pgd) (0) #endif Then no changes would be required to arm and arm64 (or other architectures). To help with bisectability, could we please have a suitable fix applied to the two patches in the -mm tree: http://ozlabs.org/~akpm/mmots/broken-out/mm-update-generic-gup-implementation-to-handle-hugepage-directory.patch http://ozlabs.org/~akpm/mmots/broken-out/arch-powerpc-switch-to-generic-rcu-get_user_pages_fast.patch rather than applied afterwards? With pgd_huge(x) defined, this patch passes my futex test on arm (Arndale platform) and arm64(Juno). Cheers, diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 90aa4583..46f81fb 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -181,6 +181,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) +#define pgd_huge(pgd) (0) + #define pmd_none(pmd) (!pmd_val(pmd)) #define pmd_present(pmd) (pmd_val(pmd)) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 464c5ce..d4462ca 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -462,6 +462,8 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern pgd_t idmap_pg_dir[PTRS_PER_PGD]; +#define pgd_huge(pgd) (0) + /* * Encode and decode a swap entry: * bits 0-1: present (must be zero) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 65e12a2..6e6d338 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -138,7 +138,6 @@ static inline void hugetlb_show_meminfo(void) #define prepare_hugepage_range(file, addr, len) (-EINVAL) #define pmd_huge(x) 0 #define pud_huge(x) 0 -#define pgd_huge(x) 0 #define is_hugepage_only_range(mm, addr, len) 0 #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })