Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2021 13:26:18 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>, Emmanuel Vadot <manu@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 11d62b6f31ab - main - linuxkpi: add kernel_fpu_begin/kernel_fpu_end
Message-ID:  <be0ef658-6075-5575-7221-2701208b5812@FreeBSD.org>
In-Reply-To: <X/2hR9Hi3Jhf5ZNs@kib.kiev.ua>
References:  <202101121143.10CBh02x095972@gitrepo.freebsd.org> <X/2hR9Hi3Jhf5ZNs@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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@FreeBSD.org>
>> AuthorDate: 2021-01-12 11:02:38 +0000
>> Commit:     Emmanuel Vadot <manu@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?be0ef658-6075-5575-7221-2701208b5812>