From: Steven Rostedt <rostedt@goodmis.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: Possible use of RCU while in extended QS: idle vs RCU read-side in interrupt vs rcu_eqs_exit
Date: Thu, 10 Jan 2019 12:23:46 -0500 [thread overview]
Message-ID: <20190110122346.7063cf08@gandalf.local.home> (raw)
In-Reply-To: <600900741.1177.1547140315581.JavaMail.zimbra@efficios.com>
On Thu, 10 Jan 2019 12:11:55 -0500 (EST)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> ----- On Jan 10, 2019, at 8:44 AM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
>
> > ----- On Jan 10, 2019, at 8:08 AM, rostedt rostedt@goodmis.org wrote:
> >
> >> On Wed, 9 Jan 2019 20:38:51 -0500 (EST)
> >> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> >>
> >>> Hi Paul,
> >>>
> >>> I've had a user report that trace_sched_waking() appears to be
> >>> invoked while !rcu_is_watching() in some situation, so I started
> >>> digging into the scheduler idle code.
> >>
> >> I'm wondering if this isn't a bug. Do you have the backtrace for where
> >> trace_sched_waking() was called without rcu watching?
> >
> > I strongly suspect a bug as well. I'm awaiting a reproducer from the
> > user whom reported this issue so I can add a WARN_ON_ONCE(!rcu_is_watching())
> > in the scheduler code near trace_sched_waking() and gather a backtrace.
> >
> > It still has to be confirmed, but I suspect this have been triggered
> > within a HyperV guest. It may therefore be related to a virtualized environment.
> >
> > I'll try to ask more specifically on which environment this was encountered.
>
> So it ends up it happens directly on hardware on a Linux laptop. Here is
> the stacktrace:
>
> vmlinux!try_to_wake_up
> vmlinux!default_wake_function
> vmlinux!pollwake
> vmlinux!__wake_up_common
> vmlinux!__wake_up_common_lock
> vmlinux!__wake_up
> vmlinux!perf_event_wakeup
> vmlinux!perf_pending_event
> vmlinux!irq_work_run_list
> vmlinux!irq_work_run
> vmlinux!smp_irq_work_iterrupt
The first thing this calls is ipi_entering_ack_irq(), which calls
irq_enter(), which calls rcu_irq_enter().
So why isn't rcu watching here?
-- Steve
> vmlinux!irq_work_interrupt
> vmlinux!finish_task_switch
> vmlinux!__schedule
> vmlinux!schedule_idle
> vmlinux!do_idle
> vmlinux!cpu_startup_entry
> vmlinux!start_secondary
> vmlinux!secondary_startup_64
>
> Does it raise any red flag ?
>
> Thanks,
>
> Mathieu
>
> >
> > Thanks,
> >
> > Mathieu
> >
> >>
> >> -- Steve
> >>
> >>>
> >>> It appears that interrupts are re-enabled before rcu_eqs_exit() is
> >>> invoked when exiting idle code from the scheduler.
> >>>
> >>> I wonder what happens if an interrupt handler (including scheduler code)
> >>> happens to issue a RCU read-side critical section before rcu_eqs_exit()
> >>> is called ? Is there some code on interrupt entry that ensures rcu eqs
> >>> state is exited in such scenario ?
> >>>
> >>> Thanks,
> >>>
> >>> Mathieu
> >
> > --
> > Mathieu Desnoyers
> > EfficiOS Inc.
> > http://www.efficios.com
>
next prev parent reply other threads:[~2019-01-10 17:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 1:38 Mathieu Desnoyers
2019-01-10 4:13 ` Paul E. McKenney
2019-01-10 6:30 ` Mathieu Desnoyers
2019-01-10 14:19 ` Paul E. McKenney
2019-01-10 16:08 ` Steven Rostedt
2019-01-10 16:44 ` Mathieu Desnoyers
2019-01-10 17:11 ` Mathieu Desnoyers
2019-01-10 17:23 ` Steven Rostedt [this message]
2019-01-10 17:25 ` Mathieu Desnoyers
2019-01-10 17:45 ` Perf: event wakeup discards sched_waking events Mathieu Desnoyers
2019-01-14 13:09 ` Peter Zijlstra
2019-01-14 21:36 ` Mathieu Desnoyers
2019-01-14 22:04 ` Steven Rostedt
2019-01-14 22:31 ` Mathieu Desnoyers
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=20190110122346.7063cf08@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
/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
all inboxes | Powered by JetHome®