From patchwork Tue Apr 30 18:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649874 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B9BE199E97; Tue, 30 Apr 2024 18:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502312; cv=fail; b=j7FrIzwYG1wHGqvZOQMNtB/D07+VoAi8LMLMEF1YH0ZHIsTbovRlwKhGl+RQNjmz96j1R9iU/S+AgCgWumRIxauRMaS7LAMcxe/fCkKgfskPob8e8s1Cy8zVg6raWYRaQtE8qpw6i8BWlw7mWz/u/2oKGB/uGD1MBtu738bjsxE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502312; c=relaxed/simple; bh=TFxGFHQCBMaqvdP9/VY6E1q5d7d9ZRCVgrmsIATtYEY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NThpJrzuacgYLmfOme1wL/E4Qe7B7c0pInzGrqnO+4BTvkh0CMbG+Wus/5atNQ2gSM/0VFD9WO7FSEVJtW/3+cdpdUBj0IRxCBOSoMfnM6gGzwpqgZmTXZbR5qeUX8xPhyMjj76LLTEvp5ypePgrPr/CfNRR8cZW9nfHYCIIDqY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=BNM6y3T+; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=lS5CCDTQ; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="BNM6y3T+"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="lS5CCDTQ" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIkon026936; Tue, 30 Apr 2024 18:37:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=HdAczQ+ZjtCAM9TckgmMgIcWtHoJTvXFQ4LSTfKD6q0=; b=BNM6y3T+AlRAgWd+pfWrKMPmknMO3BFXvosPw+JRbM6n0jxXd03xnD4LwowwK9obM8+2 62WgI9eVGieFDPOQnVsyTDjB5k29LoOuY/OUcK4GUJhHo1TgHh0aNXKT9t0srVdcru97 ZcA2yhgNd86wc4bxYKrVe246J/M+IMHFsBtRbqfJukZKjqKo2Gc+Gqe7cJsN7uEX7C/4 SUgv5LcIXJpWpPN6TDk2dYEOBYxuGM5/kKovhZO90APm28PqYg7nvwZWSRtdlKyu/nYN 94TPUQBf1AQQxMP1qrdiNN/D4fABOA5UgiIxW8HvXTo19N1nYrirQXBHkGH/+w7/zqr4 iA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr54dujt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:38 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHdbKf033207; Tue, 30 Apr 2024 18:37:37 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt84r38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XMFkFYH6QT7duh4W3AgwOAJYUX3bNoi3MJ9MZfUn96R600nVBbf63bUVtDwSIrLbUIjV5ELEFRtZMQp5EMGoTQokgaVLhVkMMLjm+PZBw6JfBr4OjzKMurKcsbFOjtVdlWcyUKDBRKxd+6ry3sfrWlGwnQOSfJXtmYijvorm+QeS1/cQjYKJBBch1Bqprcc59AVZ3FWJGf90+sAr3kYHRAlC4ZW7KNVR1fiLD/5Pn5TzfIdX6VU6zdj5H0TgHD39K7FMIwW+QxHiqlojbxuLcGe2RDrHxSc1yI6WvxUbuMY1G2rn10XmAAaaBy7vXQzEYwRMDyGf9ixlekwuPAvtKw== 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=HdAczQ+ZjtCAM9TckgmMgIcWtHoJTvXFQ4LSTfKD6q0=; b=ejUeJhM0S3TAj1JF+WLmAceyHwq1YRNaM7mn4NDJssu5riByl8rOpTODnZZ2DsXuW8+Xj5rc9FuSISw1DJPFwGBZWb3wiIxm7wG0kcUDrjBNHjaWDMxRSHy/theJuzln6b2vdPMorhohzoCWQvRPOqyIM1dhjVvEkQHE6xPwgd58W3T2m1vfBXHORaE+p0/W4or+fDFfxiTpN08UQ9VentKvtk9056X53GUWPIxZWfs6shcPh8Sa3f/3dfKUW/Fpj3xct+sGT/qE3IQCUzs7UYpnpLRXQ+62OnNFFQkr9AcAsdwFhMvEAm+gcdAYH9xeSHKIr3zbBxjVLWxmWUNCrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HdAczQ+ZjtCAM9TckgmMgIcWtHoJTvXFQ4LSTfKD6q0=; b=lS5CCDTQQwMHOf4zd+MYuGNWcGR/1MTKqoAescrgX1vjDT4zBm8jtaI78sqKIH0Mm7DvnW3cR9qzsv94Y+nUQkqhMSUzRE9Fwl7M08cPz6g293VZahFGNmZyoKhPyIXDmw5HJXlcph6gTk7B0ad5adVH4OvfIVWWGIc5iZwqtfo= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by DS0PR10MB6152.namprd10.prod.outlook.com (2603:10b6:8:c4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.25; Tue, 30 Apr 2024 18:37:34 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:34 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 1/9] cpuidle: rename ARCH_HAS_CPU_RELAX to ARCH_HAS_OPTIMIZED_POLL Date: Tue, 30 Apr 2024 11:37:22 -0700 Message-Id: <20240430183730.561960-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0136.namprd04.prod.outlook.com (2603:10b6:303:84::21) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|DS0PR10MB6152:EE_ X-MS-Office365-Filtering-Correlation-Id: 8137e8b5-a426-4cf5-d90e-08dc69449a3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: 6CrgJ3VHAu2/anMk6DlpLrzTADspspjxExO6dt/WFBhTqcCfi/qoPevSiszM5oIDGOaGo4VSV5f/TSCNK00gH6Ml2BxMeoqqgSVMOeHpeAW5cpQ0U8IzdgSK6EBt6bXv3PQphOPdrIKzKwQ0/Kq2Annb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jQv5qdsfRjSc4wOJg2bmETNu/iF/xVIkkYbrH/EUiHnEFOByq5SYIVGdtQIdbvihO+J3sNFHioHMKT2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SiHcbhCbjWP9MRHGuPU9tJZbGcpysBZ5gMyq49Nir37xBlMXCvtvICqnM2VqdxK5tsR2TqhZVQHyHs0fRZGOFnd9IT35fpzC40NiFOWbDbE/0SMqJmgEioy0BjhL8keiWPNreNSeLB9mVXYbyg9yy26vxKbo/Werkd8uX892PseHGzqgFn79qjL4lLMUfbgk6FCF/IRp3cQs+95/kzMSCpLhCRsLSj1CFSwLLUPihWyTjH7JYE25t+XQbVehl9IipQ2Pr0VlKXK4zVATO0TnRtUakXpvyZlgGg0zWFS6O9tBYILLJ2t2qwbdnfBmD9vasNHPYQ6BdAZB7/3esVMP5xYM4mCqC/w+cS397C9wY6V/tdule+kSGypx04il+aFl06sxPM6baMP/FoMxQBye2R3krOWlvmGcGxYEvjxkSTukZUyN90azcXKXZpQgywar6yujQYsjfUOBua9GEarLDvH383VNYMsJOAf5aEyWxAvy1LjlAIUcTJjekTnrFm+KH+WfUConkkFtWc0qrmgm+On+UJoXKpg164SQ1kdU2SM7TE0EaYfmZAX4Cazlf+b7nEnlJI2iJBFjx2fYbJvgsIPT7Qxuhh//uiXt56+y/PYWS0K3dH+ZEWL3884ZTGDmY37S7ybBhQAMASWaxGRIC6eAvVKecZpLELPEh7oisUcrx6zhF5oJtus7qP3WeZCuC+Xhg3kdvcNcr026WdamJVUvjq830J99Lgw57XkB3j7TYQsT6DnnoD8fZqOrsmEjSRkWzgDl6R3440VCCosVHJWAMUvyeLjKz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N+dNJxonec0DcOU+1wuQdTRkPPLQDlNBbwuulv24DNKrQefsDqN0xQMew1drpSCjNSc4xyu4V0jdc2JbW2hCYtYYiEfQy11BDpJfvo761fzOpmfPkGrHQBvjCIYFBdL8p1pKeNYIAAfNybKlOazpkmbMy9KOWVWV+Bn+AFOsu1vZBnh7sCv35E9cI73K0wy5G6y/Us4HqvO1Lc9ndQ6eXIAGMf7wmZbzZGNnF58MN8N4qYaYHrPXyIuTXGJRj8RT165tUI2AuqncACV0fj9KrKtoO0b7oavAhE4qMJVu9XPh7ci4Jky88G1Q49ug5/4PnVJx/Uy0lHsATofI/b46hsBEi+hFoLO3zDUKjEiKCN1Wm05qM8cgEIMoJTsYs9qS0jSxoHSOspuxPflyFkEQEeT4MWSiWSX67jvqTo1SiJFnFrJtpUlj4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8137e8b5-a426-4cf5-d90e-08dc69449a3d X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:34.7425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ADpbbicc2JBLdomVubigKLYIPMQKwbHHeTu1k+OuJCsEtFwBJLLaWYWqXcL8UNaGPLm49uq1pPc2u+bnggkdSxsXjze+ECf4r4Uj2DzkFGo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6152 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-ORIG-GUID: LhFNlWfvRqGAFUQPWhshBlxXW3zQ8tCE X-Proofpoint-GUID: LhFNlWfvRqGAFUQPWhshBlxXW3zQ8tCE ARCH_HAS_CPU_RELAX is a bit of a misnomer since all architectures define cpu_relax(). Not all, however, have a performant version, with some only implementing it as a compiler barrier. In contexts that this config option is used, it is expected to provide an architectural primitive that can be used as part of a polling mechanism -- one that would be cheaper than spinning in a tight loop. Advertise the availability of such a primitive by renaming to ARCH_HAS_OPTIMIZED_POLL. And, while at it, explicitly condition cpuidle-haltpoll and intel-idle, both of which depend on a polling state, on it. Suggested-by: Will Deacon Signed-off-by: Ankur Arora --- arch/x86/Kconfig | 2 +- drivers/acpi/processor_idle.c | 4 ++-- drivers/cpuidle/Kconfig | 2 +- drivers/cpuidle/Makefile | 2 +- drivers/idle/Kconfig | 1 + include/linux/cpuidle.h | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4474bf32d0a4..b238c874875a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -368,7 +368,7 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_HAS_CPU_RELAX +config ARCH_HAS_OPTIMIZED_POLL def_bool y config ARCH_HIBERNATION_POSSIBLE diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index bd6a7857ce05..ccef38410950 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -36,7 +36,7 @@ #include #endif -#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) +#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL) ? 1 : 0) static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0400); @@ -787,7 +787,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) if (max_cstate == 0) max_cstate = 1; - if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { + if (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL)) { cpuidle_poll_state_init(drv); count = 1; } else { diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index cac5997dca50..75f6e176bbc8 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -73,7 +73,7 @@ endmenu config HALTPOLL_CPUIDLE tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST + depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index d103342b7cfc..f29dfd1525b0 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -7,7 +7,7 @@ obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o obj-$(CONFIG_DT_IDLE_STATES) += dt_idle_states.o obj-$(CONFIG_DT_IDLE_GENPD) += dt_idle_genpd.o -obj-$(CONFIG_ARCH_HAS_CPU_RELAX) += poll_state.o +obj-$(CONFIG_ARCH_HAS_OPTIMIZED_POLL) += poll_state.o obj-$(CONFIG_HALTPOLL_CPUIDLE) += cpuidle-haltpoll.o ################################################################################## diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index 6707d2539fc4..6f9b1d48fede 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -4,6 +4,7 @@ config INTEL_IDLE depends on CPU_IDLE depends on X86 depends on CPU_SUP_INTEL + depends on ARCH_HAS_OPTIMIZED_POLL help Enable intel_idle, a cpuidle driver that includes knowledge of native Intel hardware idle features. The acpi_idle driver diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 3183aeb7f5b4..7e7e58a17b07 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -275,7 +275,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, } #endif -#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX) +#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_OPTIMIZED_POLL) void cpuidle_poll_state_init(struct cpuidle_driver *drv); #else static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} From patchwork Tue Apr 30 18:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649866 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A3A317BB1E; Tue, 30 Apr 2024 18:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502308; cv=fail; b=eorCZI8f6X4r/eQ3LrbwV9ziKYpKBnI8wembQWpTx4dhReAHdlXRUngYEl72GMmtsyMPc2RWdPRGIhBF3Bc2x38EWdcqWyM/97QRslJD960eq54uww+kZUSr86XOUtATFI/A3BvKS6bQeMLUE+MHJSlxPRUgfj0Fq27wnGZUu/E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502308; c=relaxed/simple; bh=RB25v8iDSmKsZ4TrmsbTOiWNYMVuW+7I0GPPGgOpr3w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=g8AqqXzr+AeupSXjUtT1iIWMSTgla0yM0mf+HZTnkMEShm6TMJEAUUOwmTUhsVh2LtOYus1iExF1fqr+LQC7FUUARJH/1xI7WaqEUR4DS7dQYoVe8Sc7wSSuxcCqPvd/mc1qvZn+aSCnCAEF5Fb9u9w4zC1FY1/cJjnlNgwG2yc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=PBZj239P; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=dspAs57H; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="PBZj239P"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="dspAs57H" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIgfI015489; Tue, 30 Apr 2024 18:37:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=3KL0ovtz5J1V9K6QyEbhTNrrab1knK22ZJGGfS7NQtI=; b=PBZj239Ph2o5iNs3hmzxTgjKRY9d4TodkyCHRRjmrZrSbtYg3JtiVSXpYLazrKWGs/YR BscfiOj51bBteY+yljhuygX5l6gsgY56Jgj8ryewHyZVCf3PLq+kBgoBxRTehRuVVhI+ 5ApIHARvOft67nUtx1IuOMmk66bxLfajME+3LrwoPdcpAOYfmzezqpVZSlnGyonhzf0W 17M8vkAufFF84LGmi3Ceo8fcuNMIQNJZFBP0U4Fo9m/3BMyT9tgt0A4z6sGr9NevRzHc WXUmTffV1mzVOTckjfRCF5Jnih5KNYIgO2AaeQQlmT3k43Tv7RBdyFUOqhSLl9hLY73o +Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr9cnxfp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:40 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UI09Gw011468; Tue, 30 Apr 2024 18:37:39 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt8ceyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQ0gIxWvbcctVC6z8qZGggnN/+b7LPuRarGTUk56qh1627+eEHVErVU7+a9Yty28aH9r4+EvfLxds9kBCnbSZFnG0YyVMfDdvDBOSwKaJ+zAaebX9YtlTtbNTXBBq4Oxyl6zhtEviy+axIGGTRBcrmRDdOvq2RwEtLadypFv5Xl7xoXVaB0DUGNS9L7zJ3Rp5Cyceif44G5T517BkAy4v+WoK6N/QQkRG17YXGJ8jIxsOricblajDpydf5U9v7kow6PQhaqVcVn60IO0WImv1RSeL0p9Hm5gWLgeu9SxvuIlIAIlOklFMPYJGvs3Yc0vmQxMmYj8XsGekW5An9S4pg== 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=3KL0ovtz5J1V9K6QyEbhTNrrab1knK22ZJGGfS7NQtI=; b=e6Q7Zd3zQqdDSGPp0QK3g5GYbjRhvDyqthlpnTMN9Ba3/q8TSTVIjErdqWDX1cxqiygUS2A06nUvzCdo3GGmbvgs0zhcEXjkc9CIkdp/5vP4c1I9GSn/PUSLtrFp15m2R0nbn82vPTOTt1TrijNZ8fT8dnOwArQOQ66UZ8o4PcNaJKbhk7U2z26hGJweQiEcnDJdSJ5XazTkUfwGj0S4s5vMemXpRfLrM6hL79jK+KhgQfw/ex3Pt/x3bEc4dXSx3f15BrAwAq3wfzzA8/0ujzBgNrJ7kWfJUz7SBZxTSTVZTu1xlHW3MsHTFAtWUZAixUNyjlZe05Nr3AqdmduK8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3KL0ovtz5J1V9K6QyEbhTNrrab1knK22ZJGGfS7NQtI=; b=dspAs57Hi/JznBOVJR5sN5f3qJeAZpgKxA2tg4N9uIX+SGXdHuVNnLGv2do3KEa2qUA1ljCSMjo88+1JW3M7Q7/TlWoEd43H5YhQwl9c2Y3fk5EpWgcFWvioPYrFyLQk1oCCtg0KqMHk1bj5oF1l+Ca/K3A4D5SwNMbW4WXSm7g= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ0PR10MB4733.namprd10.prod.outlook.com (2603:10b6:a03:2ae::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 18:37:36 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:36 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 2/9] Kconfig: move ARCH_HAS_OPTIMIZED_POLL to arch/Kconfig Date: Tue, 30 Apr 2024 11:37:23 -0700 Message-Id: <20240430183730.561960-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0138.namprd04.prod.outlook.com (2603:10b6:303:84::23) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SJ0PR10MB4733:EE_ X-MS-Office365-Filtering-Correlation-Id: 92e1e601-464b-48f2-c745-08dc69449b4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005|366007; X-Microsoft-Antispam-Message-Info: 4goZLogfzvalpY1oxe+U4aHf6IS4GCUl/lO33HWLsLkVxqI9cErwi5I0FNyui9ZAKz/dOoHZoq3J5ASMxa2LbRIO6qelB4Efw7pWEyDiNtqc81zOgVfmfEuCpx+fH+JeW33jqO0BjtcX2JXwgDeArZyi3ePtZtvqFe3C0s4cS+RajTQpRxX+i7LJsIaGXPKdvtIZS5HtkqY9GbiCDcZTeo4UqDdAnEABxzNwVpjzz50nvaQb1JWYsPgzOF4Rh4ciKWxiOixeQ+t5B9Qrv4x5CmLkjUp4TxPouUwEbw1jc+vBTjusicuPFt8+OJMB5Te/eXSNoKnLaLWm/WZqA4PcAnHNyt0v33RyWjmmHMtKPbsWGiqT08AEYlm5vfqt69BZ9CzNYEkKKh9wSvaPdGlMv9ipI+R8A/GXRly3vRWTbBrBI0P1zCPHSYBIgxzQMj8SR7jRLsLQNNhRv95rln8It2BjF6HaZgiNLybzOVH1MkqgxCMbeV5Bk5X1hCeX2AAH6AFscvDz4HE/utKXNkmosZ+ZszZJBcMTF6thRZNvYdWuh2/fJnPyqXJaJDCQwg4XuVnuoYsea29oeNBljDjsHjh4ofjLrs2R69Sd8c0lQoZckcnqnk7UczYZD0bBQWuxQjMql2kuiRa5wsaHg3Go1/zcFQWjJBx0amdMVd/eNYb4iwjTMNS+2savHkJx9oHriwUhCnzTaqGXeA8X+7Y9HebCjNp/SiwIhosq7Jbvls9VY60YH6lzIQpOSGjMUymXf4fIy6dbMu1b9HWLLRXFxcczONdgbSYXOffTAp5sGECgcqMjZ4cuvCYbCzFHdknuukWZ+76hKMhbMYMa9sl5+tcGTFYtYUteJRg/wVy55+OLdwQ8A7eBQ32dpKAv3W/S3VVpMhCeGr+EKLxlTGKvfq5siCtt9jZXMur4mcAAdxmbXYk+6zis+2MoFsySNq4pR9J6DQUCe1cASUVyIWLQBx2myuGyG5AwBRo3vvevxWpo7oNlGTu5cutibV3FmhsCEtVzgwAUrngtsvA/XxmwAwa8mXzJ8ghQNp2ejY1/BeBosPaR4xFdZjAlTK2ffC+D8+DztYv/zsok3xRVuPB3ocN8TV33kUIHrd+EukRSytErPS/+GDGHyVfq3X8gC0yD8i7PUvojSowlKUq5vJHC1t0iUEp6AcEOmMY/DjokeoZ1Fyg6Rr3yXgh40ser0WgyRbMYUMlp86NRFtFd5HobBSsutpTHuW1Liv4lkHcH0xBv57mASfDk7dg6xj+BsbLGof2/C17sHTIU4ie6WZIHOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O9pnGEr8HXfxjz0gvQxxit++cjaE7lkt2ZkROYRgyZzSfwjmXzpvmBw+xG3MLpj/Sx9jZIjTuh/yHDvA8Bz0yBbFKhLSFms2qbJWl8/JZQcAtVjutPmwt2ORiHIeuj4lhVHrL5TIAs/UzmwgdJYOdrLUAr/BYAn1rY1FDQzomD1MlXQFQAyFFDqLXfs4KodCKLHUgjqcvldNfQeKjxSNOIscYiOd/c4vnjC3zMjUMVEGNlgfuELG4u37iQz+u/YfwuUXTuYGRdzX3LdosgPRiwy+ka+Nt/peDQ4R52k+wLgBPqPa2j1UMrVt7eQeZVGMm2kYsr+Gxi0jzZTs1gfVs57UR+Qc6Twrq7EAFadztfzh+zv+sJ1FopysbYyB5RYe1fEuCXQVIOaL1v5FdhXUsLHcrOXXxSlxEjGj+MRWLoiiimw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4ydl70A94iGDhge46cgFf0ZCh2tacXWNUCacGsTQKRaAKzvlp8/qv6etvbbqAfZBeoUNHikcT1em4+o2g44fTSUaJUhbAtg2Y61Sy8fuXkgXBw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 0hUNArs6M1ZBNXc41G+yuAfaalAcnQMnwvUY8+wmhA9r3veex1sKWjiRJB5EHbpN7UOAO+YDznAh9kbLnejCWt2BUqTJ76DPZEsdikMbv9Vps8ZbIM3rQ7cHl5reiIzx1QNll7xwv/yKIJS9S5Jm42pBX0Y+boi68Ap+B0Qw8G+E6/mA/gbZTuHhCUZ6a0tKvsMY7k0jitDe3hBPxuwYWg11jrC2LlDOlqHIq7IufKf2E/1ZnKoNiBVt299pZQzvbpn+djPKSNtSojO7Y2QcZFA8ZbxYzX5DokQSW6MXG7XSs8D6FulUFcZSY2GbJ4mQKu60uIRhAJJcnuga7PV6hWjN7CtoFUQPHmjXIx0Te/GKTAbSatwLjnIu+HPFhh5RqahgJWJQhMB9qqy5g02KZrQUyuQnZFKO/T6o7HhRc4ittD8AtR7+OJinqfr4pngEZSZ0huoxP0BHwJb4sbdiW6YhMtIRCg4FwWX+3kbgpoWsMyP4js9xU8bk6bN6UEkmyOVGwZScBFQmMNnWTUdhE6P5wiyP8rGJ7FFHpA285awrA+71rhJZpOW7jBxyD1pIIZondxEHA+olkIm6yXseS9k68qFyYNT+Ys5rpe788hg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92e1e601-464b-48f2-c745-08dc69449b4f X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:36.5817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: re5leCCu+TRX+XgLBul1aqdzpuUd0U5HKUc0HlGZ7qGZRecqvPBmqlBvdFCgQvRCo9XhGqY+SP7s6a19ah8E+TMubzaRji/uLYGflSZ5tjc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4733 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-GUID: CLA18znf-xxv9ApHPjPuEpq6z09K-fkY X-Proofpoint-ORIG-GUID: CLA18znf-xxv9ApHPjPuEpq6z09K-fkY From: Joao Martins ARCH_HAS_OPTIMIZED_POLL gates selection of polling while idle in poll_idle(). Move the configuration option to arch/Kconfig to allow non-x86 architectures to select it. Note that ARCH_HAS_OPTIMIZED_POLL should probably be exclusive with GENERIC_IDLE_POLL_SETUP (which controls the generic polling logic in cpu_idle_poll()). However, that would remove boot options (hlt=, nohlt=). So, leave it untouched for now. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 65afb1de48b3..6d918c19a099 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -256,6 +256,9 @@ config HAVE_ARCH_TRACEHOOK config HAVE_DMA_CONTIGUOUS bool +config ARCH_HAS_OPTIMIZED_POLL + bool + config GENERIC_SMP_IDLE_THREAD bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b238c874875a..670ec5d5d923 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -131,6 +131,7 @@ config X86 select ARCH_WANTS_NO_INSTR select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP if X86_64 select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP if X86_64 @@ -368,9 +369,6 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_HAS_OPTIMIZED_POLL - def_bool y - config ARCH_HIBERNATION_POSSIBLE def_bool y From patchwork Tue Apr 30 18:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649872 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E77D194C79; Tue, 30 Apr 2024 18:38:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502311; cv=fail; b=m91NVfwWhQNmrl/9uRC1zyGwcBQBbb0j89vGF+naCBuY96sDfhmoPGbUVNf4/UhFW71BLh/bSdTFUhQmccZlmbYELDHnAwI+ZxWM2tyUc6FXTQesZG15BJWfbQ4E/6bg52oECsg+oLdQHpb9Q0UvLaFdR6WnOyYLuQ8AywYajJQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502311; c=relaxed/simple; bh=1tSPop/Aa40C5eMqd405zd9D5szO6qZPEGJ47AVD5Xc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UXWnZ/Nbe6DLt+N6NuLPlO3iowjWdEdmqxtmezfXpPe45SB1V5hKEkaHDOW8S6kSKXtgu91c9C//f9jy6Mc233sFJypSMkTaT4iT/ge+KqwH4NSuXrtna8puOJ7vFPl9SzkNZpSGqWHoU08a/5lh6YZeq0RDibzTWFVD+c8dcPU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=AVxZ2szj; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=bDSJZHAM; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="AVxZ2szj"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="bDSJZHAM" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIhsY012703; Tue, 30 Apr 2024 18:37:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=PFKGe3msmS9uypHg1D4NVF1g24szXb61m885m1UIas4=; b=AVxZ2szjlL4LiGM78wePEozoPWZt4kIMIDJll7DaCvteGKIGtoDb4t311UY3qExXdUhd +nxeCyK0Vy2yWI2CINFlSqedPTs/P5aA6V54s5ZkT+PK+rIvNCmIrZ2s0lIFlFfoetSy u4Xg3mj08RzUsP2g09P4b9qbYdIP1rXnosGlW1uhCYkOVlQXioZBN/WObI+hJl6JBDb5 ckPPBDhBvrosXSpxlmNI0jbS8B92/vpxPcPRYsiVk+uW6fas7inyLCW9MzqqpPaoZPFj PrqISrW2W1NI0khjqVg1nSdRQGQ4r911K+ct32bqSkZxXY7XoC2EZepBxJqdPLp9LykS pw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrqy2wxcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:47 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UH3kuB016678; Tue, 30 Apr 2024 18:37:46 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqteckhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JSSj4E38oe60WvtCj1SG7aL9A7iSfkR6lb1bT7dTwM3PQLszrCycHffL7B66l+JHbGyXe+nbWpxoAjQsds4dzVb6MumV2/xiZ2RX5UT4WPm0la5A3n0wVHxMnXNkgfE7IhC3pup8ceE+2ZimsRRR4cgwVH+mFMTfwSIDs8bE7iym/QttH5WOI31i5QcSPBFHxXnlYEpOHpdEjMMn7I5dhTHrAR2sDmgDcI/l4QRJ8RI5L7kVC4bFfFWM6e5R3Zu3YFLN/t9Jg2ioUDnRGY+3K/R17+rTVXphROcYhDK+ApY6BvxkRvWG3/+Wy/PNRcznyo9EgiPIf3Cf/JPnIwcPqg== 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=PFKGe3msmS9uypHg1D4NVF1g24szXb61m885m1UIas4=; b=WFJ4u2oN0p2miHchSKbt1DZl1kHl+XlLg6BccYLOuRqeb3LUxqPu5IkBO29fM+fvs0ihCDYSuxcs/G8n3z2uxAWizR9ffYzC9jsHUGp8y1QENxVYiPFueesM2hKr4DAT2RAHuHNJHtfjgs2emHRuXxK9+kB3mWTXp22CM8aZNBQyExemL77JA+12c1ZqRwIYatyB9vevzQh3I35OMdhCu5dZpJwn1XIR2ZH43OGMcGfMZu229AdWvUlmIzKgvCtvRRhrfCREovYGdmLEbnO57PRRNpsx9qTZvsRJ8vq+u+MP3SFa37j65v2Icso4WH2NTQToRC7aMZFnM6GF73VdUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PFKGe3msmS9uypHg1D4NVF1g24szXb61m885m1UIas4=; b=bDSJZHAMRWt/1v02dvr28bIystqLbRMhay5bsbGotM3WzByZZEgLE7Lt9hIQGmVDpBTIC3ZNBR/RSbb7DvNldl8DBGuUj4FofTK01fyv0hV72vo2lkjeWTFzaSYmVBk6TH5cbFsB/hwAyomnBKtOBdSEk2pgiCeXYqnj+pNElCw= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:42 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:41 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 3/9] cpuidle-haltpoll: condition on ARCH_CPUIDLE_HALTPOLL Date: Tue, 30 Apr 2024 11:37:24 -0700 Message-Id: <20240430183730.561960-4-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0130.namprd04.prod.outlook.com (2603:10b6:303:84::15) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f28dcc2-dcb5-40f6-e168-08dc69449e51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: jAVzqO66WwhlLyb5tq8OlEP1d3+RZQxNlLniN5S3CfnySjtcTLeyMRZX+AsGq6WNTWv9D1bYf5xC0s+g08jZyrffn7UdTb1kdtlkT2QxDdueOVkx4/kRka8/yz5u0fyszT2hp2MwYEqxBEfvQZCHRb4NnZhCmskupyKQwfPnGgg/S0yRLmv7FlyhxpDbEaIM/cTVEo1gE/Y/LtMOCzLH7ZPL3bDd/JZ+I4zrhxJP0J3UnGK81pnlFFy38yDpHPDupro2dIc6XhGAU4lDZvC7cTn13Cv8RR0GW7JRYWg/2IgHg8HqmvuNqFy2Ieywui8RaQoPciabJNsI0ernGI4evn+kNgBkgwaB+i6pdFCFIcbdjJazwOInwHCmeJSDgJrqognV1R/pypy6dHhSzr4nb4W7KFLiiuB0cQonuXYjTxrFU6IiaI18oEIu17P6HH+VRGnGkLMsec5SsaRqPeZZFM4VYqdbLkB+gloaZgXf1dikGH+i3+GKFYjiYcv59YuvSH5/kc3MFGJnuCuNw6g2XFtfM8A4h8yR8cb4B4OJAUSE+wUCeY39yHYWHWDxHwi1J/GVBYmJ/zazmG9RME/KYqwnn1bOjZkLXg70tINkBFXRcuwBrS5Ou7QPErSdoKsx2vevAk0D+D3fNj1jvj/0HyAu2OaVqE9SpOr1YPXeyxHOGYa9VLJc5QqbZx7YEn0Kg1oNgnP7S8Clw4oAWAjdeScvxxkGLakEBXHnTZ9NDD+3QhOwfLyM6f4ELdr4GEdkozyeR7Q7McP1qNvG/8m7Zh+eNhjnclAMBhRdiIBavysvfOV4RAgCroyfttj5qVsbwSXO0c3WYTF1Jn3qOHg1od38bQeEU9l5pBSsf6ZItf5bm5/+nc11OI06YET/Ya80P36sPFRbVvKe08hs9s0fzLBqysq+ezvjXl9ruFF9AREFv/02ZH8H/7UPlSY3FYex/7FSKcfUVMmjGYcOVdXFvugYtMqueyetKW9zgM4GvwdNfqy70z3Toxn7hxrGjf3vOsM+oec9nRtgc26Phqzd0NXJKGW/VXD2Lcx7P+ZDxsj5EyGX8eDc9lua8dKprLKQPWuJueeQKNMXFN2QEDBlbB4Ia3xqN0fFMyjRhMQgi+Mh4ZLeK6A8Q/U+OXfBTWVxdMkLYIjTdsAvKbOf6qrtQbYw4gJSARXrgovce/9hzbjDioUsKOPiJhdJGl/sScNqoLXp19nnC8+c8M2f/TGJ2kZm22RhbzlqEVkY1PFZmaGoB0SEFYI7/rhFMhKOCI80+COkHTqnyLaIPaHCLsidmA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g8Y9twu4ewG5T437auRGiw8sI6v67wkJxDyezDnQEwiL+iDbbsK1G8onuL8JKsiKqrjmt4sm3SJo4Zi4CyawIYisLs4xJDyHBICxUQAyUP8dT9DlDYgA5JwgBWMItk088fxKDh1lQfPy+uDiLdbaEMSl3dr0ED8TYxFKIsy7LJowN6US5YajyoQsi33PR6j8VlAjdsLUYRun0cSjSmTEmQah04lZHkZiXfRPITjDcUk1YUbiIfvbev6IMSt7D+aV8gp+/pMT5fLzKfbCBiLSQiUVKZharFAIusDmm1qlZr7N2lHpJK7y3vb0HXNU0AlNbXBq2BO7bz/A5+Ixsq+IzKabFKbWzQQxBnncjV6219yb4nb2aYeUjvRyyG9vvzyFeHXpbigTq+O5V4xDuQdKa2MnD3BoAsquhlAvWKz8uN0CYmX4K0ofk3HM9HrRz8rs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z1k9ud6fl/whlURb66nhd8az8ewwd+Qm9PIpGD0NMoS2LWGAi5e61th4W7q+8DSToapyVvmk6Yf6CPjTvRX/r4CA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: /TrnSrw0lGbxiPPXD29ZFtVPznn+x7ZBW+w3cgZdBT4YfCRUoMoX8NM23jGKlIyLIN9L1ZYb4GKu/pUoRxaFFZPmfRQP37Q/2T2Y0v9x1kc9beLTA90iiY279/s8A57BPESvS3YTlu3CYi3dW5oPRnrYdb/7x4rB7IX1rknw+GD6sOOUHwZ5KkDLrBoaIlRDjSIQ0z2iPPjFaGKozUau7m0xroXNPl8e8GwI4itTs08LuU2zUEZop/JWOgivjsYqjdR1QQUWCvS3Hyfb0omha0tV1MVbfdBheUK3IdmVEjQwSjYfDh/Rhgy4GeqkyaFL+CTQ/5o8ANgaCq0SWvGl+1TqPsvth2bdME9o/MK1tkOzqF6q0VVl1/7Wfk5rwScWRpQVAl5XaVJvxP47QVCA4+bEcvc3cHNlwdNeZ47vHVqFCvOd0RvOkG7LjaQGlYKsxoElezAemXc/KaRXdsTWirYbnmMR659H+obeK4B5BZNVDptOBxdcJ/xA4j7kXvbT76U3gJZQJCCwvX8wVS8CJ0VeXraHzOPVy53E7jAOdI9pSVZTgYZsNDvWUSU017EhPa+TEBUsZtW+1Uow6UehlkP7leKFXG5dApRfyiKaWAs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f28dcc2-dcb5-40f6-e168-08dc69449e51 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:41.5612 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W8MZdkIGkZPFzPeVkv1ic5NottTU+i8e5cDg7ttJ30qTOfq0yGYGI2DeYHBL90hsvoCcRF5c9JBT9BtePNohVUxRW75XwKfL14zseTfv9xI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-ORIG-GUID: _0TmJ7kzjgoAimFU5vVoQmCnp4D64Ffl X-Proofpoint-GUID: _0TmJ7kzjgoAimFU5vVoQmCnp4D64Ffl The cpuidle-haltpoll driver and its namesake governor are selected under KVM_GUEST on X86. In addition, KVM_GUEST also selects ARCH_CPUIDLE_HALTPOLL and defines the requisite arch_haltpoll_{enable,disable}() functions. So remove the explicit dependence on KVM_GUEST, and instead use ARCH_CPUIDLE_HALTPOLL as proxy for architectural support for haltpoll. While at it, change "halt poll" to "haltpoll" in one of the summary clauses, since the second form is used everywhere else. Signed-off-by: Ankur Arora --- drivers/cpuidle/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index 75f6e176bbc8..c1bebadf22bc 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -35,7 +35,6 @@ config CPU_IDLE_GOV_TEO config CPU_IDLE_GOV_HALTPOLL bool "Haltpoll governor (for virtualized systems)" - depends on KVM_GUEST help This governor implements haltpoll idle state selection, to be used in conjunction with the haltpoll cpuidle driver, allowing @@ -72,8 +71,8 @@ source "drivers/cpuidle/Kconfig.riscv" endmenu config HALTPOLL_CPUIDLE - tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL + tristate "Haltpoll cpuidle driver" + depends on ARCH_CPUIDLE_HALTPOLL && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help From patchwork Tue Apr 30 18:37:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649871 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21AB723C9; Tue, 30 Apr 2024 18:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502310; cv=fail; b=HJNUEvFUGZBVJnHWYo6ri2aBBMG9MaBU7xl+ON9/r2vS6SRExBj5SF9oevihvnCtBnW6gfFfkUm8/VeB7rv2XIKmG0EITWtIlb4z7JZVLwyQQnixnOlYMpzmFYnuWDSJ0csiNDDUi/6bDQclI4NKr7FYmMM219iBRwCFiPPC+9g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502310; c=relaxed/simple; bh=NDPGzI/c23kfTTC4q3SaITR/rXnM/N3GkRwLpHzjJ2o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WOKLk/BH6IAHxXICuP+kSi9c/kOiCLwGSBSwdlHS2FQAo4ExZ02eHabDyYig0Nu/KkCV4iSg7AUC7VgG058Mtr20SI5akszd+lZfz8RV9a+cr/OVggXLhOQp48J8wg0aMdATVCo2v3CdJTKeZejoxbqet3rwFnn29DdCcEyCRMw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=iOlCj3XN; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=aI6l9rVv; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="iOlCj3XN"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="aI6l9rVv" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIj8J013014; Tue, 30 Apr 2024 18:37:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=e4hefLP1/keZMizm6J/lhFsjEvynlLKzlO3Rbfd9p2c=; b=iOlCj3XN7vSXnPjxAwd2unPhiO8WUbE/fuU/WN6UAOjeHIIM9q6ZDDlVuXHs/GmqsdMq buQKx5eo5yPt6hEnsw/gjAMU1ta5JPIio9Uq6Ls6I4WmqkO7/nPjym+riIsk3cgDcpO2 JDZ6XnrQ7oDggkPSnNQA0E2mLfl0tq86bvKneFb7VT6Vfi0H1ns8t8aW8SqhISpag8dB /WajHYjnFIrB1o58wWXByOA47kzPmeljUX2EU5lVp2/vz7btizWPMKlqoRL6bKhcNvG6 UTpdje0mfdFW6rYDMl4JrB0QxsqR8mkgBrJuydsNMdd2Hv1JJyYxtJ9NsmHs/LtJd4ML pA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrqy2wxce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:48 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UH3kuE016678; Tue, 30 Apr 2024 18:37:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqteckhe-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EU7W1x62DXG6f640RtSrrdBH7JNG2k9BkfiiLn017mSCWQqTu80jvdJWi/grrRT0h9s/FjPAKUx0Z/8IqB+r8w70jTHZAbZ9YTAAEOPXnUGX/AK2HyT3F3yr3WU/DsOqM6C6eMlf6RDlt1urI2xyTiEi8Fd/g0iXUDIg/0rzcuampl+9UKWl9iTZrHL5FotNIJ4Tuda9AMkZmOjwqO8qwMpFGszoTwBWbAW9EJKcLB9bXCRREr+gbwHuOs2SXuXM2d0fORCVGYrKZuJhbZuyNWLg0L892WRvwR8wydKNbO/KZjNnvfWxlM/Fol9VzaY07O/jEiyGzx2SwQAmzUNiZg== 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=e4hefLP1/keZMizm6J/lhFsjEvynlLKzlO3Rbfd9p2c=; b=akVSfEXhhVeKHhhvIEVPVjZsK8AdFszGEDxl0Y+RYL1/Q6ZjmJ9zrBjBQE3H5mkNdeHA6qkbY3si6LnXtp1JDxTIpyVdquyWOA0RKNacYYEvm97DJgHMn8svpXzsWUU1j/USwqTnlYYqyzEyQ8pDjz/HB/8jx3bOEjAu/eT0dkIDQfTMxR1oPS/gVqdK5xVQl96LIBJeRwnxeOEHY2PZxnbGufgKC6Z07Hx+LV6xYBNHRYcCcHvlrvflPGF5ttNfUn9CTahmdGYV0tcGAUpPzH87t6Ty6gUkXIS8RpDxCnVGuGfPqozzvBjDMN7ShgCFRl/zbu5xAssTgKq+hwJC3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e4hefLP1/keZMizm6J/lhFsjEvynlLKzlO3Rbfd9p2c=; b=aI6l9rVv5eQsFBYcY/pNVm7wW3AlFTW9nwfutx1oE3XEmT6WLQ0g8wH5asITVMupd/gbl3/5tYweCb1Sh3c+uPdu9EZ+/FyZdf9N4k6F+NnO+DBImGpUokYrvY+a8zxWezBlgChZJJdOMx8LDlfKm0rEedsk00Pv6lOPVrntUKE= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:43 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:43 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 4/9] cpuidle-haltpoll: define arch_haltpoll_supported() Date: Tue, 30 Apr 2024 11:37:25 -0700 Message-Id: <20240430183730.561960-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0182.namprd04.prod.outlook.com (2603:10b6:303:86::7) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d7fc43f-8e68-4a2e-078e-08dc69449f6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376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ANqMrn/moBM+8pGoWsUIaK2fz1U1gKKHSV4kKlDGf0I3qfXvHL3LwQ6TAqsTYCMwcrU7q5DasR3VR3Avvr2PvGfKE6yuBpl17panxWMpAZATbv2mWikUqZTJoA0DetKw+CUNcIKgAPNDxlwXtSEfiYIuFDTFtquLBXFxSbYmOO5f5ziir7Rd8VWXXY9p5GRtd4tfX5jQARf/4lRtsRKoe+7Te6Uk3CO38dgFyg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vspiUkmkGJQ5qfNhoUzuFh+QzS9/mQbLdkBgiZ1Xx1vgRXMqmpU9pu9C7Wac08kYoAqMdMJtMwQR7FT/q0Udk490E397oIMr+VuLCRLQ8Lg1opaTNwrYNXAvK6uwkzKnUTNfFkAEJ0LXKi9+vpm73YvM3CEym/mfmGck4Gfc2dBNCjRIEogYLWAdvK+gdm9/0Z0qxoNQeXgPGzaIebv/1LC74u9/aVRBIx4aTz6wmSQM0U7BybL5qKKPXDEh3rlA5CRZKSuQhr7qR8AHYW5/Gyak5KN7e6Miw8wPhlt4Jo4YovLHWsQj2KwfFPpj63Kr/oro/cIoIO0oanLoGud5kx9nYY8UVSNUp1+Xo7Ct/6QD45g5nyySUZwQCCZvUzxHUIK3bKFHuHmWpyj2LilftL4gvFykIWzg1OPjT1NEZqoxbkvAMma++t/7YDZB8qC3mGPR3EYl59Z9jkUMy9uiN92VHTzXsCEBiAzuZm9MdFzx39aDMM9/MoqWzAKnyVHOpDJ6Xp2ttkAIZm+FD7p/cqEt0sEMIH5fQA67fz68NCWkgpztfawmpRGWeD/wQUgLvR2EhSEqOB/hWSmKmNQmLRwP6C9iU8VM4svaQzhN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ageData-0: nvp3247Ru8IdozOp7m+T98UiiJ8483h/VRexwnooMIgcwkYR/IqH2sfV14EbUH3IFjZBf86NI7jmLCOfAy6yRJaG1N9Bk74RJJPse7RkbXU9Rq9ZXhuAKZiJA5eIiS+sIcjW2g/NteDKKYF9BdPkJUBE0YIWHNBWb7toodfvKN6LSvP+I3AsVdk4AGaN9d5JpH4F2f/HLv+a/G9B4PWRdmMxqn7neYMXVHIRKYzFG3WJjp1G0WNJKSX+xWaqwZQ/gVqY/2e1sxlw2fP9TJ5Sy2Ba7RxaQjOBMU3gInjqgiE95DHLkkUOFVe9HC3UMN6DyzWvYJ2W+Uhc+M6pdbpmJ7vFAJJuC3xycknsl3RxjmjWVbO2y9/xZGmbcfoxxsCMN1jgVJTi5qr8W/14dG8W8bBJyHzi6gE8mwMF8EeOd2pgkNlEo+dUJ9a/5DjV0CZFQ4a/B/UGx7vBJG7LAzSmINJ/vLNyUCaPphioB6uq62985+dn8S2zUUG4jF8V1Kd2N1PkelW+LYEHq4H2kh/pRGnqNaSji0vn4sLTmKvlhTTeVqipQn5fLMtU+VPzvU1PmpGhIpSqnz2TlpeCQ7E8A9Len7w7QgaPTanlQAiOJTc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d7fc43f-8e68-4a2e-078e-08dc69449f6a X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:43.4100 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mHKNFg/0tEqKOg/wdjtEMK2EBU2OVJGbp3ltoBHXjpRNWJ7zRn5VoxTo4xYBVdXMLuUvcZKJwEzUhuHuenDAQH4eq59VYVKHfa53P8ahyTI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-ORIG-GUID: RguJQfy0gg3UuuZDU4eAMvN8a0vbzSal X-Proofpoint-GUID: RguJQfy0gg3UuuZDU4eAMvN8a0vbzSal From: Joao Martins Right now kvm_para_has_hint(KVM_HINTS_REALTIME) is x86 only. In pursuit of making cpuidle-haltpoll architecture independent, define arch_haltpoll_supported() which handles the architectural check for enabling haltpoll. Move the (kvm_para_available() && kvm_para_has_hint(KVM_HINTS_REALTIME)) check to the x86 specific arch_haltpoll_supported(). Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- Changelog: - s/arch_haltpoll_want/arch_haltpoll_supported/ - change the check in haltpoll_want() from: (kvm_para_available() && arch_haltpoll_want()) || force; to arch_haltpoll_supported() || force; Dropped Rafael's acked-by due to these changes. --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 10 ++++++++++ drivers/cpuidle/cpuidle-haltpoll.c | 9 ++------- include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/cpuidle_haltpoll.h b/arch/x86/include/asm/cpuidle_haltpoll.h index c8b39c6716ff..43ce79b88662 100644 --- a/arch/x86/include/asm/cpuidle_haltpoll.h +++ b/arch/x86/include/asm/cpuidle_haltpoll.h @@ -4,5 +4,6 @@ void arch_haltpoll_enable(unsigned int cpu); void arch_haltpoll_disable(unsigned int cpu); +bool arch_haltpoll_supported(void); #endif diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 7f0732bc0ccd..e4dcbe9acc07 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1151,4 +1151,14 @@ void arch_haltpoll_disable(unsigned int cpu) smp_call_function_single(cpu, kvm_enable_host_haltpoll, NULL, 1); } EXPORT_SYMBOL_GPL(arch_haltpoll_disable); + +bool arch_haltpoll_supported(void) +{ + /* Do not load haltpoll if idle= is passed */ + if (boot_option_idle_override != IDLE_NO_OVERRIDE) + return false; + + return kvm_para_available() && kvm_para_has_hint(KVM_HINTS_REALTIME); +} +EXPORT_SYMBOL_GPL(arch_haltpoll_supported); #endif diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index d8515d5c0853..70f585383171 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -15,7 +15,6 @@ #include #include #include -#include #include static bool force __read_mostly; @@ -95,7 +94,7 @@ static void haltpoll_uninit(void) static bool haltpoll_want(void) { - return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; + return arch_haltpoll_supported() || force; } static int __init haltpoll_init(void) @@ -103,11 +102,7 @@ static int __init haltpoll_init(void) int ret; struct cpuidle_driver *drv = &haltpoll_driver; - /* Do not load haltpoll if idle= is passed */ - if (boot_option_idle_override != IDLE_NO_OVERRIDE) - return -ENODEV; - - if (!kvm_para_available() || !haltpoll_want()) + if (!haltpoll_want()) return -ENODEV; cpuidle_poll_state_init(drv); diff --git a/include/linux/cpuidle_haltpoll.h b/include/linux/cpuidle_haltpoll.h index d50c1e0411a2..a3caf01d3f0e 100644 --- a/include/linux/cpuidle_haltpoll.h +++ b/include/linux/cpuidle_haltpoll.h @@ -12,5 +12,10 @@ static inline void arch_haltpoll_enable(unsigned int cpu) static inline void arch_haltpoll_disable(unsigned int cpu) { } + +static inline bool arch_haltpoll_supported(void) +{ + return false; +} #endif #endif From patchwork Tue Apr 30 18:37:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649869 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 766531802DA; Tue, 30 Apr 2024 18:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502310; cv=fail; b=CI9lAFRs70KF4jP0pOMmJl2SGiU6Jr0xJsu6vRyz0lMBdaTLV0P+pm4JsffP+9HGDS4n06UUC8+p5CLV1KC6KqhDX+2yZ2KFoVVDOaFR5IXGQXSc9SX0FxTqOVBoM+ldRobc1G4t149/0SsgWKm+heG7B1yoSTWx96bFEZ1wUBE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502310; c=relaxed/simple; bh=KFGeP/FpAML4FXKpLFKfHiDpT8NYqERwImO8J/BOynE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fyIVUPdJ7rtmpP+Q/FiBnWBZpXDelvudDVJILU01xwq/nN6sY9wGblaA9lvWkBG+zStL3JKpa2c4QVVHSqsG5hJEfET8ZEeTY486GIys/zyXWz4j1A1bR0COATZ4EiqpwDZYu48JWcaDFkFZfiB+/RjcrdlRIAgZpuNtdgD9qDQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=gzMEjh+E; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=i8MxIXOX; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gzMEjh+E"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="i8MxIXOX" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIkop026936; Tue, 30 Apr 2024 18:37:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=9JPGZCPhmr2BbOmo0OZVXiCt5Je9dfuGj8xVEW23KiM=; b=gzMEjh+EfflrEOFQSEKOK4YqOSvqvHrpo4ZGfANgue7sk1Vj95loqQsHGcpNyHnoM3ES q49CT2CuplF4a2yp/XeJzjFcxGLgfPnHmh+6+//Y/2dxV0dm6J0S188W1ocG/6xoV3Ek bIGu4UPhexMbcDqRXPuyAM0EQNSklFsSP22B73x2SvINBNZ0OhWsxU7fB+VFhftYdIZH MuK2IPkbVZ3UTZsqNH4OYB+LV5QXc9Xgyh3QsYo/HIeLHCKn3vDgPLHmfAM0NR23Ddak fVP8i9KY/eADaIwwoiBjDD9U2UcUx5maGlfBE7EiT9C0JKupkBsfT77GtPyU40WmRewl Gw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr54duk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:48 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UH3kuF016678; Tue, 30 Apr 2024 18:37:48 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqteckhe-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ocmp7aWZmc8fMl+A8S6QSn4lIRSYYqM9r0zUbUs9V+72Lrmn3LPM2F/hL9D5BaSP67V3hX150okPMMAR/dO2Ll+WBuSfMvbVI8EzUnsnr5h+Sv/0kdyqALPzSIdZSO+HxIolylvATjfoYVkVKF+5agWo7s2bJBjaT9HPlDRPk7oK050agKjt7V13Rssumc5Kn26iBifRtwvWfn2a25rH90e9qnN1N68HImT+23Uy5br5d6WpkYj9TKuoKbTP+r5gBbCrzIZbqGMJNKhqTu8em675IctkvxJGekPBqEY6gnBDVM32xvyBlcKX39mzkJFc89gbQT+WBSGylLVOx+h3HA== 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=9JPGZCPhmr2BbOmo0OZVXiCt5Je9dfuGj8xVEW23KiM=; b=OXBOsLmhpkUcOdEijv3+YkmvByMGRkdXaqy1KpFCb5/TZi/i/q6OzQDwI6DfkGB8Hz7w2GmvCC1u8lXRBA3hSl629VTbTyVgi3RNWvxCeh/JUH8ay+gtsgvTsBzwGSFlAzJrUB6j+61IlchTuBaShYzeFOdXgfVdssgkQnmP+mKGzfbW8a0W0+RvvC0IcSr/g86s8bCiynW33eCxwP4UMu3lalan8AN3am0c2uv8EwMaLToeqz4rJe9tHwRvJsUOvnitFH2S6z/blch5kc42OPIbacoI+ni36LisbWv9Z+JAa1+PWQ3tJ0r4GSXk2+JETHVdlFT1Jr8t7dkugTp6VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9JPGZCPhmr2BbOmo0OZVXiCt5Je9dfuGj8xVEW23KiM=; b=i8MxIXOXSWYLZZYla8/yz5sM3ubj0/cvn+QvuXZLvfrOz8V3lmHkprFQvrXTbuKbOym5PzjDnlK2oOOFMKS4LXTTNFkLHb+u4bUk607tXXbyWaf1oyscJPYd5EWW+bQW7+QIns+5KcfuQQc3x3WZbR7uFSrubXrz86VuDnYzBmE= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:45 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:45 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 5/9] governors/haltpoll: drop kvm_para_available() check Date: Tue, 30 Apr 2024 11:37:26 -0700 Message-Id: <20240430183730.561960-6-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0068.namprd04.prod.outlook.com (2603:10b6:303:6b::13) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: ac21ae12-2b91-40df-b073-08dc6944a084 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: TOdv0xjMDIvCIEsQNOhSV0RmMWfcggzRainQMT+M2yOXs+Dzhb1AzU+IAiCROfde2W8PU6SmWmfw19UUZ5RHJsVWpChfwqJEgmoOhJcfKIwsv6uYVf9D14JM2pUEaobV9JMQdZdbXriTqwiPk3ISbhDWyR/BYXlKUTMGsiZJCxVlQxDF2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vmWdGCWTi2W00vHDFQIpok35wxTYs1z2Lz5rWwvYHGQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 851//vKLF4gWzMGPCShaLtbnQ1/sFgvxPf2vIiwTdrbGgkd5mEjaDfhN7HkI+Y2uFw21XPPR8wK1d6lQoQvI1Yd3nQg9/lCAdJN1piRbN8o6whcug6kxTAGdJwOQwmLoWHdHwNOJW3QKC6UrRFNYgl99x64hyIOkTNoBuh1P0KsU4A7usR5or1tFcP/svwKHxt5Rb3DhziEOxFXPnjJc2YioLsPyiT9Rxl6uNyB0DrAdIMp87pH6e5o8XH+ixxpVLMrxrbbs62Mjs5ahWtYLpV5VcczsRTopv8ShYQPSAmQUx2rFdRpz5InzrXcNPNvSUS28+0sv5AFvWtkmhfcw3MgOkNVSQf943HQQdgXpN2Azgc8xc6tFarxWLKI8S+hInonmM4taQxmVd05gziMopa4Eg8fp+PFPMyQ/2rsci+kFjUIVkMn8/sWwCzTrMDhuM9yMj2+hl5drs1RbgaXN/zpb1AfWBy/mhuBJVmTMkkzjyB3AKYu3aiV746X3br8PaGM2HKbWx7XftszotHpWyfnVtfaSgoH/6LJJHYR1fsXRo87UYjt9eXx+vDDLFHF2LHZa3vs6RhKj6tmrtVUYf3SCkVYvoG1u1/Fxb3DR96C0oXf4leLbZg4dBgAHHtaOlkmi0YZXxByazFxxiGV+tXP3grFskOneP44Qmipr0dmUOs9liySYngcO7NFsSMzoxyXgdv9ffKKoOLIk6F724WKAUbPbjcAx3KJlWyuITy1X657qewBM3Eps2LtuZekbVeMEgoMY9GDcBi+vgRk2B87/0CRtF255nVHu6tJWA5YoaTY1n9X4luTuDRpbsyY5hTqWeTwtezTrw5pZ6xcFEDZEUETxToAypi9SuN6cczerp554t8ZOMyf8V/MP/iAlzlKAI28wntgpK73o6dAEIipN0dE3EI/UH7tFrAlv8ShoGSblCI8w8asuDDddTBfQjWWE/Fd+T2OQswooj97Q1bT1gA5bS+7S8kUgw7u0+XcjusLjN8jZz5zBQ6+465eZ9g3JhVggRZbUKNHzhhxpe5uu6xrJOhf5h2Sw4I1+GQ7omAcv44Z2MnepfGNOqemYTDjcaE3JSifhaUVKDfdCY5qK891b8+YgvydwnJhp+QobAcn3PhbCQoTMmiXoyRd3b1492gWmULGkZUqKWir7FuAMQAx/LG0mPpIE5/V5fzXG1uIMj79cwd//GMV+MeEl3KGvHG9KkCMshnJOZZKB6314lgK81u9az42iSI/jN/zdFa6qwK1mEcvRmwFQLPM+HTH5YywE/jogfwjMoKRhgr8KAnD5E2GXyvY9Q/9V9ZRZ+toB6QPu2yfg9FYP42KhgVosloM3QI1UEmQVawgWmA4XvpJTc3l7X1Fm/CdJZlKxj0YBs+qzD7UWDdGif7m6cOY7zrzhscqAeYVM+FaV/V+kGyDhZGKliZTNhAPLxwmarRhyjOKer+WiCdWX4PEOEGPF2nmy2GhGxJBL2R0Aa6nYU30kiOMFPHEJFoBDizh8ta7yi2rM3ozzu9WxVg269oOqOyyBQ8TcWhaCue92WOknMrwaAr/+FNzWtuc5pdUKhkEVNBKqzL2VxgEbq4B+duY0Ch7LKe7+K120oMfTpg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 7vNe+m5zxuJ/SCcoGoGRzp+3SK4tdD/VRCyJIiehMZQH1xPvSAqWGxze5qhNofTjJ59SoLTjDaeLAZjjnqgZ7llLRK/jqWvRG7fPBe6wBb7754UsSCTnQAIZJKXkXo/keuPwYjjWTu2p2XABTKLfK1pOUGzUKH7wkSttjaKh6F/WJthJObis1xYjoBWajTYo5cZzFe2xEDaaMtkutafdSMIn2WVVXar0lcmCkzywfrjDPj1kcw5jat9hYHebjEuPLPmh4mMxkRoKO6nxdNPBDOoxiTl83HamVpaHSadZeGcqWOVAdKply4Upn/lh5z31uLz1F51gLOGbKABu4i81OX5LyLDs6AMuvcF6X5C403JqIG0YU1knHPorU2d7thHRL4UPfcFIT5bgU5jd9ioO0Zn6UOaBp2umay0BDLPfGcSt1qub+zJ+wSLdFKyXaZ8htdRxPn2czrViKBsWouBq2Ji5W8CDCTq6SnF7qWBJaxjAUmeGxcYudRxjAI6pGjoP+BaHxrvDyU7pKrvzPycETNtYj8NOhudyb7OacSfXBAUQaPkZSNjtlEA6ptSSl3W24p7/qBu3IpueAea1Emb/r2Iez4/ued46IW+3pekafQU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac21ae12-2b91-40df-b073-08dc6944a084 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:45.2553 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4HWGiMHREaVYUuqKkw9B7p2dEKR9xh7VM4zY6mjH6abdjLhgQ1JqnBMdFwUSvWrPY1XMfMA50jx3LFnJDK7OV37ggI6h+6qTnB/roTK8Rfo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-ORIG-GUID: Hw59kAtNW6V46ZzTe_vDITnKR1P0Sm_K X-Proofpoint-GUID: Hw59kAtNW6V46ZzTe_vDITnKR1P0Sm_K From: Joao Martins The haltpoll governor is selected either by the cpuidle-haltpoll driver, or explicitly by the user. In particular, it is never selected by default since it has the lowest rating of all governors (menu=20, teo=19, ladder=10/25, haltpoll=9). So, we can safely forgo the kvm_para_available() check. This also allows cpuidle-haltpoll to be tested on baremetal. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Acked-by: "Rafael J. Wysocki" Signed-off-by: Ankur Arora --- drivers/cpuidle/governors/haltpoll.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c index 663b7f164d20..c8752f793e61 100644 --- a/drivers/cpuidle/governors/haltpoll.c +++ b/drivers/cpuidle/governors/haltpoll.c @@ -18,7 +18,6 @@ #include #include #include -#include #include static unsigned int guest_halt_poll_ns __read_mostly = 200000; @@ -148,10 +147,7 @@ static struct cpuidle_governor haltpoll_governor = { static int __init init_haltpoll(void) { - if (kvm_para_available()) - return cpuidle_register_governor(&haltpoll_governor); - - return 0; + return cpuidle_register_governor(&haltpoll_governor); } postcore_initcall(init_haltpoll); From patchwork Tue Apr 30 18:37:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649873 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5EE6194C92; Tue, 30 Apr 2024 18:38:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502311; cv=fail; b=pHTcbdYJcGyQ2der2LeC3LktLT8eiC8NJ7TwDFSH+6MlKr7Ex6P5CKV7knMG690JlpTWgKPoz92FAw4E9o1Z2h6ejasc3lhZd7CqqwkGt/VU2x0QzYVlp4DBumDLYDDf2NPKA4Yc4phjQBPj1Hhtn3QQddhL6ghVjTkh8fBobSA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502311; c=relaxed/simple; bh=l7Ohyfgcv+gHPOIGGlqVZqif1FzxNBEPOoEK79ntrL8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WEPrO4q2EM43IzjKVQ7szrxI0ybt5EEuyrT+qQSP4X+Va+SPxhGDBmambNQd6WPF3PHyrR6WlyogNIMf7Nk+Buu4MyEAgTRaQ49G7DzZDiCVesnzhT8XYHUfNIcDKzW1iBpBue+qbq9SuE+vj4DEtmGShu8mPf9t8wtSKQPM5wA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=h9liy6/e; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=SV5zux2w; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="h9liy6/e"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="SV5zux2w" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIchp015452; Tue, 30 Apr 2024 18:37:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=CkE+FQofaQZB21BMzCKAtZTmDzS1Gm1fDdPRKdgpBKg=; b=h9liy6/eZA3oryrErLA+t3LucTFC+LuLgngegzrmvJERaKKk8U2IW6ZqBrlP7vePksN3 fmWE8hSqEvyePVUmBuWQiUQNB4j/9UbDhC5VZNuDhO/R/xfNvuiIcuwzx94Kb6+yDZav R/mfcUrA/tqFvWb+gqiDNPq5F0lJU7q+S+Rv2f8Ykk+w22xjckezyRtbt+Hr9bjrz7KY zPeELFMZpIzn+oZ0xMNmPHr6RZPMYqU68mJlq9IdOc8/7gc91Ojv2/e75w+UYDjDUGhx meDcdaeyTBFa3p2EZ/lzte8li65blr1/KlF3OcVqTtFwv+6XBsZb+PhI5Yxe0wXS7dM9 Kg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr9cnxgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:54 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UISs8P005044; Tue, 30 Apr 2024 18:37:53 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt7vk17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D4J2BrsziaxV4ycMDDJyKqu3+taiZ7eARAKt4QsO5L/+0CbLvn5hQ3HmQq6XmTUCKBnJcTAIjyvz/AO0R1MiUnoN9wUJeEOKSv43ga3DYigRQoAJwzXKXVXTrpWXQT8/BMHsjR1nbK7Ej5MoJ5jJUSb/dQUfv2JMO14hHEA4lwKa5PTop247lHJ9dT7pABzOiXyHdGLoTfKKl+4Hx8mvE/4kmp2VVV0q673ySskc9jiecjZZwiLQyhRo4lXT3EcbIGEJ5TgoKaD4bhUILHOH6XuJi6ro/OGNqTAD8SUgCKVBprb46LkbxkKAK/DXUox99NWn47FqamulmgKirVY8Og== 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=CkE+FQofaQZB21BMzCKAtZTmDzS1Gm1fDdPRKdgpBKg=; b=m9Roq4olbDe1abnkf605ACYqRX9TGZIIFlQUHNsHq1hTki/XYvlMs1DafihKFEOFi3B2JDFoHB/GZHaacZCFclIdmfd8K1VxF8Jon6THnugqMogQFvPLhOEXqOxwJyFSEzxIkAW6faIfJSOr6tdm+fXzKzsWHQdr25m5ahtqLLMOWUVbfdZ9ULfnMlkInMDuUrfJROdnmROufVW241/dXdzkLYKfrll07bGCQ/NOYuVvVb9kIZDGG3gjmGUswzRF4LSrrUTPZ7myRNtq5R3hL6m//jt2er8d3TIlVwPiQYPYlm8hHwS9d6qLCHTBTbCjDfS/4eqCJS4QwU96IynDJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CkE+FQofaQZB21BMzCKAtZTmDzS1Gm1fDdPRKdgpBKg=; b=SV5zux2wISNAncJNIJOrOMIKFZBuXwY9TDn1uDcgGZznPnRe1S3TQI0pXGmR+8dpNAHWgbqP1V75RwBD9I1M+TZrSRfqhqSqk74tN6NCQzUH0LVjJY8L7A3FSsBdG6mWil3EEuFVDn3bdWVsIALouJZjqK3H9GbATxmi7W/O1Ak= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:50 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:50 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 6/9] cpuidle/poll_state: poll via smp_cond_load_relaxed() Date: Tue, 30 Apr 2024 11:37:27 -0700 Message-Id: <20240430183730.561960-7-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0078.namprd04.prod.outlook.com (2603:10b6:303:6b::23) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 408bfa6a-be96-4d43-0866-08dc6944a361 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: VNzKRDzIATLjKX2v1iGRk11XgidLzvBED7fu08gNF6g0zWrIRdLcyHctYOsVqbW5qrdAnps+7Ik6TwMLk0hueCuxa8Dp/BEX0I0mfpreP/GZArwOZ2evex7Zyw8CT7lr+n5o/0GD1ptGEOiNnNLRifxa6T+uA+ZqssDjJGiG9nLtZEGRD8GVX6bzqrSm/Q3tr2olDF1nX61yGlxpUlrPj/ycbJWp2wQqnK6zuUAbLbexuTJoOo8WlCQatFLt/4HXiHDf+xe4dTBllGGbcZMtICYHILjVFVafSCziXK7ttOrbmrVr7ZB3QJQzKW+JEqCpNhT974kyheFO3P4ThYKQaU/XmO1vapPbG/jnSmnoBM34edHFSjVpuRi5zs+GAVECbcbFiLVjR0Nk+c8dxuSEPGRTo7JgyvlXFZuja3nUKtbHtXpEFO+MPWXGZXJ+/ihWXN3GlDvQtiXv6feGfqywfkl1AYUUi17uFfS2qS4whA8ITKPud4gfkdfAmESnNNz2B/WqA7vaZ5RW9oTczTO90i920Rx6AZ8F9qSCXB5kUuZ2Ruqu6n1DxQ34ZxQfLsmnW1tmvYsTstsDJqbHAL40Xbax7R4mbFOXNhNrg/SVX0eunyJmMHifDwwbkL1yo/h3ZlBv7nBSoHZgCtkSC2oESfJeTYiYfLNq9pIPHQDmYHAVIyEYam0Oc7I45Ij7qCKxmLMOqrQD++9CRZQCZBLdg1mgSrNc0goCBofgoJvMGhfmyJDSJeFNHzP/hL8TlDVqiVdBNwJCQC6M+aPpFL2M6Ls2ogp/6g5Rz2RtCTN7OYt43CTWg6McI4HU/zL/unnkduKTiggt4wxHFojt+xJN3j94/QmIePgBvjmSTetmPsR8ydzPcy/3vmZskPS/ItZv3uhCHIsLO6v2GaQGjkUebDz/cb9vLFcdo3Y7GqsVi2u5T+Rxdx/oiDJX28o8HfbL9O0oUydW5u4FOryn3P7Xun4W/O0BrYHdNUEngZnJqWoOJ6aRJJ6JnyL7FhtG5FsZ/hsr8tzOJ6QO28/2JTv0D5iZKTYBe0fm6QOo6Q6BpESeRgD7v3TkPK7so5BZ2Pktuht40nynwv2fYHeS+MjNeFOngj9eYck3pbh0oWQ6SsNi6zWPkyHI3pFvuCjrWFLe/7WysOLezi1Qxxa03ueftWG5Q5ds8gR3t7q40uYb0rlFxs7o3qXb0yG7OXnszBp4c5kgFGGgWOMrM0a85qjB6ZNF6cVLqckrcUUEYN3SU/raHG7QkPPK2PuiaMMBiUALKmNJ/MRLn+mxeutW4y1iGA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FqpEcDCs6OCEUchDX9jRUuBnRmrswe9f5hMbulBF9EV8X8/7L3ZOf4zW68uGDVIj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WsDAKX/vHBpahpryu4UqOY2JhADLRSfvQoUigemSd/qOvtIa/Ha0zDoi+E82YUaUe9KLO0JPzVjzGo05ibeI7LyqZADZIs6JcrbiU0PM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 408bfa6a-be96-4d43-0866-08dc6944a361 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:50.0610 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UyvYGDuoeaX0LJav34C7IV5nx0POMK4Mr3kKr7Cd7/u0RkmMVX2Rqp/98pZnMITwriIPBHMUIe0TRVTFQ1q0oJPpzCS3eTZBlydASdElfkQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-GUID: pNqSBNTgMbZMg0QJ0a_wH0dso5GEz-hT X-Proofpoint-ORIG-GUID: pNqSBNTgMbZMg0QJ0a_wH0dso5GEz-hT From: Mihai Carabas The inner loop in poll_idle() polls up to POLL_IDLE_RELAX_COUNT times, checking to see if the thread has the TIF_NEED_RESCHED bit set. The loop exits once the condition is met, or if the poll time limit has been exceeded. The time check is done only infrequently (once in POLL_IDLE_RELAX_COUNT iterations) so as to minimize the number of instructions executed in each iteration. In addition, each loop iteration executes cpu_relax() which on certain platforms provides a hint to the pipeline that the loop is busy-waiting, thus allowing the processor to reduce power consumption. However, cpu_relax() is not defined optimally everywhere. In particular, on arm64, it is implemented as a YIELD which merely serves as a hint to prefer a different hardware thread if one is available. arm64 exposes a better mechanism via smp_cond_load_relaxed() which uses LDXR, WFE where the LDXR loads a memory region in exclusive state and the WFE waits for any stores to the region. So restructure the loop and fold both checks in smp_cond_load_relaxed(). Also, move the time check to the head of the loop so, once TIF_NEED_RESCHED is set, we exit straight-away without doing an unnecessary time check. Suggested-by: Peter Zijlstra Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- Changelog: - reorganized the loop to keep the original poll_idle() structure. --- drivers/cpuidle/poll_state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 9b6d90a72601..532e4ed19e0f 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -21,21 +21,21 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, raw_local_irq_enable(); if (!current_set_polling_and_test()) { - unsigned int loop_count = 0; + unsigned int loop_count; u64 limit; limit = cpuidle_poll_time(drv, dev); while (!need_resched()) { - cpu_relax(); - if (loop_count++ < POLL_IDLE_RELAX_COUNT) - continue; - loop_count = 0; if (local_clock_noinstr() - time_start > limit) { dev->poll_time_limit = true; break; } + + smp_cond_load_relaxed(¤t_thread_info()->flags, + VAL & _TIF_NEED_RESCHED || + loop_count++ >= POLL_IDLE_RELAX_COUNT); } } raw_local_irq_disable(); From patchwork Tue Apr 30 18:37:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649875 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C32C21BED72; Tue, 30 Apr 2024 18:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502314; cv=fail; b=iKya7Ag+YoGCxgfyMkZNxv05MwAYNS1nSiY0PXE17pQR/Je6d1as68gxXcv3u7NANVMJIsLOFNn/BneetYEsrG54m2XM/L43cd7YoXyNzoy/JX1JOYBS2TiXqb0m6sl8u9K1qbsyA52LKQ+aUEQF96q8tfs0AYodmXek3JKDytM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502314; c=relaxed/simple; bh=AeGn1trKCVc+6iz5L/MFvIjh1g7tD+Rw8YPPwOEvlcg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=H0vbZ1jrHTPCfV5A4mahSfkDzeAWo2OkP3jQ8CIQyyWMlSS1X/zja5YvPF/oWZ5OWKM6UD9Pn9hgNlYWJtQcFxtD4LjMNoOdVhQPlhBuGJEZPO59Q1uecl6QEg+BwoASNM6Y5goXYgluNLJvTAUv1pDQb2UDFX5KTzwGKZxd2f0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=gxLNRpFW; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=zOa1MnpZ; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gxLNRpFW"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="zOa1MnpZ" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIe1N014225; Tue, 30 Apr 2024 18:37:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=0jYPmxlQLlR57Tk0Hp9NfbW34AvEBNpgzAF0tyq6clI=; b=gxLNRpFWJfyiL2xwvILd4GRgLDl32fvHBz8Ip30xUNWKJmGtWe5EqIBM6zccJw/q4vC8 LVsVp/jfwn+Q7dGiG1CJaKrKHTah4bnzhQyflcKMvyN9d1xuQnZ+s4M9SnU3KulsjDVO tqSzVYX6fHjk6PV6aR99rQDnigwX5XA7gVq3/QDEPQZb0pvK9kt1aefzF1g3GrbhXQHn RhO+sjp+ccZouc4c8eMje+fkr1YRoc7U1Z7dHpB+yo54Q6Hys/ZA5tq9i798Du6jPIl2 zmKzRE9t+1okcYNWqPosoZ065B+Z4LR2vkyoJaBopLhe2z264bVCP9DNh3QZxIzXaAkj tg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrs8cntj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:54 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UISs8Q005044; Tue, 30 Apr 2024 18:37:54 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt7vk17-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bKPbwMJN1iR3j7l4s1jorg4Blz6zFeyq8ELLckweY2KeMvtX8SlZwcx3guCKSOmQtMQ8jnAD0+mxddqA4mJWX+hEU15ThwufhQUsP3oOOp+toZRxlvZQx1in0sNyniFwtzXMqNQnUrbBGLaTk1vKHByINoZVyjpRha5XXChlMrqdKYms9sTfLZHKMki7mMHaJAsCEdcQTUcvW9uRq4szuofdzQ38EtUScYwE9BH+TgD4HlyM6ChuVcgiw8F3kKKA6LcbSF2Whz5bnDbWL+H/m4p1jv9k/YxIZZQTjYzHEiDyikP0SVkisVqWXQ4SJxXOb0rK8k95B5JEhD8afIf8RQ== 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=0jYPmxlQLlR57Tk0Hp9NfbW34AvEBNpgzAF0tyq6clI=; b=AG/FfEJMcCdNUTjzXZpKcKdTQqS1wz7SK6U+/ule5Whcom3fDfacavPy6vvUsD+djU7Z+WeEFa4/tsoWfFLndSj4cXFCs44SaNSF+N/dQ7+7uSzhFlwqWd9shDGWgk801GH1fs8lcgisRpxQGGM6B0LDT+/VKFQP9RRHduRWsIQ37sExc5i8G589ALQ3QzPDVZR/ioOMYVxmxebhk1s/+ifUiwj3jh9zKc/I2xgbIXwe1t+IxF78tJAwYlrnBD0DoNmw+F3kvYtRFvZrRgqJmkuDytdN/WXXKtY00+9l7z/X26/LdkQUdEzBXlYWaBKVZCgA0be7PeQhXfDr/lw9BQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0jYPmxlQLlR57Tk0Hp9NfbW34AvEBNpgzAF0tyq6clI=; b=zOa1MnpZq58Ru3n9pOBJOHCSVx7uSfBh0j/p/2Cn2Equ7WxwDtoGAgow71j4WwSCkDjT5c4kOmuTh72O1bya/cSSd14pckZPti/IuZTFVpolRCsj5PS1wYx2lEO4A7aNyuHyA2ZNEHWNZ9X96bd/I12BpEbyEPDPmxjoKSwSag4= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:51 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:51 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 7/9] arm64: define TIF_POLLING_NRFLAG Date: Tue, 30 Apr 2024 11:37:28 -0700 Message-Id: <20240430183730.561960-8-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0063.namprd04.prod.outlook.com (2603:10b6:303:6b::8) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 60596754-9082-4f68-0924-08dc6944a46c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: G0e21h9Q4ZaUoIgwwNqlTlOZ1uzVpQLiyBnNtkbK6eCgBnA9opNFo5kH0qYR6ZkIoKcrghIv4ipSn9UkyJU47DFzswn3IqgoA0tRIw82Dc47uUu8efEg6+1b7DEPfAWwy1rhf9YKAgqIZBc+6EHprMDPksWGaE/gI6oyqOSRxh8psL8fXx6aPCgbXb43KutaKNzo73RlRxQIPfLvC5yEayw9nQAJdw8RavKt5Yg+N65VYSmIsGjwqf+ind0/G2IYPuamr29FtQ/aSrHj+1m3MnHiBeoxYg8QdJIXxRPNleOgvZzG7j3mKv7r7mSeJf5yX+QzleGaWkB6nDgCfIaRBImYolnRVge/Srzu55jrDgjc4altzdB/0FnqTIAjpAmhF9aK4Vpmg7Aw87M6esGh8eCKSuV5r4ZJx822c1hDrhi79XLYtfcVxYi4R0Mnue8kcVix4FsrKH1r7MIZmgtp+rzbtDrQ6cRN8vhH5XVE8p6DRVczuNkGwcu/qSImaRt1Dia1Jfg0G3UTt/ZXtDEENu3JQR/C+gOedJ1QFvAduMHd36GaS93w28f92hfyDoexgy7m4iTIqOPuWPxHX6lkTcpTelBNfI8y/5KdR6fKau7mO6M0rtERCICXrXGmckX09/GaKe2slJDDFvNHf+g/oo29I3DDaS0Pi2TDgI20VmDiKJpFEcpjYHM2KpzyGUPi2k5Tt6utodNKoBwjwml9vErP5leAD9dsNsAogYzprcQoKNy3BPKxg+3goO6VB4Z7naGtyN/Xxuxzem4DsgYFzzf2jjKUCLwy6sGwzsougQudRnehdepH9ImQ8pScusuBT2dHq2bQrRx1X/98XRifQSEZL87Mmpxgqy8KmBqaKGlzgs0sgqIXXWXhbFs2beuBoUkzl0Hks2GJREPaZXBBiDsVh+T0FM9LNLkmAZW+1KOy37MiKxZ2SAlaKg0LVQwZZ/VO9PeGLpUaWlxnCY98IJAQD8W/xv2wYZ0lBzwhmCgQkmnS3jumUg/ZVcEn60cc3XT4jjNQwFg3EA5oT1G3MVdrMAxD9u9wa5AHfKY59E+62qWHMimLQh7E48ZnAgfoWVa/xpa1VG8FeC7gHmrS54zv1NjmYBxdmzqZdw742hQB19wNXAaMue4s1jD+T24yRdFCo+JY9oZIGa4JUWc2+nNpShvJJqc1OMxvw+HWxFJfPmB8zs7UhM2z26PM843FKlHIU0KSp0VldwJCbhgEezU+Kjp5FZcwjh9av65Q4aLWSKzzdlUsT5es5eW463XGbBvVDIGupssoAnINhGAXLQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP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JRuMb9G94iOkFmRv0kkt5qJGvEfvwUbNKA0jqourzJqR0q/zSGgSs/8XmYdYA6Aq118MOY09q/Es6WGXLwE8szOrqIjWLOGV2bRbcqgUJR0hqPAShcsXVtzmvnon0LAeN81TmgRHzleU7ABeOW0AiR1uvKCwdiZJLvS2AL/o7oqDxdgkQihVEf4VOeiI0AumYZil2u8bCgeUDYqDOISCoL5CdwsznYmcBhts6wTrljg6AY41bigLYGThhKq6BJgIIz25/o4+ErvaGjpJur33ZGsHoKnmdrDP3hGhvPcGaiQYqdXC33X8jeqh+6Hp+e7EhG1o29f5aTS84LQneJASPiHwHctg2UtF2Tj6hNHDYRl81SqVLaM5XY8proBCCgMSoRkQsou+disvcahIY7hkEXHUexU0562tmMrz4991zv1dUhXy82zOnpx+mE0s3oxTa35MAMvqxXuU2luxGTvrnJKoTu2PlLw/8iCNck3hEjyCJBVMsa+3TY2bxrEFQavmZc64oYwHr9ufM+cawmcJyWOhSW+RkpYZ++rRwbWxl/4J5CpCNj8ScH/VA4aU1EKc0oHTMdHxmJf0Rcr853o6ZOV00FjxCaIA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WxINAY9bsvlhTxlVjnNwPfeQtu5JsbCQXuLea9gLClvVrQK/70tKFtvwb+STb7tO+4P3Lu27utQ4A9WQzS014f32g1BdHwm4qejhroaS0vTDSYigOk/H+7BMRQFCQlaxKOy9cytg2kdTQqxPJi77ZGHLswRXB3P1/0H8AsDEIm6ZoYNOSViPeQcw/AhaHCgRc7b5ZzWTFqpXzrXiSnE/CFEYPBGj47SGrhovHuYD8XzHfbT1RposarbaJu36uYBZvPg8DvpBzRtt8Un5Uyd146Ap0WwZvhT9eEJhq7Gg9u9/J+mSc8MSjqcLGk5FqDKuHWGrOFvZ8Z18TY1ki2hZwSHcuuXtKAv8IBhQ2cFo7uDhftRXbI6qcSx0BDwHl2RnaxDReZHiAdogz/99lOLKO83GbSEKRHkK7RXY49D2kLK50gzGbtFwl0OrcedoE3RVUl21188fxfTonfXHW03ryUoaGFTQrKksdZT2t46CVhzabamQLvmRBQ40qkjYtvmpf+6t1sPkhV5tT/m10Ifji4SH5WgYTlhkQhEigPY/TEdXEabLlfrbpMZdG6RRJlcnenRk5xPBPSNS/ooUyVp1SEiukBTwzNxY/J/mfm89teg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60596754-9082-4f68-0924-08dc6944a46c X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:51.8022 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bTF8w+uokm9DjlGgrHBOVqwpyOg9UobMFmeywD/mCj6/ed19VNiniRVGPbBqFTPJWXYjterAfi8fa9a+Y4y1zXuRdUfeJax8JEGxEuIbg90= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-GUID: VTgAoIDHJw88LwEhztUsgl2f8VHMkhGA X-Proofpoint-ORIG-GUID: VTgAoIDHJw88LwEhztUsgl2f8VHMkhGA From: Joao Martins Commit 842514849a61 ("arm64: Remove TIF_POLLING_NRFLAG") had removed TIF_POLLING_NRFLAG because arm64 only supported non-polled idling via cpu_do_idle(). To add support for polling via cpuidle-haltpoll, we want to use the standard poll_idle() interface, which sets TIF_POLLING_NRFLAG while polling. Reuse the same bit to define TIF_POLLING_NRFLAG. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/arm64/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index e72a3bf9e563..23ff72168e48 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -69,6 +69,7 @@ void arch_setup_new_exec(void); #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ #define TIF_SECCOMP 11 /* syscall secure computing */ #define TIF_SYSCALL_EMU 12 /* syscall emulation active */ +#define TIF_POLLING_NRFLAG 16 /* set while polling in poll_idle() */ #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 @@ -91,6 +92,7 @@ void arch_setup_new_exec(void); #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) +#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) #define _TIF_32BIT (1 << TIF_32BIT) From patchwork Tue Apr 30 18:37:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649867 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21B0417B509; Tue, 30 Apr 2024 18:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502309; cv=fail; b=B69Arf/zkiSyKb03AsDX4iPkrOtQrdhQOGlhQHhRi/L8k39HJbqGm1KAMtYwOfoqmPPKqODn2mCyt1yDGVTrNjXAoo59vgtX7mOjTl38rA65tKudLUHU7p7umt4ltBy6iTj9nsVF/Pvl66Y9LLF+CB2pcaCIYFXXaeyyS45jLK0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502309; c=relaxed/simple; bh=0HC3Oy8V0Ibd8uWiTBvva1JyLZIP4eTtiWSq9DL1o40=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=sffG7XpKpWXlirYYSCpGOWu5vZAyJOgb1uYe+DKQLIFbAYlJHjuqTn1Rw9iCRFmfpEnqxnC6Lu62PWnSD87oKCZXdIuz3NdkWMGAC3IToHY+KHNhkE043D+k1TvA1Mw2cKJco7ri4Ih6xoMxeMJj49rREKsYDWEfRlJFCqZ5wXU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=AnkW4YDC; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=J09BEEFe; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="AnkW4YDC"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="J09BEEFe" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHIbDv015449; Tue, 30 Apr 2024 18:37:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=n73fTaTDWK899CwwgEbSj2lPuVttzM5z90YLOVqfO3U=; b=AnkW4YDCW6zm9D5NqO39HNZIcwEVaHKOYjySMiwiYIE9lwKwjVBKffhuH6MQJImayOBh S9qsoICBJqvH2xSmH2a2pyR0gy25jXQUiBynoLYHKe0Ov6DuIhJ/28plw7XYJwv0JrXc EeAzyZYKPlmuYKevopBIUafzmN+IH54At35jp9UvSOg+LVUpSAfyPVlg1EYAo87KLtf4 P/xeh4SHfW+8EFNue1T514XzvaGizYKQUi5qTM+fiDAnDjMMBjmNTqUfM6K9VUziVuQq 5dDVR2J1IeHao1DHIy2HophOU8/2lJnQilHbP5PYmFgfnirDPeYwBdRDJMuZxj7X+/MF Gw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr9cnxgj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:56 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UH3ZUi011336; Tue, 30 Apr 2024 18:37:56 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt8cffx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:37:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KMaAsPBoSvofRBpRHTKPXYyTRHQZKmbsjqgIoubwoQT+kr2etkHJa9UQGk9I6s+UkL0Dpx4RXfA1dYZ0Jm8eVQxty3WvMNem7kse9HC2AZiYZU5TzltqRykq/1FfEN+s2wWYdlxPDXYHDWZohNu/9LRFzLnME5VZvGTsZ6GWYAD92+Kc9MRMgaiH+WACHnK3f4mLr/ZmWYQnQq8PHwE9OVUAMyql02Hkl0QWGgS7Hhe+4s4mMNBRMkYfJtvrWn4OEgudhazCpE9D8We7dkcgFDvUeBJ5sufxjbo40S8Qzga92srrcMSWbUVM6Y9rhqoTYRyTBnL2TSlhBJJSVVw7Pg== 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=n73fTaTDWK899CwwgEbSj2lPuVttzM5z90YLOVqfO3U=; b=YoWhTX3UD0uwa7fR2+DbfEuG3carlVZunmp6T1vbXXzlVAhPY9iSIFNhJACEjhkdpYs5zHF/hbpA2AdcHEeJXqB9o+cd5bxjkcLBqu9I2owHGyA4hm3yCTL/Y3xOIvunhAXmhiFkQqSCugz8xKNikL5U9ruQzPeUmNJW/KSEIHR4IQVh6W1MsGVtF51hTVSaDojijea/6vzowwmtDne6CSjoYKoJiO8B0s1A5FiOLR6yJJGstNuySm2kbNau6sIYUdiwX/smIbcx94CzFlJvEeTXQHmCja54ULXPe+mLDkdoGKhV9x8O0I3YzUMWTDbaZh23VDYwhfOIXuD3kY/QnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n73fTaTDWK899CwwgEbSj2lPuVttzM5z90YLOVqfO3U=; b=J09BEEFekSUz0M93vdzudOfC47OY8Aw/RaU7NyPsKjHz9+atb6CTXUceHGXhTkNOJa0HOxWexXlwsBMOnuWiuWJJp8Qa40z0IK+58lLWSyEQRhJxtk5eJUYqKm+2HxnJRsjp+NfuNc6cQSVJkkTfmVyip1OrLX70jJ7H7XFrAVs= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:53 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:53 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 8/9] arm64: support cpuidle-haltpoll Date: Tue, 30 Apr 2024 11:37:29 -0700 Message-Id: <20240430183730.561960-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0334.namprd03.prod.outlook.com (2603:10b6:303:dc::9) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 43cf9dc7-bd75-406b-e896-08dc6944a562 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: 6LdFhwglhNqepU6yqsoTSdCnpKiuItV7snCCW0Qu64wDZ22PnmEejrE1al1JxmQCjmt7XSXRwsbdm9PxjUjMpXlgmD1S2NAswMDhpEsaakp45OihUq32od5vfQDEPS5Mn+1tPUxhqe2CG9mwDlqsYMMK64hkdVKB+PO479VGiIF/KQ01Z7Y0xG+xlfVZRxkCgzCwkfZSf8LAYuAWxhzAzv81E29VdJw3fB8ZmBV3esvVdICWgxAsoF3bEum4KswLmY/tpQWYXR4Ay+05AJ278X2d8xfrve1UGqcqvLmhZTz1j8lA7vUliDBV+Vfu7X+c3eL0pzC2HRPM1Xg2m4Tm6wLOI4cTwEQgBixibLyN/ysdNK41sn6IgpYlXGiz7lYKExKXubYBBIt+SLZEDd5nLUagdwTpEdslxkhawVz95F0hOMeK8xEe13jnzqAx6C/rSO47UZZP9U438wN2wDopNM4n/8qwwFX8gP7n3eE6RaS4zpD/Ji4GSJI9c0qebMjZ7lwIsmx5bHU0yY19RNrRtfFB/7/i7dEimGeVaAAZR5EYbRzbgAGTEa1CJcd3kB8ZfuF5KyYhdQjtQEe2AtsPiiGy8uFXsCr6BNjz74BNi+udAE8BdefoXCohwIUaUGBrb+iEs/cQd4Da+f2KbxVxvM7FCQuVxqry66KWmC5BGeuvRgUumFcKGTpj3FRfskLPJSFomkeFARbz4kqFean8gCOBROOH67FwpNSVWIt9HBy6ULpeNDasBJHxa71vp6KsNe5Px7szRhh5DIqtq4uhSUQrJDvXDTsrLn6nby+NSxwkrHp/cNe3UAFuAqgyPazQpSPuRy1pNtjq4P3qPOD4gVCR6dUjavGdqGlIM95zKT4b2o3sAX17THCDzVq3AVWx1jOTLuHhLJpB5GsBPoOwFIIJ1GJPaXtfsvoJ9Cai/j6iVpKpa0+YSjnAJRPhYikc1VLTvl4RsluDZCy08DQNpeKJZWmdG5LSzqCtjtonupW+Sl6iDYPB/zaOKaJaib9EcUa90ouqlaIY4r6QcPdKtmV8ilkhJSto9g8JX9Pg3u4y4JTn9K03SmdAbkiaoBENkchzFroO+6CHEaKg1rLh+uXtWHbe0IYZkGrNW6BwyLaeSfvdwzG6wDVvis3qqAfoZnGkTZkyQp/AY1HfZ4c4VCeVbvgGSaIGrpPLV9GxjpByb9Fw4Wg5+Wr91W7OZH0U7aoUhcFJ7wiRD5oSYw4OOAnNAHyGjTbUZw9xvSztkeYZ7B8CsVcuz0ysdqDC5w7/Vgj1qouY0PiF2mL0kzigNA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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EBuS4ITaWI4KRfKx0HORm75hdF2rspSb6+UPFTinXXppeD8cSBHrCuvbi0ZDXkzSWnvwluYO0HWtulrC6xwfxB7RNEIJf0OXP4oOMhpxz5biDI0YDZoPfDKQmku5r0HjHM3J85mayGu3f5CMnb1d8+eRl77fmiTAHGYxYO4vOk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43cf9dc7-bd75-406b-e896-08dc6944a562 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:53.4218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MOqZs0X4Vsl51wpB1AHw5exGWvrCeRqb3lV3XucoK4L29iPoQJvX6XlsQBjMCBQjzzogtqxNy+40iIf4wb+xBUKuvw+tqbzL4UhQ0Cc4YOY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-GUID: Unu0M4hw8FftoV0SKgs_ypO1t1R3gUE_ X-Proofpoint-ORIG-GUID: Unu0M4hw8FftoV0SKgs_ypO1t1R3gUE_ Add architectural support for the cpuidle-haltpoll driver by defining arch_haltpoll_*(). Also select ARCH_HAS_OPTIMIZED_POLL since we have an optimized polling mechanism via smp_cond_load*(). Add the configuration option, ARCH_CPUIDLE_HALTPOLL to allow cpuidle-haltpoll to be selected. Note that we limit cpuidle-haltpoll support to when the event-stream is available. This is necessary because polling via smp_cond_load_relaxed() uses WFE to wait for a store which might not happen for an prolonged period of time. So, ensure the event-stream is around to provide a terminating condition. Signed-off-by: Ankur Arora --- arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/cpuidle_haltpoll.h | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7b11c98b3e84..6f2df162b10e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -34,6 +34,7 @@ config ARM64 select ARCH_HAS_MEMBARRIER_SYNC_CORE select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_HW_PTE_YOUNG @@ -2331,6 +2332,15 @@ config ARCH_HIBERNATION_HEADER config ARCH_SUSPEND_POSSIBLE def_bool y +config ARCH_CPUIDLE_HALTPOLL + bool "Enable selection of the cpuidle-haltpoll driver" + default n + help + cpuidle-haltpoll allows for adaptive polling based on + current load before entering the idle state. + + Some virtualized workloads benefit from using it. + endmenu # "Power management options" menu "CPU Power Management" diff --git a/arch/arm64/include/asm/cpuidle_haltpoll.h b/arch/arm64/include/asm/cpuidle_haltpoll.h new file mode 100644 index 000000000000..a79bdec7f516 --- /dev/null +++ b/arch/arm64/include/asm/cpuidle_haltpoll.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_HALTPOLL_H +#define _ASM_HALTPOLL_H + +static inline void arch_haltpoll_enable(unsigned int cpu) +{ +} + +static inline void arch_haltpoll_disable(unsigned int cpu) +{ +} + +static inline bool arch_haltpoll_supported(void) +{ + /* + * Ensure the event stream is available to provide a terminating + * condition to the WFE in the poll loop. + */ + return arch_timer_evtstrm_available(); +} +#endif From patchwork Tue Apr 30 18:37:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13649868 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BF4717F363; Tue, 30 Apr 2024 18:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502309; cv=fail; b=BZrajDSl869AY58VG21OaEGeznFALcxnqkUFbzIjtcDJGr848myledg4Xh44rFYPSEZWbkdDoNVLiAXwoPrPGTSvBuzzNKjm34P3wi5wYBlTq74gbxaXscGDWgRRCcbVVoJwiz0bM6Ja57Vr/FuP8PfNoLIkADl3O9dKsoRhW48= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502309; c=relaxed/simple; bh=gKnLz346lLastvUCDmG6V9AtUq8MXiRM7Btvw9X0rnA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QcSpjXCRd46Yww4uw8EQ8lw+KKjKmDH5CHRZC2cvHBaXUzxJOdAMB9tZGVtu45yjwKwYiR0XNMmRx0F6dGVcCFDyvA7XoNwP1UfAueAHuO4tF8N8BAGyTBg6vVa7lhxY9pWrTXhlKnZqrSs9FUr0axMX9CKifHCWdmx0aJ97KtY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=ffiVkPz+; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Ep2WLv5D; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ffiVkPz+"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Ep2WLv5D" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43UHINnB026804; Tue, 30 Apr 2024 18:38:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=9Sv9yijDN1XGvCdbf64quJQL8t5uud17ed9RXYTLfTc=; b=ffiVkPz+Nak5l7NEX0NNXMyj4WtwZt/YvQJygfb7LKG9tT938h8oAQ0wso43oE19a5Z6 EOAgn4HJEZTGpXwE66TsyCovzmxvDfzWUHtzpIM8OdZm0xtmHsIIvo4RLS7KJTsqT97d aIsoqjBbIBgTgTKTijI6dTbA3jREhdDqpKxPY10XkpTTzyoBfFJArEu65v0fEz3Eqvy7 d0q918V0dgzh8MHyTx11U6K1UbYQiuTr9YhSRdlVuA/QsrIoEtNiyyo733GYAw1NtXwa UMRIJ3FudHFi5kg2RGEbQEPxNC4j01Qv0yeC4a4iViZdPUcxCxss2aBLRRcEnk3G2Qxl 3w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrr54dukd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:38:02 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43UIHWWI005127; Tue, 30 Apr 2024 18:38:01 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqt7vk8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2024 18:38:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WYn7IaYgXBBA/UbXcUA4EsQW1oSxYdoLxMiytukji0qoY0Ifk2itouom+qJKEPmqfOidyIVA4udpAYxK4jqSKPYQi9Hs+ZrQ+FORUwO82j+eoNX7LGeMmlKam2ZFyG/S6hBhff+lyLaCXqMF70t79tEAw28hF77Oz7Lz2f0sT+BgQ+FCTYNof0RmSBcPZTB18Dc/aZHNwA9m3yVIC9qNIBvBa9JT3TE7WfoXzW9B5nNDQX+IN3uK/bj1fP9Bpj/MN5I1hxOI5nIAGStad4zDuPXFNwyCtK2E2CHsMmz2sjk+joMCxTmUYLPSkZHIYolB4njYD9EUXEhh/xxYDWdaNA== 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=9Sv9yijDN1XGvCdbf64quJQL8t5uud17ed9RXYTLfTc=; b=g+fC8vrQTFfzAsoTknvVkIao8oxYhP898yVKP69aB8vFZREUX6jcTejV/pF9qYHFTjjYydnnlZQigElQiNHiIiXmT6FL3Yzrl9XkT5oP0OWMVM+VKqB71dEsI+XJmm0tl8EZDQUi/c1FpED5YDciPXjr09f8tQ6LdTMj4ep3Yb/nvpXIof1RV2SJ+1UZiYQee2ELKUxN1Cc2dUtHwr6XvL3ZswAOZF2RmcEixB8QbCuzEi0TWV8yfboTb9HPr3o37xRybkhptIURyRH5tIwE0DYSCMQNvGYBdQUS40mf4JHKRIhAivOSxTPonclavztyf2uPUwjxJ+WnjYpViKcnDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9Sv9yijDN1XGvCdbf64quJQL8t5uud17ed9RXYTLfTc=; b=Ep2WLv5DL/tAs/a+GRGxBhdGbtg9LpvHgjkTV6rrD9KVD9wPM5ZjcWcnP4Cw/m+hKIBhzbbBHie2SWN5YH1Yd4USn52h8F0GEtk1LdVBhTrVM3CtJ/DJbfzSro3bX3x8CzA75tU6m7LWd1lzfcyZOK/eu1GiBTl9VVeEk+FyaSU= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SN7PR10MB6308.namprd10.prod.outlook.com (2603:10b6:806:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 18:37:58 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::4104:529:ba06:fcb8%7]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 18:37:58 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 9/9] cpuidle/poll_state: limit POLL_IDLE_RELAX_COUNT on arm64 Date: Tue, 30 Apr 2024 11:37:30 -0700 Message-Id: <20240430183730.561960-10-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240430183730.561960-1-ankur.a.arora@oracle.com> References: <20240430183730.561960-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0200.namprd04.prod.outlook.com (2603:10b6:303:86::25) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SN7PR10MB6308:EE_ X-MS-Office365-Filtering-Correlation-Id: 449f83a1-f209-461e-0164-08dc6944a845 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: nfgT+uRheqx12Pcl2T+dhMc+Zg63wyJD/damKEk96ZhH6VW7iJ7ER4d4Z0UofRkn5QUsVadpNH01D1eHU3x7EJ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o+/Yq3wtKmfSEJ7iSmC+UvtHIPFvVrNUfRw0mlzU4TBxq6R+EJwQDQyT3g2mzqcU2bT8AlIGqL5p+9h/kTTAXdZ4rTnCNo8qYCeyMIndoaZQ7xZVA/zIbp8T6q8kAKZB6Bdvef3M1Lt757kkw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oK5tsl+Xm7Dko1Gdgtgn/LXJBOy+/svcQdwRSIDlhtxoXwWbWdPN/8Gd1qkX4luntRuqgg5CkBdyZlywWdyHcVa1FyYi2OShejm1kIE3s6/AGBKHwVARMqqehHHeq2h00VOOONzFwHQMesDqKehcl+3kWvqBT86LZiLVfd7mrTKNdhYvUa6/jaQ27YOSWeeF9VHS+xwvI5jkiC+QWL3SSE8q0F/223a3xr+h7m8MiBZEed1ifHh52IiUxOq/saAxwLnGNuOb1rvwBssBc7zidzVgevajiI/JqqMFDRF272gchPd6f5LLSVdAFqi89FIqYANMFFdR//uGOlXSAHPOsLZqTU8rSgMG8OXxXbnqjcXkwe/qnQXYZXJI/SE7a5VC7zWw5Rpl30qI5jVrfKu9OsRzA+HDHTRXyi+AQtaLI/Zj64CWa84N2SiM3eTP9Tafqr7mrXYzsDmWFqSe2DOB0m2iz7GQsQUEW8XIloZ0y3M63w2kl82luY6t/BGth8sFTh+acll1U2UCZMl9XfOZn7h8uvLyvsZ+SQwBE5H6I5ElzMkWxbGWV0kXLcdmFDwsaxn8XdHJxEZ8nz0UmfgXr28wk7kgR1YF1laQh6tbXvARJjW+/rZeTUP8//BCrYCbFDw6c4iQqrawaqv1qZq3ZwaJvHC7cA8vhZauXp7/7Ebsb0Sjfm7c6owL+Bsl/nM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BPOq8ZfAPagmRgqiwzhuxEHTYdlnphPYGTJe0kQMTCRaflrxcaw8BMDgxj06Fi0hNe2JK0omjFuwDfPPH6gRidxb7tmfMGhhhZJdinpL35ezX8sVFd3nsjEGXtzHKAZxq6JLMrmCZU1uUuzw5JHlJjv6GHuyhrCWoe0DbK+sws1xN5Yxsnqa3qZlCqGnxhrxipNyNKdW5sdJpL0m0D5QQkjjNl0JZYN7Zdb+v7ssyFrY2cYOFwhAa/wILzFvEpWf7ese0HMLADfq8tOqkGdqw48tQ9lA+OLSkP1T1W1KTCYC3pGk9Vcxxffo3jueLBz/XJwojq0qJRzo7ITwvPKqHyPE0mMC0vK+wo19mC5LWy75iJfwkRGB4Qa6STyWL+1YjBFpAT5FEBEKKx3qOqzJp9h2sqlQAxGaUsBiZ/9m98UWH1GgNIpIjQkTShJmyxQSL5q0aQi5i90sL/T7UtMs7uWYtc+vGe1eBLuXl8nbEhjHM1XcQziYn8tMNyhMSeC/7NqlW8v1vI6Tn8sT6G9vkejGY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 449f83a1-f209-461e-0164-08dc6944a845 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 18:37:58.2531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O/Uhd4eUf601epdBp+Ib6lzn008ube9W9oAV7pz1Zm0DPryvbeFJcThWxYxTeVoOGw3Sq2DejQ5lbU0h78a1Fg/PcjR6XoOyvW0su/2ZGlw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_11,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404300134 X-Proofpoint-ORIG-GUID: V1oLAXowiiGx7BQXRAD6b1HlqZHfZhjI X-Proofpoint-GUID: V1oLAXowiiGx7BQXRAD6b1HlqZHfZhjI smp_cond_load_relaxed(), in its generic polling variant polls on the loop condition, waiting for it to change, eventually exiting the loop if the time limit has been exceeded. To limit the frequency of the time check it is done only once every POLL_IDLE_RELAX_COUNT iterations. arm64, however uses an event based mechanism, where instead of polling, we wait for store to a region. Limit the POLL_IDLE_RELAX_COUNT to 1 for that case. Suggested-by: Haris Okanovic Signed-off-by: Ankur Arora --- drivers/cpuidle/poll_state.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 532e4ed19e0f..b69fe7b67cb4 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -8,7 +8,18 @@ #include #include +#ifdef CONFIG_ARM64 +/* + * POLL_IDLE_RELAX_COUNT determines how often we check for timeout + * while polling for TIF_NEED_RESCHED in thread_info->flags. + * + * Set this to a low value since arm64, instead of polling, uses a + * event based mechanism. + */ +#define POLL_IDLE_RELAX_COUNT 1 +#else #define POLL_IDLE_RELAX_COUNT 200 +#endif static int __cpuidle poll_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)