Re: [PATCH v1 1/1] loop: scale loop device by introducing per device lock

2020-07-23 Thread Pavel Tatashin
> > > > - atomic_inc(&lo->lo_refcnt); > > > > -out: > > > > + err = mutex_lock_killable(&lo->lo_mutex); > > > > mutex_unlock(&loop_ctl_mutex); > > > > > > I don't see a possibility for deadlock but it bothers me a little that > > > we're not unlocking in the reverse locking order here

Re: [PATCH v1 1/1] loop: scale loop device by introducing per device lock

2020-07-23 Thread Tyler Hicks
On 2020-07-23 14:29:31, Pavel Tatashin wrote: > Hi Tyler, > > Thank you for the review comments. My replies are inlined below. > > > > Scale it by introducing per-device lock: lo_mutex that proctests > > > field in struct loop_device. Keep loop_ctl_mutex to protect global > > > > s/proctests fiel

Re: [PATCH v1 1/1] loop: scale loop device by introducing per device lock

2020-07-23 Thread Pavel Tatashin
Hi Tyler, Thank you for the review comments. My replies are inlined below. > > Scale it by introducing per-device lock: lo_mutex that proctests > > field in struct loop_device. Keep loop_ctl_mutex to protect global > > s/proctests field/protects the fields/ OK > > @@ -1890,22 +1890,23 @@ static

Re: [PATCH v1 1/1] loop: scale loop device by introducing per device lock

2020-07-23 Thread Tyler Hicks
On 2020-07-17 16:53:22, Pavel Tatashin wrote: > Currently, loop device has only one global lock: > loop_ctl_mutex. > > This becomes hot in scenarios where many loop devices are used. > > Scale it by introducing per-device lock: lo_mutex that proctests > field in struct loop_device. Keep loop_ctl_

[PATCH v1 1/1] loop: scale loop device by introducing per device lock

2020-07-17 Thread Pavel Tatashin
Currently, loop device has only one global lock: loop_ctl_mutex. This becomes hot in scenarios where many loop devices are used. Scale it by introducing per-device lock: lo_mutex that proctests field in struct loop_device. Keep loop_ctl_mutex to protect global data such as loop_index_idr, loop_lo