Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1711913rdb; Sun, 8 Oct 2023 23:24:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH32GpLRw+AMBzT3I46CIPhCmRtQiVHHGWN3o+xwcrL7IVY3HNTU95O39P9bmIUOMCujGRb X-Received: by 2002:a05:6a20:3d0a:b0:16b:ff2c:c42c with SMTP id y10-20020a056a203d0a00b0016bff2cc42cmr7006403pzi.62.1696832668857; Sun, 08 Oct 2023 23:24:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696832668; cv=pass; d=google.com; s=arc-20160816; b=M2BHNbR9k8pRvVIc7fVQJf8k9NhaNzZ1HUBcIxbP6aeQ2MSMoQ/XBb9Hf2psxkN9Cu erZGR/Zkp6edL7b/0418YDIJXSSvb7gBccmTnfeASyDYb7+kLFZGoaHsWWaaTT2HlWIW FVQoe7KIT/xD3cMsHLtVK43S1rsDaV1nKv48fCjoChK9NLc3POVNrQL89gqNjCJynkjZ 4gnGANcXim036CD/laGLrJSu6V3fXYkEFcX969e54j3J5dIRi5gatPcsGW1/0oQ5vwhL bFn5L4lfIWKQJ/z87Z4xBf7EZ01yk2Qq9McM/7jB07EgIXHkSvEOmJLNL/wZZzk9dm/a 2VNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aT1Er/rn0mAaHdkWHSlqF0IhSqNQdOXq7TNsL9660rw=; fh=+wLHB9sPqAsYAmTLCSdlzcz4rBfyrmm4O4EA1iJ5NDM=; b=iE/jcUREB9HLOvgDns8Fe4SNnJEpZR51VYFNmlGxoL5wh4UkAEBk87yBcFa4G6XHDv oeMPvNo2zjLoZb32sF1AhQo4T2wf3GrhRtZ39sPS0n24pWMI3tfRZUmxgtcLWMOWHB8S gNLLlcuVVZALbJHk/RRNhhUeWFH36pGHepIAMIwY+WXhxilVwU5QPu4kSCl2VC91cfnW QzWArkTxt5ZUUXR/supuzirAYf6ND/LY54Iyoufs73cOVSk9GEIiGg15JwU5Mfr4sVkh lv6kah/SmC/TrUnod4/WPb309F2ei14+j3ibNSRaytSzQzZi78++XucdWrYON5VsCkEU WhaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=0iyNXLmh; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l1-20020a056a00140100b0068a557febfcsi6699977pfu.111.2023.10.08.23.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 23:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=0iyNXLmh; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C9443809C4F6; Sun, 8 Oct 2023 23:24:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345221AbjJIGYN (ORCPT + 99 others); Mon, 9 Oct 2023 02:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345168AbjJIGYL (ORCPT ); Mon, 9 Oct 2023 02:24:11 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2042.outbound.protection.outlook.com [40.107.102.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DE6FA2; Sun, 8 Oct 2023 23:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ImejjI24d1Hth2pXWAarnUCstxomRYBYrN131sB/6DfHoZUvbWz9ndjGhS5hq9sMBI7qRbG0Fm8wRtuNhscJHHQNGmzbh1uwiptsykxAasKlLu+l/JPs0IBBUMc70B9NUsmcudgZhymBTc6w3pnjatKUcYmFXMkeA0MoTiLSjNA5mZq6Y1Yc0k+JTCkResNsTMpbP9oio5ad/3bJ3brzl/BAEDnbW2sfDkuKYl4iBz2vDouBgAXwxdgwc62SsqU2QqucDzrxaIwcUH/r1x3JuN9XIW714rCyS4z7mbg5plzM+ruTHSwUMF4CLuGw16gBJIySh3OsMcXzlM/Tbv7fEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aT1Er/rn0mAaHdkWHSlqF0IhSqNQdOXq7TNsL9660rw=; b=ELJe4Uh05i1JfJSrsa6+KS89rlj5zfObpvxBwmj4EKhLhZpibYeP7P6wZCqbvQxkp1yLoT4RSoc1sowItUqgR21VTQW1rDEAPI/+QirScFtB1FBevH2p7yVjkMkxvFMdrzgUdiaRkVUkv4F1vO+3VE7V4na8zf9bVSMYwYD+S18ZXTdtzYdmXCABou1wjsz/Vh/EsK7jXEpWqzCvXRHryxkf5uv2FX1gG+st6auocqp0TMiCJIksvwPO0Nx8gbEqJBJWVmlozdbyz+by2e6qTwuly34d8sfPl6nH6Ww+oqoYiK/rxKvZplrMZNUmXwO4ZFWrs1podmXspinlh6B/Hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aT1Er/rn0mAaHdkWHSlqF0IhSqNQdOXq7TNsL9660rw=; b=0iyNXLmh+GmTQ/GuArPOneLnSCWsdIuTGKhKOzdspwcWI3909jSAOuuIKh5XKInKvmWE3A2WmhENmoAImNsTBzViii3RBhyScz4T3rq+MBki6G0PM4tmMXdJfJ/i1Y1rT2CD/4jo9VeDAtQxCwmD9Pb9nRHOdvA5iO35tqcwR/s= Received: from DS7PR03CA0145.namprd03.prod.outlook.com (2603:10b6:5:3b4::30) by MW6PR12MB8760.namprd12.prod.outlook.com (2603:10b6:303:23a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.43; Mon, 9 Oct 2023 06:24:07 +0000 Received: from DS1PEPF00017094.namprd03.prod.outlook.com (2603:10b6:5:3b4:cafe::7e) by DS7PR03CA0145.outlook.office365.com (2603:10b6:5:3b4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Mon, 9 Oct 2023 06:24:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017094.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 06:24:06 +0000 Received: from BLR-5CG13462PL.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 9 Oct 2023 01:24:00 -0500 From: Wyes Karny To: Meng Li CC: Wyes Karny , "Rafael J . Wysocki" , Huang Rui , , , , , Shuah Khan , , Nathan Fontenot , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , Perry Yuan , Xiaojian Du , Viresh Kumar , Borislav Petkov Subject: Re: [PATCH V8 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core Date: Mon, 9 Oct 2023 11:53:48 +0530 Message-ID: <20231009062310.5zjzg4avv36o4vvg@BLR-5CG13462PL.amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231009024932.2563622-7-li.meng@amd.com> References: <20231009024932.2563622-1-li.meng@amd.com> <20231009024932.2563622-7-li.meng@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017094:EE_|MW6PR12MB8760:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a7df083-25cb-4c8a-8d19-08dbc8905712 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oy7pof0bm7moXO9vxnHR+xeWKfug2GKBtxfS4Qu6/NOgd2tyaqcpq/OOIV8g1OPgrRYzDz+qMk8rlQ5yoSJJQ+9ZXotXxHim8X2yEpod3gw0uXjMXHGJcLw6aGq/eKYj8C1FyxCg2B3APoWJf91wEWTwhEe+RiIXgjUeTJEESCaJlgcjIi5GPoQeuKxuSVxwuSDqSep8MD47icC+B1P1lRFXvsUmfRETvB/KRUa9C7HLVgGsvgXwi8eGmmRt4s2HzmSAC2lwdKHOQsK3Yi9BBw2/KlsIfFQOUl1AdCBVxQyxS1EXeJlSnYlGUnXMn/g92adXaiTYehsxyVTlZ6gJpJ2QsRm5UzO35MritKBDp41tT9RdJbGbWMGVyCm69dMc5toFgt/RK4mkBqd//NveI1xWUbWhGni01/0hYZCgCG7quiraTwerlSV2A2bHQNvPQNb4/V+vdSPV9vSSUCjlxW8A81Tytv7ceRWHjRcVVDf7lm/cjYXRbcdPILzDnlRDxY+0EJOnmudCv3BdmtpqcDBkDv1tSkm6Qlh+mxCj5xKjmu6aprGrEFevh3q7ux4l4j64UZDPhrvFkfQudE5btGD6R61hAc8LWiw8pX2YbcWhD7E7im+yxTjrXBLlYLfa+ZDpHinXTHtWdGBk3pK+Pec5+QCz0T6xvQhiwdcKd7c/DFOLKo5CjUF/eN8RqRrElCjUXKluSioYNW6kF/FjGvLs9v0OVl4uuCvdm23L9HYaMq35OaTHBtNI0NvaJzcB0+98fD0ysVFGjEG6/dgF4g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(39860400002)(346002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(6666004)(1076003)(40460700003)(40480700001)(55016003)(86362001)(36860700001)(81166007)(356005)(82740400003)(26005)(16526019)(47076005)(426003)(336012)(83380400001)(2906002)(7696005)(478600001)(8676002)(6862004)(4326008)(8936002)(70586007)(41300700001)(6636002)(316002)(70206006)(5660300002)(44832011)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 06:24:06.3955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7df083-25cb-4c8a-8d19-08dbc8905712 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017094.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8760 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,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 pete.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 (pete.vger.email [0.0.0.0]); Sun, 08 Oct 2023 23:24:26 -0700 (PDT) X-Spam-Level: ** On 09 Oct 10:49, Meng Li wrote: > Introduce amd-pstate preferred core. > > check preferred core state set by the kernel parameter: > $ cat /sys/devices/system/cpu/amd-pstate/prefcore > > Reviewed-by: Mario Limonciello > Reviewed-by: Huang Rui Reviewed-by: Wyes Karny > Signed-off-by: Meng Li > --- > Documentation/admin-guide/pm/amd-pstate.rst | 59 ++++++++++++++++++++- > 1 file changed, 57 insertions(+), 2 deletions(-) > > diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst > index 1cf40f69278c..0b832ff529db 100644 > --- a/Documentation/admin-guide/pm/amd-pstate.rst > +++ b/Documentation/admin-guide/pm/amd-pstate.rst > @@ -300,8 +300,8 @@ platforms. The AMD P-States mechanism is the more performance and energy > efficiency frequency management method on AMD processors. > > > -AMD Pstate Driver Operation Modes > -================================= > +``amd-pstate`` Driver Operation Modes > +====================================== > > ``amd_pstate`` CPPC has 3 operation modes: autonomous (active) mode, > non-autonomous (passive) mode and guided autonomous (guided) mode. > @@ -353,6 +353,48 @@ is activated. In this mode, driver requests minimum and maximum performance > level and the platform autonomously selects a performance level in this range > and appropriate to the current workload. > > +``amd-pstate`` Preferred Core > +================================= > + > +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. > + > +``amd-pstate`` preferred core enables the scheduler to prefer scheduling on > +cores that can achieve a higher frequency with lower voltage. The preferred > +core rankings can dynamically change based on the workload, platform conditions, > +thermals and ageing. > + > +The priority metric will be initialized by the ``amd-pstate`` driver. The ``amd-pstate`` > +driver will also determine whether or not ``amd-pstate`` preferred core is > +supported by the platform. > + > +``amd-pstate`` driver will provide an initial core ordering when the system boots. > +The platform uses the CPPC interfaces 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 and set the cpu's priority. > + > +``amd-pstate`` Preferred Core Switch > +================================= > +Kernel Parameters > +----------------- > + > +``amd-pstate`` peferred core`` has two states: enable and disable. > +Enable/disable states can be chosen by different kernel parameters. > +Default enable ``amd-pstate`` preferred core. > + > +``amd_prefcore=disable`` > + > +For systems that support ``amd-pstate`` preferred core, the core rankings will > +always be advertised by the platform. But OS can choose to ignore that via the > +kernel parameter ``amd_prefcore=disable``. > + > User Space Interface in ``sysfs`` - General > =========================================== > > @@ -385,6 +427,19 @@ control its functionality at the system level. They are located in the > to the operation mode represented by that string - or to be > unregistered in the "disable" case. > > +``prefcore`` > + Preferred core state of the driver: "enabled" or "disabled". > + > + "enabled" > + Enable the ``amd-pstate`` preferred core. > + > + "disabled" > + Disable the ``amd-pstate`` preferred core > + > + > + This attribute is read-only to check the state of preferred core set > + by the kernel parameter. > + > ``cpupower`` tool support for ``amd-pstate`` > =============================================== > > -- > 2.34.1 >