Re: [PATCH] init/Kconfig: Update the THREAD_INFO_IN_TASK description
Huacai Chen <[email protected]>
| Newsgroups | gmane.linux.kbuild.devel |
|---|---|
| Message-ID | <CAAhV-H54YJ_5_XYxGCDTMF2e3gC91JtW5QnJfvjbVnCjbfv=bw@mail.gmail.com> |
Hi, Nathan, On Tue, Jun 9, 2026 at 5:46 AM Nathan Chancellor <[email protected]> wrote: > > Hi Huacai, > > On Sat, Jun 06, 2026 at 05:25:01PM +0800, Huacai Chen 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 <[email protected]> > > You addressed this to Kbuild folks but I don't really think this is our > domain. I think you would be better off sending this to the scheduler > folks or Andrew Morton. OK, I will resend it to scheduler. Thanks. Huacai > > > --- > > 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 > > > > -- > Cheers, > Nathan