Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF64FC433E0 for ; Wed, 27 Jan 2021 18:08:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73C2964DA0 for ; Wed, 27 Jan 2021 18:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343858AbhA0SIB (ORCPT ); Wed, 27 Jan 2021 13:08:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:50762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235334AbhA0SH6 (ORCPT ); Wed, 27 Jan 2021 13:07:58 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7168964DA8; Wed, 27 Jan 2021 18:07:16 +0000 (UTC) Date: Wed, 27 Jan 2021 13:07:14 -0500 From: Steven Rostedt To: Mathieu Desnoyers Cc: paulmck , linux-kernel , Matt Mullins , Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Dmitry Vyukov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Kees Cook , Peter Zijlstra , Josh Poimboeuf , Alexey Kardashevskiy Subject: Re: [PATCH v4] tracepoint: Do not fail unregistering a probe due to memory failure Message-ID: <20210127130714.4ec189d5@gandalf.local.home> In-Reply-To: <2075610164.123.1611770446483.JavaMail.zimbra@efficios.com> References: <20210127123951.14f8d321@gandalf.local.home> <2075610164.123.1611770446483.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Jan 2021 13:00:46 -0500 (EST) Mathieu Desnoyers 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. -- Steve