From: Catalin Marinas <catalin.marinas@arm.com>
To: Wooyeon Kim <wooy88.kim@samsung.com>
Cc: 'Mark Rutland' <mark.rutland@arm.com>,
'Bhupesh Sharma' <bhsharma@redhat.com>,
'Julien Grall' <julien.grall@arm.com>,
'Vincenzo Frascino' <vincenzo.frascino@arm.com>,
'Will Deacon' <will@kernel.org>,
yhwan.joo@samsung.com, 'Anisse Astier' <aastier@freebox.fr>,
'Marc Zyngier' <maz@kernel.org>,
'Allison Randal' <allison@lohutok.net>,
'Sanghoon Lee' <shoon114.lee@samsung.com>,
'Wooki Min' <wooki.min@samsung.com>,
'Dave Martin' <Dave.Martin@arm.com>,
'Kees Cook' <keescook@chromium.org>,
'Suzuki K Poulose' <suzuki.poulose@arm.com>,
jihun.kim@samsung.com,
'Kristina Martsenko' <kristina.martsenko@arm.com>,
'Jeongtae Park' <jtp.park@samsung.com>,
'Thomas Gleixner' <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org,
'Steve Capper' <steve.capper@arm.com>,
'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, 'James Morse' <james.morse@arm.com>,
'Sudeep Holla' <sudeep.holla@arm.com>,
dh.han@samsung.com
Subject: Re: [PATCH] arm64: fpsimd: Added API to manage fpsimd state inside kernel
Date: Thu, 11 Jun 2020 15:11:02 +0100 [thread overview]
Message-ID: <20200611141101.GA31408@gaia> (raw)
In-Reply-To: <001401d63fd4$95646690$c02d33b0$@samsung.com>
On Thu, Jun 11, 2020 at 06:42:12PM +0900, Wooyeon Kim wrote:
> I am in charge of camera driver development in Samsung S.LSI division.
>
> In order to guarantee real time processing such as Camera 3A algorithm in
> current or ongoing projects, prebuilt binary is loaded and used in kernel
> space, rather than user space.
Thanks for the additional details.
If you do such intensive processing in an IRQ context you'd probably
introduce additional IRQ latency. Wouldn't offloading such work to a
real-time (user) thread help? In a non-preempt-rt kernel, I don't think
you can get much in terms of (soft) guarantees for IRQ latency anyway.
> Because the binary is built with other standard library which could use
> FPSIMD register, kernel API should keep the original FPSIMD state for other
> user tasks.
Can you not recompile those libraries not to use FP?
As Mark said, for a kernel API we require at least an in-kernel,
upstreamed, user of that functionality.
> In the case of the kernel_neon_begin / kernel_neon_end that you mentioned,
> there is a limitation that cannot be used in hardirq context.
> Also, if another kernel task switching occurs while kernel API is being
> used, fpsimd register corruption may occur.
kernel_neon_begin/end disable preemption, so you can't have a task
switch (you can have interrupts though but we don't allow FPSIMD in IRQ
context).
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Wooyeon Kim <wooy88.kim@samsung.com>
Cc: 'Dave Martin' <Dave.Martin@arm.com>,
'Mark Rutland' <mark.rutland@arm.com>,
'Bhupesh Sharma' <bhsharma@redhat.com>,
'Julien Grall' <julien.grall@arm.com>,
'Vincenzo Frascino' <vincenzo.frascino@arm.com>,
'Will Deacon' <will@kernel.org>,
yhwan.joo@samsung.com, 'Anisse Astier' <aastier@freebox.fr>,
'Marc Zyngier' <maz@kernel.org>,
'Allison Randal' <allison@lohutok.net>,
'Sanghoon Lee' <shoon114.lee@samsung.com>,
jihun.kim@samsung.com, 'Kees Cook' <keescook@chromium.org>,
'Suzuki K Poulose' <suzuki.poulose@arm.com>,
'Wooki Min' <wooki.min@samsung.com>,
'Kristina Martsenko' <kristina.martsenko@arm.com>,
'Jeongtae Park' <jtp.park@samsung.com>,
'Thomas Gleixner' <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org,
'Steve Capper' <steve.capper@arm.com>,
'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, 'James Morse' <james.morse@arm.com>,
'Sudeep Holla' <sudeep.holla@arm.com>,
dh.han@samsung.com
Subject: Re: [PATCH] arm64: fpsimd: Added API to manage fpsimd state inside kernel
Date: Thu, 11 Jun 2020 15:11:02 +0100 [thread overview]
Message-ID: <20200611141101.GA31408@gaia> (raw)
In-Reply-To: <001401d63fd4$95646690$c02d33b0$@samsung.com>
On Thu, Jun 11, 2020 at 06:42:12PM +0900, Wooyeon Kim wrote:
> I am in charge of camera driver development in Samsung S.LSI division.
>
> In order to guarantee real time processing such as Camera 3A algorithm in
> current or ongoing projects, prebuilt binary is loaded and used in kernel
> space, rather than user space.
Thanks for the additional details.
If you do such intensive processing in an IRQ context you'd probably
introduce additional IRQ latency. Wouldn't offloading such work to a
real-time (user) thread help? In a non-preempt-rt kernel, I don't think
you can get much in terms of (soft) guarantees for IRQ latency anyway.
> Because the binary is built with other standard library which could use
> FPSIMD register, kernel API should keep the original FPSIMD state for other
> user tasks.
Can you not recompile those libraries not to use FP?
As Mark said, for a kernel API we require at least an in-kernel,
upstreamed, user of that functionality.
> In the case of the kernel_neon_begin / kernel_neon_end that you mentioned,
> there is a limitation that cannot be used in hardirq context.
> Also, if another kernel task switching occurs while kernel API is being
> used, fpsimd register corruption may occur.
kernel_neon_begin/end disable preemption, so you can't have a task
switch (you can have interrupts though but we don't allow FPSIMD in IRQ
context).
--
Catalin
next prev parent reply other threads:[~2020-06-11 14:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200605073214epcas2p1576f3f90dbcefaad6180f2559ca5980d@epcas2p1.samsung.com>
2020-06-05 7:30 ` [PATCH] arm64: fpsimd: Added API to manage fpsimd state inside kernel Wooyeon Kim
2020-06-05 7:30 ` Wooyeon Kim
2020-06-05 10:37 ` Mark Rutland
2020-06-05 10:37 ` Mark Rutland
2020-06-08 10:34 ` Dave Martin
2020-06-08 10:34 ` Dave Martin
2020-06-11 9:17 ` ???
2020-06-11 9:17 ` ???
2020-06-11 12:47 ` Mark Rutland
2020-06-11 12:47 ` Mark Rutland
2020-06-11 9:42 ` Wooyeon Kim
2020-06-11 9:42 ` Wooyeon Kim
2020-06-11 14:11 ` Catalin Marinas [this message]
2020-06-11 14:11 ` Catalin Marinas
2020-06-15 10:30 ` Dave Martin
2020-06-15 10:30 ` Dave Martin
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=20200611141101.GA31408@gaia \
--to=catalin.marinas@arm.com \
--cc=Dave.Martin@arm.com \
--cc=aastier@freebox.fr \
--cc=allison@lohutok.net \
--cc=bhsharma@redhat.com \
--cc=dh.han@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=james.morse@arm.com \
--cc=jihun.kim@samsung.com \
--cc=jtp.park@samsung.com \
--cc=julien.grall@arm.com \
--cc=keescook@chromium.org \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=shoon114.lee@samsung.com \
--cc=steve.capper@arm.com \
--cc=sudeep.holla@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
--cc=wooki.min@samsung.com \
--cc=wooy88.kim@samsung.com \
--cc=yhwan.joo@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.