xen-netback: Aggregate TX unmap operations

Unmapping causes TLB flushing, therefore we should make it in the largest
possible batches. However we shouldn't starve the guest for too long. So if
the guest has space for at least two big packets and we don't have at least a
quarter ring to unmap, delay it for at most 1 milisec.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Zoltan Kiss 2014-03-06 21:48:31 +00:00 committed by David S. Miller
parent 093507885a
commit e9275f5e2d
3 changed files with 37 additions and 1 deletions

View file

@ -137,6 +137,8 @@ struct xenvif {
u16 dealloc_ring[MAX_PENDING_REQS];
struct task_struct *dealloc_task;
wait_queue_head_t dealloc_wq;
struct timer_list dealloc_delay;
bool dealloc_delay_timed_out;
/* Use kthread for guest RX */
struct task_struct *task;