All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 14:41 ` Michal Hocko
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 14:41 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Tobias Klauser, linux-mm, LKML, Michal Hocko

From: Michal Hocko <mhocko@suse.com>

1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
to be a bad idea for some architectures. E.g. m68k fails with
   In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
                    from arch/m68k/include/asm/pgtable.h:4,
                    from include/linux/vmalloc.h:9,
                    from arch/m68k/kernel/module.c:9:
   arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
    #define pgd_offset_k(address) pgd_offset(&init_mm, address)

as spotted by kernel build bot. nios2 fails for other reason
In file included from ./include/asm-generic/io.h:767:0,
                 from ./arch/nios2/include/asm/io.h:61,
                 from ./include/linux/io.h:25,
                 from ./arch/nios2/include/asm/pgtable.h:18,
                 from ./include/linux/mm.h:70,
                 from ./include/linux/pid_namespace.h:6,
                 from ./include/linux/ptrace.h:9,
                 from ./arch/nios2/include/uapi/asm/elf.h:23,
                 from ./arch/nios2/include/asm/elf.h:22,
                 from ./include/linux/elf.h:4,
                 from ./include/linux/module.h:15,
                 from init/main.c:16:
./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?

which is due to the newly added #include <asm/pgtable.h>, which on nios2
includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
again includes <linux/vmalloc.h>.

Tweaking that around just turns out a bigger headache than
necessary. This patch reverts 1f5307b1e094 and reimplements the original
fix in a different way. __vmalloc_node_flags can stay static inline
which will cover vmalloc* functions. We only have one external user
(kvmalloc_node) and we can export __vmalloc_node_flags_caller and
provide the caller directly. This is much simpler and it doesn't really
need any games with header files.

Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
Signed-off-by: Michal Hocko <mhocko@suse.com>
---

Hi Linus and Andrew,
it seems that this one slipped through cracks as well. Kbuild robot has
quickly noticed that my original fix doesn't compile on m68k [1] and
I've provided fix [2] at the time but it seems Andrew has missed it and
sent the wrong one which got merged. Other users have noticed as well [3].

This is a full revert along with the fix.  I can split it to a revert
and the new fix if you prefer. Just let me know.

[1] http://lkml.kernel.org/r/201705030806.pzzQRBiN%fengguang.wu@intel.com
[2] http://lkml.kernel.org/r/20170503063750.GC1236@dhcp22.suse.cz
[3] http://lkml.kernel.org/r/20170509085045.7342-1-tklauser@distanz.ch

 include/linux/vmalloc.h | 19 +++++++------------
 mm/util.c               |  3 ++-
 mm/vmalloc.c            | 18 +++++++++++++++++-
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 0328ce003992..4a0fabeb1e92 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -6,7 +6,6 @@
 #include <linux/list.h>
 #include <linux/llist.h>
 #include <asm/page.h>		/* pgprot_t */
-#include <asm/pgtable.h>	/* PAGE_KERNEL */
 #include <linux/rbtree.h>
 
 struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
@@ -82,23 +81,19 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
 			pgprot_t prot, unsigned long vm_flags, int node,
 			const void *caller);
 #ifndef CONFIG_MMU
-extern void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags);
+extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
+static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
+{
+	return __vmalloc_node_flags(size, node, flags);
+}
 #else
-extern void *__vmalloc_node(unsigned long size, unsigned long align,
-			    gfp_t gfp_mask, pgprot_t prot,
-			    int node, const void *caller);
-
 /*
  * We really want to have this inlined due to caller tracking. This
  * function is used by the highlevel vmalloc apis and so we want to track
  * their callers and inlining will achieve that.
  */
-static inline void *__vmalloc_node_flags(unsigned long size,
-					int node, gfp_t flags)
-{
-	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
-					node, __builtin_return_address(0));
-}
+extern void *__vmalloc_node_flags_caller(unsigned long size,
+					int node, gfp_t flags, void* caller);
 #endif
 
 extern void vfree(const void *addr);
diff --git a/mm/util.c b/mm/util.c
index 718154debc87..464df3489903 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -382,7 +382,8 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
 	if (ret || size <= PAGE_SIZE)
 		return ret;
 
-	return __vmalloc_node_flags(size, node, flags);
+	return __vmalloc_node_flags_caller(size, node, flags,
+			__builtin_return_address(0));
 }
 EXPORT_SYMBOL(kvmalloc_node);
 
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1dda6d8a200a..4a1de70e68e1 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1649,6 +1649,9 @@ void *vmap(struct page **pages, unsigned int count,
 }
 EXPORT_SYMBOL(vmap);
 
+static void *__vmalloc_node(unsigned long size, unsigned long align,
+			    gfp_t gfp_mask, pgprot_t prot,
+			    int node, const void *caller);
 static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 				 pgprot_t prot, int node)
 {
@@ -1791,7 +1794,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
  *	with mm people.
  *
  */
-void *__vmalloc_node(unsigned long size, unsigned long align,
+static void *__vmalloc_node(unsigned long size, unsigned long align,
 			    gfp_t gfp_mask, pgprot_t prot,
 			    int node, const void *caller)
 {
@@ -1806,6 +1809,19 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
 }
 EXPORT_SYMBOL(__vmalloc);
 
+static inline void *__vmalloc_node_flags(unsigned long size,
+					int node, gfp_t flags)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
+					node, __builtin_return_address(0));
+}
+
+
+void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL, node, caller);
+}
+
 /**
  *	vmalloc  -  allocate virtually contiguous memory
  *	@size:		allocation size
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 14:41 ` Michal Hocko
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 14:41 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Tobias Klauser, linux-mm, LKML, Michal Hocko

From: Michal Hocko <mhocko@suse.com>

1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
to be a bad idea for some architectures. E.g. m68k fails with
   In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
                    from arch/m68k/include/asm/pgtable.h:4,
                    from include/linux/vmalloc.h:9,
                    from arch/m68k/kernel/module.c:9:
   arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
    #define pgd_offset_k(address) pgd_offset(&init_mm, address)

as spotted by kernel build bot. nios2 fails for other reason
In file included from ./include/asm-generic/io.h:767:0,
                 from ./arch/nios2/include/asm/io.h:61,
                 from ./include/linux/io.h:25,
                 from ./arch/nios2/include/asm/pgtable.h:18,
                 from ./include/linux/mm.h:70,
                 from ./include/linux/pid_namespace.h:6,
                 from ./include/linux/ptrace.h:9,
                 from ./arch/nios2/include/uapi/asm/elf.h:23,
                 from ./arch/nios2/include/asm/elf.h:22,
                 from ./include/linux/elf.h:4,
                 from ./include/linux/module.h:15,
                 from init/main.c:16:
./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?

which is due to the newly added #include <asm/pgtable.h>, which on nios2
includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
again includes <linux/vmalloc.h>.

Tweaking that around just turns out a bigger headache than
necessary. This patch reverts 1f5307b1e094 and reimplements the original
fix in a different way. __vmalloc_node_flags can stay static inline
which will cover vmalloc* functions. We only have one external user
(kvmalloc_node) and we can export __vmalloc_node_flags_caller and
provide the caller directly. This is much simpler and it doesn't really
need any games with header files.

Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
Signed-off-by: Michal Hocko <mhocko@suse.com>
---

Hi Linus and Andrew,
it seems that this one slipped through cracks as well. Kbuild robot has
quickly noticed that my original fix doesn't compile on m68k [1] and
I've provided fix [2] at the time but it seems Andrew has missed it and
sent the wrong one which got merged. Other users have noticed as well [3].

This is a full revert along with the fix.  I can split it to a revert
and the new fix if you prefer. Just let me know.

[1] http://lkml.kernel.org/r/201705030806.pzzQRBiN%fengguang.wu@intel.com
[2] http://lkml.kernel.org/r/20170503063750.GC1236@dhcp22.suse.cz
[3] http://lkml.kernel.org/r/20170509085045.7342-1-tklauser@distanz.ch

 include/linux/vmalloc.h | 19 +++++++------------
 mm/util.c               |  3 ++-
 mm/vmalloc.c            | 18 +++++++++++++++++-
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 0328ce003992..4a0fabeb1e92 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -6,7 +6,6 @@
 #include <linux/list.h>
 #include <linux/llist.h>
 #include <asm/page.h>		/* pgprot_t */
-#include <asm/pgtable.h>	/* PAGE_KERNEL */
 #include <linux/rbtree.h>
 
 struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
@@ -82,23 +81,19 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
 			pgprot_t prot, unsigned long vm_flags, int node,
 			const void *caller);
 #ifndef CONFIG_MMU
-extern void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags);
+extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
+static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
+{
+	return __vmalloc_node_flags(size, node, flags);
+}
 #else
-extern void *__vmalloc_node(unsigned long size, unsigned long align,
-			    gfp_t gfp_mask, pgprot_t prot,
-			    int node, const void *caller);
-
 /*
  * We really want to have this inlined due to caller tracking. This
  * function is used by the highlevel vmalloc apis and so we want to track
  * their callers and inlining will achieve that.
  */
-static inline void *__vmalloc_node_flags(unsigned long size,
-					int node, gfp_t flags)
-{
-	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
-					node, __builtin_return_address(0));
-}
+extern void *__vmalloc_node_flags_caller(unsigned long size,
+					int node, gfp_t flags, void* caller);
 #endif
 
 extern void vfree(const void *addr);
diff --git a/mm/util.c b/mm/util.c
index 718154debc87..464df3489903 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -382,7 +382,8 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
 	if (ret || size <= PAGE_SIZE)
 		return ret;
 
-	return __vmalloc_node_flags(size, node, flags);
+	return __vmalloc_node_flags_caller(size, node, flags,
+			__builtin_return_address(0));
 }
 EXPORT_SYMBOL(kvmalloc_node);
 
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1dda6d8a200a..4a1de70e68e1 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1649,6 +1649,9 @@ void *vmap(struct page **pages, unsigned int count,
 }
 EXPORT_SYMBOL(vmap);
 
+static void *__vmalloc_node(unsigned long size, unsigned long align,
+			    gfp_t gfp_mask, pgprot_t prot,
+			    int node, const void *caller);
 static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 				 pgprot_t prot, int node)
 {
@@ -1791,7 +1794,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
  *	with mm people.
  *
  */
-void *__vmalloc_node(unsigned long size, unsigned long align,
+static void *__vmalloc_node(unsigned long size, unsigned long align,
 			    gfp_t gfp_mask, pgprot_t prot,
 			    int node, const void *caller)
 {
@@ -1806,6 +1809,19 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
 }
 EXPORT_SYMBOL(__vmalloc);
 
+static inline void *__vmalloc_node_flags(unsigned long size,
+					int node, gfp_t flags)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
+					node, __builtin_return_address(0));
+}
+
+
+void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL, node, caller);
+}
+
 /**
  *	vmalloc  -  allocate virtually contiguous memory
  *	@size:		allocation size
-- 
2.11.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 14:41 ` Michal Hocko
@ 2017-05-09 14:51   ` Tobias Klauser
  -1 siblings, 0 replies; 16+ messages in thread
From: Tobias Klauser @ 2017-05-09 14:51 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Linus Torvalds, Andrew Morton, linux-mm, LKML, Michal Hocko

On 2017-05-09 at 16:41:08 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> 
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> 
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
> 
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
> 
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Tobias Klauser <tklauser@distanz.ch>

This fixes the build for ARCH=nios2, thanks.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 14:51   ` Tobias Klauser
  0 siblings, 0 replies; 16+ messages in thread
From: Tobias Klauser @ 2017-05-09 14:51 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Linus Torvalds, Andrew Morton, linux-mm, LKML, Michal Hocko

On 2017-05-09 at 16:41:08 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> 
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> 
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
> 
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
> 
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Tobias Klauser <tklauser@distanz.ch>

This fixes the build for ARCH=nios2, thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 14:41 ` Michal Hocko
  (?)
  (?)
@ 2017-05-09 15:25 ` kbuild test robot
  -1 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2017-05-09 15:25 UTC (permalink / raw)
  To: Michal Hocko
  Cc: kbuild-all, Linus Torvalds, Andrew Morton, Tobias Klauser,
	linux-mm, LKML, Michal Hocko

[-- Attachment #1: Type: text/plain, Size: 29112 bytes --]

Hi Michal,

[auto build test ERROR on mmotm/master]
[also build test ERROR on next-20170509]
[cannot apply to v4.11]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Michal-Hocko/mm-vmalloc-fix-vmalloc-users-tracking-properly/20170509-224536
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: c6x-evmc6678_defconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 6.2.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=c6x 

All error/warnings (new ones prefixed by >>):

   block/bio.c:879:48: sparse: cast truncates bits from constant value (7fffffffffffffff becomes ffffffff)
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/memcontrol.h:24,
                    from include/linux/swap.h:8,
                    from block/bio.c:19:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/blk-core.c:1145:24: sparse: context imbalance in '__get_request' - unexpected unlock
   block/blk-core.c:1284:23: sparse: context imbalance in 'blk_old_get_request' - different lock contexts for basic block
   block/blk-core.c:1651:17: sparse: context imbalance in 'blk_queue_bio' - different lock contexts for basic block
   block/blk-core.c:3269:17: sparse: context imbalance in 'blk_flush_plug_list' - unexpected unlock
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/pagemap.h:10,
                    from include/linux/blkdev.h:15,
                    from include/linux/backing-dev.h:14,
                    from block/blk-core.c:16:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/blk-flush.c:271:9: sparse: context imbalance in 'flush_end_io' - different lock contexts for basic block
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/bio.h:21,
                    from block/blk-flush.c:69:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/blk-ioc.c:110:28: sparse: context imbalance in 'ioc_release_fn' - different lock contexts for basic block
   block/blk-ioc.c:191:9: sparse: context imbalance in 'put_io_context_active' - different lock contexts for basic block
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/bio.h:21,
                    from block/blk-ioc.c:7:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   include/linux/sched.h:1526:16: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/sched.h:1526:16:    expected struct thread_info *ti
   include/linux/sched.h:1526:16:    got struct thread_info [pure] *
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/pagemap.h:10,
                    from include/linux/blkdev.h:15,
                    from include/linux/backing-dev.h:14,
                    from block/blk-mq.c:9:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/ioctl.c:263:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:263:16:    got unsigned short *<noident>
   block/ioctl.c:263:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:263:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:263:16:    got unsigned short *<noident>
   block/ioctl.c:268:16: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:268:16:    expected void *__p
   block/ioctl.c:268:16:    got int [noderef] <asn:1>*<noident>
   block/ioctl.c:268:16: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:268:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:268:16:    got int *<noident>
   block/ioctl.c:268:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:268:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:268:16:    got int *<noident>
   block/ioctl.c:273:16: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:273:16:    expected void *__p
   block/ioctl.c:273:16:    got unsigned int [noderef] <asn:1>*<noident>
   block/ioctl.c:273:16: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:273:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:273:16:    got unsigned int *<noident>
   block/ioctl.c:273:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:273:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:273:16:    got unsigned int *<noident>
   block/ioctl.c:278:16: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:278:16:    expected void *__p
   block/ioctl.c:278:16:    got long [noderef] <asn:1>*<noident>
   block/ioctl.c:278:16: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:278:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:278:16:    got long *<noident>
   block/ioctl.c:278:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:278:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:278:16:    got long *<noident>
   block/ioctl.c:283:16: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:283:16:    expected void *__p
   block/ioctl.c:283:16:    got unsigned long [noderef] <asn:1>*<noident>
   block/ioctl.c:283:16: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:283:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:283:16:    got unsigned long *<noident>
   block/ioctl.c:283:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:283:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:283:16:    got unsigned long *<noident>
   block/ioctl.c:288:16: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:288:16:    expected void *__p
   block/ioctl.c:288:16:    got unsigned long long [noderef] [usertype] <asn:1>*<noident>
   block/ioctl.c:288:16: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:288:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:288:16:    got unsigned long long *<noident>
   block/ioctl.c:288:16: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:288:16:    expected void [noderef] <asn:1>*ptr
   block/ioctl.c:288:16:    got unsigned long long *<noident>
   block/ioctl.c:445:13: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:445:13:    expected void const *__p
   block/ioctl.c:445:13:    got int [noderef] <asn:1>*<noident>
   block/ioctl.c:445:13: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:445:13:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:445:13:    got int *<noident>
   block/ioctl.c:445:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:445:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:445:13:    got int *<noident>
   block/ioctl.c:445:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:445:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:445:13:    got int *<noident>
   block/ioctl.c:445:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:445:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:445:13:    got int *<noident>
   block/ioctl.c:445:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:445:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:445:13:    got int *<noident>
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   block/ioctl.c:487:13: sparse: incorrect type in initializer (different address spaces)
   block/ioctl.c:487:13:    expected void const *__p
   block/ioctl.c:487:13:    got int [noderef] <asn:1>*argp
   block/ioctl.c:487:13: sparse: incorrect type in argument 1 (different address spaces)
   block/ioctl.c:487:13:    expected void const volatile [noderef] <asn:1>*<noident>
   block/ioctl.c:487:13:    got int *<noident>
   block/ioctl.c:487:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:487:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:487:13:    got int *<noident>
   block/ioctl.c:487:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:487:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:487:13:    got int *<noident>
   block/ioctl.c:487:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:487:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:487:13:    got int *<noident>
   block/ioctl.c:487:13: sparse: incorrect type in argument 2 (different address spaces)
   block/ioctl.c:487:13:    expected void const [noderef] <asn:1>*ptr
   block/ioctl.c:487:13:    got int *<noident>
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/pagemap.h:10,
                    from include/linux/blkdev.h:15,
                    from block/ioctl.c:2:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/genhd.c:1462:10: sparse: bad integer constant expression
   block/genhd.c:1463:10: sparse: bad integer constant expression
   block/genhd.c:1467:10: sparse: bad integer constant expression
   block/genhd.c:1468:10: sparse: bad integer constant expression
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/pagemap.h:10,
                    from include/linux/blkdev.h:15,
                    from block/genhd.c:10:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   block/scsi_ioctl.c:103:25:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:103:25:    got int *<noident>
   block/scsi_ioctl.c:103:25: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:103:25:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:103:25:    got int *<noident>
   block/scsi_ioctl.c:103:25: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:103:25:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:103:25:    got int *<noident>
   block/scsi_ioctl.c:103:25: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:103:25:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:103:25:    got int *<noident>
   block/scsi_ioctl.c:121:16: sparse: incorrect type in initializer (different address spaces)
   block/scsi_ioctl.c:121:16:    expected void *__p
   block/scsi_ioctl.c:121:16:    got int [noderef] <asn:1>*p
   block/scsi_ioctl.c:121:16: sparse: incorrect type in argument 1 (different address spaces)
   block/scsi_ioctl.c:121:16:    expected void const volatile [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:121:16:    got int *<noident>
   block/scsi_ioctl.c:121:16: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:121:16:    expected void [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:121:16:    got int *<noident>
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   block/scsi_ioctl.c:435:13: sparse: incorrect type in initializer (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const *__p
   block/scsi_ioctl.c:435:13:    got unsigned int [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:435:13: sparse: incorrect type in argument 1 (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const volatile [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:435:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:435:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:435:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:435:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:435:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:435:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:435:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:435:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:435:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:435:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in initializer (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const *__p
   block/scsi_ioctl.c:437:13:    got unsigned int [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in argument 1 (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const volatile [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:437:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:437:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:437:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:437:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:437:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:437:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:437:13:    got unsigned int *<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in initializer (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const *__p
   block/scsi_ioctl.c:441:13:    got unsigned char [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in argument 1 (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const volatile [noderef] <asn:1>*<noident>
   block/scsi_ioctl.c:441:13:    got unsigned char *<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:441:13:    got unsigned char *<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:441:13:    got unsigned char *<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:441:13:    got unsigned char *<noident>
   block/scsi_ioctl.c:441:13: sparse: incorrect type in argument 2 (different address spaces)
   block/scsi_ioctl.c:441:13:    expected void const [noderef] <asn:1>*ptr
   block/scsi_ioctl.c:441:13:    got unsigned char *<noident>
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   include/linux/uaccess.h:166:18: sparse: incorrect type in argument 1 (different modifiers)
   include/linux/uaccess.h:166:18:    expected void *<noident>
   include/linux/uaccess.h:166:18:    got void const *from
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/highmem.h:9,
                    from include/linux/pagemap.h:10,
                    from include/linux/blkdev.h:15,
                    from block/scsi_ioctl.c:23:
>> include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
>> include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
>> include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
..

vim +/__vmalloc_node_flags_caller +85 include/linux/vmalloc.h

    78	extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
    79	extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
    80				unsigned long start, unsigned long end, gfp_t gfp_mask,
    81				pgprot_t prot, unsigned long vm_flags, int node,
    82				const void *caller);
    83	#ifndef CONFIG_MMU
  > 84	extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
  > 85	static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
    86	{
  > 87		return __vmalloc_node_flags(size, node, flags);
    88	}
    89	#else
    90	/*

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 5454 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 14:41 ` Michal Hocko
@ 2017-05-09 15:37   ` Michal Hocko
  -1 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 15:37 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Tobias Klauser, linux-mm, LKML

Sigh. I've apparently managed to screw up again. This should address the
nommu breakage reported by 0-day.
---
>From 95d49bf93ae4467f3f918520ec03b3596e5b36cc Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.com>
Date: Tue, 9 May 2017 16:27:39 +0200
Subject: [PATCH] mm, vmalloc: fix vmalloc users tracking properly

1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
to be a bad idea for some architectures. E.g. m68k fails with
   In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
                    from arch/m68k/include/asm/pgtable.h:4,
                    from include/linux/vmalloc.h:9,
                    from arch/m68k/kernel/module.c:9:
   arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
    #define pgd_offset_k(address) pgd_offset(&init_mm, address)

as spotted by kernel build bot. nios2 fails for other reason
In file included from ./include/asm-generic/io.h:767:0,
                 from ./arch/nios2/include/asm/io.h:61,
                 from ./include/linux/io.h:25,
                 from ./arch/nios2/include/asm/pgtable.h:18,
                 from ./include/linux/mm.h:70,
                 from ./include/linux/pid_namespace.h:6,
                 from ./include/linux/ptrace.h:9,
                 from ./arch/nios2/include/uapi/asm/elf.h:23,
                 from ./arch/nios2/include/asm/elf.h:22,
                 from ./include/linux/elf.h:4,
                 from ./include/linux/module.h:15,
                 from init/main.c:16:
./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?

which is due to the newly added #include <asm/pgtable.h>, which on nios2
includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
again includes <linux/vmalloc.h>.

Tweaking that around just turns out a bigger headache than
necessary. This patch reverts 1f5307b1e094 and reimplements the original
fix in a different way. __vmalloc_node_flags can stay static inline
which will cover vmalloc* functions. We only have one external user
(kvmalloc_node) and we can export __vmalloc_node_flags_caller and
provide the caller directly. This is much simpler and it doesn't really
need any games with header files.

Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
Signed-off-by: Michal Hocko <mhocko@suse.com>
---
 include/linux/vmalloc.h | 17 ++++++-----------
 mm/util.c               |  3 ++-
 mm/vmalloc.c            | 18 +++++++++++++++++-
 3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 0328ce003992..268b3a919a5f 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -6,7 +6,6 @@
 #include <linux/list.h>
 #include <linux/llist.h>
 #include <asm/page.h>		/* pgprot_t */
-#include <asm/pgtable.h>	/* PAGE_KERNEL */
 #include <linux/rbtree.h>
 
 struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
@@ -83,22 +82,18 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
 			const void *caller);
 #ifndef CONFIG_MMU
 extern void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags);
+static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
+{
+	return __vmalloc_node_flags(size, node, flags);
+}
 #else
-extern void *__vmalloc_node(unsigned long size, unsigned long align,
-			    gfp_t gfp_mask, pgprot_t prot,
-			    int node, const void *caller);
-
 /*
  * We really want to have this inlined due to caller tracking. This
  * function is used by the highlevel vmalloc apis and so we want to track
  * their callers and inlining will achieve that.
  */
-static inline void *__vmalloc_node_flags(unsigned long size,
-					int node, gfp_t flags)
-{
-	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
-					node, __builtin_return_address(0));
-}
+extern void *__vmalloc_node_flags_caller(unsigned long size,
+					int node, gfp_t flags, void* caller);
 #endif
 
 extern void vfree(const void *addr);
diff --git a/mm/util.c b/mm/util.c
index 718154debc87..464df3489903 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -382,7 +382,8 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
 	if (ret || size <= PAGE_SIZE)
 		return ret;
 
-	return __vmalloc_node_flags(size, node, flags);
+	return __vmalloc_node_flags_caller(size, node, flags,
+			__builtin_return_address(0));
 }
 EXPORT_SYMBOL(kvmalloc_node);
 
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1dda6d8a200a..4a1de70e68e1 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1649,6 +1649,9 @@ void *vmap(struct page **pages, unsigned int count,
 }
 EXPORT_SYMBOL(vmap);
 
+static void *__vmalloc_node(unsigned long size, unsigned long align,
+			    gfp_t gfp_mask, pgprot_t prot,
+			    int node, const void *caller);
 static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 				 pgprot_t prot, int node)
 {
@@ -1791,7 +1794,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
  *	with mm people.
  *
  */
-void *__vmalloc_node(unsigned long size, unsigned long align,
+static void *__vmalloc_node(unsigned long size, unsigned long align,
 			    gfp_t gfp_mask, pgprot_t prot,
 			    int node, const void *caller)
 {
@@ -1806,6 +1809,19 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
 }
 EXPORT_SYMBOL(__vmalloc);
 
+static inline void *__vmalloc_node_flags(unsigned long size,
+					int node, gfp_t flags)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
+					node, __builtin_return_address(0));
+}
+
+
+void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller)
+{
+	return __vmalloc_node(size, 1, flags, PAGE_KERNEL, node, caller);
+}
+
 /**
  *	vmalloc  -  allocate virtually contiguous memory
  *	@size:		allocation size
-- 
2.11.0

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 15:37   ` Michal Hocko
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 15:37 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Tobias Klauser, linux-mm, LKML

Sigh. I've apparently managed to screw up again. This should address the
nommu breakage reported by 0-day.
---

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 14:41 ` Michal Hocko
                   ` (3 preceding siblings ...)
  (?)
@ 2017-05-09 15:59 ` kbuild test robot
  -1 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2017-05-09 15:59 UTC (permalink / raw)
  To: Michal Hocko
  Cc: kbuild-all, Linus Torvalds, Andrew Morton, Tobias Klauser,
	linux-mm, LKML, Michal Hocko

[-- Attachment #1: Type: text/plain, Size: 5270 bytes --]

Hi Michal,

[auto build test ERROR on mmotm/master]
[also build test ERROR on next-20170509]
[cannot apply to v4.11]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Michal-Hocko/mm-vmalloc-fix-vmalloc-users-tracking-properly/20170509-224536
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: c6x-evmc6678_defconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 6.2.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=c6x 

All errors (new ones prefixed by >>):

   mm/nommu.c:51:5: sparse: symbol 'sysctl_nr_trim_pages' was not declared. Should it be static?
   mm/nommu.c:52:5: sparse: symbol 'heap_stack_gap' was not declared. Should it be static?
   mm/nommu.c:63:35: sparse: symbol 'generic_file_vm_ops' was not declared. Should it be static?
   mm/nommu.c:240:6: sparse: symbol '__vmalloc_node_flags' was not declared. Should it be static?
   mm/nommu.c:1175:48: sparse: incorrect type in argument 2 (different address spaces)
   mm/nommu.c:1175:48:    expected char [noderef] <asn:1>*<noident>
   mm/nommu.c:1175:48:    got void *[assigned] base
   mm/nommu.c:1790:15: sparse: symbol 'arch_get_unmapped_area' was not declared. Should it be static?
   mm/nommu.c:638:9: sparse: context imbalance in '__put_nommu_region' - wrong count at exit
   mm/nommu.c:659:13: sparse: context imbalance in 'put_nommu_region' - unexpected unlock
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/memcontrol.h:24,
                    from include/linux/swap.h:8,
                    from mm/nommu.c:23:
   include/linux/vmalloc.h:85:21: error: conflicting types for '__vmalloc_node_flags_caller'
    static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void* caller)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:84:14: note: previous declaration of '__vmalloc_node_flags_caller' was here
    extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h: In function '__vmalloc_node_flags_caller':
   include/linux/vmalloc.h:87:9: error: implicit declaration of function '__vmalloc_node_flags' [-Werror=implicit-function-declaration]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
   include/linux/vmalloc.h:87:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/nommu.c: At top level:
>> mm/nommu.c:240:7: error: conflicting types for '__vmalloc_node_flags'
    void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags)
          ^~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/io.h:767:0,
                    from ./arch/c6x/include/generated/asm/io.h:1,
                    from include/linux/io.h:25,
                    from include/linux/irq.h:24,
                    from include/asm-generic/hardirq.h:12,
                    from arch/c6x/include/asm/hardirq.h:18,
                    from include/linux/hardirq.h:8,
                    from include/linux/memcontrol.h:24,
                    from include/linux/swap.h:8,
                    from mm/nommu.c:23:
   include/linux/vmalloc.h:87:9: note: previous implicit declaration of '__vmalloc_node_flags' was here
     return __vmalloc_node_flags(size, node, flags);
            ^~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/__vmalloc_node_flags +240 mm/nommu.c

8518609d Robert P. J. Day 2007-10-19  234  	 * returns only a logical address.
^1da177e Linus Torvalds   2005-04-16  235  	 */
84097518 Nick Piggin      2006-03-22  236  	return kmalloc(size, (gfp_mask | __GFP_COMP) & ~__GFP_HIGHMEM);
^1da177e Linus Torvalds   2005-04-16  237  }
b5073173 Paul Mundt       2007-07-21  238  EXPORT_SYMBOL(__vmalloc);
^1da177e Linus Torvalds   2005-04-16  239  
c7e6abdb Michal Hocko     2017-05-03 @240  void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags)
c7e6abdb Michal Hocko     2017-05-03  241  {
c7e6abdb Michal Hocko     2017-05-03  242  	return __vmalloc(size, flags, PAGE_KERNEL);
c7e6abdb Michal Hocko     2017-05-03  243  }

:::::: The code at line 240 was first introduced by commit
:::::: c7e6abdbe12a86cfa1bdba2bd3e9f5fdb1cb175b mm: introduce kv[mz]alloc helpers

:::::: TO: Michal Hocko <mhocko@suse.com>
:::::: CC: Johannes Weiner <hannes@cmpxchg.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 5454 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 14:41 ` Michal Hocko
@ 2017-05-09 19:01   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-05-09 19:01 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML,
	Michal Hocko

Hi Michal,

On Tue, May 9, 2017 at 4:41 PM, Michal Hocko <mhocko@kernel.org> wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
>
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
>
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
>
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
>
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

FWIW, this did fix the following build failure on m68k in linus/master
(commit 2868b2513aa732a9 ("Merge tag 'linux-kselftest-4.12-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"):

    In file included from arch/m68k/include/asm/pgtable_mm.h:148,
                     from arch/m68k/include/asm/pgtable.h:5,
                     from include/linux/vmalloc.h:10,
                     from arch/m68k/kernel/module.c:10:
    arch/m68k/include/asm/motorola_pgtable.h: In function ‘pgd_offset’:
    arch/m68k/include/asm/motorola_pgtable.h:198: error: dereferencing
pointer to incomplete type
    scripts/Makefile.build:294: recipe for target
'arch/m68k/kernel/module.o' failed

but given the complaints from 0day on this and future versions, I think it's
better not to provide a Tested-by yet.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 19:01   ` Geert Uytterhoeven
  0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-05-09 19:01 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML,
	Michal Hocko

Hi Michal,

On Tue, May 9, 2017 at 4:41 PM, Michal Hocko <mhocko@kernel.org> wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
>
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
>
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
>
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
>
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

FWIW, this did fix the following build failure on m68k in linus/master
(commit 2868b2513aa732a9 ("Merge tag 'linux-kselftest-4.12-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"):

    In file included from arch/m68k/include/asm/pgtable_mm.h:148,
                     from arch/m68k/include/asm/pgtable.h:5,
                     from include/linux/vmalloc.h:10,
                     from arch/m68k/kernel/module.c:10:
    arch/m68k/include/asm/motorola_pgtable.h: In function ‘pgd_offset’:
    arch/m68k/include/asm/motorola_pgtable.h:198: error: dereferencing
pointer to incomplete type
    scripts/Makefile.build:294: recipe for target
'arch/m68k/kernel/module.o' failed

but given the complaints from 0day on this and future versions, I think it's
better not to provide a Tested-by yet.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 19:01   ` Geert Uytterhoeven
@ 2017-05-09 19:36     ` Michal Hocko
  -1 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 19:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML

On Tue 09-05-17 21:01:25, Geert Uytterhoeven wrote:
> Hi Michal,
> 
> On Tue, May 9, 2017 at 4:41 PM, Michal Hocko <mhocko@kernel.org> wrote:
> > From: Michal Hocko <mhocko@suse.com>
> >
> > 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> > asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> > to be a bad idea for some architectures. E.g. m68k fails with
> >    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
> >                     from arch/m68k/include/asm/pgtable.h:4,
> >                     from include/linux/vmalloc.h:9,
> >                     from arch/m68k/kernel/module.c:9:
> >    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
> >     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> >
> > as spotted by kernel build bot. nios2 fails for other reason
> > In file included from ./include/asm-generic/io.h:767:0,
> >                  from ./arch/nios2/include/asm/io.h:61,
> >                  from ./include/linux/io.h:25,
> >                  from ./arch/nios2/include/asm/pgtable.h:18,
> >                  from ./include/linux/mm.h:70,
> >                  from ./include/linux/pid_namespace.h:6,
> >                  from ./include/linux/ptrace.h:9,
> >                  from ./arch/nios2/include/uapi/asm/elf.h:23,
> >                  from ./arch/nios2/include/asm/elf.h:22,
> >                  from ./include/linux/elf.h:4,
> >                  from ./include/linux/module.h:15,
> >                  from init/main.c:16:
> > ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> > ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> >
> > which is due to the newly added #include <asm/pgtable.h>, which on nios2
> > includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> > again includes <linux/vmalloc.h>.
> >
> > Tweaking that around just turns out a bigger headache than
> > necessary. This patch reverts 1f5307b1e094 and reimplements the original
> > fix in a different way. __vmalloc_node_flags can stay static inline
> > which will cover vmalloc* functions. We only have one external user
> > (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> > provide the caller directly. This is much simpler and it doesn't really
> > need any games with header files.
> >
> > Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> 
> FWIW, this did fix the following build failure on m68k in linus/master
> (commit 2868b2513aa732a9 ("Merge tag 'linux-kselftest-4.12-rc1' of
> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"):
> 
>     In file included from arch/m68k/include/asm/pgtable_mm.h:148,
>                      from arch/m68k/include/asm/pgtable.h:5,
>                      from include/linux/vmalloc.h:10,
>                      from arch/m68k/kernel/module.c:10:
>     arch/m68k/include/asm/motorola_pgtable.h: In function ‘pgd_offset’:
>     arch/m68k/include/asm/motorola_pgtable.h:198: error: dereferencing
> pointer to incomplete type
>     scripts/Makefile.build:294: recipe for target
> 'arch/m68k/kernel/module.o' failed
> 
> but given the complaints from 0day on this and future versions, I think it's
> better not to provide a Tested-by yet.

FWIW I have already sent a follow up fix
http://lkml.kernel.org/r/20170509153702.GR6481@dhcp22.suse.cz
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-09 19:36     ` Michal Hocko
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Hocko @ 2017-05-09 19:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML

On Tue 09-05-17 21:01:25, Geert Uytterhoeven wrote:
> Hi Michal,
> 
> On Tue, May 9, 2017 at 4:41 PM, Michal Hocko <mhocko@kernel.org> wrote:
> > From: Michal Hocko <mhocko@suse.com>
> >
> > 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> > asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> > to be a bad idea for some architectures. E.g. m68k fails with
> >    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
> >                     from arch/m68k/include/asm/pgtable.h:4,
> >                     from include/linux/vmalloc.h:9,
> >                     from arch/m68k/kernel/module.c:9:
> >    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
> >     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> >
> > as spotted by kernel build bot. nios2 fails for other reason
> > In file included from ./include/asm-generic/io.h:767:0,
> >                  from ./arch/nios2/include/asm/io.h:61,
> >                  from ./include/linux/io.h:25,
> >                  from ./arch/nios2/include/asm/pgtable.h:18,
> >                  from ./include/linux/mm.h:70,
> >                  from ./include/linux/pid_namespace.h:6,
> >                  from ./include/linux/ptrace.h:9,
> >                  from ./arch/nios2/include/uapi/asm/elf.h:23,
> >                  from ./arch/nios2/include/asm/elf.h:22,
> >                  from ./include/linux/elf.h:4,
> >                  from ./include/linux/module.h:15,
> >                  from init/main.c:16:
> > ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> > ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> >
> > which is due to the newly added #include <asm/pgtable.h>, which on nios2
> > includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> > again includes <linux/vmalloc.h>.
> >
> > Tweaking that around just turns out a bigger headache than
> > necessary. This patch reverts 1f5307b1e094 and reimplements the original
> > fix in a different way. __vmalloc_node_flags can stay static inline
> > which will cover vmalloc* functions. We only have one external user
> > (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> > provide the caller directly. This is much simpler and it doesn't really
> > need any games with header files.
> >
> > Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> 
> FWIW, this did fix the following build failure on m68k in linus/master
> (commit 2868b2513aa732a9 ("Merge tag 'linux-kselftest-4.12-rc1' of
> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"):
> 
>     In file included from arch/m68k/include/asm/pgtable_mm.h:148,
>                      from arch/m68k/include/asm/pgtable.h:5,
>                      from include/linux/vmalloc.h:10,
>                      from arch/m68k/kernel/module.c:10:
>     arch/m68k/include/asm/motorola_pgtable.h: In function a??pgd_offseta??:
>     arch/m68k/include/asm/motorola_pgtable.h:198: error: dereferencing
> pointer to incomplete type
>     scripts/Makefile.build:294: recipe for target
> 'arch/m68k/kernel/module.o' failed
> 
> but given the complaints from 0day on this and future versions, I think it's
> better not to provide a Tested-by yet.

FWIW I have already sent a follow up fix
http://lkml.kernel.org/r/20170509153702.GR6481@dhcp22.suse.cz
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 15:37   ` Michal Hocko
@ 2017-05-10  9:37     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-05-10  9:37 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML

On Tue, May 9, 2017 at 5:37 PM, Michal Hocko <mhocko@kernel.org> wrote:
> Sigh. I've apparently managed to screw up again. This should address the
> nommu breakage reported by 0-day.
> ---
> From 95d49bf93ae4467f3f918520ec03b3596e5b36cc Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Tue, 9 May 2017 16:27:39 +0200
> Subject: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
>
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
>
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
>
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
>
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
>
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-10  9:37     ` Geert Uytterhoeven
  0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2017-05-10  9:37 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Linus Torvalds, Andrew Morton, Tobias Klauser, Linux MM, LKML

On Tue, May 9, 2017 at 5:37 PM, Michal Hocko <mhocko@kernel.org> wrote:
> Sigh. I've apparently managed to screw up again. This should address the
> nommu breakage reported by 0-day.
> ---
> From 95d49bf93ae4467f3f918520ec03b3596e5b36cc Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Tue, 9 May 2017 16:27:39 +0200
> Subject: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
>
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
>>> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
>
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
>
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
>
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
>
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
  2017-05-09 15:37   ` Michal Hocko
@ 2017-05-10  9:51     ` Tobias Klauser
  -1 siblings, 0 replies; 16+ messages in thread
From: Tobias Klauser @ 2017-05-10  9:51 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Linus Torvalds, Andrew Morton, linux-mm, LKML

On 2017-05-09 at 17:37:02 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> Sigh. I've apparently managed to screw up again. This should address the
> nommu breakage reported by 0-day.
> ---
> From 95d49bf93ae4467f3f918520ec03b3596e5b36cc Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Tue, 9 May 2017 16:27:39 +0200
> Subject: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
> 
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> 
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> 
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
> 
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
> 
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Tobias Klauser <tklauser@distanz.ch>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
@ 2017-05-10  9:51     ` Tobias Klauser
  0 siblings, 0 replies; 16+ messages in thread
From: Tobias Klauser @ 2017-05-10  9:51 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Linus Torvalds, Andrew Morton, linux-mm, LKML

On 2017-05-09 at 17:37:02 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> Sigh. I've apparently managed to screw up again. This should address the
> nommu breakage reported by 0-day.
> ---
> From 95d49bf93ae4467f3f918520ec03b3596e5b36cc Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Tue, 9 May 2017 16:27:39 +0200
> Subject: [PATCH] mm, vmalloc: fix vmalloc users tracking properly
> 
> 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users") has pulled
> asm/pgtable.h include dependency to linux/vmalloc.h and that turned out
> to be a bad idea for some architectures. E.g. m68k fails with
>    In file included from arch/m68k/include/asm/pgtable_mm.h:145:0,
>                     from arch/m68k/include/asm/pgtable.h:4,
>                     from include/linux/vmalloc.h:9,
>                     from arch/m68k/kernel/module.c:9:
>    arch/m68k/include/asm/mcf_pgtable.h: In function 'nocache_page':
> >> arch/m68k/include/asm/mcf_pgtable.h:339:43: error: 'init_mm' undeclared (first use in this function)
>     #define pgd_offset_k(address) pgd_offset(&init_mm, address)
> 
> as spotted by kernel build bot. nios2 fails for other reason
> In file included from ./include/asm-generic/io.h:767:0,
>                  from ./arch/nios2/include/asm/io.h:61,
>                  from ./include/linux/io.h:25,
>                  from ./arch/nios2/include/asm/pgtable.h:18,
>                  from ./include/linux/mm.h:70,
>                  from ./include/linux/pid_namespace.h:6,
>                  from ./include/linux/ptrace.h:9,
>                  from ./arch/nios2/include/uapi/asm/elf.h:23,
>                  from ./arch/nios2/include/asm/elf.h:22,
>                  from ./include/linux/elf.h:4,
>                  from ./include/linux/module.h:15,
>                  from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> 
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
> 
> Tweaking that around just turns out a bigger headache than
> necessary. This patch reverts 1f5307b1e094 and reimplements the original
> fix in a different way. __vmalloc_node_flags can stay static inline
> which will cover vmalloc* functions. We only have one external user
> (kvmalloc_node) and we can export __vmalloc_node_flags_caller and
> provide the caller directly. This is much simpler and it doesn't really
> need any games with header files.
> 
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Tested-by: Tobias Klauser <tklauser@distanz.ch>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-05-10  9:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 14:41 [PATCH] mm, vmalloc: fix vmalloc users tracking properly Michal Hocko
2017-05-09 14:41 ` Michal Hocko
2017-05-09 14:51 ` Tobias Klauser
2017-05-09 14:51   ` Tobias Klauser
2017-05-09 15:25 ` kbuild test robot
2017-05-09 15:37 ` Michal Hocko
2017-05-09 15:37   ` Michal Hocko
2017-05-10  9:37   ` Geert Uytterhoeven
2017-05-10  9:37     ` Geert Uytterhoeven
2017-05-10  9:51   ` Tobias Klauser
2017-05-10  9:51     ` Tobias Klauser
2017-05-09 15:59 ` kbuild test robot
2017-05-09 19:01 ` Geert Uytterhoeven
2017-05-09 19:01   ` Geert Uytterhoeven
2017-05-09 19:36   ` Michal Hocko
2017-05-09 19:36     ` Michal Hocko

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.