From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751643AbdLLLst (ORCPT ); Tue, 12 Dec 2017 06:48:49 -0500 Received: from ozlabs.org ([103.22.144.67]:39401 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdLLLsq (ORCPT ); Tue, 12 Dec 2017 06:48:46 -0500 Date: Tue, 12 Dec 2017 22:48:43 +1100 From: Stephen Rothwell To: Michal Hocko Cc: Arnd Bergmann , Andrew Morton , Dan Williams , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct Message-ID: <20171212224843.077fa51a@canb.auug.org.au> In-Reply-To: <20171212074722.GG4779@dhcp22.suse.cz> References: <20171211162243.233177-1-arnd@arndb.de> <20171212074722.GG4779@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/cfpRivBd+X8RjgX_=Bjfv.d" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --MP_/cfpRivBd+X8RjgX_=Bjfv.d Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Michal, On Tue, 12 Dec 2017 08:47:22 +0100 Michal Hocko wrote: > > On Mon 11-12-17 17:21:27, Arnd Bergmann wrote: > > The infiniband umem code causes a build failure in some configurations: > > > > In file included from drivers/infiniband/core/umem_odp.c:41:0: > > include/linux/hugetlb.h: In function 'vma_kernel_pagesize': > > include/linux/hugetlb.h:262:32: error: dereferencing pointer to incomplete type 'const struct vm_operations_struct' > > > > Including the header file that defines the structure is sufficient to > > avoid this. > > > > Fixes: ac9284a6b670 ("mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct") > > Signed-off-by: Arnd Bergmann > > I've tried to do the same but the compilation failed for other > arches/configs. See http://lkml.kernel.org/r/20171210113715.GE20234@dhcp22.suse.cz I sent a patch yesterday for that particular powerpc failure ... You were not CC'd, but I have attached the email. -- Cheers, Stephen Rothwell --MP_/cfpRivBd+X8RjgX_=Bjfv.d Content-Type: message/rfc822 Content-Transfer-Encoding: binary Content-Disposition: inline AF: NF: 0 PS: 10 SRH: 1 SFN: DSR: MID: CFG: PT: 0 S: sfr@canb.auug.org.au RQ: SSV: ozlabs.org NSV: SSH: R: ,,,,, MAID: 2 X-Claws-Privacy-System: X-Claws-Sign: 0 SCF: #imap/ozlabs.org/Sent X-Claws-Auto-Wrapping: 0 X-Claws-Auto-Indent: 0 X-Claws-End-Special-Headers: 1 Date: Mon, 11 Dec 2017 16:05:54 +1100 From: Stephen Rothwell To: Andrew Morton Cc: Linux-Next Mailing List , Linux Kernel Mailing List , Dan Williams , Benjamin Herrenschmidt , Michael Ellerman Subject: linux-next: build failure after merge of the akpm-current tree Message-ID: <20171211160554.00c79749@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Andrew, After merging the akpm-current tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: In file included from include/linux/hugetlb.h:451:0, from arch/powerpc/mm/hugetlbpage.c:14: arch/powerpc/include/asm/hugetlb.h:125:26: error: redefinition of 'vma_mmu_pagesize' #define vma_mmu_pagesize vma_mmu_pagesize ^ arch/powerpc/mm/hugetlbpage.c:563:15: note: in expansion of macro 'vma_mmu_pagesize' unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) ^ In file included from arch/powerpc/mm/hugetlbpage.c:14:0: include/linux/hugetlb.h:274:29: note: previous definition of 'vma_mmu_pagesize' was here static inline unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) ^ Caused by commit ac9284a6b670 ("mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct") I have added the following fix patch for today: From: Stephen Rothwell Date: Mon, 11 Dec 2017 15:51:41 +1100 Subject: [PATCH] mm, hugetlbfs: move testing of vma_mmu_pagesize to after inclusion of asm/hugetlb.h Signed-off-by: Stephen Rothwell --- arch/powerpc/include/asm/hugetlb.h | 1 + include/linux/hugetlb.h | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 14c9d44f355b..3cc6ca1bdaf2 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -123,6 +123,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, * to override the version in mm/hugetlb.c */ #define vma_mmu_pagesize vma_mmu_pagesize +unsigned long vma_mmu_pagesize(struct vm_area_struct *vma); /* * If the arch doesn't supply something else, assume that hugepage diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index c354befab724..b0f1f6768336 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -264,19 +264,6 @@ static inline unsigned long vma_kernel_pagesize(struct vm_area_struct *vma) return PAGE_SIZE; } -/* - * Return the page size being used by the MMU to back a VMA. In the majority - * of cases, the page size used by the kernel matches the MMU size. On - * architectures where it differs, an architecture-specific version of this - * function is required. - */ -#ifndef vma_mmu_pagesize -static inline unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) -{ - return vma_kernel_pagesize(vma); -} -#endif - #ifdef CONFIG_HUGETLBFS struct hugetlbfs_sb_info { long max_inodes; /* inodes allowed */ @@ -615,6 +602,19 @@ static inline void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr } #endif /* CONFIG_HUGETLB_PAGE */ +/* + * Return the page size being used by the MMU to back a VMA. In the majority + * of cases, the page size used by the kernel matches the MMU size. On + * architectures where it differs, an architecture-specific version of this + * function is required. + */ +#ifndef vma_mmu_pagesize +static inline unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) +{ + return vma_kernel_pagesize(vma); +} +#endif + static inline spinlock_t *huge_pte_lock(struct hstate *h, struct mm_struct *mm, pte_t *pte) { -- 2.15.0 -- Cheers, Stephen Rothwell --MP_/cfpRivBd+X8RjgX_=Bjfv.d--