From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbdIENgR (ORCPT ); Tue, 5 Sep 2017 09:36:17 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45583 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbdIENgP (ORCPT ); Tue, 5 Sep 2017 09:36:15 -0400 Date: Tue, 5 Sep 2017 15:36:11 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: mingo@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] smp/hotplug annotations In-Reply-To: Message-ID: References: <20170905075218.526515965@infradead.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Sep 2017, Thomas Gleixner wrote: > On Tue, 5 Sep 2017, Peter Zijlstra wrote: > > > These two patches appear to make hotplug work again without tripping lockdep. > > They cover the case where the plug/unplug succeeds, but they will not work > when a plug/unplug operation fails, because after a fail it rolls back > automatically, so in case UP fails, it will go down again, but the > initiator side still waits on the 'UP' completion. Same issue on down. > > I think that extra lockdep magic can be avoided completely by splitting the > completions into a 'up' and a 'down' completion, but that only solves a > part of the problem. The current failure handling does an automated > rollback, so if UP fails somewhere the AP rolls back, which means it > invokes the down callbacks. DOWN the other way round. > > We can solve that by changing the way how rollback is handled so it does > not automatically roll back. > > if (callback() < 0) { > store_state(); > complete(UP); > wait_for_being_kicked_again() > } > > and on the control side have > > wait_for_completion(UP); > > if (UP->failed) { > kick(DOWN); > wait_for_completion(DOWN); > } > > It's not entirely trivial, but I haven't seen a real problem with it yet. Now I found one. It's the multi instance rollback. This is a nested rollback mechanism deep in the call chain. Seperating that one is going to be a major pain. Thanks, tglx