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

Re: [Xen-devel] [question] will softirq handler potentially be called many times?


  • To: Kai Huang <mail.kai.huang@xxxxxxxxx>, <Xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Fri, 17 Feb 2012 09:20:03 +0000
  • Delivery-date: Fri, 17 Feb 2012 09:20:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcztVVRYby6kbTTENUCk0nsbtjA5Mg==
  • Thread-topic: [Xen-devel] [question] will softirq handler potentially be called many times?

On 17/02/2012 04:47, "Kai Huang" <mail.kai.huang@xxxxxxxxx> wrote:

> Hi,
> 
> I see the __do_softirq is called when ! in_atomic(), which means
> potentially __do_softirq may be interrupted by trap, exception,
> interrupt, etc, so seems softirq handler may be executed many times?
> 
> For example, if interrupt happens after i =
> find_first_set_bit(pending), the same softirq hander will be called
> twice as the do_softriq will be called after all interrupt handler
> returned, and the pending bit has not been cleared yet when first
> do_softirq was called.

Can't happen, we only call do_softirq() when returning from an interrupt
back to guest context. Therefore a nested interrupt call does not cause
do_softirq to run.

  -- Keir

> static void __do_softirq(unsigned long ignore_mask)
> {
>     ......
>     for ( ; ; )
>     {
>         ......
>         i = find_first_set_bit(pending);
>                                                    <- interrupt happens
>         clear_bit(i, &softirq_pending(cpu));
>         (*softirq_handlers[i])();
>     }
> }
> 
> -cody
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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