|
|
Subscribe / Log in / New account

Short waits with umwait

Short waits with umwait

Posted Jun 17, 2019 0:54 UTC (Mon) by xywang (guest, #108121)
Parent article: Short waits with umwait

What will happen if the sleeping task should be interrupted for reschedule? Does these instructions temporarily ignore or delay time interrupt?


to post comments

Short waits with umwait

Posted Jun 17, 2019 3:01 UTC (Mon) by ncm (guest, #165) [Link]

The kernel would need to resume the thread after the wait, as the deadline would certainly have passed. It could resume at the instruction, but that would break immediately so there would be no point -- unless sleeps longer than a scheduling interval were permitted, which seems unlikely.

But probably you would run this on an isolcpu, with nohz, and hope never to get scheduled out.

It appears I have not yet discovered a formula that guarantees no schedule breaks, ever. I would welcome enlightenment.

Short waits with umwait

Posted Jun 17, 2019 4:08 UTC (Mon) by jcm (subscriber, #18262) [Link]

I believe recent enough parts allow a small delta in the VMEXIT to be controlled by the Hypervisor. No idea if this is respected for the userspace mwait instructions, but it could be. In any case, you're coming out of the VM and when you go back in you're going to have to restart the pause. Similar for kernel/userspace. Interrupts will preempt anything like this. Otherwise you'd have a DoS opportunity.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds