evtchn: double per-channel locking can't hit identical channels
authorJan Beulich <jbeulich@suse.com>
Wed, 25 Nov 2020 13:08:14 +0000 (14:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Nov 2020 13:08:14 +0000 (14:08 +0100)
commit181f2c224ccd0a2900d6ae94ec390a546731f593
treed7f4a707fefc66976328f7b1e555586ca8898b36
parent500516fcb9e1c09eae9bbbd3b30bb294c6993853
evtchn: double per-channel locking can't hit identical channels

Inter-domain channels can't possibly be bound to themselves, there's
always a 2nd channel involved, even when this is a loopback into the
same domain. As a result we can drop one conditional each from the two
involved functions.

With this, the number of evtchn_write_lock() invocations can also be
shrunk by half, swapping the two incoming function arguments instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/common/event_channel.c