Re: [PATCH v8 3/3] riscv: store percpu offset into thread_info
Thomas Gleixner <[email protected]>
| Newsgroups | org.kernel.vger.linux-arch,dev.linux.lists.llvm,org.infradead.lists.linux-riscv,org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <87bjcnlrbv.ffs@fw13> |
On Fri, Jul 03 2026 at 20:28, Yunhui Cui wrote:
> +
> extern struct task_struct *__switch_to(struct task_struct *,
> struct task_struct *);
>
> @@ -122,6 +129,7 @@ do { \
> if (switch_to_should_flush_icache(__next)) \
> local_flush_icache_all(); \
> __switch_to_envcfg(__next); \
> + __switch_to_pcpu_offset(__next); \
Why do you want to go through the indirection of current:
> +static inline void __switch_to_pcpu_offset(struct task_struct *next)
> +{
> +#ifdef CONFIG_SMP
> + next->thread_info.pcpu_offset = __my_cpu_offset;
> +#endif
> +}
instead of using __prev->.....offset, which is right there available?