mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Phil Auld <pauld@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH 2/5] context_tracking:  Don't implement exception_enter/exit() on CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK
Date: Wed, 11 Nov 2020 15:32:18 +0100	[thread overview]
Message-ID: <20201111143218.GU2611@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201027150827.148821-3-frederic@kernel.org>

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
> 

  reply	other threads:[~2020-11-11 14:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 15:08 [PATCH 0/5] context_tracking: Flatter archs not using exception_enter/exit() v2 Frederic Weisbecker
2020-10-27 15:08 ` [PATCH 1/5] context_tracking: Introduce HAVE_CONTEXT_TRACKING_OFFSTACK Frederic Weisbecker
2020-10-27 15:08 ` [PATCH 2/5] context_tracking: Don't implement exception_enter/exit() on CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK Frederic Weisbecker
2020-11-11 14:32   ` Peter Zijlstra [this message]
2020-11-11 22:20     ` Frederic Weisbecker
2020-10-27 15:08 ` [PATCH 3/5] sched: Detect call to schedule from critical entry code Frederic Weisbecker
2020-10-27 15:08 ` [PATCH 4/5] context_tracking: Only define schedule_user() on !HAVE_CONTEXT_TRACKING_OFFSTACK archs Frederic Weisbecker
2020-11-11 14:34   ` Peter Zijlstra
2020-11-11 22:22     ` Frederic Weisbecker
2020-10-27 15:08 ` [PATCH 5/5] x86: Support HAVE_CONTEXT_TRACKING_OFFSTACK Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2020-11-17 15:16 [PATCH 0/5] context_tracking: Flatter archs not using exception_enter/exit() v3 Frederic Weisbecker
2020-11-17 15:16 ` [PATCH 2/5] context_tracking: Don't implement exception_enter/exit() on CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK Frederic Weisbecker
2020-10-05 10:49 [PATCH 0/5] context_tracking: Flatter archs not using exception_enter/exit() Frederic Weisbecker
2020-10-05 10:49 ` [PATCH 2/5] context_tracking: Don't implement exception_enter/exit() on CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK Frederic Weisbecker

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=20201111143218.GU2611@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pauld@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome