Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp10254imm; Wed, 5 Sep 2018 19:57:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaxrasnBfTsD4jZHZ7HhQ/OPNmXiqTszCoLfN1Ej8j2L+hXbL+rfcUxaw/a8YKl8WOBke88 X-Received: by 2002:a17:902:7586:: with SMTP id j6-v6mr638961pll.295.1536202674297; Wed, 05 Sep 2018 19:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536202674; cv=none; d=google.com; s=arc-20160816; b=a+dJ1tzfrTtNDv2qDH/Khlqlhgw0OdMhCgLtbt8Zl64smQz5EQ69suojsKsIRkHQTo 7G8uHcmVjsmZyHwFdIy1JQWgIGRx3DUm1TtTK9+TjvL7a7xtqoc0YvViUiqpar+dqThB Ioe8H6CaGZw/OKjZNGqodmowwmBwEo34AQv53SFXFQyqXeuYToAglYNt73Vml3g3NgFY 4TAzQQwiLYMryUMqEs6NXTXXaNp/D27Z8qkszg1IMr5R3YBoCPUO0TJyXKNF/Gklb6eC J5H2cuA/WqkTRDrs9KxkZOq73U8EhBe2Oyn/i7OqGe+0cTMR3DWo5MUso6WvRPc+gtB/ NWBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=eErvJKxkhvoLOIx8RbMGpFQCLe/pncW75aXe3VrapkE=; b=b1AOHJ8vQ+Ievdft16aCcKU8YmAHSlLAoNYZfzHUzde/hHAhY52TKQvCEHuyMsVJMr ePW2MuAxMyotEZAv6lZ8dgg9qXIb60waGxkxCPLYSM8IloG9wQVWpg0Zcnpgvzxm1bUr ID/9pI1A9adhk7G3GAEgUWmzt07KA1DTABcrpwR3fyWO7VMEHKfApHNa60UE2AW7FJ8I pFiuYbfRtRFfrGWAYCT49kihb4BOitfe2WO9zVoxgPTxXhSEzzCqGwQScKrpLlWgbLYi NUDN4+l12VwokTx6betiaCHaldHKl6HQXM6kUynIZD9894AaHHY4K9e5I4n/5EgoNT0M ngRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRSeoFnU; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRSeoFnU; 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 x10-v6si3834292pgl.567.2018.09.05.19.57.38; Wed, 05 Sep 2018 19:57:54 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRSeoFnU; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRSeoFnU; 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 S1727691AbeIFH3f (ORCPT + 99 others); Thu, 6 Sep 2018 03:29:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47412 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbeIFH3f (ORCPT ); Thu, 6 Sep 2018 03:29:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D925B607B5; Thu, 6 Sep 2018 02:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536202586; bh=6ZXclQG4RV6rQzOwlrK8mLRgw9s+Z9Ya9a+JKHXTv4g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IRSeoFnUrxMIDTXekpIxMFCuEnv3W1+9s6/Pb92VRAwhI6gMjCo1zNYvSJi7ymrqk 6dBglyIMzG+3PKKeECw5b/1qdAohM0GU65Q8jXRS7cHO/x029w2Er7qlU6nuv1b+Z+ iWQkNiYpqlko8nPKkE5EF4eEAh2vAWXfhE4xcCIE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.78.89] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: neeraju@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D58706034F; Thu, 6 Sep 2018 02:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536202586; bh=6ZXclQG4RV6rQzOwlrK8mLRgw9s+Z9Ya9a+JKHXTv4g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IRSeoFnUrxMIDTXekpIxMFCuEnv3W1+9s6/Pb92VRAwhI6gMjCo1zNYvSJi7ymrqk 6dBglyIMzG+3PKKeECw5b/1qdAohM0GU65Q8jXRS7cHO/x029w2Er7qlU6nuv1b+Z+ iWQkNiYpqlko8nPKkE5EF4eEAh2vAWXfhE4xcCIE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D58706034F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=neeraju@codeaurora.org Subject: Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu() To: Thomas Gleixner 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 References: <1536042803-6152-1-git-send-email-neeraju@codeaurora.org> <5b0e528f-e597-9598-3ff6-b9e08ddb8165@codeaurora.org> From: Neeraj Upadhyay Message-ID: <9cac90ff-1a43-8663-da2e-7191975b5e93@codeaurora.org> Date: Thu, 6 Sep 2018 08:26:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation