[bug report] memory corruption panic caused by SG_IO ioctl()

2018-08-03 Thread Wanlong Gao
Hi Martin and all folks, Recently we find a kernel panic with memory corruption caused by SG_IO ioctl(), and it can be easily reproduced by running following reproducer about minutes,  any idea?

Re: [PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-10-28 Thread Wanlong Gao
On 10/28/2013 04:01 PM, Asias He wrote: vqs are freed in virtscsi_freeze but the hotcpu_notifier is not unregistered. We will have a use-after-free usage when the notifier callback is called after virtscsi_freeze. Signed-off-by: Asias He as...@redhat.com Reviewed-by: Wanlong Gao gaowanl

Re: [PATCH] virtio-scsi: Fix virtqueue affinity setup

2013-07-31 Thread Wanlong Gao
-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 2168258..74b88ef 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c

Re: [PATCH V7 0/5] virtio-scsi multiqueue

2013-04-06 Thread Wanlong Gao
On 04/06/2013 04:40 PM, James Bottomley wrote: On Fri, 2013-04-05 at 16:55 +0800, Wanlong Gao wrote: On 03/28/2013 10:22 AM, Wanlong Gao wrote: On 03/23/2013 07:28 PM, Wanlong Gao wrote: This series implements virtio-scsi queue steering, which gives performance improvements of up to 50

Re: [PATCH V7 0/5] virtio-scsi multiqueue

2013-04-05 Thread Wanlong Gao
On 03/28/2013 10:22 AM, Wanlong Gao wrote: On 03/23/2013 07:28 PM, Wanlong Gao wrote: This series implements virtio-scsi queue steering, which gives performance improvements of up to 50% (measured both with QEMU and tcm_vhost backends). This version rebased on Rusty's virtio ring rework

Re: [PATCH V7 0/5] virtio-scsi multiqueue

2013-03-27 Thread Wanlong Gao
On 03/23/2013 07:28 PM, Wanlong Gao wrote: This series implements virtio-scsi queue steering, which gives performance improvements of up to 50% (measured both with QEMU and tcm_vhost backends). This version rebased on Rusty's virtio ring rework patches, which has already gone into virtio

[PATCH V7 0/5] virtio-scsi multiqueue

2013-03-23 Thread Wanlong Gao
your Acked-by? Paolo Bonzini (3): virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: push vq lock/unlock into virtscsi_vq_done virtio-scsi: introduce multiqueue support Wanlong Gao (2): virtio-scsi: redo allocation of target data virtio-scsi: reset virtqueue

[PATCH V7 4/5] virtio-scsi: introduce multiqueue support

2013-03-23 Thread Wanlong Gao
Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com Tested-by: Venkatesh Srinivas venkate...@google.com --- drivers/scsi/virtio_scsi.c | 282 - 1 file changed, 254 insertions(+), 28 deletions

[PATCH V7 1/5] virtio-scsi: redo allocation of target data

2013-03-23 Thread Wanlong Gao
: James Bottomley james.bottom...@hansenpartnership.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 71

Re: [PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-23 Thread Wanlong Gao
On 03/23/2013 02:36 PM, Paolo Bonzini wrote: Il 20/03/2013 08:56, Wanlong Gao ha scritto: This one does not apply on top of virtio-next + patch 1-4 in this series. I'm very sorry. This fault is because I modified the 4/5 from /* if the affinity hint is set for virtqueues

[PATCH V7 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-03-23 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 22

[PATCH V7 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-23 Thread Wanlong Gao
Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 29

[PATCH V7 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-03-23 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers

[PATCH V6 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-03-20 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 22

[PATCH V6 4/5] virtio-scsi: introduce multiqueue support

2013-03-20 Thread Wanlong Gao
Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 282 - 1 file changed, 254 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b

[PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-20 Thread Wanlong Gao
Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 29

[PATCH V6 0/5] virtio-scsi multiqueue

2013-03-20 Thread Wanlong Gao
): virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: push vq lock/unlock into virtscsi_vq_done virtio-scsi: introduce multiqueue support Wanlong Gao (2): virtio-scsi: redo allocation of target data virtio-scsi: reset virtqueue affinity when doing cpu hotplug

[PATCH V6 1/5] virtio-scsi: redo allocation of target data

2013-03-20 Thread Wanlong Gao
: James Bottomley james.bottom...@hansenpartnership.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 71 -- 1 file changed, 25 insertions

[PATCH V6 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-03-20 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers

Re: [PATCH V5 4/5] virtio-scsi: introduce multiqueue support

2013-03-20 Thread Wanlong Gao
? */ Could you rephrase that, please? Thank you, fixed in V6, please review. Tested on qemu and w/ Google Compute Engine's virtio-scsi device. Cool. Reviewed-and-tested-by: Venkatesh Srinivas venkate...@google.com Do you mind review and test the V6? Thank you. Regards, Wanlong Gao Thanks

Re: [PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-20 Thread Wanlong Gao
On 03/20/2013 03:24 PM, Asias He wrote: On Wed, Mar 20, 2013 at 03:01:24PM +0800, Wanlong Gao wrote: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong

Re: [PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-20 Thread Wanlong Gao
On 03/20/2013 03:24 PM, Asias He wrote: On Wed, Mar 20, 2013 at 03:01:24PM +0800, Wanlong Gao wrote: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong

[PATCH V5 1/5] virtio-scsi: redo allocation of target data

2013-03-19 Thread Wanlong Gao
Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 40 +++- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index b53ba9e

[PATCH V5 4/5] virtio-scsi: introduce multiqueue support

2013-03-19 Thread Wanlong Gao
Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 269 - 1 file changed, 241 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b

[PATCH V5 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-03-19 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers

[PATCH V5 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-03-19 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 22

[PATCH V5 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-19 Thread Wanlong Gao
Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Reviewed-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 29

[PATCH V5 0/5] virtio-scsi multiqueue

2013-03-19 Thread Wanlong Gao
into virtscsi_vq_done virtio-scsi: introduce multiqueue support Wanlong Gao (1): virtio-scsi: reset virtqueue affinity when doing cpu hotplug drivers/scsi/virtio_scsi.c | 359 - 1 file changed, 290 insertions(+), 69 deletions(-) -- 1.8.2.rc2

[PATCH V4 1/5] virtio-scsi: redo allocation of target data

2013-03-10 Thread Wanlong Gao
the virtio_scsi_target_state structs in the flexible array member at the end of struct virtio_scsi, because we will place the virtqueues there in the next patches. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi

[PATCH V4 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-10 Thread Wanlong Gao
Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 29 + 1 file

[PATCH V4 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-03-10 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 22 +- 1 file changed, 9

[PATCH V4 4/5] virtio-scsi: introduce multiqueue support

2013-03-10 Thread Wanlong Gao
Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 269 - 1 file changed, 241 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 3573704

[PATCH V4 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-03-10 Thread Wanlong Gao
From: Paolo Bonzini pbonz...@redhat.com This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 17

[PATCH V4 0/5] virtio-scsi multiqueue

2013-03-10 Thread Wanlong Gao
): virtio-scsi: redo allocation of target data virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: push vq lock/unlock into virtscsi_vq_done virtio-scsi: introduce multiqueue support Wanlong Gao (1): virtio-scsi: reset virtqueue affinity when doing cpu hotplug

Re: [PATCH v3 0/5] virtio-scsi multiqueue

2013-02-18 Thread Wanlong Gao
- included Wanlong Gao's CPU hotplug patches Ok for 3.9? It would probably be easier to get it in via Rusty's tree because of the prerequisites. James, can I get your Acked-by? I can't apply this series on top of Rusty's virtio-next, I missed something or needed rebase them ? Thanks, Wanlong Gao

Re: [PATCH 1/1] Drivers: scsi: storvsc: Initialize the sglist

2013-01-24 Thread Wanlong Gao
On 01/25/2013 09:04 AM, K. Y. Srinivasan wrote: Properly initialize scatterlist before using it. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: Stable sta...@vger.kernel.org Reviewed-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/storvsc_drv.c |1 + 1 files

[PATCH 1/2] virtio-scsi: split out request queue set affinity function

2013-01-15 Thread Wanlong Gao
These two patches are based on the multi-queue virtio-scsi patch set. We set cpu affinity when the num_queues equals to the number of VCPUs. Split out the set affinity function, this also fix the bug when CPU IDs are not consecutive. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com

[PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-01-15 Thread Wanlong Gao
Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/scsi/virtio_scsi.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

Re: [PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-01-15 Thread Wanlong Gao
On 01/16/2013 11:31 AM, Rusty Russell wrote: Wanlong Gao gaowanl...@cn.fujitsu.com writes: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. You need to be careful to get_online_cpus() and put_online_cpus() here, so CPUs can't go up and down in the middle

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-03 Thread Wanlong Gao
status group 0 (all jobs): READ: io=34863MB, aggrb=242320KB/s, minb=242320KB/s, maxb=242320KB/s, mint=147325msec, maxt=147325msec WRITE: io=34437MB, aggrb=239357KB/s, minb=239357KB/s, maxb=239357KB/s, mint=147325msec, maxt=147325msec Thanks, Wanlong Gao From

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-25 Thread Wanlong Gao
under cpu hotplug We set virtqueue affinity when the num_queues equals to the number of VCPUs. Register a hotcpu notifier to notifier whether the VCPU number is changed. If the VCPU number is changed, we force to set virtqueue affinity again. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com

Re: [PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-23 Thread Wanlong Gao
about 68%. Thanks, Wanlong Gao Patch 1 adds a new API to add functions for piecewise addition for buffers, which enables various simplifications in virtio-scsi (patches 2-3) and a small performance improvement of 2-6%. Patches 4 and 5 add multiqueuing. I'm mostly looking for comments

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-08 Thread Wanlong Gao
] virtio-scsi: split scatterlist per target Go ahead and make sure that vq-vq_lock is relinquished w/ spin_unlock first, then release tgt-tgt_lock w/ spin_unlock_irqrestore. Did you hit any error? I don't think this order is wrong. Thanks, Wanlong Gao Cc: Paolo Bonzini pbonz...@redhat.com Cc

[PATCH 1/5] virtio-scsi: remove the useless assignment

2012-11-07 Thread Wanlong Gao
Reassign err is not needed, just a cleanup. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: linux-scsi@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers

[PATCH 5/5] virtio-scsi: tidy up the goto label in init()

2012-11-07 Thread Wanlong Gao
Tidy up the goto label in init(), and remove the useless NULL pointer assignment. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: linux-scsi@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Wanlong Gao

[PATCH 4/5] virtio-scsi: create a separate work queue for virtio-scsi

2012-11-07 Thread Wanlong Gao
Create a separate work queue for virtio-scsi to improve the performance. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: linux-scsi@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Wanlong Gao gaowanl

[PATCH 2/5] virtio-scsi: remove the needless variable gfp_mask

2012-11-07 Thread Wanlong Gao
Just use the macro instead of define a variable. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: linux-scsi@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com

[PATCH 3/5] virtio-scsi: use pr_err instead of printk

2012-11-07 Thread Wanlong Gao
Use pr_err() instead of printk() for code cleanups. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: linux-scsi@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com

[PATCH 0/5] virtio-scsi: create a separate workqueue

2012-11-07 Thread Wanlong Gao
=4820/3169, in_queue=7991, util=90.62% sdb: ios=6364/5358, merge=39/53, ticks=3810/2816, in_queue=6615, util=84.63% sdc: ios=6458/5352, merge=74/47, ticks=4425/3048, in_queue=7459, util=88.41% Wanlong Gao (5): virtio-scsi: remove the useless assignment virtio-scsi: remove the needless

Re: [PATCH 0/5] virtio-scsi: create a separate workqueue

2012-11-07 Thread Wanlong Gao
On 11/07/2012 08:23 PM, Asias He wrote: On Wed, Nov 7, 2012 at 6:18 PM, Wanlong Gao gaowanl...@cn.fujitsu.com wrote: patch 1-3,5 are some cleanups. patch 4: create a separate work queue for virtio-scsi to improve the performance, I tested with tmpfs backed disk, the config file is like below

Re: [PATCH 0/5] virtio-scsi: create a separate workqueue

2012-11-07 Thread Wanlong Gao
touched (complete_event) shouldn't ever run during a normal benchmark. It's only used for hotplug/hot-unplug. Nevertheless, I'll queue the cleanup patches. Thanks for those. Oops, got it, I will investigate more. Thank you for teaching me. Regards, Wanlong Gao -- To unsubscribe from