On 9/24/19 5:13 PM, Ming Lei wrote:
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.
I had confused e->kobj and eq->kobj, hence my comments. After having
taken another look at your patch:
Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>