Re: [PATCH] tracing/events: Add bounce tracing to swiotbl-xen

2013-09-02 Thread Zoltan Kiss
On 23/08/13 13:55, Konrad Rzeszutek Wilk wrote: On Thu, Aug 22, 2013 at 10:47:28PM +0100, Zoltan Kiss wrote: Ftrace is currently not able to detect when SWIOTLB has to do double buffering under Xen. You can only see it indirectly in function_graph, when xen_swiotlb_map_page() doesn't stop after

[PATCH V3 5/6] vhost_net: poll vhost queue after marking DMA is done

2013-09-02 Thread Jason Wang
We used to poll vhost queue before making DMA is done, this is racy if vhost thread were waked up before marking DMA is done which can result the signal to be missed. Fix this by always polling the vhost thread before DMA is done. Signed-off-by: Jason Wang --- - The patch is needed for stable 3.4

[PATCH V3 3/6] vhost: switch to use vhost_add_used_n()

2013-09-02 Thread Jason Wang
Let vhost_add_used() to use vhost_add_used_n() to reduce the code duplication. To avoid the overhead brought by __copy_to_user(). We will use put_user() when one used need to be added. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 54 ++-- 1

[PATCH V3 6/6] vhost_net: correctly limit the max pending buffers

2013-09-02 Thread Jason Wang
As Michael point out, We used to limit the max pending DMAs to get better cache utilization. But it was not done correctly since it was one done when there's no new buffers submitted from guest. Guest can easily exceeds the limitation by keeping sending packets. So this patch moves the check into

[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time

2013-09-02 Thread Jason Wang
Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if upend_idx != done_idx we still set zcopy_used to true and rollback this choice later. This could be avoided by determining zerocopy once by checking all conditions at one time before. Signed-off-by: Jason Wang --- driver

[PATCH V3 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()

2013-09-02 Thread Jason Wang
We tend to batch the used adding and signaling in vhost_zerocopy_callback() which may result more than 100 used buffers to be updated in vhost_zerocopy_signal_used() in some cases. So switch to use vhost_add_used_and_signal_n() to avoid multiple calls to vhost_add_used_and_signal(). Which means muc

[PATCH V3 1/6] vhost_net: make vhost_zerocopy_signal_used() return void

2013-09-02 Thread Jason Wang
None of its caller use its return value, so let it return void. Signed-off-by: Jason Wang --- drivers/vhost/net.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 969a859..280ee66 100644 --- a/drivers/vhost/net.c +++ b/d

[PATCH V3 0/6] vhost code cleanup and minor enhancement

2013-09-02 Thread Jason Wang
This series tries to unify and simplify vhost codes especially for zerocopy. With this series, 5% - 10% improvement for per cpu throughput were seen during netperf guest sending test. Plase review. Changes from V2: - Typo fixes and code style fix - Add performance gain in the commit log of patch

Re: [PATCH V2 6/6] vhost_net: correctly limit the max pending buffers

2013-09-02 Thread Jason Wang
On 09/02/2013 02:30 PM, Jason Wang wrote: > On 09/02/2013 01:56 PM, Michael S. Tsirkin wrote: >> > On Fri, Aug 30, 2013 at 12:29:22PM +0800, Jason Wang wrote: >>> >> As Michael point out, We used to limit the max pending DMAs to get >>> >> better cache >>> >> utilization. But it was not done corre