On Tue, Jan 23, 2018 at 10:58:48AM -0700, Jason Gunthorpe wrote: > On Tue, Jan 23, 2018 at 10:54:33AM -0700, Jason Gunthorpe wrote: > > On Mon, Jan 22, 2018 at 02:51:14PM +0200, Leon Romanovsky wrote: > > > + mutex_lock(&dev->res.mutex); > > > + hash_del_rcu(&res->node); > > > + mutex_unlock(&dev->res.mutex); > > > + > > > + res->valid = false; > > > + > > > + if (res->task) > > > + put_task_struct(res->task); > > > + synchronize_srcu(&dev->res.srcu); > > > +} > > > > This locking is wrong.. > > Actually, just don't use RCU. > > We can't afford to call synchronize_srcu in the destroy() path of > every object and the netlink user is not critical enough to bother > optimizing the read side. In large systems with many objects, such rwlock will block easily destroy of the objects. > > Replace the rcu and the mutex with a simple rwlock. My initial proposal was SRCU per-res to protect data with rwlock per-type to protect lists. > > Jason
Attachment:
signature.asc
Description: PGP signature