# Re: BUG or not? GFP\_KERNEL with interrupts disabled.

- From: Linus Torvalds \<torvalds@transmeta.com\>
- Date: 2003-03-27 17:56:12 
- List: netdev
- Page: https://ratatoskr.run/netdev/2003/03/537869
- Thread: https://ratatoskr.run/lkml/2003/03/537766/t.md

```text

On Thu, 27 Mar 2003, David S. Miller wrote:
> 
>    I do agree that we should obviously not run bottom halves with
>    interrupts disabled
>    
> Ok, so can we add a:
> 
> 	if (irqs_disabled())
> 		BUG();
> 
> check to do_softirq()?

I'd suggest making it a counting warning (with a static counter per
local-bh-enable macro expansion) and adding it to local_bh_enable() -
otherwise it will only BUG()  when the (potentially rare) condition
happens - instead of always giving a nice backtrace of exact problem 
spots.

		Linus
```
