From: Massimiliano Hofer <max@nucleus.it>
To: netfilter-devel@lists.netfilter.org
Cc: "Giacomo S." <delleceste@gmail.com>, Gregor Maier <gregor@net.in.tum.de>
Subject: Re: information about kernel locking issue
Date: Tue, 11 Jul 2006 01:41:19 +0200 [thread overview]
Message-ID: <200607110141.20519.max@nucleus.it> (raw)
In-Reply-To: <44B2D73B.3080209@net.in.tum.de>
On Tuesday 11 July 2006 12:39 am, Gregor Maier wrote:
> > Your code snippet doesn't show how the function is called. If this is
> > invoked by (*match)() you are in a soft interrupt context and should use
> > read_lock(). read_lock_bh() is what you use in process context when a
> > soft interrupt may use write_lock().
>
> That's wrong. When you run in interrupt context, you must ensure that
> you disable interrupts (be it soft or hardware interrupts) while holding
> a spinlock.
You're right and I made a poor choice of words, but in his case the lock
protects dev_base and, to the best of my knowledge, it is never written by
interrupts (soft or hard). Correct me if I'm mistaken on this point.
In this case, if you take a read lock and no other interrupt ever takes
anything more than a read lock, while user context always disables interrupts
while taking a write lock, you shouldn't be able to trigger a deadlock.
--
Bye,
Massimiliano Hofer
prev parent reply other threads:[~2006-07-10 23:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-01 11:55 information about kernel locking issue Giacomo S.
2006-07-01 20:29 ` Massimiliano Hofer
2006-07-02 8:08 ` Giacomo
2006-07-10 22:39 ` Gregor Maier
2006-07-10 23:41 ` Massimiliano Hofer [this message]
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=200607110141.20519.max@nucleus.it \
--to=max@nucleus.it \
--cc=delleceste@gmail.com \
--cc=gregor@net.in.tum.de \
--cc=netfilter-devel@lists.netfilter.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.