Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp35751rdg; Tue, 10 Oct 2023 03:36:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtz8HD58R0dNSgkb4052ROsrFrYoTH9bP4lShkJwBpWRP+dxpWDm+G1IdDAVYNxpqLuiAS X-Received: by 2002:a05:6a00:f8e:b0:68f:b5a3:5ec6 with SMTP id ct14-20020a056a000f8e00b0068fb5a35ec6mr19554368pfb.0.1696934218527; Tue, 10 Oct 2023 03:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696934218; cv=none; d=google.com; s=arc-20160816; b=dQU0B5bhGT/jnqTYtMeRUa9ZqHyi0LbCv/rCw8lKOGHvyYqp5UvZaM9YwhQJia/QaW 5zsyOreOw/Qpg4jp1MeIbGyv1cNauC6lNqiXt4woqJOTLvDnJTJMlm6LwEA94dT0KZfm 7IuurSbX+pCf25tYSYNVkoEaYl3L63RNWRNKzaQGy1zfjDQw770VliySM6TGOtbnvPK2 UF3T3+5wrIc+yYX58bJ5j8TljmZGh2aQWigm2zRVivYm9tZR+drz/4CNoCpAFzKQjlW1 uk8dc30Xffbxbxh70Ih4I5R3xc0CDs+iVMkTEsVsoQfR7xIkqgeS1dqZ2f+/3+2TiVgI F9yg== 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=QdI+5V9yIlogu8K/04Iaa4H4soULWRigcAOJTct/Jvg=; fh=hgQwi4QHky5ycDAg8CcQLK8gHjkqXY68/pKyi1jApy4=; b=XAzFSVX2wRdHGTf5s4PW5ysS5DBfyO1WZOTFMi9tUIbjIos49wK6qQ3TepARDkGxNT QaMQmpHXceoePVPL0QKjW4Uy5FGiCB9fXztpaRk1e8SeI3XWsw/DMVh4wFIgsBmc9qRj 9ehDRAy78R7ntFqmCnYzKBZc3ArG3xzBOEL5UFGWa8aOU+HG8N2SM6uQaOOVvjZvLBbI oKuNWJlBBJ3JUtOcRrrMSraboHKIOF9org0zHeunPzGmluCkII8KRzLr/G9QM97wDZ9g cJCOZ3Sa2yu9gP/YGnM4+Wj0iTobAlogwP1Ef0IWuQuUFeP7YqeF09Fz8RR+EdfwBLyv zwwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="a/WUK/uY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q8-20020a056a00084800b0069338b22bfdsi9602058pfk.205.2023.10.10.03.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 03:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="a/WUK/uY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id CF82D80258BE; Tue, 10 Oct 2023 03:36:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbjJJKgr (ORCPT + 99 others); Tue, 10 Oct 2023 06:36:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjJJKgp (ORCPT ); Tue, 10 Oct 2023 06:36:45 -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 BAEEE9E; Tue, 10 Oct 2023 03:36:43 -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=QdI+5V9yIlogu8K/04Iaa4H4soULWRigcAOJTct/Jvg=; b=a/WUK/uYdbRSB/Jd3vZe1hGzLA YtKU5OIsXLVDC3Ezpa6ps2+kLB8luNqYltTTOQK88USWpn2EMs+5KpJ9NagT0DPg3Dki4l5vKGzlI lwWMMsJqsB/sz8/z9FE318NBJH4nyxuTp5kgDmU3TB7d6seNbiX6psiuH8Zekn+TzvQnHsohMO5QU pE95DCWH8SPOm1j6m2Lc5/MDT5AKUoPZwQZhG6Pz9k9N/Vm7H+mMQ0Y6uOoX654bmWr8CDqNl0oCz B4FqC8jcWWEeajWcgE5XN4w5hRe/Yh4O4PFYMpn1dGlojlAUGf2kEBMLIaqFCn6MjgXav05DeTCqm G40cfMOg==; 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 1qqA6G-00GmnI-0G; Tue, 10 Oct 2023 10:36:29 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 35B69300392; Tue, 10 Oct 2023 12:36:29 +0200 (CEST) Date: Tue, 10 Oct 2023 12:36:29 +0200 From: Peter Zijlstra To: Meng Li Cc: "Rafael J . Wysocki" , Huang Rui , 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, Nathan Fontenot , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , Perry Yuan , Xiaojian Du , Viresh Kumar , Borislav Petkov Subject: Re: [PATCH V8 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting. Message-ID: <20231010103629.GI377@noisy.programming.kicks-ass.net> References: <20231009024932.2563622-1-li.meng@amd.com> <20231009024932.2563622-4-li.meng@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009024932.2563622-4-li.meng@amd.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 03:36:56 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 10:49:28AM +0800, Meng Li wrote: > +static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) > +{ > + int ret; > + u32 highest_perf; > + static u32 max_highest_perf = 0, min_highest_perf = U32_MAX; > + > + ret = amd_pstate_get_highest_perf(cpudata->cpu, &highest_perf); > + if (ret) > + return; > + > + cpudata->hw_prefcore = true; > + /* check if CPPC preferred core feature is enabled*/ > + if (highest_perf == AMD_PSTATE_MAX_CPPC_PERF) { > + pr_debug("AMD CPPC preferred core is unsupported!\n"); > + cpudata->hw_prefcore = false; > + return; > + } > + > + if (!amd_pstate_prefcore) > + return; > + > + /* > + * The priorities can be set regardless of whether or not > + * sched_set_itmt_support(true) has been called and it is valid to > + * update them at any time after it has been called. > + */ > + sched_set_itmt_core_prio(highest_perf, cpudata->cpu); You still got the whole u32 vs int thing confused, I've only pointed that out *TWICE* before. Boris, can you pull out the clue hammer please? > + > + if (max_highest_perf <= min_highest_perf) { > + if (highest_perf > max_highest_perf) > + max_highest_perf = highest_perf; > + > + if (highest_perf < min_highest_perf) > + min_highest_perf = highest_perf; > + > + if (max_highest_perf > min_highest_perf) { > + /* > + * This code can be run during CPU online under the > + * CPU hotplug locks, so sched_set_itmt_support() > + * cannot be called from here. Queue up a work item > + * to invoke it. > + */ > + schedule_work(&sched_prefcore_work); > + } > + } > +}