All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost-scsi: remove incorrect memory barrier
@ 2019-04-16  8:56 Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2019-04-16  8:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrea Parri, virtualization, stefanha, mst

At this point, vs_tpg is not public at all; tv_tpg_vhost_count
is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is
accessed under vhost_scsi_mutex.  Therefor there are no atomic
operations involved at all here, just remove the barrier.

Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Signed-off-by: Paolo Bonzini <pbonzini@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 @@ static void vhost_scsi_flush(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);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost-scsi: remove incorrect memory barrier
  2019-04-16  8:56 Paolo Bonzini
  2019-04-17  5:56 ` Jason Wang
@ 2019-04-17  5:56 ` Jason Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Wang @ 2019-04-17  5:56 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel; +Cc: Andrea Parri, mst, stefanha, virtualization


On 2019/4/16 下午4:56, Paolo Bonzini wrote:
> At this point, vs_tpg is not public at all; tv_tpg_vhost_count
> is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is
> accessed under vhost_scsi_mutex.  Therefor there are no atomic
> operations involved at all here, just remove the barrier.
>
> Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Signed-off-by: Paolo Bonzini <pbonzini@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 @@ static void vhost_scsi_flush(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);


Acked-by: Jason Wang <jasowang@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost-scsi: remove incorrect memory barrier
  2019-04-16  8:56 Paolo Bonzini
@ 2019-04-17  5:56 ` Jason Wang
  2019-04-17  5:56 ` Jason Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Wang @ 2019-04-17  5:56 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel; +Cc: Andrea Parri, virtualization, stefanha, mst


On 2019/4/16 下午4:56, Paolo Bonzini wrote:
> At this point, vs_tpg is not public at all; tv_tpg_vhost_count
> is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is
> accessed under vhost_scsi_mutex.  Therefor there are no atomic
> operations involved at all here, just remove the barrier.
>
> Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Signed-off-by: Paolo Bonzini <pbonzini@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 @@ static void vhost_scsi_flush(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);


Acked-by: Jason Wang <jasowang@redhat.com>


_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] vhost-scsi: remove incorrect memory barrier
@ 2019-04-16  8:56 Paolo Bonzini
  2019-04-17  5:56 ` Jason Wang
  2019-04-17  5:56 ` Jason Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2019-04-16  8:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrea Parri, mst, jasowang, stefanha, virtualization

At this point, vs_tpg is not public at all; tv_tpg_vhost_count
is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is
accessed under vhost_scsi_mutex.  Therefor there are no atomic
operations involved at all here, just remove the barrier.

Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Signed-off-by: Paolo Bonzini <pbonzini@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 @@ static void vhost_scsi_flush(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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-17  5:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16  8:56 [PATCH] vhost-scsi: remove incorrect memory barrier Paolo Bonzini
2019-04-16  8:56 Paolo Bonzini
2019-04-17  5:56 ` Jason Wang
2019-04-17  5:56 ` Jason Wang

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.