Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-28 Thread Paolo Bonzini
Il 28/05/2014 03:48, Ming Lei ha scritto: On Wed, May 28, 2014 at 12:57 AM, Paolo Bonzini wrote: Il 27/05/2014 18:50, Venkatesh Srinivas ha scritto: Hi, I think this patch has a small race involving just two commands: 1. The first command to a target is in virtscsi_pick_vq(), after atomi

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-27 Thread Ming Lei
On Wed, May 28, 2014 at 12:57 AM, Paolo Bonzini wrote: > Il 27/05/2014 18:50, Venkatesh Srinivas ha scritto: > >> Hi, >> >> I think this patch has a small race involving just two commands: >> >> 1. The first command to a target is in virtscsi_pick_vq(), after >>atomic_inc_return(&tgt->tgt_lock

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 18:50, Venkatesh Srinivas ha scritto: Hi, I think this patch has a small race involving just two commands: 1. The first command to a target is in virtscsi_pick_vq(), after atomic_inc_return(&tgt->tgt_lock)) but before write_seqcount_begin() 2. A second command to the same targe

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-27 Thread Venkatesh Srinivas
Hi, I think this patch has a small race involving just two commands: 1. The first command to a target is in virtscsi_pick_vq(), after atomic_inc_return(&tgt->tgt_lock)) but before write_seqcount_begin() 2. A second command to the same target enters virtscsi_pick_vq(). It will hit the same

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 15:28, Ming Lei ha scritto: The spinlock of tgt_lock is only for serializing read and write req_vq, one lockless seqcount is enough for the purpose. On one 16core VM with vhost-scsi backend, the patch can improve IOPS with 3% on random read test. Nice. :) The patch looks good, t

[PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-23 Thread Ming Lei
The spinlock of tgt_lock is only for serializing read and write req_vq, one lockless seqcount is enough for the purpose. On one 16core VM with vhost-scsi backend, the patch can improve IOPS with 3% on random read test. Cc: Paolo Bonzini Signed-off-by: Ming Lei --- drivers/scsi/virtio_scsi.c |