Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3973675pxb; Mon, 1 Feb 2021 09:12:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK6aLM+2xgosE8bHK7C0eaNw1DsgE1eOjwao47MTc/pcm3SruV/G/MrEuu3gHIAw6YXP/m X-Received: by 2002:a17:906:3999:: with SMTP id h25mr18908511eje.146.1612199572381; Mon, 01 Feb 2021 09:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612199572; cv=none; d=google.com; s=arc-20160816; b=GGMIWpU14m9BoPrxPl7Wh9etV8b6b1pDxtMPDPPIITNNvwEbtgBqjbvIYMQxMNP64V 68FOHJBD0bC6opkFAsjvBTy6v/8L6UOsW8seeSbZjRRXvKntRITLCPO6mLzOepB26Poq G0iaD4UE43NFG9jcsOOFB0RJOHEWpcUcIpge/UYiFvwlwSD/BTTpN6QH1KNbHfVCzt59 GqfHhJa69shK+29I6LMpY+0AlnZFzyJWabjUF2/Ld2esge0CrC9JnfYwkg4LrBxRDBYI yo/W4c/+LO+Yp0r3VGkeoeA22dKvb/1j1mFr98jeZ7GgjANqo2MwG2vnQPP9hvKpeQw3 D+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=v/+Ar1ZZEIucj6pZY+lu0oI0Gfm++0xU6UJYi0B/r6M=; b=izNVPsF+Z3ut1suggS2azhawuoz+S8t2pGVyfHfraYnvNEHsfx5QJagBaubVyZLs5W x9Ff1ymcSpd9rov0QUNBYz/sueHP6qsWN3afxqSGO86kgjus6Rs3j4DsyBeBm/C30noA i7n2WI+9/fU0/Or7P94iu7GSQiNnP96eX7AhzSHFWbuKxM0r/ZT9aTYU41v1rlIEjSd4 XfhK7adFk6HEuDOxCxrHiILOg4aqIjL3cykO8WayzCVbM3lyRtRvdez/dlKyxz0HZiL8 3BNFC/NSSwoGhc60H6g880/KTuGZ0qa1VOyasTW8FylDubpgzmNtoVygJB5aH+wm7F3g EheQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh22si10829903ejb.571.2021.02.01.09.12.24; Mon, 01 Feb 2021 09:12:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbhBARKx (ORCPT + 99 others); Mon, 1 Feb 2021 12:10:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:40366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhBARKv (ORCPT ); Mon, 1 Feb 2021 12:10:51 -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 7026D64EA9; Mon, 1 Feb 2021 17:10:09 +0000 (UTC) Date: Mon, 1 Feb 2021 12:10:07 -0500 From: Steven Rostedt To: Alexey Kardashevskiy , Ingo Molnar Cc: LKML , Mathieu Desnoyers , Matt Mullins , paulmck , 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 Subject: Re: [PATCH v5] tracepoint: Do not fail unregistering a probe due to memory failure Message-ID: <20210201121007.51c0ac59@gandalf.local.home> In-Reply-To: <13608cdc-2068-6340-6795-28944c9fe3ca@ozlabs.ru> References: <20210127170721.58bce7cc@gandalf.local.home> <20210130093626.0b7b3b1b@oasis.local.home> <20210130094211.719f03a6@oasis.local.home> <13608cdc-2068-6340-6795-28944c9fe3ca@ozlabs.ru> 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 Mon, 1 Feb 2021 12:18:34 +1100 Alexey Kardashevskiy wrote: > > Just curious, does the following patch fix it for v5? > > > Yes it does! Thanks for verifying. > > > > > > -- Steve > > > > diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c > > index 7261fa0f5e3c..cf3a6d104fdb 100644 > > --- a/kernel/tracepoint.c > > +++ b/kernel/tracepoint.c > > @@ -306,6 +306,7 @@ static int tracepoint_remove_func(struct tracepoint *tp, > > tp->unregfunc(); > > > > static_key_disable(&tp->key); > > + tracepoint_synchronize_unregister(); > > rcu_assign_pointer(tp->funcs, tp_funcs); > > } else { > > rcu_assign_pointer(tp->funcs, tp_funcs); > > OK, since it would be expensive to do a synchronization on every removal like that, but the tp->funcs should not be reset. It appears that your check is still required, since the iterator has been added. The quick fix is the check you gave. But I think we could optimize this (not having to dereference the array twice, and do the check twice) by making the iterator part of the tp_funcs array, and having the rest of the array as its argument. But that can be a separate update. The check you added should be a patch and marked for stable. Care to send it, and mark it for stable as well as: Fixes: d25e37d89dd2f ("tracepoint: Optimize using static_call()") Thanks! -- Steve