[lkml]   [2002]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] 2.4.18 raid1 - fix SMP locking/interrupt
> However a bare spin_unlock_irq() in a function means that
> callers which wish to keep interrupts disabled are subtly
> subverted. We've had bugs from this before.
It is trivial to catch such bugs at runtime. I tried it a year ago, and
immediately run into sleep_on() users that legitimately call
spin_lock_irq() with disabled interrupts. Perhaps they are gone now,
I'll retest my patch.

> So the irqrestore functions are much more robust. I believe
> that they should be the default choice. The non-restore
> versions should be viewed as a micro-optimised version,
> to be used with caution. The additional expense of the save/restore
> is quite tiny - 20-30 cycles, perhaps.

OTHO, if a function doesn't work correctly if it's called with disabled
interrupts, then it should not use spin_lock_irqsave() - it's
e.g. if it calls kmalloc(GFP_KERNEL), down(), schedule(), etc.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:25    [W:0.034 / U:45.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site