Thread (32 messages) 32 messages, 9 authors, 2021-10-05

Re: [RFC PATCH 5/8] sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y

flat view

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2021-09-14 15:53:13
Also in: linux-riscv, linux-s390, linuxppc-dev, lkml

On Tue, Sep 14, 2021 at 5:11 AM Ard Biesheuvel [off-list ref] wrote:
quoted hunk ↗ jump to hunk

 static inline unsigned int task_cpu(const struct task_struct *p)
 {
 #ifdef CONFIG_THREAD_INFO_IN_TASK
-       return READ_ONCE(p->cpu);
+       return READ_ONCE(p->thread_info.cpu);
 #else
        return READ_ONCE(task_thread_info(p)->cpu);
 #endif
Those two lines look different, but aren't.

Please just remove the CONFIG_THREAD_INFO_IN_TASK conditional, and use

          return READ_ONCE(task_thread_info(p)->cpu);

unconditionally, which now does the right thing regardless.

             Linus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help