Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5738838ioo; Wed, 1 Jun 2022 11:29:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxbFGLRtB53FqeFvEIybi66ds8F5JiGYStTwVKNG3VwzZEdrHtC6OHjybe/stwSwEjDpjo X-Received: by 2002:a62:3001:0:b0:51b:b142:88ad with SMTP id w1-20020a623001000000b0051bb14288admr893250pfw.52.1654108177585; Wed, 01 Jun 2022 11:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108177; cv=none; d=google.com; s=arc-20160816; b=ZS0FxLeJuBdg8pjnITeTOpydMa7gvnUT6dXVp5CSyYfLYdR7+soWg9B7o2uv6X3g1b 8GTwWR0Ql1EQ5ZMR5tjJVD49W+NZT4IqzEUOjmMPoKG+nLvHfqMV2u7eL3EL6bLAqCmh 6TPjlnwussJz+nvJNriMIpW685a+o+mG6VniAg1gbn/9wLI2kjtLGQe4lcTAkXVajPkG wNBzm0bZ0w2BckMvoCkRpxmZ5LaWPopqN/Wi70Hxvf1bRAIjDuD+iW5VMWgpcsia4HjE WoZiF4ni75GklM2HNtly7WOuFSOszTC2K3cMldOvWG+1uGfg5fKEpuD/COdQym5Do3cK lF9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=1sspQ35G5aSQ+++l6IYriZ0Sm6pA3iBlqPQBAXhh4bU=; b=ZvaJ+t4F2Y7UdnQt/kjNI+K+pji6wFm7H/HJ6kkbMqdTpGqkIUvp2StwQbPWIJ/c7D kil2DLrXWwpArB2c8hHMyWWBjbH0je3HeaWXM+6yMpLjVt1Hu1Z0LTenO+0Aphr85FbM vaMDMsqD6Rx/iaIoCxLBzBmXKN/kaTPugU2Lh0kkwvHVR5ggyYCRWdHtuPfJpuZjmo3q aedHUf/lHh7MVqG7+hqWjJswgMXFat4EjycQw1NWLxNOCFr43RlYeZexnSh03gv7+osw 9hR2llua6NaIbFtkwfEz7sTGSTo+2LCqKaYz/seBw3RcVIdHeOm/VIqHQP2j3/9M3p4q MzPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TW6MRvHG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i5-20020aa78b45000000b00518be006107si2872757pfd.116.2022.06.01.11.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:29:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TW6MRvHG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D989762A0C; Wed, 1 Jun 2022 11:28:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356171AbiFAQjg (ORCPT + 99 others); Wed, 1 Jun 2022 12:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356163AbiFAQjd (ORCPT ); Wed, 1 Jun 2022 12:39:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF7B671A34 for ; Wed, 1 Jun 2022 09:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654101571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1sspQ35G5aSQ+++l6IYriZ0Sm6pA3iBlqPQBAXhh4bU=; b=TW6MRvHG6EeUdWnfXup85t0IwQIA5zCevt1WLcE7lzUvNv20qn1N2AjKaMI6BTWZnh0USd qBOfTplsw+OnPNjtPz0N0zazrMJfCGPAYIVNfQR32EZpiyhAOSfePbSaein2gro0EgG9QO 6WVK14cGB4MFObYcbiC+vnKJs6Fmzeg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-455-O3AKFw3LMqCPZ1_XvLd74w-1; Wed, 01 Jun 2022 12:39:30 -0400 X-MC-Unique: O3AKFw3LMqCPZ1_XvLd74w-1 Received: by mail-wr1-f72.google.com with SMTP id p10-20020adfaa0a000000b0020c4829af5fso410014wrd.16 for ; Wed, 01 Jun 2022 09:39:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=1sspQ35G5aSQ+++l6IYriZ0Sm6pA3iBlqPQBAXhh4bU=; b=tufjXtWGLX6IU6WIB6S/OG1bxLpfqxjXmIvAlk6izpMzHtjyYVyb6qXaRwtXXoYtiZ NbWlZLgBGOKaPS5ZZvXpoTUCTv4hCVhpTG2+JGKB4Rd2auRSMBXDp9th+rdAMqlMExMk 1FbV6dC3CZntJeH9eiQ1f4g5wCFLP7QzeaF7FqxjLK3uHlsG5+2pgK0m8xTJ8EGCsQk9 5vlnyHZQgfdFQ02rj98DGasMay6NUHkMVarT/Ah72pJT9vRSK+u4WZTOKH/eMbCppVZ5 ZIjqag97HEyfJje5WWe6gzNdL3U1tzScnAHI+epalMIj5VGQLvBp2IDKo+XBWwMXCA6q WJDQ== X-Gm-Message-State: AOAM530XwNJYhn4csQP5tFTVelz1POeMmLySh9B2BFzuwcORbLcP76QE QWgxFSBblAVFkWuOkF4BfFmrklNuTKQ43+H5KvHWjRX9Q2bwPjC6D5lgLygUDv3hxhcHe4y3XAM SbecMoakTefFg99x9X2KMEOmB X-Received: by 2002:a5d:6445:0:b0:211:7eee:2f94 with SMTP id d5-20020a5d6445000000b002117eee2f94mr212788wrw.631.1654101567892; Wed, 01 Jun 2022 09:39:27 -0700 (PDT) X-Received: by 2002:a5d:6445:0:b0:211:7eee:2f94 with SMTP id d5-20020a5d6445000000b002117eee2f94mr212772wrw.631.1654101567648; Wed, 01 Jun 2022 09:39:27 -0700 (PDT) Received: from vschneid.remote.csb ([185.11.37.247]) by smtp.gmail.com with ESMTPSA id j2-20020a5d6042000000b002102baa2370sm2094843wrt.100.2022.06.01.09.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 09:39:27 -0700 (PDT) From: Valentin Schneider To: Phil Auld Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH v2 1/2] cpuhp: make target_store() a nop when target == state In-Reply-To: References: <20220526160615.7976-1-pauld@redhat.com> <20220526160615.7976-2-pauld@redhat.com> <20220527132156.GB26124@pauld.bos.csb> Date: Wed, 01 Jun 2022 17:39:26 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 01/06/22 11:49, Phil Auld wrote: > On Mon, May 30, 2022 at 01:27:00PM +0100 Valentin Schneider wrote: >> >> Yeah, you could append a simple: >> >> else >> WARN_ON(st->state != target); > > I was thinking more like: > > else > if (st->target != target) st->target = target; > > Since this is a write to the target field and we are not > doing one of the operations that will set target because > state == target we should make sure target == target. Although > that could have its own issues, I suppose. But as I said > fixing the boot cpu should make it much less likely that > st->target != st->state once we have the hotplug lock. > > I don't see how that WARN would ever fire. We're under the lock > and nothing is re-reading the value of st->state anyway. Looks more > like a compiler sanity check :) > Right, having a warning in there would mostly be to catch unexpected/unintended scenarios like the one you've found for the boot CPU. I'd vote for WARN("Huh, didn't expect that") + fix st->target > > Cheers, > Phil > > >> > Maybe I'll include that if/when I have code to keep cpux/online in sync >> > with st->state and cpu_online_mask. >> > > --