* [question] what's the purpose of smp_send_event_check_mask?
@ 2012-01-19 9:02 Kai Huang
2012-01-19 9:14 ` Keir Fraser
0 siblings, 1 reply; 6+ messages in thread
From: Kai Huang @ 2012-01-19 9:02 UTC (permalink / raw)
To: Xen-devel
Hi,
I see cpu_raise_softirq calls smp_send_event_check_mask after setting
softirq bit for target CPU if target CPU is not the current CPU. I
thought smp_send_event_check_mask will send IPI to target CPU and then
trigger target CPU to run pending irq, but seems
smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
the purpose of this function? Why do we need this function?
BTW, would someone gives me some knowledge when will the pending irqs
be triggered to run after setting up the pending bits? Seems normally
they are called asynchronously.
Thanks in advance!
-cody
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [question] what's the purpose of smp_send_event_check_mask?
2012-01-19 9:02 [question] what's the purpose of smp_send_event_check_mask? Kai Huang
@ 2012-01-19 9:14 ` Keir Fraser
2012-01-19 9:18 ` Kai Huang
2012-01-19 9:26 ` Kai Huang
0 siblings, 2 replies; 6+ messages in thread
From: Keir Fraser @ 2012-01-19 9:14 UTC (permalink / raw)
To: Kai Huang, Xen-devel
On 19/01/2012 09:02, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
> Hi,
>
> I see cpu_raise_softirq calls smp_send_event_check_mask after setting
> softirq bit for target CPU if target CPU is not the current CPU. I
> thought smp_send_event_check_mask will send IPI to target CPU and then
> trigger target CPU to run pending irq, but seems
> smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
> the purpose of this function? Why do we need this function?
Xen always checks softirqs on return from interrupt context to guest
context, and also in its idle loopon wakeup. Hence the event_check interrupt
handler itself doesn't need to do anything.
> BTW, would someone gives me some knowledge when will the pending irqs
> be triggered to run after setting up the pending bits? Seems normally
> they are called asynchronously.
Yes, of course it's asynchronous, the smp_send_event_check_mask interrupt is
just to make sure it happens "soon".
-- Keir
> Thanks in advance!
>
> -cody
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [question] what's the purpose of smp_send_event_check_mask?
2012-01-19 9:14 ` Keir Fraser
@ 2012-01-19 9:18 ` Kai Huang
2012-01-19 9:26 ` Kai Huang
1 sibling, 0 replies; 6+ messages in thread
From: Kai Huang @ 2012-01-19 9:18 UTC (permalink / raw)
To: Keir Fraser; +Cc: Xen-devel
On Thu, Jan 19, 2012 at 5:14 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>
> On 19/01/2012 09:02, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
>
>> Hi,
>>
>> I see cpu_raise_softirq calls smp_send_event_check_mask after setting
>> softirq bit for target CPU if target CPU is not the current CPU. I
>> thought smp_send_event_check_mask will send IPI to target CPU and then
>> trigger target CPU to run pending irq, but seems
>> smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
>> the purpose of this function? Why do we need this function?
>
> Xen always checks softirqs on return from interrupt context to guest
> context, and also in its idle loopon wakeup. Hence the event_check interrupt
> handler itself doesn't need to do anything.
Thanks. This makes sense.
-cody
>
>> BTW, would someone gives me some knowledge when will the pending irqs
>> be triggered to run after setting up the pending bits? Seems normally
>> they are called asynchronously.
>
> Yes, of course it's asynchronous, the smp_send_event_check_mask interrupt is
> just to make sure it happens "soon".
>
> -- Keir
>
>> Thanks in advance!
>>
>> -cody
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [question] what's the purpose of smp_send_event_check_mask?
2012-01-19 9:14 ` Keir Fraser
2012-01-19 9:18 ` Kai Huang
@ 2012-01-19 9:26 ` Kai Huang
2012-01-19 9:49 ` Keir Fraser
2012-01-19 9:52 ` Kai Huang
1 sibling, 2 replies; 6+ messages in thread
From: Kai Huang @ 2012-01-19 9:26 UTC (permalink / raw)
To: Keir Fraser; +Cc: Xen-devel
On Thu, Jan 19, 2012 at 5:14 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>
> On 19/01/2012 09:02, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
>
>> Hi,
>>
>> I see cpu_raise_softirq calls smp_send_event_check_mask after setting
>> softirq bit for target CPU if target CPU is not the current CPU. I
>> thought smp_send_event_check_mask will send IPI to target CPU and then
>> trigger target CPU to run pending irq, but seems
>> smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
>> the purpose of this function? Why do we need this function?
>
> Xen always checks softirqs on return from interrupt context to guest
> context, and also in its idle loopon wakeup. Hence the event_check interrupt
> handler itself doesn't need to do anything.
Does this mean if raising softirq for remote CPU, we don't need to
call do_softirq explicitly on target CPU?
-cody
>
>> BTW, would someone gives me some knowledge when will the pending irqs
>> be triggered to run after setting up the pending bits? Seems normally
>> they are called asynchronously.
>
> Yes, of course it's asynchronous, the smp_send_event_check_mask interrupt is
> just to make sure it happens "soon".
>
> -- Keir
>
>> Thanks in advance!
>>
>> -cody
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [question] what's the purpose of smp_send_event_check_mask?
2012-01-19 9:26 ` Kai Huang
@ 2012-01-19 9:49 ` Keir Fraser
2012-01-19 9:52 ` Kai Huang
1 sibling, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2012-01-19 9:49 UTC (permalink / raw)
To: Kai Huang; +Cc: Xen-devel
On 19/01/2012 09:26, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
> On Thu, Jan 19, 2012 at 5:14 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>>
>> On 19/01/2012 09:02, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I see cpu_raise_softirq calls smp_send_event_check_mask after setting
>>> softirq bit for target CPU if target CPU is not the current CPU. I
>>> thought smp_send_event_check_mask will send IPI to target CPU and then
>>> trigger target CPU to run pending irq, but seems
>>> smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
>>> the purpose of this function? Why do we need this function?
>>
>> Xen always checks softirqs on return from interrupt context to guest
>> context, and also in its idle loopon wakeup. Hence the event_check interrupt
>> handler itself doesn't need to do anything.
>
> Does this mean if raising softirq for remote CPU, we don't need to
> call do_softirq explicitly on target CPU?
That's right, it's called automatically from various places, which you can
grep for.
-- Keir
> -cody
>
>>
>>> BTW, would someone gives me some knowledge when will the pending irqs
>>> be triggered to run after setting up the pending bits? Seems normally
>>> they are called asynchronously.
>>
>> Yes, of course it's asynchronous, the smp_send_event_check_mask interrupt is
>> just to make sure it happens "soon".
>>
>> -- Keir
>>
>>> Thanks in advance!
>>>
>>> -cody
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [question] what's the purpose of smp_send_event_check_mask?
2012-01-19 9:26 ` Kai Huang
2012-01-19 9:49 ` Keir Fraser
@ 2012-01-19 9:52 ` Kai Huang
1 sibling, 0 replies; 6+ messages in thread
From: Kai Huang @ 2012-01-19 9:52 UTC (permalink / raw)
To: Keir Fraser; +Cc: Xen-devel
On Thu, Jan 19, 2012 at 5:26 PM, Kai Huang <mail.kai.huang@gmail.com> wrote:
> On Thu, Jan 19, 2012 at 5:14 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>>
>> On 19/01/2012 09:02, "Kai Huang" <mail.kai.huang@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I see cpu_raise_softirq calls smp_send_event_check_mask after setting
>>> softirq bit for target CPU if target CPU is not the current CPU. I
>>> thought smp_send_event_check_mask will send IPI to target CPU and then
>>> trigger target CPU to run pending irq, but seems
>>> smp_send_event_check_mask does nothing but jast ACK the IPI. So what's
>>> the purpose of this function? Why do we need this function?
>>
>> Xen always checks softirqs on return from interrupt context to guest
>> context, and also in its idle loopon wakeup. Hence the event_check interrupt
>> handler itself doesn't need to do anything.
>
> Does this mean if raising softirq for remote CPU, we don't need to
> call do_softirq explicitly on target CPU?
>
I think I understand now after looking at the code. When interrupt
returns, if there's any pending softirqs, the do_softirq will be
called. do_softirq will run handler for all pending bits and
additional call to do_softirq will have no harm as it just do nothing
if no bits are pending.
Thanks.
-cody
> -cody
>
>>
>>> BTW, would someone gives me some knowledge when will the pending irqs
>>> be triggered to run after setting up the pending bits? Seems normally
>>> they are called asynchronously.
>>
>> Yes, of course it's asynchronous, the smp_send_event_check_mask interrupt is
>> just to make sure it happens "soon".
>>
>> -- Keir
>>
>>> Thanks in advance!
>>>
>>> -cody
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-19 9:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19 9:02 [question] what's the purpose of smp_send_event_check_mask? Kai Huang
2012-01-19 9:14 ` Keir Fraser
2012-01-19 9:18 ` Kai Huang
2012-01-19 9:26 ` Kai Huang
2012-01-19 9:49 ` Keir Fraser
2012-01-19 9:52 ` Kai Huang
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.