Re: lock_kernel() & kmalloc - evil together?

From: Jeff V. Merkey (jmerkey@timpanogas.com)
Date: Fri Aug 11 2000 - 15:44:15 EST


Thanks! This is good to know. This means if I use it inside of
spinlock_irqsave() outside an interrupt, it will tell me not to context
switch .... Need to look at this.

Jeff

Tigran Aivazian wrote:
>
> On Fri, 11 Aug 2000, Linus Torvalds wrote:
> > On Fri, 11 Aug 2000, Jeff V. Merkey wrote:
> > >
> > > Is there a counter of some type in Linux I could check to detect this
> > > easily?
> >
> > It's called
> >
> > in_interrupt()
> >
> > in Linux - it's not a single counter, as hard interrupts and soft
> > interrupts are counted separately, but it gives you the information you
> > want (whether you're in an interrupt or not).
>
> with one documented "gotcha", though - it returns false positive if you
> have interrupts disabled. According to Rusty Russel's Unreliable Guide to
> Locking, page 7.
>
> Regards,
> Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:25 EST