Skip to contentSkip to conversation

riscv: use 16KB kernel stack on 64-bit

PATCH In review Andreas Schwab 4 participants 4 messages Jul 6, 2020 – Jul 8, 2020 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: use 16KB kernel stack on 64-bit

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

---
 arch/riscv/include/asm/thread_info.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/include/asm/thread_info.h +4 -0
index 1dd12a0cbb2b..464a2bbc97ea 100644
@@ -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__
Signature · 7 lines
2.26.2


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Andreas Schwab

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

---
 arch/riscv/include/asm/thread_info.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/include/asm/thread_info.h +4 -1
index 1dd12a0cbb2b..464a2bbc97ea 100644
@@ -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

Quoted 4 lines

--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Looks good to me.

Regards,
Anup

#2 lore raw
In reply to Andreas Schwab
Quoted 26 lines · Andreas Schwab

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

---
 arch/riscv/include/asm/thread_info.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/include/asm/thread_info.h +4 -0
index 1dd12a0cbb2b..464a2bbc97ea 100644
@@ -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__
Signature · 1 line
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.

Signature · 7 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv