Re: [PATCH 1/2] freezer: add unsafe versions of freezable helpers

From: Jeff Layton
Date: Mon May 06 2013 - 06:59:16 EST


On Mon, 6 May 2013 10:50:25 +0200
Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> On Fri, May 03, 2013 at 02:04:09PM -0700, Colin Cross wrote:
> > NFS calls the freezable helpers with locks held, which is unsafe
> > and caused lockdep warnings when 6aa9707 "lockdep: check that no
> > locks held at freeze time" was applied (reverted in dbf520a).
> > Add new *_unsafe versions of the helpers that will not run the
> > lockdep test when 6aa9707 is reapplied, and call them from NFS.
>
> Am I the only one that would like a bit more information about why NFS does
> this and why we need to work around it?
>

NFS does this because this is how we initially "fixed" it to not block
the freezer. It sucks and is prone to deadlocking if you selectively
freeze processes via the cgroup freezer. It does basically "work" in
most cases though if the freezer is running to suspend the whole system.

I'm looking at fixing this by instead setting points within the NFS/RPC
layers that cause these calls to return something like ERESTARTSYS
instead when a freeze event comes in, depending on whether a call has
already been transmitted to the server.

That's likely to take a while though, and in the meantime we don't want
lockdep complaining every time someone fires off a RPC call with locks
held. So for now, we'd like to "opt out" of these lockdep warnings.

--
Jeff Layton <jlayton@xxxxxxxxxx>
--
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/