lkml.org 
[lkml]   [2007]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] irq_flags_t: intro and core annotations
Date
Jeff Garzik <jeff@garzik.org> wrote:
>
> Let me add to the chorus of voices: I continually see two cases where
> real bugs crop up:
>
> 1) hacker uses spin_lock_irq() in incorrect context (where it is not
> safe to do a blind enable/disable)
>
> 2) hacker uses spin_lock_irq() correctly, but the surrounding code
> changes, thus invalidating prior assumptions.
>
> I would even go so far as to support the drastic measure of deleting
> spin_lock_irq().
>
> spin_lock_irqsave() generates fewer bugs, is more future-proof, and by
> virtue of 'flags' permits architectures a bit more flexibility.

Could we add a debug option that warned if spin_lock_irq is
executed with IRQs turned off already?

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-10-23 05:39    [from the cache]
©2003-2011 Jasper Spaans