Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp235924imm; Thu, 6 Sep 2018 01:23:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ78R8tZ2XsvonZT0sOJ0t0IOPuzTqZQkTS7VXGCq6a78Mltc7JmS70hUZqSD6aqcVTOYsu X-Received: by 2002:a17:902:724c:: with SMTP id c12-v6mr1559151pll.326.1536222237365; Thu, 06 Sep 2018 01:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536222237; cv=none; d=google.com; s=arc-20160816; b=jU3pKOV/MUvjTJ2pOjWH43AUC/7BJ2H7hVXu1sSrTPAOXcF7RqaozOwtxImQVEm+C1 KgQ8ZS1q80dvOl34Yf6MO7jQ/a8SKlKYYaHkH2XlS89Jw1JWlHK9cZsEmHj2rCuJ2z5H AU/ME7qjIfuwjgPd1PCvqPloMBssvw5tAMp6nWtd4vsL0cgQ6m+6SDKbNX/0hdZdI/hG WnPLkafPCih9tpXOggwUBUHx/G0wuQNnh+nLSnGAa13xpMC4ncHP4E8jd18yDG9S8TXG eNHxM8eSTKKiR3/bV+WhR16iyZi5n2KMAsu17g++x+EpDMD/oazPjKdJ3kkVcKSRrr+J 1Fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=2lqA1YHgDZX76aanQDadUsJZvrZMR6skrJ+qHGAM6ds=; b=J4OeIv5lWQIqLJ1cS4dnU5tHZjcgLTb1qlfI4kAZh2HykQru47kpQFkpPPClgb7RvY i4cSaW5amfn6B5iHTmeAWnoqslFpugTCuTnOELwWNPUjfgVVgxACoJyTS7F4BfYyCn0y 1pCezGFN1x20fgLp0RHs63mZfiTHYrv4zgtRrCnlkuE8yLy6UIpRRG3Vn+8yehx6X2zf X/y7Rt+2K2wdITO6a8ryZ36TJzWYqLHR5Br1ToG29EW2a6rMIBpB4nFU37M0tqb1haRv wj5l4OU7Mmxd3eu0X8edMUGesDCZO4whsj3e9hCAplS8cPF6GLjST3ugvcQhTNIEYZdY X89Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si4445504pgk.121.2018.09.06.01.23.12; Thu, 06 Sep 2018 01:23:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbeIFMxL (ORCPT + 99 others); Thu, 6 Sep 2018 08:53:11 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:32946 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbeIFMxL (ORCPT ); Thu, 6 Sep 2018 08:53:11 -0400 Received: from p4fea45ac.dip0.t-ipconnect.de ([79.234.69.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fxpUu-0000mz-Ts; Thu, 06 Sep 2018 10:18:41 +0200 Date: Thu, 6 Sep 2018 10:18:40 +0200 (CEST) From: Thomas Gleixner To: Neeraj Upadhyay cc: josh@joshtriplett.org, peterz@infradead.org, mingo@kernel.org, jiangshanlai@gmail.com, dzickus@redhat.com, brendan.jackman@arm.com, malat@debian.org, linux-kernel@vger.kernel.org, sramana@codeaurora.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu() In-Reply-To: <9cac90ff-1a43-8663-da2e-7191975b5e93@codeaurora.org> Message-ID: References: <1536042803-6152-1-git-send-email-neeraju@codeaurora.org> <5b0e528f-e597-9598-3ff6-b9e08ddb8165@codeaurora.org> <9cac90ff-1a43-8663-da2e-7191975b5e93@codeaurora.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-975396822-1536221920=:1416" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-975396822-1536221920=:1416 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Thu, 6 Sep 2018, Neeraj Upadhyay wrote: > On 09/05/2018 06:47 PM, Thomas Gleixner wrote: > > On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: > > > On 09/05/2018 05:53 PM, Thomas Gleixner wrote: > > > > And looking closer this is a general issue. Just that the TEARDOWN state > > > > makes it simple to observe. It's universaly broken, when the first > > > > teardown > > > > callback fails because, st->state is only decremented _AFTER_ the > > > > callback > > > > returns success, but undo_cpu_down() increments unconditionally. > > > > > > > As per my understanding, there are 2 problems here; one is fixed with your > > > patch, and other is cpuhp_reset_state() is used during rollback from > > > non-AP to > > > AP state, which seem to result in 2 increments of st->state (one increment > > > done by cpuhp_reset_state() and another by cpu_thread_fun()) . > > And how did your hack fix that up magically? I'll have a look later today. > > > > Thanks, > > > > tglx > > The hack fixes it by not calling cpuhp_reset_state() and doing rollback state > reset inline inĀ  _cpu_down(). And how is that any different from the proper patch I sent? It ends up in the same state. So I have a hard time to understand your blurb above where you claim that my patch just solves one of two problems? Thanks, tglx --8323329-975396822-1536221920=:1416--