linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: linux-next: build failure after merge of the akpm-current tree
Date: Tue, 5 Nov 2019 16:00:20 -0800	[thread overview]
Message-ID: <0892a018-152f-629d-3dd0-60ce79f2887b@oracle.com> (raw)
In-Reply-To: <20191105211920.787df2ab@canb.auug.org.au>

On 11/5/19 2:19 AM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the akpm-current tree, today's linux-next build (powerpc64
> allnoconfig) failed like this:
> 
> In file included from arch/powerpc/mm/mem.c:30:
> include/linux/hugetlb.h:233:19: error: redefinition of 'pmd_huge'
>   233 | static inline int pmd_huge(pmd_t pmd)
>       |                   ^~~~~~~~
> In file included from arch/powerpc/include/asm/book3s/64/pgtable.h:301,
>                  from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20,
>                  from arch/powerpc/include/asm/book3s/64/mmu.h:46,
>                  from arch/powerpc/include/asm/mmu.h:356,
>                  from arch/powerpc/include/asm/lppaca.h:47,
>                  from arch/powerpc/include/asm/paca.h:17,
>                  from arch/powerpc/include/asm/current.h:13,
>                  from include/linux/sched.h:12,
>                  from arch/powerpc/mm/mem.c:16:
> arch/powerpc/include/asm/book3s/64/pgtable-4k.h:74:19: note: previous definition of 'pmd_huge' was here
>    74 | static inline int pmd_huge(pmd_t pmd) { return 0; }
>       |                   ^~~~~~~~
> In file included from arch/powerpc/mm/mem.c:30:
> include/linux/hugetlb.h:238:19: error: redefinition of 'pud_huge'
>   238 | static inline int pud_huge(pud_t pud)
>       |                   ^~~~~~~~
> In file included from arch/powerpc/include/asm/book3s/64/pgtable.h:301,
>                  from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20,
>                  from arch/powerpc/include/asm/book3s/64/mmu.h:46,
>                  from arch/powerpc/include/asm/mmu.h:356,
>                  from arch/powerpc/include/asm/lppaca.h:47,
>                  from arch/powerpc/include/asm/paca.h:17,
>                  from arch/powerpc/include/asm/current.h:13,
>                  from include/linux/sched.h:12,
>                  from arch/powerpc/mm/mem.c:16:
> arch/powerpc/include/asm/book3s/64/pgtable-4k.h:75:19: note: previous definition of 'pud_huge' was here
>    75 | static inline int pud_huge(pud_t pud) { return 0; }
>       |                   ^~~~~~~~
> 
> Caused by commit
> 
>   9823e12e021f ("hugetlbfs: convert macros to static inline, fix sparse warning")
> 
> I have reverted that commit for today.

Hello Michael,

When I started to look into this I noticed that you added commit aad71e3928be
("powerpc/mm: Fix build break with RADIX=y & HUGETLBFS=n") some time back.
It appears that all other architectures get the definition of pmd_huge and
pud_huge from <linux/hugetlb.h> in the !CONFIG_HUGETLB_PAGE case.  Previously,
this was not an issue as the #define pmd_huge/pud_huge did not conflict with
the static inline in the powerpc header files.  The conflicts above happened
when I converted the macros to also be static inlines.  Could you live with
a patch like the following to remove the stubs from powerpc header files and
fix your original build break by including  <linux/hugetlb.h>?  After the
below patch is applied, the above commit will not cause the build errors seen
in linux-next.

From 4b3ab017e639e4e583fff801e6d8e6727b7877e8 Mon Sep 17 00:00:00 2001
From: Mike Kravetz <mike.kravetz@oracle.com>
Date: Tue, 5 Nov 2019 15:12:15 -0800
Subject: [PATCH] powerpc/mm: remove pmd_huge/pud_huge stubs and include
 hugetlb.h

This removes the power specific stubs created by commit aad71e3928be
("powerpc/mm: Fix build break with RADIX=y & HUGETLBFS=n") used when
!CONFIG_HUGETLB_PAGE.  Instead, it addresses the build break by
getting the definitions from <linux/hugetlb.h>.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
 arch/powerpc/include/asm/book3s/64/pgtable-4k.h  | 3 ---
 arch/powerpc/include/asm/book3s/64/pgtable-64k.h | 3 ---
 arch/powerpc/mm/book3s64/radix_pgtable.c         | 1 +
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable-4k.h b/arch/powerpc/include/asm/book3s/64/pgtable-4k.h
index a069dfcac9a9..4e697bc2f4cd 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable-4k.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable-4k.h
@@ -70,9 +70,6 @@ static inline int get_hugepd_cache_index(int index)
 	/* should not reach */
 }
 
-#else /* !CONFIG_HUGETLB_PAGE */
-static inline int pmd_huge(pmd_t pmd) { return 0; }
-static inline int pud_huge(pud_t pud) { return 0; }
 #endif /* CONFIG_HUGETLB_PAGE */
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable-64k.h b/arch/powerpc/include/asm/book3s/64/pgtable-64k.h
index e3d4dd4ae2fa..34d1018896b3 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable-64k.h
@@ -59,9 +59,6 @@ static inline int get_hugepd_cache_index(int index)
 	BUG();
 }
 
-#else /* !CONFIG_HUGETLB_PAGE */
-static inline int pmd_huge(pmd_t pmd) { return 0; }
-static inline int pud_huge(pud_t pud) { return 0; }
 #endif /* CONFIG_HUGETLB_PAGE */
 
 static inline int remap_4k_pfn(struct vm_area_struct *vma, unsigned long addr,
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index 6ee17d09649c..974109bb85db 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -13,6 +13,7 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/mm.h>
+#include <linux/hugetlb.h>
 #include <linux/string_helpers.h>
 #include <linux/stop_machine.h>
 
-- 
2.23.0



       reply	other threads:[~2019-11-06  0:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191105211920.787df2ab@canb.auug.org.au>
2019-11-06  0:00 ` Mike Kravetz [this message]
2019-11-11 10:24   ` linux-next: build failure after merge of the akpm-current tree Michael Ellerman
2019-11-12  0:59     ` Michael Ellerman
2019-11-12 18:12       ` Mike Kravetz
     [not found] <20140613151652.69bb6961@canb.auug.org.au>
2014-06-16 23:31 ` Andrew Morton
     [not found] <20140613150550.7b2e2c4c@canb.auug.org.au>
2014-06-13 15:12 ` Naoya Horiguchi
     [not found] ` <1402672324-io6h33kn@n-horiguchi@ah.jp.nec.com>
2014-06-16  2:01   ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0892a018-152f-629d-3dd0-60ce79f2887b@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).