All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Question about evtchn_callback reentry
@ 2006-12-18  9:53 Xu, Anthony
  2006-12-18 11:24 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Xu, Anthony @ 2006-12-18  9:53 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, xen-ia64-devel

Keir Fraser write on 2006年12月18日 17:32:
> On 18/12/06 5:28 am, "Xu, Anthony" <anthony.xu@intel.com> wrote:
> 

Thanks for your quick response

>> If there is no special handling, low privileged interrupt may
>> "interrupt" high privileged interrupt.
> 
> There's no concept of privilege among event channels. Since Xen simply
> allocates ExtInts to vectors in a round-robin manner, there is no
> meaningful priority comparsion to be made between vectors anyway.

Yes there's no concept of privilege among event channel,

But all device interrupts have privilege and  device interrupts are delivered through event channel.

That means ide interrupt may interrupt time interrup in dom0.
It maybe not reasonable.


> 
>> BTW,
>> I do see evtchn_callback reentry happen on IPF dom0, and that incur
>> about 5% performance degradation
>> with KB on VTI-domain compared to non_reentry.
> 
> KB == Keyboard?!
Sorry for confusion,
KB means Kernal Build.

> 
> Reentry is allowed -- it shouldn't happen often unless the ISRs are
> really long (bad) or we are hammering the interrupt line for some
> reason (bad). 

If evtchn_callback reentry is allowed.
There are 1024 event channels.
In theory, dom0 kernal stack may be overflowed.
Is there any mechanism to prevent this?

Since event channels have no concept of privilege.
Why we allow evtchn_callback reentered ?

I think evtchn_callback can handle all events in batch.
This is good for performance.


-- Anthony

> 
>  -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Question about evtchn_callback reentry
@ 2006-12-20 10:08 Xu, Anthony
  2006-12-20 10:31 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Xu, Anthony @ 2006-12-20 10:08 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, xen-ia64-devel

Keir Fraser write on 2006年12月20日 16:31:
> On 20/12/06 3:03 am, "Xu, Anthony" <anthony.xu@intel.com> wrote:
> 
> How did you implement nesting avoidance? It'll be a bit subtle to get
> right. 

I added another global_event_mask in share page.

1. before injecting to event_callback_handler, set global_event_mask to 1 to 
   disable event inject..
2. after event_callback_handler is executed, it will return to ia64_leave_kernel
    assembly code in dom0, in this assembly code, it sets global_event_mask to 0
    to enable event inject.

There is no other code operating the global_event_mask.
Global_event_mask is initiated to 0(unmask).

Only global_event_mask is 0 and vcpu->vcpu_info->evtchn_upcall_mask is 0,
Can XEN injects to event_callback_handler of dom0.

--Anthony





> 
>  -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: [Xen-devel] Question about evtchn_callback reentry
@ 2006-12-20  3:03 Xu, Anthony
  2006-12-20  8:31 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Xu, Anthony @ 2006-12-20  3:03 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, xen-ia64-devel

Keir Fraser write on 2006年12月18日 21:42:
> On 18/12/06 11:24, "Keir Fraser" <keir@xensource.com> wrote:
> 
> Okay, so I remember now that of course the APIC divides these into 16
> priority levels so that does rather restrict the maximum nesting.
> I'll be happy to consider adding prioritisation (or just complete
> disallow of nesting) for 3.0.5. 

Hi Keir,

I did a experiment,
If we completely disallow of nesting.
Even dom0 can't boot.

I suspected timer interrupt is blocked by other events.

--Anthony



> 
>  -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Xen-devel] Question about evtchn_callback reentry
@ 2006-12-18  5:28 Xu, Anthony
  2006-12-18  9:31 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Xu, Anthony @ 2006-12-18  5:28 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, xen-ia64-devel

Hi Keir,

I have some questions about evtchn_callback,

As we know all external interrupts and events are deliver to dom0 by
evtchn_callback,

Are evtchn_callback reentered?

I mean when evtchn_callbacak is executing on dom0,

Another external interrupt or event may happen, can this event be
deliverred immediately?

I found __sti will set vcpu_info-> evtchn_upcall_mask=0, which permits
event deliverring.

and __sti may be called at any device driver. 

If evtchn_callback can be reentered, how does it hanlde external
interrupt privilege?

If there is no special handling, low privileged interrupt may
"interrupt" high privileged interrupt.


BTW,
I do see evtchn_callback reentry happen on IPF dom0, and that incur
about 5% performance degradation
with KB on VTI-domain compared to non_reentry.



Thanks,
Anthony

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-12-20 10:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18  9:53 Question about evtchn_callback reentry Xu, Anthony
2006-12-18 11:24 ` Keir Fraser
2006-12-18 13:42   ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2006-12-20 10:08 Xu, Anthony
2006-12-20 10:31 ` Keir Fraser
2006-12-20  3:03 [Xen-devel] " Xu, Anthony
2006-12-20  8:31 ` Keir Fraser
2006-12-18  5:28 [Xen-devel] " Xu, Anthony
2006-12-18  9:31 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.