Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3802434imm; Wed, 5 Sep 2018 06:19:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUEbpr52Sd6r8WEOVnJFWTYxmrj6/9M50+EvQh4uC/O1DoKJfpxBFJc/vPAfFezx1dHAcq X-Received: by 2002:a62:7a01:: with SMTP id v1-v6mr40097625pfc.153.1536153554344; Wed, 05 Sep 2018 06:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536153554; cv=none; d=google.com; s=arc-20160816; b=DZn7lH5uAooxl9PCH3GU5eGyVs7atMujdIdIDhYkFqXH2gBP25zQC6+Qd/va89yzMB 05C+x6tBfIgQYJqjC/aIESf+lhAkkhrhXYbeyaRTEn6Fb8K4sqd7emPdfuD6PBnQloS0 yc2ltbsIqYlNoOjbc+zrWfQ3PzA0bHYA1rnhYmFGrYjDjiOWdo+8lHz311ffmneuOYm7 D0igGtjhwia35BQjS5E00z98sH9qVXpU3q+z7Zl/2bht57tPCUHoOZkYlgPa+Y/BFWbZ KUD0nCzwV+yjHcbLV//a1xlkJipi5TtRZnZyWSR7D0Quth0Ems2HWsxOTh1TaW/oShIM 5Pdw== 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=d8l8sGXPGmSGnsNh4YTcXhzGsuwq03nSMjXN+45iFHM=; b=Ypc/4Xir9BaONm3s4dXDdP+Mzy2oJWY9qRdrfVJsCz3OSE0msgxFsmslxS01MoF9mf EYe9SghqTzsCXEVaIgDYuFP3KVNn/RvBEbV5BpJRGoR5KXdit4cYWCdSyVvzFSXCXkdg GZgqEgmND+UYUPSdnCMviFPljm5VMC2NMU/XRfFh7IIGd9U9VTdM7xmtOnM1XzZ8+B1c Bkb+fMzU0xXXJqU8tu4x+Is4j8eKrjmJt7q4g6USplk6tOcn39p+KPM3p8U8ur5NQCJI gOFKgMHJRF5Nuhi4GYAWSz5q7OtEUuBGwKV0g+GlBfypHSp8hNh0WEeYHPCwHLerKLp0 RRgg== 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 h8-v6si1780762pgp.202.2018.09.05.06.18.58; Wed, 05 Sep 2018 06:19:14 -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 S1727739AbeIERrb (ORCPT + 99 others); Wed, 5 Sep 2018 13:47:31 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59578 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbeIERra (ORCPT ); Wed, 5 Sep 2018 13:47:30 -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 1fxXgA-0004V8-PZ; Wed, 05 Sep 2018 15:17:06 +0200 Date: Wed, 5 Sep 2018 15:17:06 +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: <5b0e528f-e597-9598-3ff6-b9e08ddb8165@codeaurora.org> Message-ID: References: <1536042803-6152-1-git-send-email-neeraju@codeaurora.org> <5b0e528f-e597-9598-3ff6-b9e08ddb8165@codeaurora.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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