hexagon: build error in -next due to 'mm: memcontrol: per-lruvec stats infrastructure'
Quoted 25 lines · On Fri, Jun 16, 2017 at 01:37:21PM -0700, wrote:
Quoted 6 lines · On Fri, 16 Jun 2017 16:15:23 -0400 Johannes Weiner <[email protected]> wrote:
In any case,
memcontrol.hdoesn't/shouldn't needhardirq.h. When that include is removed, the below patch compiles on: x86 allno,x86_64allno, and my regularx86_64config:---
Subject: mm-memcontrol-per-lruvec-stats-infrastructure-fix-4Did you try
x86_64allmodconfig? I'm getting a mess:In file included from
./include/linux/mm.h:1032,from ./include/linux/highmem.h:7, from ./include/linux/bio.h:21, from ./include/linux/writeback.h:205, from ./include/linux/memcontrol.h:28, from ./include/linux/swap.h:8, from ./include/linux/suspend.h:4, from arch/x86/kernel/asm-offsets.c:12:
./include/linux/vmstat.h: In function 'lruvec_page_state':./include/linux/vmstat.h:362: error: implicit declaration of function 'mem_cgroup_disabled'./include/linux/vmstat.h:365: error: dereferencing pointer to incomplete type./include/linux/vmstat.h:365: error: type defaults to 'int' in declaration of 'type name'
...
Quoted 4 lines
Presumably because we have
memcontrol.hindirectly includingmm.hwhich includesvmstat.h(from a stupid place) and with this patch we havevmstat.hincludingmemcontrol.h.
How about the following ? Seems to be less invasive, and it fixes the immediate problem.
Guenter
---
Quoted 1 line
From
3aa278a36b5f71ff64b28e0cea05182fbcaa72e6Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Sat, 17 Jun 2017 08:15:57 -0700
Subject: [PATCH] hexagon: Fix build error caused by include file order
hexagon builds fail with the following error message. In file included from ./include/linux/memcontrol.h:30:0,
from ./include/linux/swap.h:8, from ./arch/hexagon/include/asm/pgtable.h:27, from ./include/linux/mm.h:70, from arch/hexagon/kernel/asm-offsets.c:28:
./include/linux/vmstat.h: In function '__inc_zone_page_state':./include/linux/vmstat.h:294:2: error:
implicit declaration of function 'page_zone'
Drop unnecessary includes from header files and add missing includes to source files to fix the problem.
--- arch/hexagon/include/asm/pgtable.h | 1 - arch/hexagon/kernel/asm-offsets.c | 1 - arch/hexagon/mm/vm_tlb.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)
arch/hexagon/include/asm/pgtable.h +0 -1
@@ -24,7 +24,6 @@/* * Page table definitions for Qualcomm Hexagon processor. */ -#include <linux/swap.h> #include <asm/page.h> #define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h>
arch/hexagon/kernel/asm-offsets.c +0 -1
@@ -25,7 +25,6 @@#include <linux/compat.h> #include <linux/types.h> #include <linux/sched.h> -#include <linux/mm.h> #include <linux/interrupt.h> #include <linux/kbuild.h> #include <asm/ptrace.h>
arch/hexagon/mm/vm_tlb.c +1 -0
@@ -24,6 +24,7 @@* be instantiated for it, differently from a native build. */ #include <linux/mm.h> +#include <linux/sched.h> #include <asm/page.h> #include <asm/hexagon_vm.h>
Signature · 1 line
2.7.4
Johannes Weiner
Acked-byQuoted 52 lines · Guenter Roeck
Quoted 25 lines · On Fri, Jun 16, 2017 at 01:37:21PM -0700, wrote:
Quoted 6 lines · On Fri, 16 Jun 2017 16:15:23 -0400 Johannes Weiner <[email protected]> wrote:
In any case,
memcontrol.hdoesn't/shouldn't needhardirq.h. When that include is removed, the below patch compiles on: x86 allno,x86_64allno, and my regularx86_64config:---
Subject: mm-memcontrol-per-lruvec-stats-infrastructure-fix-4Did you try
x86_64allmodconfig? I'm getting a mess:In file included from
./include/linux/mm.h:1032,from ./include/linux/highmem.h:7, from ./include/linux/bio.h:21, from ./include/linux/writeback.h:205, from ./include/linux/memcontrol.h:28, from ./include/linux/swap.h:8, from ./include/linux/suspend.h:4, from arch/x86/kernel/asm-offsets.c:12:
./include/linux/vmstat.h: In function 'lruvec_page_state':./include/linux/vmstat.h:362: error: implicit declaration of function 'mem_cgroup_disabled'./include/linux/vmstat.h:365: error: dereferencing pointer to incomplete type./include/linux/vmstat.h:365: error: type defaults to 'int' in declaration of 'type name'
...Quoted 4 lines
Presumably because we have
memcontrol.hindirectly includingmm.hwhich includesvmstat.h(from a stupid place) and with this patch we havevmstat.hincludingmemcontrol.h.How about the following ? Seems to be less invasive, and it fixes the immediate problem.
Guenter
---
From3aa278a36b5f71ff64b28e0cea05182fbcaa72e6Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Sat, 17 Jun 2017 08:15:57 -0700
Subject: [PATCH] hexagon: Fix build error caused by include file orderhexagon builds fail with the following error message. In file included from
./include/linux/memcontrol.h:30:0,from ./include/linux/swap.h:8, from ./arch/hexagon/include/asm/pgtable.h:27, from ./include/linux/mm.h:70, from arch/hexagon/kernel/asm-offsets.c:28:
./include/linux/vmstat.h: In function '__inc_zone_page_state':./include/linux/vmstat.h:294:2: error:
implicit declaration of function 'page_zone'
Quoted 7 lines
Drop unnecessary includes from header files and add missing includes to source files to fix the problem.
Cc Johannes Weiner <[email protected]>Cc Andrew Morton <[email protected]>Fixes fb6646f52c45 ("mm: memcontrol: per-lruvec stats infrastructure")Signed-off-by Guenter Roeck <[email protected]>
If they're not needed, all the better. Thanks!