Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548Ab3GHPYr (ORCPT ); Mon, 8 Jul 2013 11:24:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49323 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743Ab3GHPYp (ORCPT ); Mon, 8 Jul 2013 11:24:45 -0400 Date: Mon, 8 Jul 2013 16:25:33 +0200 From: Oleg Nesterov To: Masami Hiramatsu Cc: Steven Rostedt , linux-kernel@vger.kernel.org, "zhangwei(Jovi)" , Jiri Olsa , Peter Zijlstra , Arnaldo Carvalho de Melo , Srikar Dronamraju , Frederic Weisbecker , Ingo Molnar , Andrew Morton Subject: Re: [RFC][PATCH 3/4] tracing/kprobes: Fail to unregister if probe event files are open Message-ID: <20130708142533.GA23749@redhat.com> References: <20130704033347.807661713@goodmis.org> <20130704034038.819592356@goodmis.org> <51D56E74.3090404@hitachi.com> <20130704184813.GA2695@redhat.com> <51D6351A.2000206@hitachi.com> <20130705172655.GA18576@redhat.com> <51DA25BF.6000701@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51DA25BF.6000701@hitachi.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1279 Lines: 37 On 07/08, Masami Hiramatsu wrote: > > (2013/07/06 2:26), Oleg Nesterov wrote: > (Perhaps, uprobes too.) Sure, uprobes needs all the same fixes, lets ignore it for now. > >> A safe way is to wait rcu always right after disable_*probe > >> in disable_trace_probe. If we have an unused link, we can > >> free it after that. > > > > Aaaah... I am starting to understand... Even if kprobe_perf_func() > > is fine, synchronize_sched() is calles _before_ disable_kprobe() > > and thus it can't synchronize with the handlers which hit this probe > > after we start synchronize_sched(). > > > > Did you mean this or I misssed something else? > > Right, thus perf path also need to be synchronized. kprobe_perf_func() looks fine. This path can't use anything which can be freed by trace_remove_event_call(). We are going to free tp / tp->call but only after unregister_kprobe(). Afaics. But even if I am right, I agree it would be safer to not rely on this and simply do synchronize_sched() after disable as you suggested. Thanks, Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/