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

Re: [Xen-devel] The scenario of hypercall_preempt_check()



On Sat, Jun 1, 2013 at 12:05 PM, Andrew Cooper
<andrew.cooper3@xxxxxxxxxx> wrote:
> On 01/06/2013 10:30, Xinxin Jin wrote:
>
> Hi all,
>
> I found there is hypercall preemption check in some hypercall handlers:
>
> #define hypercall_preempt_check() (unlikely(    \
>         softirq_pending(smp_processor_id()) |   \
>         local_events_need_delivery()            \
>     ))
>
> Generally speaking, if there is pending softirq or upcall events, the
> hypercall handler will exit and try to re-execute next time. I have two
> confusions on hypercall preemption:
> (1) Why pending softirq or upcall events can affect hypercall's continuation
> ?
> (2) When do we need to do hypercall_preempt_check()? For example,
> do_mmuext_op() has this check but many other hypercall handles don't do the
> check. How to judge where to appy preemption check?
>
> A lot of thanks,
>
> Xinxin
>
>
> The whole point of hypercall preemeption is to prevent long running
> hypercalls starve VCPUs of events.  Pending softirqs means that a Xen timer
> has expired and needs to run, while local events will be to the vcpu making
> the hypercall.

In addition to allowing events to be delivered to vcpus, it also
allows Xen to switch to other vcpus, to prevent one VM making really
long hypercalls from locking up the whole system.

 -George

_______________________________________________
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®.