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: 38799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5356820973 for ; Thu, 16 Oct 2014 09:25:47 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id m8sf13389967obr.8 for ; Thu, 16 Oct 2014 02:25:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=L4AZePvo4jP9B5Uvkd4d/Td+DdDKbgM+OzdP3FHaRWg=; b=YaeaHWWjwI6iD6ZytZzY9x00Fn99wQBCLV2XQUTx/UWPjiKXE+X2/GM6+QuGRefe4Y zqBJjYAp4XpD1Lug/x+Ctt/s3Ky40PNiK6DsnHTnaTHGdfD9Ovo6YBdJG+80ogcnWFVa EsNDqRmgR0TALTNR69O+BZkWFcD0t1fBD4/FhonRvX4rhxWbgA4NMALTYhnYZ/2wKMAU TPkfdA7sGf7Q7zrjtUr10xoc9IhDK8Y68GYiTDZIKriCQrpG4MKrOXscfRhOP0VuO+SD NAbeQZ6P2NXUr5DyFJVXGZFPmteRaJS8elxXfQMPvZq0EftQEANTbHA69OgHmdShU9EL tNsQ== X-Gm-Message-State: ALoCoQkwTtBMyWqdLkJTDvc4NlsALB322H7fHpub5/6BwDrxIoE617SpvH/MFbW+EdcimBKJ6TGc X-Received: by 10.182.2.106 with SMTP id 10mr88002obt.27.1413451546985; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.194 with SMTP id u60ls686943qge.7.gmail; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) X-Received: by 10.224.45.65 with SMTP id d1mr69692qaf.43.1413451546900; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by mx.google.com with ESMTPS id n5si39222090qat.86.2014.10.16.02.25.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Oct 2014 02:25:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.41 as permitted sender) client-ip=209.85.192.41; Received: by mail-qg0-f41.google.com with SMTP id a108so2237707qge.0 for ; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) X-Received: by 10.140.48.41 with SMTP id n38mr138062qga.1.1413451546774; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.235.100 with SMTP id ul4csp694259qdc; Thu, 16 Oct 2014 02:25:46 -0700 (PDT) X-Received: by 10.69.31.193 with SMTP id ko1mr88371pbd.122.1413451545736; Thu, 16 Oct 2014 02:25:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si7455892pdl.12.2014.10.16.02.25.44 for ; Thu, 16 Oct 2014 02:25:45 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbaJPJZl (ORCPT + 27 others); Thu, 16 Oct 2014 05:25:41 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:61657 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbaJPJZi (ORCPT ); Thu, 16 Oct 2014 05:25:38 -0400 Received: by mail-wi0-f180.google.com with SMTP id em10so4147022wid.7 for ; Thu, 16 Oct 2014 02:25:37 -0700 (PDT) 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" Cc: akpm@linux-foundation.org, Andrea Arcangeli , 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, will.deacon@arm.com, catalin.marinas@arm.com, linux@arm.linux.org.uk 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 In-Reply-To: <1413390888-4934-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline 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; })