On 28-May-20 12:39 PM, Ananyev, Konstantin wrote:
Hi Anatoly,
Add two new power management intrinsics, and provide an implementation
in eal/x86 based on UMONITOR/UMWAIT instructions. The instructions
are implemented as raw byte opcodes because there is not yet widespread
compiler support for these instructions.
The power management instructions provide an architecture-specific
function to either wait until a specified TSC timestamp is reached, or
optionally wait until either a TSC timestamp is reached or a memory
location is written to. The monitor function also provides an optional
comparison, to avoid sleeping when the expected write has already
happened, and no more writes are expected.
Recently ARM guys introduced new generic API
for similar (as I understand) purposes: rte_wait_until_equal_(16|32|64).
Probably would make sense to unite both APIs into something common
and HW transparent.
Konstantin
Hi Konstantin,
That's not really similar purpose. This is monitoring a cacheline for
writes, not waiting on a specific value. The "expected" value is there
as basically a hack to get around the race condition due to the fact
that by the time you enter monitoring state, the write you're waiting
for may have already happened.
--
Thanks,
Anatoly