Re: [PATCH] x86/fpu: Fix potential NULL dereference in avx512_status()
From: Christoph Hellwig
Date: Tue Jul 22 2025 - 01:35:31 EST
On Mon, Jul 21, 2025 at 07:09:52AM -0700, Dave Hansen wrote:
> On 7/18/25 16:48, Sohil Mehta wrote:
> > + /* Do not report AVX512 usage for kernel threads */
> > + if (!(task->flags & (PF_KTHREAD | PF_USER_WORKER)))
> > + timestamp = READ_ONCE(x86_task_fpu(task)->avx512_timestamp);
>
> But the original reason that folks wanted this was so they can go find
> all the AVX-512 users and cluster them together. They obviously can't do
> that today if they're oopsing their kernels.
>
> But the real question to ask here is whether kernel threads can use
> AVX-512, and whether it's important to let userspace know which threads
> are using it.
>
> Let's fix the oops, then circle around and figure out whether tracking
> AVX-512 use in kernel threads is needed.
The RAID6 Q-stripe calculation has a AVX512 implementation which
usually is called from workqueue context.