On Thu, 2018-02-22 at 04:39 +0000, Bart Van Assche wrote: > On Thu, 2018-02-22 at 04:19 +0000, Damien Le Moal wrote: > > It looks OK to me, at least if CONFIG_DEBUG_OBJECTS_RCU_HEAD is turned > > off since the init_rcu_head() and destroy_rcu_head() functions only care > > about that. > > > > With rcu head debug turned on, I am not so sure. The object debug code > > will have references to unused rcu heads left behind for unused scsi > > cmds, which are indeed dynamically allocated for a device together with > > requests when the device is initialized, but they are never freed until > > the device is removed. So "dynamically allocated object", yes, but that > > does not match the use of the object done in scsi (i.e. alloc before use > > + free after use). > > Hello Damien, > > Please have a look at the following part of > Documentation/RCU/Design/Requirements/Requirements.html: > > Similarly, statically allocated non-stack <tt>rcu_head</tt> > structures must be initialized with <tt>init_rcu_head()</tt> > and cleaned up with <tt>destroy_rcu_head()</tt>. And from <linux/rcupdate.h>: * rcu_head structures * allocated dynamically in the heap or defined statically don't need any * initialization. Bart.