Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp350737pxj; Thu, 27 May 2021 01:29:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNqw3JaQ76U7VRMwpCHKGYY9gBzYtGPGAlUU4/QTApxb/wE3Is7NNobZy5t/C0Q7lSs1Nm X-Received: by 2002:a05:6e02:2192:: with SMTP id j18mr1989315ila.223.1622104175686; Thu, 27 May 2021 01:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622104175; cv=none; d=google.com; s=arc-20160816; b=n0OT0bhlrjgThbToPbZZ8RNoMJoaRm6t8b65a1ssmsjSMKUO4L+KDu19PqUaL/SgOO b1R4nMnHjVzrxm06SbPLqMhkIKIWXAiGtuFiLvv9S2xcFLMytWROOhI2Sur3w1jytI+i dXxzRd7OrSUKc7SmJcxs8w7aiBPZVawDtTTnkmgVn8NydwpCzYpG50r+SHsD0XZoI9oi tn1f0YppTVt2L55xJJgELBDMYpIQbGGrl82KrWqlQVGuycvZJMZgKlP1VzXuM/vkTT/1 2j1aoxYmbWcOAE4IxQTsyzsIDcOTnWIo8uSWGyDHCuB1rOGf/AbGzh8QPxoH0UZ9Yovl x8SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=tCowCEmUwpX1+bMaFwwTJmV0IPrxFe5jcX/7lWIqp8U=; b=RDT5vLCxSkNEwem0CBlKHu/rlm8zoxEQV6sosIOD80DGuER9Obz2HI8kVFGm2dLlj3 0sFku2p5kjXI7s9HNkVICeJQ+WHYlbKX2dXN8v1XIn/0wCcbUpft4/uUozAE5t5h1hGe j9ltkM2Iu2G6z9RMGFuUsev783fIO7bXRxA7DPiao4n/kVzX4gAXIqfjExNqxmFT8/HJ z6yfj5mbdUWQcwpZBfbod+3hTtP/blbYHttV/R7C3Ct3vkp2jaUEhM4q7oqwtLNgGUU3 p0c6T4YoC019yFkSsOLkP7/tPKsVwIzAXEoPYaXiGMnph4wTqT3hjaptfRjrwqShyspc lMTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si1827619ilf.108.2021.05.27.01.29.20; Thu, 27 May 2021 01:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235525AbhE0I1P (ORCPT + 99 others); Thu, 27 May 2021 04:27:15 -0400 Received: from mga12.intel.com ([192.55.52.136]:10062 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235492AbhE0I1E (ORCPT ); Thu, 27 May 2021 04:27:04 -0400 IronPort-SDR: 9didIKyxiIC8vKPI42l31QdHMLQoz+oY+ZeTyBnoEXwTnLCZ4bu2zTlckd1BSgKMKEW/9e0Eps oRygDG0CZoxA== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="182334130" X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="182334130" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 01:25:21 -0700 IronPort-SDR: zUuONXKllXerxgPUigzBX88IHvVlzT1yknWIKwbMimhnP/hw9nUDciABVzg0gTDb6yBz6kRjW2 EcZslD2h0dzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="414800514" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 27 May 2021 01:25:21 -0700 Received: from abityuts-desk1.fi.intel.com (unknown [10.237.68.32]) by linux.intel.com (Postfix) with ESMTP id 7BE4B5808F1; Thu, 27 May 2021 01:25:19 -0700 (PDT) Message-ID: Subject: Re: [PATCH] intel_idle: Adjust the SKX C6 latency and residency if PC6 is disabled From: Artem Bityutskiy To: Chen Yu , linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Zhang Rui Date: Thu, 27 May 2021 11:25:18 +0300 In-Reply-To: <20210527045647.3599-1-yu.c.chen@intel.com> References: <20210527045647.3599-1-yu.c.chen@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-05-27 at 12:56 +0800, Chen Yu wrote: ... snip ... > Exit latency: > The C6 exit latency is measured when woken up from CC6/PC6. In the past, > if PC6 is disabled, CPU would be demoted to CC6/PC3, which is close to > the latency from CC6/PC6 and there is no need to update the C6 exit latency. > However on newer platform there is no CC3/PC3 anymore, then the C6 exit > latency with PC6 disabled should be CC6/PC0. > > Target residency: > With PC6 disabled and C3/PC3 supported, the OS requests C3 if idle > duration is within [CC6, PC6) target_residency. On new CPU generations > with C3/PC3 deprecated, the OS would request C1E. This would cause > low energy-efficiency. In summary, the question is, should we lower > the bar to request C6 when PC6 is disabled? The answer is yes. ... snip ... Hi Yu, Thanks for this patch, it is very actual and helpful. Comments about the commit message below. This patch is specifically about SKX. It also covers CLX and CPX, because they have the same ID. Now, this platforms do not have C3 and PC3. So I would avoid talking about these states in the commit message. Why making a simple thing more complex? Here are all the SKX C-states. 1. Linux-level C-states (linux can ask for): C1, C1E, C6. 2. HW-level C-states (HW supports under the hood): C1, C1E, CC6, PC2, PC6. Here is the story of this patch in my understanding. 1. C6 maps to CC6 and PC6. 2. CC6 is "shallower" than PC6. 3. Linux assumes worst case - PC6. 4. Many datacenters and users disable PC6. 5. We can optimize intel_idle in this case: adjust C6 latency and target residency to match (faster) CC6. That's it. Then may be it is worth mentioning that CC6 vs PC2 difference is not really measurable, so the adjustment is only for PC6. Artem.