Re: [PATCH 3/3] x86/fpu: Remove init_task FPU state dependencies, add debugging warning

From: Linus Torvalds
Date: Wed Jun 05 2024 - 13:28:32 EST


On Wed, 5 Jun 2024 at 09:27, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> Yes, but kernel_fpu_begin() never does save_fpregs_to_fpstate() if
> current->flags & PF_KTHREAD ?

Ahh, and init_thread does have PF_KTHREAD.

Ok, looks fine to me, except I think the commit message should be cleared up.

The whole sentence about

"But the init task isn't supposed to be using the FPU in any case ..."

is just simply not true.

It should be more along the lines of "kernel threads don't need an FPU
save area, because their FPU use is not preemptible or reentrant and
they don't return to user space".

Linus