Displaying 20 results from an estimated 179 matches for "mutex_lock_nest".
Did you mean:
mutex_lock_nested
2012 Jan 30
3
[PATCH] Btrfs: allow cloning ranges within the same file
...t;f_dentry->d_inode;
ret = -EINVAL;
- if (src == inode)
- goto out_fput;
/* the src must be open for reading */
if (!(src_file->f_mode & FMODE_READ))
@@ -2282,9 +2278,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
if (inode < src) {
mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT);
mutex_lock_nested(&src->i_mutex, I_MUTEX_CHILD);
- } else {
+ } else if (inode > src) {
mutex_lock_nested(&src->i_mutex, I_MUTEX_PARENT);
mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD);
+ } else {
+ mutex_lock(&inod...
2018 Jan 23
5
[PATCH net 1/2] vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
We used to call mutex_lock() in vhost_dev_lock_vqs() which tries to
hold mutexes of all virtqueues. This may confuse lockdep to report a
possible deadlock because of trying to hold locks belong to same
class. Switch to use mutex_lock_nested() to avoid false positive.
Fixes: 6b1e6cc7855b0 ("vhost: new device IOTLB API")
Reported-by: syzbot+dbb7c1161485e61b0241 at syzkaller.appspotmail.com
Signed-off-by: Jason Wang <jasowang at redhat.com>
---
drivers/vhost/vhost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-...
2018 Jan 23
5
[PATCH net 1/2] vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
We used to call mutex_lock() in vhost_dev_lock_vqs() which tries to
hold mutexes of all virtqueues. This may confuse lockdep to report a
possible deadlock because of trying to hold locks belong to same
class. Switch to use mutex_lock_nested() to avoid false positive.
Fixes: 6b1e6cc7855b0 ("vhost: new device IOTLB API")
Reported-by: syzbot+dbb7c1161485e61b0241 at syzkaller.appspotmail.com
Signed-off-by: Jason Wang <jasowang at redhat.com>
---
drivers/vhost/vhost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-...
2020 Aug 02
2
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...eau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 7806278dce57..a7b2a9bb0ffe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
return ret;
}
- mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
+ if (drm_drv_uses_atomic_modeset(drm->dev))
+ mutex_lock(&cli->mutex);
+ else
+ mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
+
ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr);
if (ret == 0) {
ret = drm->t...
2020 Sep 30
0
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...ers/gpu/drm/nouveau/nouveau_bo.c
> > > > > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> > > > > return ret;
> > > > > }
> > > > >
> > > > > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > > > > + if (drm_drv_uses_atomic_modeset(drm->dev))
> > > > > + mutex_lock(&cli->mutex);
> > > > > + else
> > > > > + mutex_lock_nested(&cli->...
2020 Sep 30
2
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...> > > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > > > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> > > > return ret;
> > > > }
> > > >
> > > > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > > > + if (drm_drv_uses_atomic_modeset(drm->dev))
> > > > + mutex_lock(&cli->mutex);
> > > > + else
> > > > + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_...
2020 Sep 30
1
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...au_bo.c
> > > > > > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> > > > > > return ret;
> > > > > > }
> > > > > >
> > > > > > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > > > > > + if (drm_drv_uses_atomic_modeset(drm->dev))
> > > > > > + mutex_lock(&cli->mutex);
> > > > > > + else
> > > > > > + mutex_lock_...
2020 Sep 17
2
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...4
> > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> > return ret;
> > }
> >
> > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > + if (drm_drv_uses_atomic_modeset(drm->dev))
> > + mutex_lock(&cli->mutex);
> > + else
> > + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > +
> > re...
2020 Aug 03
0
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...au/nouveau_bo.c
> index 7806278dce57..a7b2a9bb0ffe 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> return ret;
> }
>
> - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> + if (drm_drv_uses_atomic_modeset(drm->dev))
> + mutex_lock(&cli->mutex);
> + else
> + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> +
> ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr);
>...
2020 Sep 29
0
[PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
...drm/nouveau/nouveau_bo.c
> > > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> > > return ret;
> > > }
> > >
> > > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > > + if (drm_drv_uses_atomic_modeset(drm->dev))
> > > + mutex_lock(&cli->mutex);
> > > + else
> > > + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> >...
2020 Oct 23
0
[PATCH 25/65] drm/nouveau: Drop mutex_lock_nested for atomic
...pu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 70b6f3b1ae85..c04a808664f8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -775,7 +775,10 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict,
return ret;
}
- mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
+ if (drm_drv_uses_atomic_modeset(drm->dev))
+ mutex_lock(&cli->mutex);
+ else
+ mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, ctx->interruptible);
if (ret == 0) {...
2018 Jan 24
1
[PATCH net 1/2] vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
...ue, 23 Jan 2018 17:27:25 +0800
>
> > We used to call mutex_lock() in vhost_dev_lock_vqs() which tries to
> > hold mutexes of all virtqueues. This may confuse lockdep to report a
> > possible deadlock because of trying to hold locks belong to same
> > class. Switch to use mutex_lock_nested() to avoid false positive.
> >
> > Fixes: 6b1e6cc7855b0 ("vhost: new device IOTLB API")
> > Reported-by: syzbot+dbb7c1161485e61b0241 at syzkaller.appspotmail.com
> > Signed-off-by: Jason Wang <jasowang at redhat.com>
>
> Michael, I see you ACK'd...
2018 Jan 24
0
[PATCH net 1/2] vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
...at redhat.com>
Date: Tue, 23 Jan 2018 17:27:25 +0800
> We used to call mutex_lock() in vhost_dev_lock_vqs() which tries to
> hold mutexes of all virtqueues. This may confuse lockdep to report a
> possible deadlock because of trying to hold locks belong to same
> class. Switch to use mutex_lock_nested() to avoid false positive.
>
> Fixes: 6b1e6cc7855b0 ("vhost: new device IOTLB API")
> Reported-by: syzbot+dbb7c1161485e61b0241 at syzkaller.appspotmail.com
> Signed-off-by: Jason Wang <jasowang at redhat.com>
Michael, I see you ACK'd this, meaning that you're...
2018 Jun 30
0
[PATCH net-next v3 2/4] net: vhost: replace magic number of lock annotation
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Use the VHOST_NET_VQ_XXX as a subclass for mutex_lock_nested.
Signed-off-by: Tonghao Zhang <zhangtonghao at didichuxing.com>
---
drivers/vhost/net.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index e7cf7d2..62bb8e8 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@...
2018 Jun 30
9
[PATCH net-next v3 0/4] net: vhost: improve performance when enable busyloop
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
This patches improve the guest receive and transmit performance.
On the handle_tx side, we poll the sock receive queue at the same time.
handle_rx do that in the same way.
This patches are splited from previous big patch:
http://patchwork.ozlabs.org/patch/934673/
For more performance report, see patch 4.
Tonghao Zhang (4):
net: vhost:
2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...s/vhost/net.c
> index ab11b2bee273..5f272ab4d5b4 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net,
> struct socket *sock;
> struct vhost_virtqueue *vq = poll_rx ? tvq : rvq;
>
> - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX);
> vhost_disable_notify(&net->dev, vq);
> sock = rvq->private_data;
>
> @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net,
> vhost_net_busy_poll_try_queue(net, vq);
> else...
2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...s/vhost/net.c
> index ab11b2bee273..5f272ab4d5b4 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net,
> struct socket *sock;
> struct vhost_virtqueue *vq = poll_rx ? tvq : rvq;
>
> - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX);
> vhost_disable_notify(&net->dev, vq);
> sock = rvq->private_data;
>
> @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net,
> vhost_net_busy_poll_try_queue(net, vq);
> else...
2018 Jun 26
3
[PATCH net-next v2] net: vhost: improve performance when enable busyloop
...e at gmail.com>
This patch improves the guest receive performance from
host. On the handle_tx side, we poll the sock receive
queue at the same time. handle_rx do that in the same way.
For avoiding deadlock, change the code to lock the vq one
by one and use the VHOST_NET_VQ_XX as a subclass for
mutex_lock_nested. With the patch, qemu can set differently
the busyloop_timeout for rx or tx queue.
We set the poll-us=100us and use the iperf3 to test
its throughput. The iperf3 command is shown as below.
on the guest:
iperf3 -s -D
on the host:
iperf3 -c 192.168.1.100 -i 1 -P 10 -t 10 -M 1400
* With the pa...
2018 Jun 26
3
[PATCH net-next v2] net: vhost: improve performance when enable busyloop
...e at gmail.com>
This patch improves the guest receive performance from
host. On the handle_tx side, we poll the sock receive
queue at the same time. handle_rx do that in the same way.
For avoiding deadlock, change the code to lock the vq one
by one and use the VHOST_NET_VQ_XX as a subclass for
mutex_lock_nested. With the patch, qemu can set differently
the busyloop_timeout for rx or tx queue.
We set the poll-us=100us and use the iperf3 to test
its throughput. The iperf3 command is shown as below.
on the guest:
iperf3 -s -D
on the host:
iperf3 -c 192.168.1.100 -i 1 -P 10 -t 10 -M 1400
* With the pa...
2018 Jul 02
5
[PATCH net-next v4 0/4] net: vhost: improve performance when enable busyloop
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
This patches improve the guest receive and transmit performance.
On the handle_tx side, we poll the sock receive queue at the same time.
handle_rx do that in the same way.
For more performance report, see patch 4.
v3 -> v4:
fix some issues
v2 -> v3:
This patches are splited from previous big patch: