From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: rostedt <rostedt@goodmis.org>
Cc: paulmck <paulmck@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Matt Mullins <mmullins@mmlx.us>, Ingo Molnar <mingo@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Dmitry Vyukov <dvyukov@google.com>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Alexey Kardashevskiy <aik@ozlabs.ru>
Subject: Re: [PATCH v4] tracepoint: Do not fail unregistering a probe due to memory failure
Date: Wed, 27 Jan 2021 13:13:22 -0500 (EST) [thread overview]
Message-ID: <119550773.160.1611771202224.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20210127130714.4ec189d5@gandalf.local.home>
----- On Jan 27, 2021, at 1:07 PM, rostedt rostedt@goodmis.org wrote:
> On Wed, 27 Jan 2021 13:00:46 -0500 (EST)
> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
>
>> > Instead of allocating a new array for removing a tracepoint, allocate twice
>> > the needed size when adding tracepoints to the array. On removing, use the
>> > second half of the allocated array. This removes the need to allocate memory
>> > for removing a tracepoint, as the allocation for removals will already have
>> > been done.
>>
>> I don't see how this can work reliably. AFAIU, with RCU, approaches
>> requiring a pre-allocation of twice the size and swapping to the alternate
>> memory area on removal falls apart whenever you remove 2 or more elements
>> back-to-back without waiting for a grace period.
>
> Good point ;-)
>
>>
>> How is this handled by your scheme ?
>
> I believe we can detect this case using the "prio" part of extra element,
> and force a rcu sync if there's back to back removals on the same
> tracepoint. That case does not happen often, so I'm hoping nobody will
> notice the slowdown with these syncs. I'll take a look at this.
>
> Thanks for bringing that up.
Requiring an RCU synchronize on element removal is quite intrusive, and can
be problematic if tracepoint removal is called from e.g. preempt-off context.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2021-01-27 18:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 17:39 [PATCH v4] tracepoint: Do not fail unregistering a probe due to memory failure Steven Rostedt
2021-01-27 17:54 ` Steven Rostedt
2021-01-27 18:00 ` Mathieu Desnoyers
2021-01-27 18:07 ` Steven Rostedt
2021-01-27 18:13 ` Mathieu Desnoyers [this message]
2021-01-27 19:16 ` Steven Rostedt
2021-01-27 20:17 ` 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=119550773.160.1611771202224.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=aik@ozlabs.ru \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=dvyukov@google.com \
--cc=john.fastabend@gmail.com \
--cc=jpoimboe@redhat.com \
--cc=kafai@fb.com \
--cc=keescook@chromium.org \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mmullins@mmlx.us \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/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