All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Iles <lkml@jamieiles.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Jamie Iles <jamie.iles@picochip.com>
Subject: Soft IRQs
Date: Mon, 12 May 2008 13:41:09 +0100	[thread overview]
Message-ID: <48283AE5.7010704@jamieiles.com> (raw)

Hi,

I am trying to understand whether it is correct behaviour for soft IRQs 
to be executed when interrupts with disabled. In particular, if I have 
some code that does:

    spin_lock_t mylock = SPIN_LOCK_UNLOCKED;
    unsigned long flags;
    spin_lock_irqsave( &mylock, flags );
   
    ...
   
    spin_lock_irqrestore( &mylock, flags );

Can soft IRQs run in the critical section above? I have a problem where 
'local_bh_enable_ip()' is being called as a result of 'dev_kfree_skb()' 
and a NET_RX_SOFTIRQ is being raised when I expect interrupts to be 
disabled.

'local_bh_enable()' only uses the 'in_irq()' macro to check whether we 
should do 'do_softirq()' and it also only checks we do not have the 
softirq field of 'preempt_count' non-zero before enabling soft IRQs.

I can see that if I was to replace 'spin_lock_irqsave()' with 
'spin_lock_bh()' then the softirq field of 'preempt_count' would be 
incremented and prevent soft IRQs until the lock was released. Should 
'spin_lock_irqsave()' also disable soft interrupts?

Thanks,

Jamie

                 reply	other threads:[~2008-05-12 13:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48283AE5.7010704@jamieiles.com \
    --to=lkml@jamieiles.com \
    --cc=jamie.iles@picochip.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.