From: Frederic Weisbecker <frederic@kernel.org>
To: Peter Zijlstra <peterz@infradead.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 4/5] context_tracking: Only define schedule_user() on !HAVE_CONTEXT_TRACKING_OFFSTACK archs
Date: Wed, 11 Nov 2020 23:22:38 +0100 [thread overview]
Message-ID: <20201111222238.GB73739@lothringen> (raw)
In-Reply-To: <20201111143458.GV2611@hirez.programming.kicks-ass.net>
On Wed, Nov 11, 2020 at 03:34:58PM +0100, Peter Zijlstra wrote:
> On Tue, Oct 27, 2020 at 04:08:26PM +0100, Frederic Weisbecker wrote:
> > schedule_user() was traditionally used by the entry code's tail to
> > preempt userspace after the call to user_enter(). Indeed the call to
> > user_enter() used to be performed upon syscall exit slow path which was
> > right before the last opportunity to schedule() while resuming to
> > userspace. The context tracking state had to be saved on the task stack
> > and set back to CONTEXT_KERNEL temporarily in order to safely switch to
> > another task.
> >
> > Only a few archs use it now and those implementing
> > HAVE_CONTEXT_TRACKING_OFFSTACK definetly can't rely on it.
>
> powerpc64 and sparc64 only, right?
Exactly! I can precise that in the changelog.
Thanks.
>
> > 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>
> > ---
> > kernel/sched/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index c23d7cb5aee3..44426e5acde2 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -4631,7 +4631,7 @@ void __sched schedule_idle(void)
> > } while (need_resched());
> > }
> >
> > -#ifdef CONFIG_CONTEXT_TRACKING
> > +#if defined(CONFIG_CONTEXT_TRACKING) && !defined(CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK)
> > asmlinkage __visible void __sched schedule_user(void)
> > {
> > /*
> > --
> > 2.25.1
> >
next prev parent reply other threads:[~2020-11-11 22:22 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
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 [this message]
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 4/5] context_tracking: Only define schedule_user() on !HAVE_CONTEXT_TRACKING_OFFSTACK archs 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 4/5] context_tracking: Only define schedule_user() on !HAVE_CONTEXT_TRACKING_OFFSTACK archs 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=20201111222238.GB73739@lothringen \
--to=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pauld@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.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