* [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
@ 2019-04-16 10:47 Stefan Hajnoczi
2019-04-17 5:57 ` Jason Wang
2019-04-17 5:57 ` Jason Wang
0 siblings, 2 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-04-16 10:47 UTC (permalink / raw)
To: kvm
Cc: virtualization, linux-kernel, Michael S. Tsirkin,
Nicholas Bellinger, Andrea Parri, Jason Wang, Stefan Hajnoczi
The vhost_scsi.ko code used several atomic variables at one point.
Later they were dropped or converted to regular ints protected by a
mutex.
The commit that made these changes left an unused smp_mb__after_atomic()
in vhost_scsi_set_endpoint(). It was previously used after incrementing
vhost_scsi->vhost_ref_cnt but this field has been dropped:
- atomic_inc(&vs->vhost_ref_cnt);
smp_mb__after_atomic_inc();
Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
drivers/vhost/scsi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 618fb6461017..c090d177bd75 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
tpg->tv_tpg_vhost_count++;
tpg->vhost_scsi = vs;
vs_tpg[tpg->tport_tpgt] = tpg;
- smp_mb__after_atomic();
match = true;
}
mutex_unlock(&tpg->tv_tpg_mutex);
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
2019-04-16 10:47 [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic() Stefan Hajnoczi
@ 2019-04-17 5:57 ` Jason Wang
2019-04-18 8:56 ` Stefan Hajnoczi
2019-04-18 8:56 ` Stefan Hajnoczi
2019-04-17 5:57 ` Jason Wang
1 sibling, 2 replies; 6+ messages in thread
From: Jason Wang @ 2019-04-17 5:57 UTC (permalink / raw)
To: Stefan Hajnoczi, kvm
Cc: virtualization, linux-kernel, Michael S. Tsirkin,
Nicholas Bellinger, Andrea Parri
On 2019/4/16 下午6:47, Stefan Hajnoczi wrote:
> The vhost_scsi.ko code used several atomic variables at one point.
> Later they were dropped or converted to regular ints protected by a
> mutex.
>
> The commit that made these changes left an unused smp_mb__after_atomic()
> in vhost_scsi_set_endpoint(). It was previously used after incrementing
> vhost_scsi->vhost_ref_cnt but this field has been dropped:
>
> - atomic_inc(&vs->vhost_ref_cnt);
> smp_mb__after_atomic_inc();
>
> Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> drivers/vhost/scsi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 618fb6461017..c090d177bd75 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
> tpg->tv_tpg_vhost_count++;
> tpg->vhost_scsi = vs;
> vs_tpg[tpg->tport_tpgt] = tpg;
> - smp_mb__after_atomic();
> match = true;
> }
> mutex_unlock(&tpg->tv_tpg_mutex);
Looks like Paolo has sent an identical patch before this one.
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
2019-04-16 10:47 [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic() Stefan Hajnoczi
2019-04-17 5:57 ` Jason Wang
@ 2019-04-17 5:57 ` Jason Wang
1 sibling, 0 replies; 6+ messages in thread
From: Jason Wang @ 2019-04-17 5:57 UTC (permalink / raw)
To: Stefan Hajnoczi, kvm
Cc: Andrea Parri, Michael S. Tsirkin, linux-kernel, virtualization
On 2019/4/16 下午6:47, Stefan Hajnoczi wrote:
> The vhost_scsi.ko code used several atomic variables at one point.
> Later they were dropped or converted to regular ints protected by a
> mutex.
>
> The commit that made these changes left an unused smp_mb__after_atomic()
> in vhost_scsi_set_endpoint(). It was previously used after incrementing
> vhost_scsi->vhost_ref_cnt but this field has been dropped:
>
> - atomic_inc(&vs->vhost_ref_cnt);
> smp_mb__after_atomic_inc();
>
> Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> drivers/vhost/scsi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 618fb6461017..c090d177bd75 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
> tpg->tv_tpg_vhost_count++;
> tpg->vhost_scsi = vs;
> vs_tpg[tpg->tport_tpgt] = tpg;
> - smp_mb__after_atomic();
> match = true;
> }
> mutex_unlock(&tpg->tv_tpg_mutex);
Looks like Paolo has sent an identical patch before this one.
Thanks
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
2019-04-17 5:57 ` Jason Wang
2019-04-18 8:56 ` Stefan Hajnoczi
@ 2019-04-18 8:56 ` Stefan Hajnoczi
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-04-18 8:56 UTC (permalink / raw)
To: Jason Wang
Cc: Stefan Hajnoczi, kvm, Andrea Parri, Michael S. Tsirkin,
linux-kernel, Linux Virtualization
On Wed, Apr 17, 2019 at 6:57 AM Jason Wang <jasowang@redhat.com> wrote:
> On 2019/4/16 下午6:47, Stefan Hajnoczi wrote:
> > The vhost_scsi.ko code used several atomic variables at one point.
> > Later they were dropped or converted to regular ints protected by a
> > mutex.
> >
> > The commit that made these changes left an unused smp_mb__after_atomic()
> > in vhost_scsi_set_endpoint(). It was previously used after incrementing
> > vhost_scsi->vhost_ref_cnt but this field has been dropped:
> >
> > - atomic_inc(&vs->vhost_ref_cnt);
> > smp_mb__after_atomic_inc();
> >
> > Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> > Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > drivers/vhost/scsi.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> > index 618fb6461017..c090d177bd75 100644
> > --- a/drivers/vhost/scsi.c
> > +++ b/drivers/vhost/scsi.c
> > @@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
> > tpg->tv_tpg_vhost_count++;
> > tpg->vhost_scsi = vs;
> > vs_tpg[tpg->tport_tpgt] = tpg;
> > - smp_mb__after_atomic();
> > match = true;
> > }
> > mutex_unlock(&tpg->tv_tpg_mutex);
>
>
> Looks like Paolo has sent an identical patch before this one.
Yes, Paolo's patch is fine.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
2019-04-17 5:57 ` Jason Wang
@ 2019-04-18 8:56 ` Stefan Hajnoczi
2019-04-18 8:56 ` Stefan Hajnoczi
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-04-18 8:56 UTC (permalink / raw)
To: Jason Wang
Cc: Andrea Parri, kvm, Michael S. Tsirkin, linux-kernel,
Linux Virtualization, Stefan Hajnoczi
On Wed, Apr 17, 2019 at 6:57 AM Jason Wang <jasowang@redhat.com> wrote:
> On 2019/4/16 下午6:47, Stefan Hajnoczi wrote:
> > The vhost_scsi.ko code used several atomic variables at one point.
> > Later they were dropped or converted to regular ints protected by a
> > mutex.
> >
> > The commit that made these changes left an unused smp_mb__after_atomic()
> > in vhost_scsi_set_endpoint(). It was previously used after incrementing
> > vhost_scsi->vhost_ref_cnt but this field has been dropped:
> >
> > - atomic_inc(&vs->vhost_ref_cnt);
> > smp_mb__after_atomic_inc();
> >
> > Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> > Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > drivers/vhost/scsi.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> > index 618fb6461017..c090d177bd75 100644
> > --- a/drivers/vhost/scsi.c
> > +++ b/drivers/vhost/scsi.c
> > @@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
> > tpg->tv_tpg_vhost_count++;
> > tpg->vhost_scsi = vs;
> > vs_tpg[tpg->tport_tpgt] = tpg;
> > - smp_mb__after_atomic();
> > match = true;
> > }
> > mutex_unlock(&tpg->tv_tpg_mutex);
>
>
> Looks like Paolo has sent an identical patch before this one.
Yes, Paolo's patch is fine.
Stefan
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
@ 2019-04-16 10:47 Stefan Hajnoczi
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-04-16 10:47 UTC (permalink / raw)
To: kvm
Cc: Andrea Parri, Michael S. Tsirkin, linux-kernel, virtualization,
Stefan Hajnoczi
The vhost_scsi.ko code used several atomic variables at one point.
Later they were dropped or converted to regular ints protected by a
mutex.
The commit that made these changes left an unused smp_mb__after_atomic()
in vhost_scsi_set_endpoint(). It was previously used after incrementing
vhost_scsi->vhost_ref_cnt but this field has been dropped:
- atomic_inc(&vs->vhost_ref_cnt);
smp_mb__after_atomic_inc();
Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
drivers/vhost/scsi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 618fb6461017..c090d177bd75 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1443,7 +1443,6 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
tpg->tv_tpg_vhost_count++;
tpg->vhost_scsi = vs;
vs_tpg[tpg->tport_tpgt] = tpg;
- smp_mb__after_atomic();
match = true;
}
mutex_unlock(&tpg->tv_tpg_mutex);
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-18 8:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 10:47 [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic() Stefan Hajnoczi
2019-04-17 5:57 ` Jason Wang
2019-04-18 8:56 ` Stefan Hajnoczi
2019-04-18 8:56 ` Stefan Hajnoczi
2019-04-17 5:57 ` Jason Wang
2019-04-16 10:47 Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.