gnttab: use per-VCPU maptrack free lists
authorMalcolm Crossley <malcolm.crossley@citrix.com>
Fri, 19 Jun 2015 09:01:24 +0000 (11:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 Jun 2015 09:01:24 +0000 (11:01 +0200)
commitdff515dfeac4c1c13422a128c558ac21ddc6c8db
tree9df8fd1077a69d290c3d6e4a3387cd900df28601
parent43147e03e8f4d82d1eb8c2324336b720d43fc6fd
gnttab: use per-VCPU maptrack free lists

Performance analysis of aggregate network throughput with many VMs
shows that performance is signficantly limited by contention on the
maptrack lock when obtaining/releasing maptrack handles from the free
list.

Instead of a single free list use a per-VCPU list. This avoids any
contention when obtaining a handle.  Handles must be released back to
their original list and since this may occur on a different VCPU there
is some contention on the destination VCPU's free list tail pointer
(but this is much better than a per-domain lock).

Increase the default maximum number of maptrack frames by 4 times
because: a) struct grant_mapping is now 16 bytes (instead of 8); and
b) a guest may not evenly distribute all the grant map operations
across the VCPUs (meaning some VCPUs need more maptrack entries than
others).

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/domain.c
xen/common/grant_table.c
xen/include/xen/grant_table.h
xen/include/xen/sched.h