lkml.org 
[lkml]   [2011]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRecursive deactivation of local bottom halves
Date
Hi,

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
and here is the previous example without the common spin_lock behaviour:

...
local_bh_disable();
....
local_bh_disable();
...
local_bh_enable();
....
local_bh_enable();
....

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?

I also couldn't find any indication in the kernel/softirq.c in the
local_bh_enable functionality that the counting in local_bh_disable makes any
difference.

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?

Kind regards,
Emil


\
 
 \ /
  Last update: 2011-01-25 14:07    [W:0.076 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site