Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp640962iog; Mon, 13 Jun 2022 09:42:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uB0PqZ8y/uFMDjXK6h5FhDTbA0VP0buE9eObZnjGH3+NSCGdTD3bAHXBoSSLya5s1LWkag X-Received: by 2002:a17:902:be12:b0:167:6cbd:f113 with SMTP id r18-20020a170902be1200b001676cbdf113mr612108pls.69.1655138528446; Mon, 13 Jun 2022 09:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655138528; cv=none; d=google.com; s=arc-20160816; b=FuGhgSPE7b16SqJYK/FqbEGh8NE6ZQaAhj42Z+dJKblTnhc18NJfJMOIvQn2VfWV9s j0ea0t/AbGrz+dbP6U/h0+hnkMGeYw7hRPxnQ5rMX/VVXpWbnC9S1VxyGqSH5aVXWDYL Q5jCJjKUhFseK7VebWng474CeIoiFD0UyNcSVNSriN5U6+xh6k1l1L6DJ1obaFyxRTp2 xYqdcaKGxhJzLJyLifPp5YBi8kl/F4ao+UVPcaYDkNv3+LQYSokT0Wu3uPGlUvjobFYx ViiyWMwoaycezzNaGcFXD73voAndTMnbHbJrKfKErQGk0KkppWzZOy4FJZUlYL8LU7vi SnLw== 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=XGj+H+fpRO/LlJr3MV24WDf1h9Fmi9x6UfIbBDjSN90=; b=bDJVxsV0gOh6YwUikYrHx4hJ6EXmV3gIGCuj5yz19UG+yayZSrz6ZaHarvrRO8xnyl AT5yAIFGjf2jJIKj1TdM1axiobyyvTn+n1VDhFoeJwUywDUl6WcuMzPAX+GF4toJoQit V5O6MPRx3fXWPk1AzZ0sQpVxxSha5Rjtmuk8K+VwkA2iJeKAqiRusqiI9u9k6VgEl0G7 X9EG8yizBBRgwqfNr5yh40ceFEqDVNpRpTa7KbfXdbxlRmF6OggdRqvQ3j2Kr4Ili9XS JY0iJyqNRz+0PrOYuwK1mpBaPj5OVBwwx8hL2QIJuyIqOy2t779IZcmZNibhZkkc3bLv S5dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XgUlqfja; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a170902ce8200b001675d8490e4si10368568plg.563.2022.06.13.09.41.54; Mon, 13 Jun 2022 09:42:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XgUlqfja; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240917AbiFMPzR (ORCPT + 99 others); Mon, 13 Jun 2022 11:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242358AbiFMPxI (ORCPT ); Mon, 13 Jun 2022 11:53:08 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA1218AD9A for ; Mon, 13 Jun 2022 06:37:54 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id v14so7192540wra.5 for ; Mon, 13 Jun 2022 06:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XGj+H+fpRO/LlJr3MV24WDf1h9Fmi9x6UfIbBDjSN90=; b=XgUlqfja5ZWiDngd5yxO9/A1rS+TiHjFwM3lWMNUhKXVo7oN0cM2pEcuNzjygpwG0N zC2JLXdgQdEii9jwUAeOyRgUxAqj62g3h7raBCksbi3LPGkqSX3vzlsasioqRRgXm9i5 CFYZ0By5rNs1B/MPFZqefiDSoLn1v+a8pYIfqXanwBk+9f0Ff4eXO017wO3U1t1P/+eH 7geD1a34tzn5fR5kOJQZyiA8ksdj0S3W49L5lZtaqswzgIOb7gFVpFF6TIlmHDZuSSlY Av0b7yZDsFI1rdOo3sREPKsWUya6vCf32OX0VG6wAk6fEKVLdNEeBJJPYW2ede+t/aOD eKYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XGj+H+fpRO/LlJr3MV24WDf1h9Fmi9x6UfIbBDjSN90=; b=WM9qM5ru8bNC+6rX7wApp0bansc86PxbkOCRhj5P9/+KCxlLBR9afaH9eWg6lpVnjp IQuL19xAzs53z/cXNDxJyLysEJoaFYBlf0nSEbQliZFGdTJQXE8Hj/4veOIO4F15qgPh /W39HSWt03nWj1qOq9k/Z65stL/mmXNiFbjI5+D4b7Fdnkxx3bNpW7/FokSQqYMsVx+P OFhl+DNNPR6avbZ0AQfba+XQPHWgMBffO/GtdAgRIcOO00YULlKc9Qv5rpNTL+ZmGl8J m19Gr9GVfuMUNPX5bGFZr3bsaL9U+E7LQ3j0pjElqEISjeGlE12C8RmhA24IJDfNxWbR CmKQ== X-Gm-Message-State: AOAM532Xu7xA94tLtM4vrFmvFkVvK1AacwZN4CsFCG7nqe70BH1YOogi BUJ8JMAY25CJyDOPviLwK2WBhQ== X-Received: by 2002:adf:9cca:0:b0:210:2f76:93fe with SMTP id h10-20020adf9cca000000b002102f7693femr55711451wre.12.1655127472493; Mon, 13 Jun 2022 06:37:52 -0700 (PDT) Received: from google.com (109.36.187.35.bc.googleusercontent.com. [35.187.36.109]) by smtp.gmail.com with ESMTPSA id ay4-20020a5d6f04000000b00219b391c2d2sm10529791wrb.36.2022.06.13.06.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 06:37:52 -0700 (PDT) Date: Mon, 13 Jun 2022 14:37:48 +0100 From: Vincent Donnefort To: Thomas Gleixner Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, vschneid@redhat.com, kernel-team@android.com, Derek Dolney Subject: Re: [PATCH v2] cpu/hotplug: Do not bail-out in DYING/STARTING sections Message-ID: References: <20220523160536.2889162-1-vdonnefort@google.com> <87mteg3flp.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mteg3flp.ffs@tglx> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2022 at 02:36:18PM +0200, Thomas Gleixner wrote: > Vincent, > > On Mon, May 23 2022 at 17:05, Vincent Donnefort wrote: > > +static int _cpuhp_invoke_callback_range(bool bringup, > > + unsigned int cpu, > > + struct cpuhp_cpu_state *st, > > + enum cpuhp_state target, > > + bool nofail) > > { > > enum cpuhp_state state; > > - int err = 0; > > + int ret = 0; > > > > while (cpuhp_next_state(bringup, &state, st, target)) { > > + int err; > > + > > err = cpuhp_invoke_callback(cpu, state, bringup, NULL, NULL); > > - if (err) > > + if (!err) > > + continue; > > + > > + if (nofail) { > > + pr_warn("CPU %u %s state %s (%d) failed (%d)\n", > > + cpu, bringup ? "UP" : "DOWN", > > + cpuhp_get_step(st->state)->name, > > + st->state, err); > > + ret = -1; > > I have a hard time to map this to the changelog: > > > those sections. In that case, there's nothing the hotplug machinery can do, > > so let's just proceed and log the failures. > > That's still returning an error code at the end. Confused. It is, but after returning from this function, only a warning will be raised (cpuhp_invoke_callback_range_nofail()) instead of stopping the HP machinery (cpuhp_invoke_callback_range()). How about this changelog? The DYING/STARTING callbacks are not expected to fail. However, as reported by Derek, drivers such as tboot are still free to return errors within those sections, which halts the hot(un)plug and leaves the CPU in an unrecoverable state. No rollback being possible there, let's only log the failures and proceed with the following steps. This restores the hotplug behaviour prior to 453e41085183 (cpu/hotplug: Add cpuhp_invoke_callback_range()) > > Thanks, > > tglx