[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Remove a set operation for VCPU_KICK_SOFTIRQ when post interrupt to vm.



On Fri, 2015-09-18 at 11:50 +0000, Zhang, Yang Z wrote:
> Andrew Cooper wrote on 2015-09-18:
> > On 18/09/15 12:40, Zhang, Yang Z wrote:

> > >  But it only happens before do vmentry. Is it possible that
> > VCPU been preempted at any time when running in hypervisor mode?
> > 
> > All vcpus may be preempted at any time by the Xen scheduler.
> > 
> > However, paths through the hypervisor are synchronous, so a vcpu
> > will
> > notice that it has been preempted on the return-to-guest path, and
> > a
> > context switch will occur as appropriate.
> 
> So the context switch only occurs on the return-to-guest patch or if
> the VCPU call schedule() by itself. It seems a little different from
> linux kernel which possible to preempt a task at any point.
> 
It is, indeed. Xen does not 'preempt itself', like Linux does, and you
also don't call schedule() directly (like Linux does).

In fact, any time you want to reschedule, you need to raise
SCHEDULE_SOFTIRQ, which is then checked and serviced in do_softirq()
(and, for instance, not in process_pending_softirq(), specifically to
avoid preemptions!).

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)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.