[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877dx6wj86.fsf@nanos.tec.linutronix.de>
Date: Wed, 20 May 2020 20:32:09 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Andy Lutomirski <luto@...nel.org>,
Andy Lutomirski <luto@...nel.org>
Cc: "Paul E. McKenney" <paulmck@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Frederic Weisbecker <frederic@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Joel Fernandes <joel@...lfernandes.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
Brian Gerst <brgerst@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Will Deacon <will@...nel.org>,
Tom Lendacky <thomas.lendacky@....com>,
Wei Liu <wei.liu@...nel.org>,
Michael Kelley <mikelley@...rosoft.com>,
Jason Chen CJ <jason.cj.chen@...el.com>,
Zhao Yakui <yakui.zhao@...el.com>,
"Peter Zijlstra \(Intel\)" <peterz@...radead.org>
Subject: Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()
Andy Lutomirski <luto@...nel.org> writes:
> So maybe the code can change to:
>
> if (user_mode(regs)) {
> enter_from_user_mode();
> } else {
> if (!__rcu_is_watching()) {
> /*
> * If RCU is not watching then the same careful
> * sequence vs. lockdep and tracing is required.
> *
> * This only happens for IRQs that hit the idle loop, and
> * even that only happens if we aren't using the sane
> * MWAIT-while-IF=0 mode.
> */
> lockdep_hardirqs_off(CALLER_ADDR0);
> rcu_irq_enter();
> instrumentation_begin();
> trace_hardirqs_off_prepare();
> instrumentation_end();
> return true;
> } else {
> /*
> * If RCU is watching then the combo function
> * can be used.
> */
> instrumentation_begin();
> trace_hardirqs_off();
> rcu_tickle();
> instrumentation_end();
> }
> }
> return false;
>
> This is exactly what you have except that the cond_rcu part is gone
> and I added rcu_tickle().
>
> Paul, the major change here is that if an IRQ hits normal kernel code
> (i.e. code where RCU is watching and we're not in an EQS), the IRQ
> won't call rcu_irq_enter() and rcu_irq_exit(). Instead it will call
> rcu_tickle() on entry and nothing on exit. Does that cover all the
> bases?
Fine with me, but the final vote needs to come from Paul and Joel.
Thanks,
tglx
Powered by blists - more mailing lists