Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp417254pxb; Wed, 20 Jan 2021 10:02:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsrB2rcv+MNtjtAMSPthsbTFezw4yEO5UF1zsmPhzkfvBV+Dmbl8t2dT2fWDGlvBxIRU5A X-Received: by 2002:aa7:d489:: with SMTP id b9mr8370368edr.374.1611165760133; Wed, 20 Jan 2021 10:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611165760; cv=none; d=google.com; s=arc-20160816; b=j5cg+uuf7IH9+H9G5n4BK74eTRGIfovcZkQCZ66cM+FiHeTAL8yuPNgu7WC9kUlTJr pJIsuLgMHNas/U8kZn1XksA0HOcNpr/q+g6nE51QI1kQa02ZHz/j2iULzsIChFCsT/8P k0CWZf5pQ6J8qKue1HPHcB3gZZiV6/0xGSukwphL2OzLske3+3MnHRTtXOZ+m8QQydgU l4Kpsoiatna5ljfT4dwvWoYP8VGz/vPdaXNOau43bO+LtwsmyGiFHaurAKua30TjqOUM J4K7USyNZNPkg9VGlOx/YN78y7hz9aGX6JCTCkEjdpLJrGhmBpls3CjQ5RZ7QBNW/qzX S8bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UaCoCKDs1OtKoxMLsbGvffQe4BHvSYXwY3luYlOzauA=; b=L+yZwl0GLzcZhtvzSfFsHIrET22ka7XAR/ZEwa/CrRSlysxyfBefRQDaSqAX+zWWNZ T8IY1In8YEvONWX59nTn2GloyhGUhTObZCJ6hIi9ELh7W2uqlX6KqEXP+NlP924ViLEW 9CeKwWNhTpvmBNrJ0tk/wlbOMKOFE5BUL7As2yFQ08WA5RykI2gxXLMLZLx9Q1XtA8bi laUsv2Ae5y3/DEJzSeBILUx9tk17Awcp02w/97d5G02G5IpyxV0niYa4SI8YbtFddV89 Yyyu+2IlOf/CCw6oCwaW41iCPxgXMuXTAxaUMkcXixh8Kx70icgLHohft5jHOSED6g1N z0XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ddBRiym1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si1139105eda.301.2021.01.20.10.02.16; Wed, 20 Jan 2021 10:02:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ddBRiym1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390701AbhATSAR (ORCPT + 99 others); Wed, 20 Jan 2021 13:00:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389565AbhATRyq (ORCPT ); Wed, 20 Jan 2021 12:54:46 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0949BC061575 for ; Wed, 20 Jan 2021 09:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UaCoCKDs1OtKoxMLsbGvffQe4BHvSYXwY3luYlOzauA=; b=ddBRiym1BIuFobGhRcJ5btSCOJ RUxiKGRfr++ywkVjyJy7u343stDzM21MbgYWafKfK+NZP80waHz08h5uj0C7/y0eQkPnSaPJlSL8o rMynpDfbnJLGI0oP+sxTLPZnU1pObctxB+PNy8MUmd/m1Akf7CP0Uc6Xk/BA57mjEiTTPCaaPTFEg xb82SkWzI0Nu9MdBjoDvHQOAr/D1OfULnARkwqnCCpS3HpKdUa4Crn1GCEdMX0PzrEgQHFhirgDe5 qp0m352zJglZ5PU1PxCmykHxd6R1YBdSetXrdUQmYveekASbWw+stFxY0eOTjLJ8MXetxBspQ7zS4 WF7erbSg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l2Hfh-00G12j-Jo; Wed, 20 Jan 2021 17:53:38 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4EA1C303271; Wed, 20 Jan 2021 18:53:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 30C4C2CEAD1A3; Wed, 20 Jan 2021 18:53:33 +0100 (CET) Date: Wed, 20 Jan 2021 18:53:33 +0100 From: Peter Zijlstra To: vincent.donnefort@arm.com Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, valentin.schneider@arm.com Subject: Re: [PATCH 3/4] cpu/hotplug: Add cpuhp_invoke_callback_range() Message-ID: References: <1610385047-92151-1-git-send-email-vincent.donnefort@arm.com> <1610385047-92151-4-git-send-email-vincent.donnefort@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 06:45:16PM +0100, Peter Zijlstra wrote: > On Mon, Jan 11, 2021 at 05:10:46PM +0000, vincent.donnefort@arm.com wrote: > > @@ -475,6 +478,11 @@ cpuhp_set_state(struct cpuhp_cpu_state *st, enum cpuhp_state target) > > static inline void > > cpuhp_reset_state(struct cpuhp_cpu_state *st, enum cpuhp_state prev_state) > > { > > + st->target = prev_state; > > + > > + if (st->rollback) > > + return; > > I'm thinking that if we call rollback while already rollback we're hosed > something fierce, no? > > That like going up, failing, going back down again, also failing, giving > up in a fiery death. Ooh, is this a hack for _cpu_down(): ret = cpuhp_down_callbacks(cpu, st, target); if (ret && st->state == CPUHP_TEARDOWN_CPU && st->state < prev_state) { cpuhp_reset_state(st, prev_state); __cpuhp_kick_ap(st); } Where cpuhp_down_callbacks() can already have called cpuhp_reset_state() ?