On Thu, May 21, 2015 at 10:56:32PM +0800, Huang Rui wrote:
> Looks like good use case. Boris, could we try to implement it?

Andy had some suggestions on how to do it here:

https://lkml.kernel.org/r/555d3629.8080...@kernel.org

which should be doable. Also, you'd probably need to set ECX[0]=0b too,
so that MWAITX doesn't get woken up by interrupts while MWAIT-ing with
interrupts disabled. I.e., this sequence:

cli
rdtsc
shove the computed timeout into ebx
mov $2,%ecx                             # this enables the timer and disables 
IRQs while MWAITing
mwaitx
sti

The NMI argument is a problem though - if and NMI gets you out of
MWAITX, a simple perf tool workload would kill all MWAITX executions.
Which is bad. :-\

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to