From: Julien Grall <julien.grall@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: kvmarm@lists.cs.columbia.edu, ard.biesheuvel@linaro.org,
julien.thierry@arm.com, marc.zyngier@arm.com,
suzuki.poulose@arm.com, will.deacon@arm.com,
christoffer.dall@arm.com, linux-kernel@vger.kernel.org,
james.morse@arm.com, Dave.Martin@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state
Date: Tue, 4 Jun 2019 11:35:11 +0100 [thread overview]
Message-ID: <5c159919-d220-f8dc-d609-b1b1b2844d4b@arm.com> (raw)
In-Reply-To: <20190603212104.mhz7vvj7afb2p3yr@mbp>
Hi Catalin,
On 6/3/19 10:21 PM, Catalin Marinas wrote:
> On Mon, Jun 03, 2019 at 05:25:34PM +0100, Catalin Marinas wrote:
>> On Tue, May 21, 2019 at 06:21:39PM +0100, Julien Grall wrote:
>>> Since a softirq is supposed to check may_use_simd() anyway before
>>> attempting to use FPSIMD/SVE, there is limited reason to keep softirq
>>> disabled when touching the FPSIMD/SVE context. Instead, we can simply
>>> disable preemption and mark the FPSIMD/SVE context as in use by setting
>>> CPU's fpsimd_context_busy flag.
>> [...]
>>> +static void get_cpu_fpsimd_context(void)
>>> +{
>>> + preempt_disable();
>>> + __get_cpu_fpsimd_context();
>>> +}
>>
>> Is there anything that prevents a softirq being invoked between
>> preempt_disable() and __get_cpu_fpsimd_context()?
>
> Actually, it shouldn't matter as the softirq finishes using the fpsimd
> before the thread is resumed.
If the softirqs is handled in a thread (i.e ksoftirqd), then
preempt_disable() will prevent them to run.
For softirq running on return from interrupt context, they will finish
before using fpsimd before the thread is resumed.
Softirq running after __get_cpu_fpsimd_context() is called will not be
able to use FPSIMD (may_use_simd() returns false).
Cheers,
--
Julien Grall
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-06-04 10:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 17:21 [PATCH v5 0/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Julien Grall
2019-05-21 17:21 ` [PATCH v5 1/3] arm64/fpsimd: Remove the prototype for sve_flush_cpu_state() Julien Grall
2019-05-21 17:21 ` [PATCH v5 2/3] arch/arm64: fpsimd: Introduce fpsimd_save_and_flush_cpu_state() and use it Julien Grall
2019-06-04 11:12 ` Catalin Marinas
2019-06-04 11:52 ` Marc Zyngier
2019-05-21 17:21 ` [PATCH v5 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Julien Grall
2019-06-03 16:25 ` Catalin Marinas
2019-06-03 21:21 ` Catalin Marinas
2019-06-04 10:35 ` Julien Grall [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c159919-d220-f8dc-d609-b1b1b2844d4b@arm.com \
--to=julien.grall@arm.com \
--cc=Dave.Martin@arm.com \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@arm.com \
--cc=james.morse@arm.com \
--cc=julien.thierry@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox