Re: [PATCH v2 3/7] bdi: protect device lifetime with RCU
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2020-03-04 17:23:48
Also in:
linux-fsdevel
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2020-03-04 17:23:48
Also in:
linux-fsdevel
On Wed, Mar 04, 2020 at 06:22:21PM +0100, Greg Kroah-Hartman wrote:
On Wed, Mar 04, 2020 at 12:05:43PM -0500, Tejun Heo wrote:quoted
Hello, It might be better to put this patch at the end rather than in the middle so that when this patch is applied things are actually fixed.quoted
+struct bdi_rcu_device { + struct device dev; + struct rcu_head rcu_head; +};(cc'ing Greg) Greg, block layer switches association between backing_device_info and its struct device and needs to protect it with RCU. Yufen did so by introducing a wrapping struct around struct device like above. Do you think it'd make sense to just embed rcu_head into struct device and let put_device() to RCU release by default?Ugh, I was dreading the fact that this day might sometime come... In theory, the reference counting for struct device shouldn't need to use rcu at all, right? what is driving the need to use rcu for backing_device_info? Are these being destroyed/used so often that rcu really is the best solution and the existing reference counting doesn't work properly? Some context is needed here.
Ah, would help if I just read the whole patch series, that helps... Something is odd if kobj->name is the problem here, let me look at the patches in full. thanks, greg k-h