[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling
> -----Original Message----- > From: Dario Faggioli [mailto:dario.faggioli@xxxxxxxxxx] > Sent: Tuesday, September 22, 2015 10:39 PM > To: George Dunlap; Wu, Feng > Cc: xen-devel@xxxxxxxxxxxxx; Tian, Kevin; Keir Fraser; George Dunlap; Andrew > Cooper; Jan Beulich > Subject: Re: [Xen-devel] [PATCH v7 15/17] vmx: VT-d posted-interrupt core > logic > handling > > On Tue, 2015-09-22 at 15:15 +0100, George Dunlap wrote: > > On 09/22/2015 02:52 PM, Wu, Feng wrote: > > > > > > > > > > -----Original Message----- > > > > From: Dario Faggioli [mailto:dario.faggioli@xxxxxxxxxx] > > > > > Yes, the idle to vCPUB switch is covered by __context_switch(), > > > > but > > > it cannot change the PI state of vCPUA at that point. Like > > > mentioned > > > above, in this case, spurious PI interrupts happens. > > > > On the contrary, when __context_switch() is called for the idle -> > > vcpuB > > transition in the above scenario, it is *actually* context switching > > from vcpuA to vcpuB, since vcpuA is still actually on the cpu. > > Which > > means that if you add PI code into arch->ctxt_switch_from(), the case > > you describe above will be handled automatically. > > > Yep, that's exactly what I was also writing... luckily, I've seen > George's email before getting too far with that! :-P > > That's the point of lazy context switch. The context of vCPUA is still > on pCPUA during the time idle executes. If, at the next transition > point, we switch from idle to vCPUA again, then nothing is needed, and > we just saved one context saving and one context restoring operation. > If it is something else, like in your case, we need to save vCPUA's > context, which is actually what we have on pCPUA, despite idle (and not > vCPUA itself) was what was running. George & Dario, thanks much for sharing so many scheduler knowledge to me, it is very useful. I think I was making a mistake about how __context_switch() work when I wrote the emails above. Now it is clear, the scenario I mentioned above can be covered in __context_switch(). > > > So the only downside to doing everything in block(), wake(), and > > __context_switch() is that if a VM is offline, or preempted by a > > tasklet, and an interrupt comes in, we will get a spurious PI (i.e., > > one > > which interrupts us but we can't do anything useful about). > > > Indeed. And that also seems bearable to me. Feng, are there reasons why > you think it's not? I cannot think the bad effect of the spurious PI as well. I was just a little confused about we can do this and why we don't do this. Maybe context_switch() is a critical path, if we can bear those spurious PI, it is not worth adding those logic in it at the cost of some performance lost during scheduling. Is this your concern? Thanks, Feng > > Regards, > Dario > -- > <<This happens because I choose it to happen!>> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |