Re: [PATCH V2] sched: Update the THREAD_INFO_IN_TASK description
From: Huacai Chen
Date: Sat Jul 25 2026 - 23:43:05 EST
Gentle ping?
Huacai
On Tue, Jun 9, 2026 at 11:20 AM Huacai Chen <chenhuacai@xxxxxxxxxxx> wrote:
>
> When commit c65eacbe290b81 ("sched/core: Allow putting thread_info into
> task_struct") introduces THREAD_INFO_IN_TASK in 4.9, the only supported
> architecture is x86 and thread_info only has a flags field. The Kconfig
> description said thread_info should only has the flags field but didn't
> explain the reason.
>
> When commit c02433dd6de32f ("arm64: split thread_info from task stack")
> introduces THREAD_INFO_IN_TASK for arm64 in 4.10, its thread_info has
> more fields than a single flags, and arm64 works well.
>
> Then commit 37a8f7c38339b2 ("x86/asm: Move 'status' from thread_struct
> to thread_info") adds status back to thread_info for x86 in 4.16, and
> x86 still works well.
>
> After that, risc-v, powerpc and many other architectures all introduce
> THREAD_INFO_IN_TASK and their thread_info have more fields rather than
> a single flags field, of course they also work well.
>
> I don't know the exact reason of the original description, but obviously
> it is wrong and misleading, so I update it, let LoongArch and some other
> architectures easier to support THREAD_INFO_IN_TASK.
>
> Also improve the try_get_task_stack() and put_task_stack() description.
>
> Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
> ---
> init/Kconfig | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/init/Kconfig b/init/Kconfig
> index 2937c4d308ae..a9466879d553 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -207,11 +207,12 @@ config THREAD_INFO_IN_TASK
> bool
> help
> Select this to move thread_info off the stack into task_struct. To
> - make this work, an arch will need to remove all thread_info fields
> - except flags and fix any runtime bugs.
> + make this work, an arch will need to remove the task_struct pointer
> + field from thread_info and fix any runtime bugs.
>
> One subtle change that will be needed is to use try_get_task_stack()
> - and put_task_stack() in save_thread_stack_tsk() and get_wchan().
> + and put_task_stack() in save_thread_stack_tsk(), get_wchan() and any
> + other stacktrace functions.
>
> menu "General setup"
>
> --
> 2.52.0
>