* [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
@ 2017-12-11 16:21 Arnd Bergmann
2017-12-12 0:55 ` Stephen Rothwell
2017-12-12 7:47 ` Michal Hocko
0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2017-12-11 16:21 UTC (permalink / raw)
To: Andrew Morton, Dan Williams, Stephen Rothwell
Cc: Arnd Bergmann, Michal Hocko, Aneesh Kumar K.V, linux-kernel
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 <arnd@arndb.de>
---
include/linux/hugetlb.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index b0f1f6768336..082ff47201be 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -9,6 +9,7 @@
#include <linux/cgroup.h>
#include <linux/list.h>
#include <linux/kref.h>
+#include <linux/mm.h>
#include <asm/pgtable.h>
struct ctl_table;
--
2.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
2017-12-11 16:21 [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct Arnd Bergmann
@ 2017-12-12 0:55 ` Stephen Rothwell
2017-12-12 7:47 ` Michal Hocko
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2017-12-12 0:55 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, Dan Williams, Michal Hocko, Aneesh Kumar K.V,
linux-kernel
Hi Arnd,
On Mon, 11 Dec 2017 17:21:27 +0100 Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de>
Added to linux-next today.
--
Cheers,
Stephen Rothwell
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
2017-12-11 16:21 [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct Arnd Bergmann
2017-12-12 0:55 ` Stephen Rothwell
@ 2017-12-12 7:47 ` Michal Hocko
2017-12-12 8:05 ` Dan Williams
2017-12-12 11:48 ` Stephen Rothwell
1 sibling, 2 replies; 6+ messages in thread
From: Michal Hocko @ 2017-12-12 7:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, Dan Williams, Stephen Rothwell, Aneesh Kumar K.V,
linux-kernel
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 <arnd@arndb.de>
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
> ---
> include/linux/hugetlb.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index b0f1f6768336..082ff47201be 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -9,6 +9,7 @@
> #include <linux/cgroup.h>
> #include <linux/list.h>
> #include <linux/kref.h>
> +#include <linux/mm.h>
> #include <asm/pgtable.h>
>
> struct ctl_table;
> --
> 2.9.0
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
2017-12-12 7:47 ` Michal Hocko
@ 2017-12-12 8:05 ` Dan Williams
2017-12-13 0:36 ` Stephen Rothwell
2017-12-12 11:48 ` Stephen Rothwell
1 sibling, 1 reply; 6+ messages in thread
From: Dan Williams @ 2017-12-12 8:05 UTC (permalink / raw)
To: Michal Hocko
Cc: Arnd Bergmann, Andrew Morton, Stephen Rothwell, Aneesh Kumar K.V,
linux-kernel
On Mon, Dec 11, 2017 at 11:47 PM, Michal Hocko <mhocko@kernel.org> 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 <arnd@arndb.de>
>
> 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
Andrew, Stephen, please drop this ->pagesize() patch out of -mm and
-next. I'll circle back once I have this include dependency fixed up.
Thanks for the reports and sorry for the noise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
2017-12-12 7:47 ` Michal Hocko
2017-12-12 8:05 ` Dan Williams
@ 2017-12-12 11:48 ` Stephen Rothwell
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2017-12-12 11:48 UTC (permalink / raw)
To: Michal Hocko
Cc: Arnd Bergmann, Andrew Morton, Dan Williams, Aneesh Kumar K.V,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]
Hi Michal,
On Tue, 12 Dec 2017 08:47:22 +0100 Michal Hocko <mhocko@kernel.org> 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 <arnd@arndb.de>
>
> 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
[-- Attachment #2: Type: message/rfc822, Size: 4407 bytes --]
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Dan Williams <dan.j.williams@intel.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Michael Ellerman <mpe@ellerman.id.au>
Subject: linux-next: build failure after merge of the akpm-current tree
Date: Mon, 11 Dec 2017 16:05:54 +1100
Message-ID: <20171211160554.00c79749@canb.auug.org.au>
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 <sfr@canb.auug.org.au>
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 <sfr@canb.auug.org.au>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct
2017-12-12 8:05 ` Dan Williams
@ 2017-12-13 0:36 ` Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2017-12-13 0:36 UTC (permalink / raw)
To: Dan Williams
Cc: Michal Hocko, Arnd Bergmann, Andrew Morton, Aneesh Kumar K.V,
linux-kernel
Hi Dan,
On Tue, 12 Dec 2017 00:05:08 -0800 Dan Williams <dan.j.williams@intel.com> wrote:
>
> On Mon, Dec 11, 2017 at 11:47 PM, Michal Hocko <mhocko@kernel.org> 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 <arnd@arndb.de>
> >
> > 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
>
> Andrew, Stephen, please drop this ->pagesize() patch out of -mm and
> -next. I'll circle back once I have this include dependency fixed up.
> Thanks for the reports and sorry for the noise.
I have removed commits:
ac9284a6b670 ("mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct")
d8115c6f55a0 ("device-dax: implement ->pagesize() for smaps to report MMUPageSize")
from my copy of the mmotm tree from today.
--
Cheers,
Stephen Rothwell
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-12-13 0:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 16:21 [PATCH] mm, hugetlbfs: include mm.h for vm_operations_struct Arnd Bergmann
2017-12-12 0:55 ` Stephen Rothwell
2017-12-12 7:47 ` Michal Hocko
2017-12-12 8:05 ` Dan Williams
2017-12-13 0:36 ` Stephen Rothwell
2017-12-12 11:48 ` Stephen Rothwell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.