Re: [PATCH] riscv: use 16KB kernel stack on 64-bit

From: Aurelien Jarno
Date: Tue Jul 07 2020 - 04:46:58 EST


On 2020-07-06 14:32, Andreas Schwab wrote:
> With the current 8KB stack size there are frequent overflows in a 64-bit
> configuration.
>
> Signed-off-by: Andreas Schwab <schwab@xxxxxxx>
> ---
> arch/riscv/include/asm/thread_info.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
> index 1dd12a0cbb2b..464a2bbc97ea 100644
> --- a/arch/riscv/include/asm/thread_info.h
> +++ b/arch/riscv/include/asm/thread_info.h
> @@ -12,7 +12,11 @@
> #include <linux/const.h>
>
> /* thread information allocation */
> +#ifdef CONFIG_64BIT
> +#define THREAD_SIZE_ORDER (2)
> +#else
> #define THREAD_SIZE_ORDER (1)
> +#endif
> #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
>
> #ifndef __ASSEMBLY__
> --
> 2.26.2


Following the discussion on the mailing list, I have been trying this
patch on my system for a few days, and it indeed seems more stable. I
just wonder if you should Cc stable@ so that it is backported in older
kernel versions.

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@xxxxxxxxxxx http://www.aurel32.net