From: Thomas Gleixner <tglx@linutronix.de>
To: Emil Langrock <emil.langrock@gmx.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Andrew Morton <akpm@linux-foundation.org>,
Venkatesh Pallipadi <venki@google.com>
Subject: Re: Recursive deactivation of local bottom halves
Date: Tue, 25 Jan 2011 14:42:18 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.1101251432210.31804@localhost6.localdomain6> (raw)
In-Reply-To: <201101251405.18157.emil.langrock@gmx.de>
On Tue, 25 Jan 2011, Emil Langrock wrote:
> I wanted or more or less had to do following:
>
> ...
> spin_lock_bh(lock1);
> ....
> spin_lock_bh(lock2);
> ...
> spin_unlock_bh(lock2);
> ....
> spin_unlock_bh(lock1);
> ....
>
> Now some weird behavior were noticed by a second person and he fixed it by
> removing the _bh from the inner spinlocks. I checked what the difference is
You're not telling us what kind of weird behaviour was observed and
why the "fix" made it go away. You neither showed the real code and
the "fix", so there is no way to tell what problem you're facing. What
I can tell w/o using a crystal ball is that the "fix" stinks.
> According to http://people.netfilter.org/rusty/unreliable-guides/kernel-
> hacking/routines-softirqs.html it makes no difference how often I use the pair
> local_bh_disable/local_bh_enable inside local_bh_disable/local_bh_enable. So
> was this changed?
Nope.
> Can somebody tell me if that is legal or not (on smp and uniprocessor)? And
> maybe can show me the related source code why is it may or may not be legal?
IANAL, so I can't tell you for sure whether it's legal or not. Though
I'd say it's legal in your jurisdiction. :)
There is no restriction on nesting local_bh_disable/enable as long as
you don't overflow the field width, which is 8 bits and therefor
supports 255 nest levels.
Thanks,
tglx
next prev parent reply other threads:[~2011-01-25 13:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 13:05 Emil Langrock
2011-01-25 13:42 ` Thomas Gleixner [this message]
2011-01-26 6:20 ` WANG Cong
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=alpine.LFD.2.00.1101251432210.31804@localhost6.localdomain6 \
--to=tglx@linutronix.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=emil.langrock@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=venki@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®