linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: use 16KB kernel stack on 64-bit
@ 2020-07-06 12:32 Andreas Schwab
  2020-07-06 13:32 ` Anup Patel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Schwab @ 2020-07-06 12:32 UTC (permalink / raw)
  To: linux-riscv; +Cc: linux-kernel

With the current 8KB stack size there are frequent overflows in a 64-bit
configuration.

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 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


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] riscv: use 16KB kernel stack on 64-bit
  2020-07-06 12:32 [PATCH] riscv: use 16KB kernel stack on 64-bit Andreas Schwab
@ 2020-07-06 13:32 ` Anup Patel
  2020-07-07  8:16 ` Aurelien Jarno
  2020-07-08 14:56 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Anup Patel @ 2020-07-06 13:32 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-riscv, linux-kernel@vger.kernel.org List

On Mon, Jul 6, 2020 at 6:02 PM Andreas Schwab <schwab@suse.de> wrote:
>
> With the current 8KB stack size there are frequent overflows in a 64-bit
> configuration.
>
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  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
>
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

Looks good to me.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

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

* Re: [PATCH] riscv: use 16KB kernel stack on 64-bit
  2020-07-06 12:32 [PATCH] riscv: use 16KB kernel stack on 64-bit Andreas Schwab
  2020-07-06 13:32 ` Anup Patel
@ 2020-07-07  8:16 ` Aurelien Jarno
  2020-07-08 14:56 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2020-07-07  8:16 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-riscv, linux-kernel

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@suse.de>
> ---
>  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@aurel32.net                 http://www.aurel32.net

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

* Re: [PATCH] riscv: use 16KB kernel stack on 64-bit
  2020-07-06 12:32 [PATCH] riscv: use 16KB kernel stack on 64-bit Andreas Schwab
  2020-07-06 13:32 ` Anup Patel
  2020-07-07  8:16 ` Aurelien Jarno
@ 2020-07-08 14:56 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-07-08 14:56 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-riscv, linux-kernel

On Mon, Jul 06, 2020 at 02:32:26PM +0200, Andreas Schwab wrote:
> With the current 8KB stack size there are frequent overflows in a 64-bit
> configuration.

Adding irqstack support would be the better fix..

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

end of thread, other threads:[~2020-07-08 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 12:32 [PATCH] riscv: use 16KB kernel stack on 64-bit Andreas Schwab
2020-07-06 13:32 ` Anup Patel
2020-07-07  8:16 ` Aurelien Jarno
2020-07-08 14:56 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).