lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1101251432210.31804@localhost6.localdomain6>
Date:	Tue, 25 Jan 2011 14:42:18 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Emil Langrock <emil.langrock@....de>
cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Venkatesh Pallipadi <venki@...gle.com>
Subject: Re: Recursive deactivation of local bottom halves

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ