Re: [PATCH] cpumask: fix lg_lock/br_lock.

From: Ingo Molnar
Date: Wed Feb 29 2012 - 04:32:48 EST



* Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> On Wed, 2012-02-29 at 09:29 +0100, Ingo Molnar wrote:
>
> > As part of any cleanup they should first be converted from
> > arch_spinlock_t to regular spinlock_t - I bet if that is
> > done then that not only simplifies the wrappers massively,
> > it also turns the above soft lockup report into a nice,
> > actionable lockdep splat.
>
> It might help if you'd actually read the code.. that will
> simply not work.

It cannot find all bugs - such as the CPU hotplug race that is
still present in the code.

Still there's no excuse to go outside regular spinlock debug
primitives via arch_spinlock_t.

If lockdep blows up in br_write_lock() due to holding up to 4096
individual locks then we should add the exceptions to this
particular write lock when the CPU count is too high - but:

- do not disable the checking on saner configs

- not disable all the *OTHER* lock debugging checks such as:

- spin-lockup detection [this works even without ->held_locks]

- allocate/free failure detection:

The percpu code could be extended to run the equivalent
of debug_check_no_locks_freed() over the percpu area
that is going away, to make sure no held locks are
freed.

etc.

Thanks,

Ingo
--
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/