On Mon, Jul 24, 2023 at 05:55:44PM +0100, Valentin Schneider wrote:
I can make that a 'do {} while ()' instead to force at least one execution of the cmpxchg().
This is only about reducing the race window, right? If we're executing this just as the target CPU is about to enter userspace, we're going to be in racy territory anyway. Regardless, I'm happy to do that change.
Right, it's only about narrowing down the race window. It probably don't matter in practice, but it's one less thing to consider for the brain :-)
Also, why bothering with handling CONTEXT_IDLE?
Thanks.