lkml.org 
[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v9 00/27] x86: load FPU registers on return to userland
Date
From: Sebastian Andrzej Siewior
> Sent: 03 April 2019 17:41
...
> To access the FPU registers in kernel we need:
> - disable preemption to avoid that the scheduler switches tasks. By
> doing so it would set TIF_NEED_FPU_LOAD and the FPU registers would be
> not valid.
> - disable BH because the softirq might use kernel_fpu_begin() and then
> set TIF_NEED_FPU_LOAD instead loading the FPU registers on completion.

Is there a possible optimisation here for kernel threads?
Since there is no 'user FP state' the 'kernel FP state' can
be saved by a task switch or softirq.

You'd still want the kernel thread to bracket fpu usage (or at least say
that it is a kernel thread that always needs the fpu) to avoid having
to save and restore the fpu registers on every context switch to/from
a kernel thread.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2019-04-04 16:00    [W:0.289 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site