[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200810195123.GJ6438@sirena.org.uk>
Date: Mon, 10 Aug 2020 20:51:23 +0100
From: Mark Brown <broonie@...nel.org>
To: Dmitry Osipenko <digetx@...il.com>
Cc: Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: regulator: deadlock vs memory reclaim
On Mon, Aug 10, 2020 at 10:41:54PM +0300, Dmitry Osipenko wrote:
> 10.08.2020 22:25, Michał Mirosław пишет:
> >> The initialization cases that are the trigger are only done for coupled
> >> regulators though AFAICT, otherwise we're not doing allocations with the
> >> lock held and should be able to progress.
> > I caught a few lockdep complaints that suggest otherwise, but I'm still
> > looking into that.
> The problem looks obvious to me. The regulator_init_coupling() is
> protected with the list_mutex, the regulator_lock_dependent() also
> protected with the list_mutex. Hence if offending reclaim happens from
> init_coupling(), then there is a lockup.
We may also have problems if I/O triggers allocations for some reason,
though that's also going to be a limited set of cases. Might be what
lockdep was showing though.
> It should be enough just to keep the regulator_find_coupler() under
> lock, or even completely remove the locking around init_coupling(). I
> think it should be better to keep the find_coupler() protected.
> Michał, does this fix yours problem?
That was the sort of thing I was thinking about here - it should at
least be an improvement if nothing else.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists