lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/5] context_tracking: Don't implement exception_enter/exit() on CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK
On Tue, Oct 27, 2020 at 04:08:24PM +0100, Frederic Weisbecker wrote:
> An architecture that provides this Kconfig feature doesn't need to
> store the context tracking state on the task stack because its entry
> code has been sanitized such that fragile path aren't preemptible
> and special use of tracing and RCU read side critical sections in these
> areas have been explicitly annotated.
>
> Hence the exception_enter()/exception_exit() couple doesn't need to be
> implemented in this case.

Could you please explain what exception_{enter,exit}() actually do, then
explain what is required to make it superfluous? Because as is, I don't
have enough information to verify the claims made.

> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Cc: Paul E. McKenney <paulmck@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Phil Auld <pauld@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
> include/linux/context_tracking.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
> index d53cd331c4dd..bceb06498521 100644
> --- a/include/linux/context_tracking.h
> +++ b/include/linux/context_tracking.h
> @@ -51,7 +51,8 @@ static inline enum ctx_state exception_enter(void)
> {
> enum ctx_state prev_ctx;
>
> - if (!context_tracking_enabled())
> + if (IS_ENABLED(CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK) ||
> + !context_tracking_enabled())
> return 0;
>
> prev_ctx = this_cpu_read(context_tracking.state);
> @@ -63,7 +64,8 @@ static inline enum ctx_state exception_enter(void)
>
> static inline void exception_exit(enum ctx_state prev_ctx)
> {
> - if (context_tracking_enabled()) {
> + if (!IS_ENABLED(CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK) &&
> + context_tracking_enabled()) {
> if (prev_ctx != CONTEXT_KERNEL)
> context_tracking_enter(prev_ctx);
> }
> --
> 2.25.1
>

\
 
 \ /
  Last update: 2020-11-11 15:32    [W:0.147 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site