xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [question] will softirq handler potentially be called many times?
@ 2012-02-17  4:47 Kai Huang
  2012-02-17  9:20 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Huang @ 2012-02-17  4:47 UTC (permalink / raw)
  To: Xen-devel

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.

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

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

end of thread, other threads:[~2012-02-17  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17  4:47 [question] will softirq handler potentially be called many times? Kai Huang
2012-02-17  9:20 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).