Re: [PATCH 1/2] Staging: zram: Turn lockdep off duringzram_init_device()

From: Witold Baryluk
Date: Sat Dec 03 2011 - 12:38:47 EST


On 11-30 14:59, Peter Zijlstra wrote:
> On Wed, 2011-11-30 at 14:14 +0100, Jerome Marchand wrote:
> > zram->init_lock can be hold over an allocation that may try to reclaim
> > memory in zram_init_device(). The same lock can later be taken from a
> > reclaim context in zram_make_request(), thus triggering a lockdep
> > warning. However, memory can not be reclaimed to an uninitialized zram
> > device. Therefore, this warning is a false positive.
> > To prevent the warning to occur, we turn lockdep off during while the
> > device is initialized.
>
> fuck no! why do you even remotely consider this a sane thing to do?
>
> There's tons of lockdep annotations, try one of those. If you have, your
> changelog utterly fails to explain why non of those are suitable and how
> your problem is special.
>

I must agree. Propsed patch is a hack, and actually can make more trouble
to other subsystems. It is better to live with warning than perform
temporary lockdep off/on.

--
Witold Baryluk
--
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/