From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>,
LKML <linux-kernel@vger.kernel.org>,
rostedt@goodmis.org
Subject: Re: call_rcu from trace_preempt
Date: Wed, 17 Jun 2015 13:37:45 -0700 [thread overview]
Message-ID: <20150617203745.GR3913@linux.vnet.ibm.com> (raw)
In-Reply-To: <5581BEE1.5060302@plumgrid.com>
On Wed, Jun 17, 2015 at 11:39:29AM -0700, Alexei Starovoitov wrote:
> On 6/17/15 2:05 AM, Daniel Wagner wrote:
> >>>Steven's suggestion deferring the work via irq_work results in the same
> >>>stack trace. (Now I get cold feets, without the nice heat from the CPU
> >>>busy looping...)
> >That one still not working. It also makes the system really really slow.
> >I guess I still do something completely wrong.
>
> tried your irq_work patch. It indeed makes the whole system
> unresponsive. Ctrl-C of hwlathist no longer works and
> it runs out of memory in 20 sec or so of running hwlathist
> on idle system (without parallel hackbench).
> It looks that free_pending flag is racy, so I removed it,
> but it didn't help.
>
> Also I've tried all sort of other things in rcu including
> add rcu_bpf similar to rcu_sched to make sure that recursive
> call into call_rcu will not be messing rcu_preempt or rcu_sched
> states and instead will be operating on rcu_bpf per-cpu states.
> In theory that should have worked flawlessly and it sort-of did.
> But multiple hackbench runs still managed to crash it.
> So far I think the temp workaround is to stick with array maps
> for probing such low level things like trace_preempt.
> Note that pre-allocation of all elements in hash map also won't
> help, since the problem here is some collision of call_rcu and
> rcu_process_callbacks. I'm pretty sure that kfree_rcu with
> rcu_is_watching patch is ready for this type of abuse.
> The rcu_process_callbacks() path - no yet. I'm still analyzing it.
How about if I just gave you a hook in __call_rcu() itself, just before
it returns, just after the local_irq_restore()? You could maintain
recursion flags and test the environment, at some point handling any
memory that needed freeing.
The idea would be to use an atomic queue to accumulate the to-be-freed
data, then kfree_rcu() it in the hook if it was safe to do so.
I really don't trust the re-entrancy, especially not in the long term.
Thanx, Paul
next prev parent reply other threads:[~2015-06-17 20:37 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 22:24 call_rcu from trace_preempt Alexei Starovoitov
2015-06-15 23:07 ` Paul E. McKenney
2015-06-16 1:09 ` Alexei Starovoitov
2015-06-16 2:14 ` Paul E. McKenney
2015-06-16 5:45 ` Alexei Starovoitov
2015-06-16 6:06 ` Daniel Wagner
2015-06-16 6:25 ` Alexei Starovoitov
2015-06-16 6:34 ` Daniel Wagner
2015-06-16 6:46 ` Alexei Starovoitov
2015-06-16 6:54 ` Daniel Wagner
2015-06-16 12:27 ` Paul E. McKenney
2015-06-16 12:38 ` Daniel Wagner
2015-06-16 14:16 ` Paul E. McKenney
2015-06-16 15:43 ` Steven Rostedt
2015-06-16 16:07 ` Paul E. McKenney
2015-06-16 17:13 ` Daniel Wagner
2015-06-16 15:41 ` Steven Rostedt
2015-06-16 15:52 ` Steven Rostedt
2015-06-16 17:11 ` Daniel Wagner
2015-06-16 17:20 ` Alexei Starovoitov
2015-06-16 17:37 ` Steven Rostedt
2015-06-17 0:33 ` Alexei Starovoitov
2015-06-17 0:47 ` Steven Rostedt
2015-06-17 1:04 ` Alexei Starovoitov
2015-06-17 1:19 ` Steven Rostedt
2015-06-17 8:11 ` Daniel Wagner
2015-06-17 9:05 ` Daniel Wagner
2015-06-17 18:39 ` Alexei Starovoitov
2015-06-17 20:37 ` Paul E. McKenney [this message]
2015-06-17 20:53 ` Alexei Starovoitov
2015-06-17 21:36 ` Paul E. McKenney
2015-06-17 23:58 ` Alexei Starovoitov
2015-06-18 0:20 ` Paul E. McKenney
2015-06-16 15:37 ` Steven Rostedt
2015-06-16 16:05 ` Paul E. McKenney
2015-06-16 17:14 ` Alexei Starovoitov
2015-06-16 17:39 ` Paul E. McKenney
2015-06-16 18:57 ` Steven Rostedt
2015-06-16 19:20 ` Paul E. McKenney
2015-06-16 19:29 ` Steven Rostedt
2015-06-16 19:34 ` Paul E. McKenney
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=20150617203745.GR3913@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=ast@plumgrid.com \
--cc=daniel.wagner@bmw-carit.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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