um: time-travel: Actually apply "free-until" optimisation
authorJohannes Berg <johannes.berg@intel.com>
Fri, 11 Dec 2020 08:01:14 +0000 (09:01 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 13 Dec 2020 21:41:56 +0000 (22:41 +0100)
commit452f94cecff692a76eaaa9330fca03fe0f204f6f
tree0820d5797c4e77eea8eee7ba5c6cdfcdde250ba3
parent9431f7c199ab0d02da1482d62255e0b4621cb1b5
um: time-travel: Actually apply "free-until" optimisation

Due a bug - we never checked the time_travel_ext_free_until value - we
were always requesting time for every single scheduling. This adds up
since we make reading time cost 256ns, and it's a fairly common call.
Fix this.

While at it, also make reading time only cost something when we're not
currently waiting for our scheduling turn - otherwise things get mixed
up in a very confusing way. We should never get here, since we're not
actually running, but it's possible if you stick printk() or such into
the virtio code that must handle the external interrupts.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/time.c