Re: [PATCH v2] sparc64: increase kernel thread stack size to 32K
From: Stian Halseth
Date: Sun Sep 27 2026 - 17:31:48 EST
Hi Imre,
Sending V3 with two separate patches now.
Thank for the feedback and testing!
Stian
On Sun, 2026-09-27 at 22:49 +0200, Imre Kaloz wrote:
> Hi Stian,
>
> I ran this on a Sun Ultra 45 (UltraSPARC IIIi, SMP). The unpatched
> kernel hits "corrupted stack end detected inside scheduler" in
> hub_power_on() on 10 out of 10 boots with USB devices attached. With
> the 32K stack it boots clean every time: 6 boots with the v1 diff,
> 10 more with the minimal diff below. A forced hub/device rebind with
> the stack tracer armed peaked at 15832 of 32768 bytes, so 32K looks
> like plenty here.
>
> On v1, Andreas agreed with 32K but asked for the dead else branches
> to be pulled into their own patch with a fixup tag for 15b9350a177b,
> since that commit should have removed them already. v2 folds the
> removal into the same patch, so I'd split it back out for v3: the
> fix as the minimal diff below, the else-branch removal as its own
> patch on top. Nice work!
>
> The minimal diff is below the scissors, feel free to fold it in.
>
> Tested-by: Imre Kaloz <kaloz@xxxxxxxxxx> # Sun Ultra 45
>
>
> Best,
> Imre
>
> -- >8 --
> Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
> ---
> diff --git a/arch/sparc/include/asm/thread_info_64.h
> b/arch/sparc/include/asm/thread_info_64.h
> index c8a73dff27f8..ec552513d63c 100644
> --- a/arch/sparc/include/asm/thread_info_64.h
> +++ b/arch/sparc/include/asm/thread_info_64.h
> @@ -100,8 +100,8 @@ struct thread_info {
> #define FAULT_CODE_BAD_RA 0x20 /* Bad RA for
> sun4v */
>
> #if PAGE_SHIFT == 13
> -#define THREAD_SIZE (2*PAGE_SIZE)
> -#define THREAD_SHIFT (PAGE_SHIFT + 1)
> +#define THREAD_SIZE (4*PAGE_SIZE)
> +#define THREAD_SHIFT (PAGE_SHIFT + 2)
> #else /* PAGE_SHIFT == 13 */
> #define THREAD_SIZE PAGE_SIZE
> #define THREAD_SHIFT PAGE_SHIFT
> @@ -129,7 +129,7 @@ extern struct thread_info
> *current_thread_info(void);
>
> /* thread information allocation */
> #if PAGE_SHIFT == 13
> -#define THREAD_SIZE_ORDER 1
> +#define THREAD_SIZE_ORDER 2
> #else /* PAGE_SHIFT == 13 */
> #define THREAD_SIZE_ORDER 0
> #endif /* PAGE_SHIFT == 13 */
Attachment:
signature.asc
Description: This is a digitally signed message part