Re: kernel BUG at mm/truncate.c:475!

From: Peter Zijlstra
Date: Tue Dec 14 2010 - 04:12:23 EST


On Mon, 2010-12-13 at 23:31 -0800, Hugh Dickins wrote:
> > > + clear_bit_unlock(AS_UNMAPPING, &mapping->flags);
> > > + smp_mb__after_clear_bit();
> > > + wake_up_bit(&mapping->flags, AS_UNMAPPING);
> > > +
> >
> > I do think this was premature optimisation. The open-coded lock is
> > hidden from lockdep so we won't find out if this introduces potential
> > deadlocks. It would be better to add a new mutex at least temporarily,
> > then look at replacing it with a MiklosLock later on, when the code is
> > bedded in.
> >
> > At which time, replacing mutexes with MiklosLocks becomes part of a
> > general "shrink the address_space" exercise in which there's no reason
> > to exclusively concentrate on that new mutex!
>
> Yes, I very much agree with you there: valiant effort by Miklos to
> avoid bloat, but we're better off using a known primitive for now.

Also, bit-spinlocks _suck_.. They're not fair, they're expensive and
like already noted they're hidden from lockdep.

Ideally we should be removing bit-spinlocks from the kernel, not add
more.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/