[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200630120059.x5p6uh4hzgqrgwuo@linutronix.de>
Date: Tue, 30 Jun 2020 14:00:59 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H . Peter Anvin " <hpa@...or.com>
Subject: Re: [PATCH 1/2] x86/entry: Use should_resched() in
idtentry_exit_cond_resched()
On 2020-06-30 13:10:12 [+0200], Peter Zijlstra wrote:
> > --- a/arch/x86/entry/common.c
> > +++ b/arch/x86/entry/common.c
> > @@ -612,13 +612,12 @@ bool noinstr idtentry_enter_cond_rcu(struct pt_regs *regs)
> >
> > static void idtentry_exit_cond_resched(struct pt_regs *regs, bool may_sched)
> > {
> > - if (may_sched && !preempt_count()) {
> > + if (may_sched && should_resched(0)) {
> > /* Sanity check RCU and thread stack */
> > rcu_irq_exit_check_preempt();
> > if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
> > WARN_ON_ONCE(!on_thread_stack());
>
> This was done on purpose, your change avoids hitting this WARN.
>
> The thing is, if we could preempt (but not nessecarily have to) we want
> to validate we're on the thread stack.
Okay then.
Sebastian
Powered by blists - more mailing lists