Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp351473rdb; Thu, 30 Nov 2023 06:35:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVeeKqV6cQ8502wTGZiy6h8oJDLpgJcHWjlx1xIeqZsOvGfcYP3y/0+043ItBex1RudXu7 X-Received: by 2002:a17:902:d4cb:b0:1c4:4462:f1bd with SMTP id o11-20020a170902d4cb00b001c44462f1bdmr23091633plg.35.1701354949909; Thu, 30 Nov 2023 06:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701354949; cv=none; d=google.com; s=arc-20160816; b=Pm51nFPJu1r/TXTQqAJK0y6L/QGWrIKyWpA6N1syy11nyBLWk+7NfZ4jv+4KgqgJqG pVekJSK1kbjOtiVmxUZpj6Z/O0IW58VK4oa+MneIifoZkm7Oi8Wp6ZWzyXduPvTnn0cA 8tF4GnvjGGC/VCgdV+yONXTQSCrgpCcp07bpmvtsmQS4DNwL9ReHyXWba+I2eiTwCYRQ VvxBqRLI01JJJuCm5ZP/DyQGc44opgAAH1cgLI3tcRdh5CP+dmHzO5cpBU212q5ElWai CgKps56foBhLto363+mxkqFMIg4DKXi6vdYwgLXjKbw65O0o+35hwNGnItuTq/xJ6H4R YSAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:mime-version:date :message-id:dkim-signature; bh=t/Bp7ZCE4LoczhLnxXNT+HgjRVKsaP8cit12SuScveU=; fh=Zuijv8SeP6VubZlt2pjQf8xX++7a7H4AEKD8Nr4gAkg=; b=U/edVq9MbSpG5HLCZ16DgKtmCWyhJbOkFAADAkruJhxjtnRRtlxI5kPSjyWK1GhusQ RDVFXFeUQejVfToBIol2YbDMnv4Cz+cT946lE5HVI/2um4RgpGGnvMFoGEURzxCRm3c0 MdDq2ByWx381/bdpawV72MdlcWrAUInT48zR/9BV4q2OA9eAlDIhE2vUf5e0R9R1yUhc pOhgj8D0371iyQ5C0889zR0vzDCmy0NRuLJjDZHG9NS3/g9nwBPdPlA2ka4ShUXc4Wwl kiCR1ibKLXIfYSZzR0kMcoEg7CBKhiSTrwZ0oZtVf5XU3UuwfhMtPXyP8tZPKmq3eUkJ Plig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=IwgDhQC3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j7-20020a170903024700b001cfaa9ba6basi1318822plh.240.2023.11.30.06.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 06:35:49 -0800 (PST) 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=@mailbox.org header.s=mail20150812 header.b=IwgDhQC3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3F7AC803100E; Thu, 30 Nov 2023 06:35:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346013AbjK3Ofc (ORCPT + 99 others); Thu, 30 Nov 2023 09:35:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbjK3Ofa (ORCPT ); Thu, 30 Nov 2023 09:35:30 -0500 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFB9B1B4; Thu, 30 Nov 2023 06:35:36 -0800 (PST) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4SgzJ34hSZz9shK; Thu, 30 Nov 2023 15:35:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1701354931; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/Bp7ZCE4LoczhLnxXNT+HgjRVKsaP8cit12SuScveU=; b=IwgDhQC3pNSAI+5O9d6vw5OMFBCN8vCCPBS3/BjLjdRO2wi+NECUrHc9PJUrPxL0ew/SVM 8BVdgvtDDCQnDaJmzua+/obBej3X6+PObowN6U0z/hwU50bkkCaBfKYcF3kR9RpeVAsjuZ 5LkjXeOJT12xXgArkViPQgeKlmKDL7FWtgQSp+i/pJ7VfmA1D5LYJ8mdO7Y6A9R9XFxlLi 3CEjthucfRGoWOJy5xOMMeK1ncNIX/cwu9kFFSY4l3eAGBZpdo+olpbN/3ccqmWoNGxzgU HmM755zOvyj0qBK9xIisA85TmRipAvoOAtXeB4AbmUs1Z76nBPr25LxrP70Qtg== Message-ID: <09ea3d40-e8f6-4cba-a576-ffeda8c02734@mailbox.org> Date: Thu, 30 Nov 2023 15:35:20 +0100 MIME-Version: 1.0 Subject: Re: [PATCH V11 0/7] amd-pstate preferred core To: Meng Li , "Rafael J . Wysocki" , Huang Rui Cc: 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 , Oleksandr Natalenko References: <20231129065437.290183-1-li.meng@amd.com> Content-Language: en-US From: Tor Vic In-Reply-To: <20231129065437.290183-1-li.meng@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MBO-RS-ID: d85b6956544caf01d74 X-MBO-RS-META: x9mtin3t79h93gzyxr6bfmadcnbujkqq X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 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]); Thu, 30 Nov 2023 06:35:47 -0800 (PST) On 11/29/23 07:54, Meng Li wrote: > Hi all: > > The core frequency is subjected to the process variation in semiconductors. > Not all cores are able to reach the maximum frequency respecting the > infrastructure limits. Consequently, AMD has redefined the concept of > maximum frequency of a part. This means that a fraction of cores can reach > maximum frequency. To find the best process scheduling policy for a given > scenario, OS needs to know the core ordering informed by the platform through > highest performance capability register of the CPPC interface. > > Earlier implementations of amd-pstate preferred core only support a static > core ranking and targeted performance. Now it has the ability to dynamically > change the preferred core based on the workload and platform conditions and > accounting for thermals and aging. > > Amd-pstate driver utilizes the functions and data structures provided by > the ITMT architecture to enable the scheduler to favor scheduling on cores > which can be get a higher frequency with lower voltage. > We call it amd-pstate preferred core. > > Here sched_set_itmt_core_prio() is called to set priorities and > sched_set_itmt_support() is called to enable ITMT feature. > Amd-pstate driver uses the highest performance value to indicate > the priority of CPU. The higher value has a higher priority. > > Amd-pstate driver will provide an initial core ordering at boot time. > It relies on the CPPC interface to communicate the core ranking to the > operating system and scheduler to make sure that OS is choosing the cores > with highest performance firstly for scheduling the process. When amd-pstate > driver receives a message with the highest performance change, it will > update the core ranking. > > Changes from V10->V11: > - cpufreq: amd-pstate: > - - according Perry's commnts, I replace the string with str_enabled_disable(). > Hi, Using clang-17, I get the following warning: ---- drivers/cpufreq/amd-pstate.c:793:34: warning: variable 'cpudata' is uninitialized when used here [-Wuninitialized] 793 | if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore)) | ^~~~~~~ drivers/cpufreq/amd-pstate.c:789:29: note: initialize the variable 'cpudata' to silence this warning 789 | struct amd_cpudata *cpudata; | ^ | = NULL 1 warning generated. ---- Cheers, Tor