Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2778192rdg; Mon, 16 Oct 2023 14:56:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdgvR2oU5qure61xppCyId1vcQoILvguje7XwpcGxtUzmQOLxwAYeECAVPQ58xQA1MrLv7 X-Received: by 2002:a17:902:d091:b0:1ca:abd:1c1e with SMTP id v17-20020a170902d09100b001ca0abd1c1emr506810plv.23.1697493361686; Mon, 16 Oct 2023 14:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697493361; cv=none; d=google.com; s=arc-20160816; b=rbe+hfNCdxjWMJbsCDnyRRDXN6CpcRavpNTHOSk0EebyW21Zl42mZO2N3CzlALKBPd +OFMgAMaHL4RFsutZuzhEwLeXWoVMFjTzMIAmBatkfw4n+sFIlJKBubcZGkFtxRnxqoM liD9RnfINvBYE40Er7UU4Jp6/nxxrAuYYEJq/PPYGpTNecKv1C3dZB6apS1H5XamU3fM p64jukSyyzRH0fjWkrdgn9kmjYUqJs4X+HHFoTkqNYB3/QNH0QExOkOfSA4s5VmYFPq+ o0AneziXB7hemCg0RPK1H6TUIeeNZRLHfFLtPEXFXcYrS77VjcoEiCfAdG5jvX5l8R/j vFyg== 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=5tkJ2bgsDt87q0DstoWjpZMRRfhwElRsndfgSDa9gto=; fh=nbS/AmkO2/evwHW+UeBSEl5JWcLmWHuM2XmZHlFoaHk=; b=V0WYZm6osS8VYTS3c20EhkdzgAzy8M68P0J+m7ZPnlOYC+cidIA2cGLb/ZGzT1K7Qx jPB/ILSf5cQRSJrv+paLAez4cU5ebQTFwGVzLCxPdh3jvLNFQwjSYmBDdsk1LMx+bDhk VLEHnAXfmje3q/XrdIcprdt0eMfc61vPvCljGLbFZCA/3i3gcXrz14TpDO/FulCAz1Ve tPfFGcVOvF9GGooWR2qbCWJFdHGqWoNR1igqFYOcEQAAQb+e+9daKS01SE/1qTavsuR6 jlyq6SAmHEFCQ8Qx4qU1RKx24EeeGkkTpPY/vX4oVhbyNk2mJqdoE0GQRH7/h19xaqRz D40A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=o8l1EIS9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q7-20020a170902a3c700b001c9ebe878d7si237876plb.109.2023.10.16.14.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 14:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=o8l1EIS9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 273E78041FF3; Mon, 16 Oct 2023 14:55:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234137AbjJPVzv (ORCPT + 99 others); Mon, 16 Oct 2023 17:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbjJPVzt (ORCPT ); Mon, 16 Oct 2023 17:55:49 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC248A1; Mon, 16 Oct 2023 14:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5tkJ2bgsDt87q0DstoWjpZMRRfhwElRsndfgSDa9gto=; b=o8l1EIS9wF0DSvO7/lfeP5B37V 2AWM2VflsyAMUBYhrSPTzyGG9HyA41o1eXWfsXoDsN7NHlrc6J71nqGFHQ8wehp1r5g9UZcMnAi1s sHCywxWN2ize1mTom6zOpMwC29C5HtySnp4/u4mf83V5aVEdb8Gi0C9l6gLTu5EmdIGMvqOdtahJf d2jSHUve/q3MpzLRILd5aXqaRhCrkQc4pUb8c8dWtWmyuHiQw8BNo4FxLCA8ofsbTqb4Wgo2Q0Fc+ jQDRRHy5TkhhdWOMUz2Tzn1/a7yMb2rMdvoTFOOmlgmli+27CBQwfODl/b6B3WXI7OowUApHwrsFU hb85lJjw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qsVYW-006KoG-1c; Mon, 16 Oct 2023 21:55:22 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 815DE300513; Mon, 16 Oct 2023 23:55:21 +0200 (CEST) Date: Mon, 16 Oct 2023 23:55:21 +0200 From: Peter Zijlstra To: srinivas pandruvada Cc: "Wysocki, Rafael J" , "Meng, Li (Jassmine)" , "Huang, Ray" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-acpi@vger.kernel.org" , Shuah Khan , "linux-kselftest@vger.kernel.org" , "Fontenot, Nathan" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Huang, Shimmer" , "Yuan, Perry" , "Du, Xiaojian" , Viresh Kumar , Borislav Petkov , Oleksandr Natalenko , "Karny, Wyes" Subject: Re: [RESEND PATCH V9 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting. Message-ID: <20231016215521.GD36211@noisy.programming.kicks-ass.net> References: <20231013033118.3759311-1-li.meng@amd.com> <20231013033118.3759311-4-li.meng@amd.com> <20231013160128.GB36211@noisy.programming.kicks-ass.net> <20231016105845.GA33217@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 14:55:59 -0700 (PDT) On Mon, Oct 16, 2023 at 11:50:34AM -0700, srinivas pandruvada wrote: I'll respond to the rest tomorrow, it's far too late. > > > Also, same question as to the amd folks; what serializes those > > > static > > > variables? > > > > That's a good one. > > This function which is checking static variables is called from cpufreq > ->init callback. Which in turn is called from a function which is > passed as startup() function pointer to > cpuhp_setup_state_nocalls_cpuslocked(). > > I see that startup() callbacks are called under a mutex > cpuhp_state_mutex for each present CPUs. So if some tear down happen, > that is also protected by the same mutex. The assumption is here is > that cpuhp_invoke_callback() in hotplug state machine is not called in > parallel on two CPUs by the hotplug state machine. But I see activity > on parallel bringup, so this is questionable now. Parallel bringup should still serialise this. It mostly only does the hardware bringup in parallel. Having a pointer back to the cpu hotplug lock would make it easier to untangle this code though.