Re: [PATCH v4 3/3] vt: fix console lock vs. kernfs s_active lock order

From: Daniel Vetter
Date: Tue Dec 16 2014 - 08:45:23 EST


On Tue, Dec 16, 2014 at 1:50 PM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote:
>>> So NACK from me for this.
>>
>> I think I proved it in the commit message that this issue is independent
>> of fbcon/fbdev, so refactoring these will not solve it. This patch fixes
>> an issue in vt and while your points may be valid, they are not really
>> about this issue or how the patch fixes it.
>
> I think you may have missed Daniel's point. Which is what I was trying to
> point out earlier but in an overly terse manner.
>
> If you start by just moving the sysfs teardown outside the console_lock
> (but still in the same thread of execution), then the direct lock inversion
> between console_lock and the sysfs lock goes away.
>
> However, you'll now realize that you can't move the sysfs teardown outside
> the console lock because fbcon is doing teardown from inside its notifier,
> which means that there would be a lock inversion between the console lock
> and the notifier lock.
>
> Which is why we're pointing out that the real problem here is the
> fb notifier call chain lock.

It's more the overall story. The patch is imo technically ok, but it's
yet another step in the wrong direction. We've unfortunately piled up
lots of those around fbcon/console_lock and eventually we need to
start going a better direction. Applying a hack will just result in
everyone forgetting about this until the next head of the hydra pops
out of the water.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
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/