git: 11d62b6f31ab - main - linuxkpi: add kernel_fpu_begin/kernel_fpu_end

John Baldwin jhb at FreeBSD.org
Tue Jan 12 21:26:20 UTC 2021


On 1/12/21 5:16 AM, Konstantin Belousov wrote:
> On Tue, Jan 12, 2021 at 11:43:00AM +0000, Emmanuel Vadot wrote:
>> The branch main has been updated by manu:
>>
>> URL: https://cgit.FreeBSD.org/src/commit/?id=11d62b6f31ab4e99df6d0c6c23406b57eaa37f41
>>
>> commit 11d62b6f31ab4e99df6d0c6c23406b57eaa37f41
>> Author:     Emmanuel Vadot <manu at FreeBSD.org>
>> AuthorDate: 2021-01-12 11:02:38 +0000
>> Commit:     Emmanuel Vadot <manu at FreeBSD.org>
>> CommitDate: 2021-01-12 11:31:00 +0000
>>
>>     linuxkpi: add kernel_fpu_begin/kernel_fpu_end
>>     
>>     With newer AMD GPUs (>=Navi,Renoir) there is FPU context usage in the
>>     amdgpu driver.
>>     The `kernel_fpu_begin/end` implementations in drm did not even allow nested
>>     begin-end blocks.
> 
> Does Linux allow more then one thread to execute kernel_fpu_begin ?

I wonder if FPU_KERN_NOCTX is a better fit?

https://stackoverflow.com/questions/15934615/calling-kernel-fpu-begin-twice-before-kernel-fpu-end

Claims you can't nest, and the body of the functions shown disable
preemption which might be a good match for FPU_KERN_NOCTX?  Though
I'm not sure if Linux permits sleeping while in fpu_kern_begin().

-- 
John Baldwin


More information about the dev-commits-src-all mailing list