Re: [PATCH] block: don't release queue's sysfs lock during switching elevator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 24, 2019 at 11:37:09AM -0700, Bart Van Assche wrote:
> On 9/23/19 8:12 AM, Ming Lei wrote:
> > @@ -523,11 +521,9 @@ void elv_unregister_queue(struct request_queue *q)
> >   		kobject_uevent(&e->kobj, KOBJ_REMOVE);
> >   		kobject_del(&e->kobj);
> > -		mutex_lock(&q->sysfs_lock);
> >   		e->registered = 0;
> >   		/* Re-enable throttling in case elevator disabled it */
> >   		wbt_enable_default(q);
> > -		mutex_unlock(&q->sysfs_lock);
> >   	}
> >   }
> 
> Does this patch cause sysfs_lock to be held around kobject_del(&e->kobj)?

Yes.

> Since sysfs_lock is locked from inside elv_attr_show() and elv_attr_store(),

The request queue's sysfs_lock isn't required in elv_attr_show() and
elv_attr_store(), and only elevator's sysfs_lock is needed in the two
functions.

> does this mean that this patch reintroduces the lock inversion problem that
> was fixed recently?

No.

The lock inversion issue only existed on kobjects of q->kobj & q->mq_obj,
which was fixed already given the queue's sysfs_lock is required in
.show/.store callback of these two kobjects' attributes.


thanks,
Ming



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux