From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: Re: [PATCH] markers: comment usage of marker_synchronize_unregister() Date: Wed, 26 Nov 2008 07:46:08 -0500 Message-ID: <20081126124608.GA22504@Krystal> References: <20081126123652.GA9446@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: LKML , Ingo Molnar , Avi Kivity , kvm@vger.kernel.org, Lai Jiangshan , "Paul E. McKenney" , Andrew Morton , Nick Piggin To: Wu Fengguang Return-path: Content-Disposition: inline In-Reply-To: <20081126123652.GA9446@localhost> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org * Wu Fengguang (fengguang.wu@intel.com) wrote: > Add more comments to marker_synchronize_unregister() in order to > reduce the chance of misusing. > > Based on comments from Lai Jiangshan . > > Cc: Lai Jiangshan > Cc: Mathieu Desnoyers > Signed-off-by: Wu Fengguang > --- > > I'm still not sure about the last sentence. Can anyone clarify on > this? Thanks! > > diff --git a/include/linux/marker.h b/include/linux/marker.h > index 889196c..89ce1b8 100644 > --- a/include/linux/marker.h > +++ b/include/linux/marker.h > @@ -164,6 +164,12 @@ extern void *marker_get_private_data(const char *name, marker_probe_func *probe, > * marker_synchronize_unregister must be called between the last marker probe > * unregistration and the end of module exit to make sure there is no caller > * executing a probe when it is freed. > + * > + * It must be called _also_ between unregistration and destruction the data > + * that unregistration-ed probes need to make sure there is no caller executing > + * a probe when it's data is destroyed. it's -> its And the way it's written, this last sentence is a bit misleading. One might think that the synchronize_unregister has to be called two, when in fact it just has to be called once, but it must be called at a moment in time between unregister and free of any resource used by the probes, including the code which is removed by module unload. > + * > + * It works reliably only when all probe routines do not sleep and reschedule. Per definition, preemption is disabled around marker probe execution, so I don't see why we should add this last sentence ? Mathieu > */ > #define marker_synchronize_unregister() synchronize_sched() > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68