From: a.ryabinin@samsung.com (Andrey Ryabinin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: get rid of hardcoded assumptions about kernel stack size
Date: Fri, 04 Jul 2014 11:13:31 +0400 [thread overview]
Message-ID: <53B6541B.6000702@samsung.com> (raw)
In-Reply-To: <201407032224.28386.arnd@arndb.de>
On 07/04/14 00:24, Arnd Bergmann wrote:
> On Wednesday 18 June 2014, Andrey Ryabinin wrote:
>> diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
>> index f989d7c..f85d2b0 100644
>> --- a/arch/arm/include/asm/thread_info.h
>> +++ b/arch/arm/include/asm/thread_info.h
>> @@ -14,9 +14,10 @@
>>
>> #include <linux/compiler.h>
>> #include <asm/fpstate.h>
>> +#include <asm/page.h>
>>
>> #define THREAD_SIZE_ORDER 1
>> -#define THREAD_SIZE 8192
>> +#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
>> #define THREAD_START_SP (THREAD_SIZE - 8)
>>
>> #ifndef __ASSEMBLY__
>
> The extra #include has caused recursive inclusion on the iop13xx platform, as you
> can see below. I've been able to work around it using this small patch:
>
Right, I've got report about this from kbuild test robot, and I was going to send the same fix as yours,
but you come first.
> diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> index 17b4027..e851f5c 100644
> --- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> +++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> @@ -3,8 +3,6 @@
>
> #ifndef __ASSEMBLY__
>
> -#include <linux/reboot.h>
> -
> /* The ATU offsets can change based on the strapping */
> extern u32 iop13xx_atux_pmmr_offset;
> extern u32 iop13xx_atue_pmmr_offset;
> @@ -14,6 +12,7 @@ void iop13xx_map_io(void);
> void iop13xx_platform_init(void);
> void iop13xx_add_tpmi_devices(void);
> void iop13xx_init_irq(void);
> +enum reboot_mode;
> void iop13xx_restart(enum reboot_mode, const char *);
>
> /* CPUID CP6 R0 Page 0 */
> diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
> index bca96f43..53c316f 100644
> --- a/arch/arm/mach-iop13xx/setup.c
> +++ b/arch/arm/mach-iop13xx/setup.c
> @@ -20,6 +20,7 @@
> #include <linux/dma-mapping.h>
> #include <linux/serial_8250.h>
> #include <linux/io.h>
> +#include <linux/reboot.h>
> #ifdef CONFIG_MTD_PHYSMAP
> #include <linux/mtd/physmap.h>
> #endif
>
>
> but I wonder if there is a way to avoid the extra include here, as it might also
> cause a general slowdown because of asm/memory.h getting pulled into more .c
> files. Would it be reasonable to hardcode PAGE_SIZE here?
>
IMO it's a bug of iop13xx platform, that it includes "higlevel" linux/reboot.h
from a very "lowlevel" header mach/iop13xx.h. I think it should be fixed with a patch above.
Slowing down of kernel build for a few more seconds is not good enough reason for me to
hardcode PAGE_SIZE here.
> Arnd
>
> ----
> In file included from /git/arm-soc/include/linux/srcu.h:33:0,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/rcupdate.h: In function '__rcu_read_lock':
> /git/arm-soc/include/linux/rcupdate.h:219:2: error: implicit declaration of function 'preempt_disable' [-Werror=implicit-function-declaration]
> preempt_disable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function '__rcu_read_unlock':
> /git/arm-soc/include/linux/rcupdate.h:224:2: error: implicit declaration of function 'preempt_enable' [-Werror=implicit-function-declaration]
> preempt_enable();
> ^
> In file included from /git/arm-soc/include/linux/srcu.h:33:0,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_lock_bh':
> /git/arm-soc/include/linux/rcupdate.h:928:2: error: implicit declaration of function 'local_bh_disable' [-Werror=implicit-function-declaration]
> local_bh_disable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_unlock_bh':
> /git/arm-soc/include/linux/rcupdate.h:942:2: error: implicit declaration of function 'local_bh_enable' [-Werror=implicit-function-declaration]
> local_bh_enable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_lock_sched_notrace':
> /git/arm-soc/include/linux/rcupdate.h:968:2: error: implicit declaration of function 'preempt_disable_notrace' [-Werror=implicit-function-declaration]
> preempt_disable_notrace();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_unlock_sched_notrace':
> /git/arm-soc/include/linux/rcupdate.h:988:2: error: implicit declaration of function 'preempt_enable_notrace' [-Werror=implicit-function-declaration]
> preempt_enable_notrace();
> ^
> In file included from /git/arm-soc/include/linux/ktime.h:25:0,
> from /git/arm-soc/include/linux/timer.h:5,
> from /git/arm-soc/include/linux/workqueue.h:8,
> from /git/arm-soc/include/linux/srcu.h:34,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/jiffies.h: At top level:
> /git/arm-soc/include/linux/jiffies.h:256:10: warning: "NSEC_PER_SEC" is not defined [-Wundef]
> ... many more...
>
WARNING: multiple messages have this Message-ID (diff)
From: Andrey Ryabinin <a.ryabinin@samsung.com>
To: Arnd Bergmann <arnd@arndb.de>, linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>,
Nicolas Pitre <nico@linaro.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm: get rid of hardcoded assumptions about kernel stack size
Date: Fri, 04 Jul 2014 11:13:31 +0400 [thread overview]
Message-ID: <53B6541B.6000702@samsung.com> (raw)
In-Reply-To: <201407032224.28386.arnd@arndb.de>
On 07/04/14 00:24, Arnd Bergmann wrote:
> On Wednesday 18 June 2014, Andrey Ryabinin wrote:
>> diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
>> index f989d7c..f85d2b0 100644
>> --- a/arch/arm/include/asm/thread_info.h
>> +++ b/arch/arm/include/asm/thread_info.h
>> @@ -14,9 +14,10 @@
>>
>> #include <linux/compiler.h>
>> #include <asm/fpstate.h>
>> +#include <asm/page.h>
>>
>> #define THREAD_SIZE_ORDER 1
>> -#define THREAD_SIZE 8192
>> +#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
>> #define THREAD_START_SP (THREAD_SIZE - 8)
>>
>> #ifndef __ASSEMBLY__
>
> The extra #include has caused recursive inclusion on the iop13xx platform, as you
> can see below. I've been able to work around it using this small patch:
>
Right, I've got report about this from kbuild test robot, and I was going to send the same fix as yours,
but you come first.
> diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> index 17b4027..e851f5c 100644
> --- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> +++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> @@ -3,8 +3,6 @@
>
> #ifndef __ASSEMBLY__
>
> -#include <linux/reboot.h>
> -
> /* The ATU offsets can change based on the strapping */
> extern u32 iop13xx_atux_pmmr_offset;
> extern u32 iop13xx_atue_pmmr_offset;
> @@ -14,6 +12,7 @@ void iop13xx_map_io(void);
> void iop13xx_platform_init(void);
> void iop13xx_add_tpmi_devices(void);
> void iop13xx_init_irq(void);
> +enum reboot_mode;
> void iop13xx_restart(enum reboot_mode, const char *);
>
> /* CPUID CP6 R0 Page 0 */
> diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
> index bca96f43..53c316f 100644
> --- a/arch/arm/mach-iop13xx/setup.c
> +++ b/arch/arm/mach-iop13xx/setup.c
> @@ -20,6 +20,7 @@
> #include <linux/dma-mapping.h>
> #include <linux/serial_8250.h>
> #include <linux/io.h>
> +#include <linux/reboot.h>
> #ifdef CONFIG_MTD_PHYSMAP
> #include <linux/mtd/physmap.h>
> #endif
>
>
> but I wonder if there is a way to avoid the extra include here, as it might also
> cause a general slowdown because of asm/memory.h getting pulled into more .c
> files. Would it be reasonable to hardcode PAGE_SIZE here?
>
IMO it's a bug of iop13xx platform, that it includes "higlevel" linux/reboot.h
from a very "lowlevel" header mach/iop13xx.h. I think it should be fixed with a patch above.
Slowing down of kernel build for a few more seconds is not good enough reason for me to
hardcode PAGE_SIZE here.
> Arnd
>
> ----
> In file included from /git/arm-soc/include/linux/srcu.h:33:0,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/rcupdate.h: In function '__rcu_read_lock':
> /git/arm-soc/include/linux/rcupdate.h:219:2: error: implicit declaration of function 'preempt_disable' [-Werror=implicit-function-declaration]
> preempt_disable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function '__rcu_read_unlock':
> /git/arm-soc/include/linux/rcupdate.h:224:2: error: implicit declaration of function 'preempt_enable' [-Werror=implicit-function-declaration]
> preempt_enable();
> ^
> In file included from /git/arm-soc/include/linux/srcu.h:33:0,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_lock_bh':
> /git/arm-soc/include/linux/rcupdate.h:928:2: error: implicit declaration of function 'local_bh_disable' [-Werror=implicit-function-declaration]
> local_bh_disable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_unlock_bh':
> /git/arm-soc/include/linux/rcupdate.h:942:2: error: implicit declaration of function 'local_bh_enable' [-Werror=implicit-function-declaration]
> local_bh_enable();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_lock_sched_notrace':
> /git/arm-soc/include/linux/rcupdate.h:968:2: error: implicit declaration of function 'preempt_disable_notrace' [-Werror=implicit-function-declaration]
> preempt_disable_notrace();
> ^
> /git/arm-soc/include/linux/rcupdate.h: In function 'rcu_read_unlock_sched_notrace':
> /git/arm-soc/include/linux/rcupdate.h:988:2: error: implicit declaration of function 'preempt_enable_notrace' [-Werror=implicit-function-declaration]
> preempt_enable_notrace();
> ^
> In file included from /git/arm-soc/include/linux/ktime.h:25:0,
> from /git/arm-soc/include/linux/timer.h:5,
> from /git/arm-soc/include/linux/workqueue.h:8,
> from /git/arm-soc/include/linux/srcu.h:34,
> from /git/arm-soc/include/linux/notifier.h:15,
> from /git/arm-soc/include/linux/reboot.h:5,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/iop13xx.h:6,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/hardware.h:14,
> from /git/arm-soc/arch/arm/mach-iop13xx/include/mach/memory.h:4,
> from /git/arm-soc/arch/arm/include/asm/memory.h:24,
> from /git/arm-soc/arch/arm/include/asm/page.h:163,
> from /git/arm-soc/arch/arm/include/asm/thread_info.h:17,
> from /git/arm-soc/include/linux/thread_info.h:54,
> from /git/arm-soc/include/asm-generic/preempt.h:4,
> from arch/arm/include/generated/asm/preempt.h:1,
> from /git/arm-soc/include/linux/preempt.h:18,
> from /git/arm-soc/include/linux/spinlock.h:50,
> from /git/arm-soc/include/linux/seqlock.h:35,
> from /git/arm-soc/include/linux/time.h:5,
> from /git/arm-soc/include/uapi/linux/timex.h:56,
> from /git/arm-soc/include/linux/timex.h:56,
> from /git/arm-soc/include/linux/sched.h:19,
> from /git/arm-soc/arch/arm/kernel/asm-offsets.c:13:
> /git/arm-soc/include/linux/jiffies.h: At top level:
> /git/arm-soc/include/linux/jiffies.h:256:10: warning: "NSEC_PER_SEC" is not defined [-Wundef]
> ... many more...
>
next prev parent reply other threads:[~2014-07-04 7:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 13:50 [PATCH] arm: get rid of hardcoded assumptions about kernel stack size Andrey Ryabinin
2014-06-18 13:50 ` Andrey Ryabinin
2014-06-18 14:31 ` Will Deacon
2014-06-18 14:31 ` Will Deacon
2014-06-18 14:49 ` Andrey Ryabinin
2014-06-18 14:49 ` Andrey Ryabinin
2014-06-18 14:40 ` Nicolas Pitre
2014-06-18 14:40 ` Nicolas Pitre
2014-06-18 15:27 ` Andrey Ryabinin
2014-06-18 15:27 ` Andrey Ryabinin
2014-07-03 20:24 ` Arnd Bergmann
2014-07-03 20:24 ` Arnd Bergmann
2014-07-04 7:13 ` Andrey Ryabinin [this message]
2014-07-04 7:13 ` Andrey Ryabinin
2014-07-04 10:27 ` Arnd Bergmann
2014-07-04 10:27 ` Arnd Bergmann
2014-07-04 13:38 ` Andrey Ryabinin
2014-07-04 13:38 ` Andrey Ryabinin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53B6541B.6000702@samsung.com \
--to=a.ryabinin@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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.