evtchn: cut short evtchn_reset()'s loop in the common case
authorJan Beulich <jbeulich@suse.com>
Fri, 2 Oct 2020 06:37:04 +0000 (08:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 2 Oct 2020 06:37:04 +0000 (08:37 +0200)
commitbb3d31e03771353ed546b0290fb3f4d8f34d962c
tree8c9f0a62b6f830504e2406af9c81d42c0590d531
parent52e1fc47abc3a0123d2b5bb7e9172e84fd571851
evtchn: cut short evtchn_reset()'s loop in the common case

The general expectation is that there are only a few open ports left
when a domain asks its event channel configuration to be reset.
Similarly on average half a bucket worth of event channels can be
expected to be inactive. Try to avoid iterating over all channels, by
utilizing usage data we're maintaining anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/common/event_channel.c