Am 19.12.2011 12:58, schrieb Avi Kivity:>> I'd suggest the easy hack first, to get things going - we can>> then help out with the proper solution.> I think you're underestimating the complexity there. LWP wasn't> designed for this.>

LWP is highly limited in its ability's to support more than one"LWP-Instance" being active for a thread, IOW it is not possible.You can't activate LWP from a threads context and simultaneouslyactivate lwp-system-wide-profiling in the way you suggested it,Ingo. Either do the first xor do the last, because you only haveone xsave-area/msr/lwpcb that is read by the hardware and only oneLWP-Buffer that is written by the hw.

So, if one thread is running LWP, because he wants to(selfmonitoring and stuff [like for what lwp was designed]) and asu or u would activate this system-wide-monitoring, both wouldfrequently interfere with the each other. I don't think you wantthis to be possible at all.

Frankly, it was already a pain to get LWP running from in-kernel,like it is done now. I would expect a much higher pain, if youwould want to do this with a transparent buffer, that gets passedaround each scheduling (and this would permanently eliminate the"lightweight" in "LWP").