lkml.org 
[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()
Date
Andy Lutomirski <luto@kernel.org> writes:
> On Wed, May 20, 2020 at 8:36 AM Andy Lutomirski <luto@kernel.org> wrote:
> 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?

Just chatted with Paul on IRC and he thinks this should work, but he's
not sure whether it's actually sane :)

Thanks,

tglx

\
 
 \ /
  Last update: 2020-05-20 21:25    [W:0.179 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site