From patchwork Fri Aug 30 22:28:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BB97CA101A for ; Fri, 30 Aug 2024 22:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rbuyqEwZ9kCiw5l0O3EjN14l2WDqLsKvyF0jfbbj+zc=; b=NrEnl5EvczYZsjrht3VzAESTMs ulU5PIJ140odmEDbHYvzhGlRgGX9q96kUAWZbe2e7DCgw4m+/oYhc43JFDXOzFib/aRxtryYS2UGu c0KWO3cI9DUixFI2vhWqBj/8NdjBwh2TMRc4WKF4oFQDd8X05saDwoEMamxLgN1IVUYL5EKCFAOpA I5ik6epAnBjR0+8r9vIVqvyMN49i7dhKxy6R3SUrGF6hii1Xq9XH5BpPlRqjjQIrEm2L5wgKN0fnI 8dToS6CwAM2nG/aWhPyNp6QPMIem6RQ65narhA3hFIKWxSRwp/On/4wWyZBGmx1Eg1QkSlt+uq8uP qjHjnBlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skANN-00000007wXE-37cG; Fri, 30 Aug 2024 22:45:53 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAEP-00000007v0o-3YbH for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:36:39 +0000 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMQJED002403; Fri, 30 Aug 2024 22:36:15 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=rbuyqEwZ9kCiw5l0O3EjN14l2WDqLsKvyF0jfbbj+zc=; b= OlA31Yer4jv/6q8s6pW+TgO3yF5SNB11UBX3BTxq9jAJLAUERLsitGTLKn8BecV2 KZunCqvJ2VHq4DR79rBgM2qxfO3X87XVm7Gv0oDzD+9StD7Lz9X9kHqQgLV5NDhu aZEIKiJ//UERCAbU31qKC51udaLfrnZVPC/7VTVJpNeZkqQARJlcVIv51lts1Ufq 3fcdyW9oBlSFjdTclv5P8mDRL48eMCmqcb5s7KeDS21GfwYzd3wt7uVBHKghHkPN 2pw6Zasx0KFK+QmDBkL+3gteWIuhuQbfXf8g5/+2NiNe3uVBhQzajMoTmMivyDZG A0xYmzZCDCTehAGuR8zKLA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bfjvgw2s-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:36:15 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMDwMr016875; Fri, 30 Aug 2024 22:28:52 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2045.outbound.protection.outlook.com [104.47.70.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 418a5wya2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=apb6Rh40/Q9c+PkTICkb55rPkZ0VVRkAHzxhUrR/VPQoa1Bkd8eyIg5QrrxZhNrny/SHyTSgWf1DSkpYAfAybvitDBiuc6fPP2H2dEkG9mK3eCa6HMYDK3plDqlfNHDq0SObKBGLyJhfpfpFY2qMhybXqLbW5QroB/35kugedpCFPaf0Oje7QYSYiWtiKLaXjX6b684eL62WNG9vhCY3YMeF+EJx8akj4uL/ulh6ItnwK1jVWW0y7+RaUOHRyPa89wakklkTGXkq7Ax1DW5pxzcXdZ/ig3dQ9a85frDc5t9yKt0XZMUwf0ne4HghvA4HAaS6/9YPJwanqY+lllB/fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rbuyqEwZ9kCiw5l0O3EjN14l2WDqLsKvyF0jfbbj+zc=; b=XjF0dj6XrNMgk3eFFJaetiqLoku042lFNOVpCiMCx0gKHifyf4cRiQ5zpMr5xDF5eLlrHllPHziAx5CroUVwk1+Fks/VyBVRi0CJ7V0Y17o7GQ59RLf+PLuFBfRGeQai+dF/5ZNHIlF7baW+aIxIL6a8wnaGe/LQGrb1TN1x+LzuXekI+3afe3NBoUsRzLScKOkfzacWAH2KCfjIfpV3B9XlaBMg2r/axgos+wf/z/qPmawnR5wRIWwwx8vUIAI6h0NAGtkeNIEIQHyNEkVtQClL7Knu7zPkDHs6Kc83wyolOnKaSkFA5606a/lRgWssjMPfzQMJfwVFd2cG5fh4+A== 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=rbuyqEwZ9kCiw5l0O3EjN14l2WDqLsKvyF0jfbbj+zc=; b=OEjhN7KubFH7Mwbjf6nP2xFmM4y3MRnw6ZskIgpvVbRAvse1bAn1I1VDYtiNZ78mYWfGT2f5YVI8O02y60IWnrjkpoZZDHFsjChRvYe93Ss2F1yT/OVSmIeCfYyyWfBgRqv1LlmcnZuKo81ESmA3BqeXCD1K8IaFJqWhql17q5c= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:28:49 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:28:49 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 01/10] cpuidle/poll_state: poll via smp_cond_load_relaxed() Date: Fri, 30 Aug 2024 15:28:35 -0700 Message-Id: <20240830222844.1601170-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BY3PR03CA0006.namprd03.prod.outlook.com (2603:10b6:a03:39a::11) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: 14a002e5-2eb4-4f3e-bc10-08dcc9431dc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: Hk2DJzMSgwHs9cbGXF6tj1VeWdyq7vMQys//7+CH4gWPiOnTOTDtG9iw7w62LcVlz9laVowo/TrMlfDXAjF63htKPmaNWZ9i5Aq/A9o1DAeQyWM4vhG7loGqt8u3/Pz0Ad9p+ADj0YdPug2WLKFyIM17bYNRW4paERcgyC0KxyXL7lLGErSQ2CrSq8PJuOYwUXsQ96AySgHk7GmvntsdoEU99DTX0Xtg9yycDUI0BxZjXS4F312OBNbD9w0h/nunEZHB8WbVIVmq6Fb+j8O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thQ== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aPDrg388fopXXtA1FqTDNj8Aw5VhLi+ftetaTzEHksGvD99CeV+yUOGMvHtHMvMoOEK2CTNBoZUQ4lOzTWkuqH5acABoBLFRu5IjykPmYhMbLc/2dXmHuq3Vki8scJ/mdjpOw2iqHChDhu9cHjXDRVdH21sDCGXeB7M7Ods3MCrxc/62vMbdXgF9ndoY0WO2UXPb0tYC+TUDkceAdkIitzfuQcr4Ntq0mMPJF59sIw7EEZNy8AtEyFpzFFautxirDVIDxc48CP+tR43O7u+N6YS86Os9uY3zYNmUmaozCXlxQu7XtoenN2J36Z8hMJ6tDkOdKXFwq4pUlABb0RbGFFOM1KeLSpgETfRaNKc73ZOz2y5zYY5wbYcnB33At0K08kfT05emQN0j6KleIIznE1Fkf1xDYIf+Wpwi+HYMDIGrp4DpmwJd4+7jvN4tS+ExU7Uy573JTSwbv/XaNdRpLIpgHaK+uuTNrPvPdG/N1TF5yE20mab9xV678dKpl5Cai1Cn/XHW0L2uopHE050GfJrKLd0fu1hgKkDtpHKbGSxzg1G9FEbHqcyYf79ZRX+FsOthGUViCcnsH1++0vTOVMAjjLhDdHOet0NY4QzjQdGz5ICg9QBg4RqlHTGrq7NZsvTdO5IdkFwO1MKuiuxg5nPc6AoXVYr5UDkwcY3suMlsrzOX98qUeUZR6J3j0kPjzyodGOGfkvCw0IjR9uVd8KwhRyyaR3dlbQVb9gKMk5BNiESKDchtiSG3fbKAYRmiKlEfJDNOLloiaP5x92bDGlpYUbhbF3O+eaf6kTpiH5/hT+fmMyK2M0E7cifL5X8/Vdo08u9wAdRbns17AJRYSJ2gg3lv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gTnS2Dq8hknv7X4itQ1bd9PVDh2wxbsFEJk1faaCn6qNkFYRd7h8cPduKPr0ww/Gq+Dabr2iKI3nA63twyp6empP+cf2c9jFqu5zmO1xP4MRCIjeb3BjK5nIGIAPo+Rjf9MqlYwGxL3RkALSFxEtOlgJxC9hxrRbrHG8z5QPhQ8iMOJGy8X0OL2mIm4qItu1uJ5923quFz9Sde7trzCsJ7kmHfYD0w+hiJGPClg1qRtpQSCjoXYhfrGRxxGURYoY7RFIRtMd9yKWn41Jkd8QXSX9wzj1pa9XlqXCdkOq3BYP8XYOHqbXvnfM12Yk1QAXQBkaeuLmJhIjX6xk/a1B99hWSCd9LmttzfOkhfMZHiZDU64JY5YX4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14a002e5-2eb4-4f3e-bc10-08dcc9431dc2 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:28:49.6458 (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: I2Usy6InFBD+2RiJ/rm7AfbogHGl3f46pbVXtUKaBrPXuAC9uUiAiiV9ANXQ+xW8rIjBOwTB1b9NTi9jdb5SGb9MFog148eR97hPVXp9QuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: XgrMviXRTQyRaCWpL5k8Cv5LSY-fZY2i X-Proofpoint-ORIG-GUID: XgrMviXRTQyRaCWpL5k8Cv5LSY-fZY2i X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_153638_045280_59B869AC X-CRM114-Status: GOOD ( 18.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. To minimize the number of instructions executed each iteration, the time check is done only infrequently (once every POLL_IDLE_RELAX_COUNT iterations). 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 defined optimally only on x86. On arm64, for instance, it is implemented as a YIELD which only serves a hint to the CPU that it prioritize a different hardware thread if one is available. arm64, however, does expose a more optimal polling mechanism via smp_cond_load_relaxed() which uses LDXR, WFE to wait until a store to a specified region. So restructure the loop, folding both checks in smp_cond_load_relaxed(). Also, move the time check to the head of the loop allowing it to exit straight-away once TIF_NEED_RESCHED is set. Suggested-by: Peter Zijlstra Signed-off-by: Mihai Carabas Reviewed-by: Christoph Lameter Reviewed-by: Misono Tomohiro Signed-off-by: Ankur Arora --- drivers/cpuidle/poll_state.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 9b6d90a72601..fc1204426158 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -21,21 +21,20 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, raw_local_irq_enable(); if (!current_set_polling_and_test()) { - unsigned int loop_count = 0; u64 limit; limit = cpuidle_poll_time(drv, dev); while (!need_resched()) { - cpu_relax(); - if (loop_count++ < POLL_IDLE_RELAX_COUNT) - continue; - - loop_count = 0; + unsigned int 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 Fri Aug 30 22:28:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CC3CCA101B for ; Fri, 30 Aug 2024 22:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rumBJ123mj0AOjrTxzTEs5lY7DqFY8qwAn61RRWrZgM=; b=W8Tnfzx7tu90LoSX1IC1tpQ3UB 78BUjTrpF/FlGCFyJ2aTyW4AkA4MEtSOCdoxvu6raqXasGrua/o2Uo0FFXBlC+iN7g6fr5ZvCAiDU FTbAk92qNsUjarik2AqBz6U8ZRFVMvAP8Dgxjj5Jp5lMAk6BV2y6sQVct0IYBQRWYppZAysfMP/MZ EJ6VCTsq/wkOtwX4FFZVc0RVNaEAUR1OTD5qNnkjTD4UaIqPU7GB3tlqmuXzMBx14PkET2RzmV/kW oEEEHdtZ87QyNAH15HQRiJmwCfhwz1dfwbsIpJ9FADXZTCt+R3uBPXy16VkuhB+Opv9eHCBIuEUv1 9w2Yvmjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAMY-00000007wRJ-3Y9h; Fri, 30 Aug 2024 22:45:02 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAEN-00000007uyt-1Zzn for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:36:37 +0000 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMNAKL030649; Fri, 30 Aug 2024 22:36:11 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=rumBJ123mj0AOjrTxzTEs5lY7DqFY8qwAn61RRWrZgM=; b= AJssfwVjjLDf25M+uT2wt0R1cHtVHq9ZVI6OAjv65jZ/we2IitS1uo7ap4z5x3Vs 6/19Ogi1cQzp3dVsugSQZyL3PSzfWiH6hRLlZ220htYSJLPMwWE4LBWqNbR9dLig xpK8Gjo3I6Oev9bUEF8SJfy9+HZCH5mQqTo6sXDigKgNtb3dIkQY4oZFjflv2pQm g46i1deINZeDcj6VC4k30j6Qyl4HJTg+ghKSD+YLEGvnPUtf7G2QpPITc/P7T097 LQs1j+eTdLGjeLeE+b029wH55PTAodKtBFSulaC2Wza4CeNftRY70DfzT908rSjI DPR9RSG24SymT5Qom1N42A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 419pugyr9f-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:36:11 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMDwMs016875; Fri, 30 Aug 2024 22:28:53 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2045.outbound.protection.outlook.com [104.47.70.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 418a5wya2f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:28:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TOEOmoB1a16Xli0MveJFv6uy2Sm4sRPjco7NK4zytyBPA/rRDGb469bYdLZyZk0sigNX0rUQzi8hD/0CkVeSrUJnjYdU292ESV6LO0wT/kVZG8sSrsHRKNa/5te1fsAOTmv/FEdMn29xOP/qIEXxBr2cqe1yY+/Cwj621DbkfW4uzEkTQrlQOAp/jBsvEZnLSyzCtdeMpDiPKn/Vn6aXZSIYqUNly2m6fPMKnowLyJrBZBcz2IZFDlTeCE5FMVvfxar5lDCMCxGGeXzfnKf1NuTuRcJ8KdwS8XGOwW2tDGF32HqB6/IwdJe3cAMeOu1PJVIY2ESFXjtT7XDnhIxTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rumBJ123mj0AOjrTxzTEs5lY7DqFY8qwAn61RRWrZgM=; b=W06ItfAeQvfnSzRmaV8Ctv095sKOk3ZlRMGrQVovAuq6uHOGHx26wsQKYUKKBez67rpRGr1z0VL5wdMo6C/pUVcKHM836jft05D55kgewHNgULRu5pOHiEwcyykf6g0ecCKq9WfA2XUJzfBGZV4G8183gzDlH195/omIAy4rJBKeMf24LBVkcIGbmd8ee5R4bzHJwsM8diDWyoq9X0RKlyDsIJYvrT2lnenJsCDuIyl8c3I1d2aHL1CpmUh7zhOIiK5AcEg3ZjMFU04meP+khuUGUERRatFAMMlTJ7OvzpLuIEmPikY1pZPtBHpzIn8+tgvAAm/K3gVj5IjlwvHRWQ== 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=rumBJ123mj0AOjrTxzTEs5lY7DqFY8qwAn61RRWrZgM=; b=Ha8lQxB9FgdQid95/LhcCx2d77b7qRumAykiBATSHLcr0J0dVGh6BxmDmvA4kLHQ8wm7r86HwFigQ+IE2hvawgLXUBUI4DVWX+xMCr52jw3dqMudX9ZGNyHstmLBf/3Xr0ltkZ39nJ3nPwqzrKpNZ5aaYlpK97rkpofduME3CBg= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:28:51 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:28: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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 02/10] cpuidle: rename ARCH_HAS_CPU_RELAX to ARCH_HAS_OPTIMIZED_POLL Date: Fri, 30 Aug 2024 15:28:36 -0700 Message-Id: <20240830222844.1601170-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: a07cac0f-eeed-4e7c-7e58-08dcc9431fb5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fxZUMqDkCKbORl+ztIr4XgG2MF8+nzNmvkBl8qk/JmN1EOhtauI0O5DKqxjljhRgVZ+CmCZFj3RslxYdkRSAiw8+IZWCp/wahNHEWPHx18VfixaKzAuKZbWdd2AV9/Qi+4w7DpeOTxnDkCcmNa73xiLc5KWnMJ1AunB/63TC+uhfSmIQSV2ABlqLc8iVvCR6KUmpkNUX9koRIYpzT5P+V9LEpUvyIdB4RuRcVkjGoMeC70TeEYVnPmojHFbu3cnqwLO+Pl8b4Lhxs3z+XkisV7p4wmKCX53NVZ/k7q67VkH48mL3/HqFeU4n44HLuQgdDL+6xLORKmIhBEaUROem7K6j/AJzsOXFumpmz6obVciazghq95oAy6pWE1LRqQ31qMO/7gTMHgmUlHky/MTh35Fxjus4vBbg== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8G3ilbNV0Ox7BbXJqbskLjsWqkL+6wqPxUFAMT0eNkf3onI1iKOl7gmfJ9ALwfXF4ppvqfp90KK8gBi5hXwWyzcqwxsD18MoqK+T4GRW2XplQ/+RHqdRe/NngpwBd1f98fwHYuEtn1G2GLFqdYzOm+Uz/yjPd0nRUPugvKQCZBSltP3L5UzPI4pRLLdNC5VGA2y0CBNR7FKmSWKlIbIg/cS6GCypm7waF8IVVDbjDR8sT3uMZiNMHjTDz64rDsUhar8/nw4ph5S4EznkLC4n4Rv81zxlUkvqJZV4c5/jMcrkSegaJXEH+ZINBWTQBkGL05SlCv2C6xxVHfRO7LVGM0uX4YAnt1PWTWMfuMXSYy4864lRYe1jIrJS4VhALYWFZtkVyQHdRRuheMsbQJ1Y0MYSUfQwrslqUvyEiIok6+fTdjyf7iWZwS0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AEWqkkEq878rzFzFRtOQCdlsccu4mbtye3F120ufNBCxtxyf559Wdg/4llr4SGZyRV1mV1v8pzJRH/MpDSu1KhFQdmIB+GCdFP8eHMnPxpJuoNw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6aT0dVhVGYjStRN7kOiEyCEM8dDFT903yp6qRCfVDQ3thG5Qdmi3jD5PiR4mpNndk4UgDlTb7KkP07KHCVEZhcvYKQNZmIRRPPV8eEPeDBferATPrUUWFkbzy+3UqXDn6WYzmdOdAFbau5mstpuQNALqYPUlMCZEX6pKW5SNrPdAymZ5QWkcUDgOj99HUejXHS6jA4o8/kgMMf2PBi/ZxaIfXeq/DLbNtCBkMfQ8dyomifzfVkS2QKb816ncHbQzvVUgzguv03H1rbEE2NzAVZHYNqvKtRPr24B5qNXTFRBoqTzCerOFIH9o7p70CKg/x2JGuF9YHz6ItKgPyA7zDMVfHocTpYoP7aLgqt8NTzyB+jDSob1gq1DbzqarNzXNuN/yRfivuv5uZt5AECGYRv8Ozj8kqAkl5/rw2w0oDOKtXDqbfRMunFRY9tqm+JiSb1uvPxjbTNXJvYvHs8SYh4578xm3V1KWTtAd/rB0GWcdOSrVxkRqjx1CoVGde49D/iyrsq5l+NaatRp40dLwrNHrOup/22lVGtZuFTnWAhm2La+Qb99NZ/j3HLQPnKBuI0d6D9s68njfnoM4rQ/rZKfKqcyy5UV5fQyQ9fFZhK8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a07cac0f-eeed-4e7c-7e58-08dcc9431fb5 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:28:51.3700 (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: DckVOwz9quvV90ELhBJith+ksxF5N9VvSSde5SoZ1SOfrihKK525mZFa5HN3Vja3xPkI4XUJnkQJ1tArbxV0v1DE8qfHbbRClN51c6dnprE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: 8gCfYSgDybX_XU2oGZnpes6XVUqabu7C X-Proofpoint-ORIG-GUID: 8gCfYSgDybX_XU2oGZnpes6XVUqabu7C X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_153635_658796_6C313215 X-CRM114-Status: GOOD ( 19.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ARCH_HAS_CPU_RELAX is defined on architectures that provide an primitive (via cpu_relax()) that can be used as part of a polling mechanism -- one that would be cheaper than spinning in a tight loop. However, recent changes in poll_idle() mean that a higher level primitive -- smp_cond_load_relaxed() is used for polling. This would in-turn use cpu_relax() or an architecture specific implementation. On ARM64 in particular this turns into a WFE which waits on a store to a cacheline instead of a busy poll. Accordingly condition the polling drivers on ARCH_HAS_OPTIMIZED_POLL instead of ARCH_HAS_CPU_RELAX. While at it, make both intel-idle and cpuidle-haltpoll explicitly depend on ARCH_HAS_CPU_RELAX. 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 007bab9f2a0e..c1b49d535eb8 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -373,7 +373,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 831fa4a12159..44096406d65d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -35,7 +35,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); @@ -782,7 +782,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 Fri Aug 30 22:28:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36245CA101B for ; Fri, 30 Aug 2024 22:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XpArr+dKlT52KzClTB9Imo3RBZnDHZrGgtFfqEqhxx4=; b=KRMoOy1qO+mnurex6icI5PqhGG 5EtQccehxoYkpzBaVtpLYNDRB0oroYGso0Dn9d/PJgjTLsP/M+8/5JporW8TwVYIy4dVqnB7Ch0nB /JOlgKsQ3Bg9h70vHY7sfKUNhSO6jtYSHTRCg1nTE4FTYWz27M5I6+Gh0yWdLpME4zsJ+KXXKCvEj fApaSQn9bPa+u8wGD69F9D52sf9CQiRw1V2+yU2bWg8DF4AW49oxG5WOwJvba0xTW6AbTm/Bk4esn go3AnGRHVbFgGl4rgESQ/Un5uvF/YeOmupCcrmKlkW8JrCWcMmswaf9SkEWse+4CZIAEd23eFjT/o RXvOPjWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAK2-00000007w3U-407b; Fri, 30 Aug 2024 22:42:26 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skADL-00000007ue3-0H0b for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:35:32 +0000 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMMdCe004190; Fri, 30 Aug 2024 22:35:06 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=XpArr+dKlT52KzClTB9Imo3RBZnDHZrGgtFfqEqhxx4=; b= gAZTT+lkRvu8+zCHZ9MHOQw5CmiIFUuCmy8uJkOUWNzK1sEBwMCkfjSv1L0N8kJD /5QF/UJKTOeYMnmsQR/fxmhHxn0wWnpbN5TjL5MUKuZ7/9u9ktJjTRirNTo+taxe nSsEBop0lge/eGqmq8kA28vq/iXH0qdIAJw/tWLk8Yx/ZZfmzEcrKxBwRXQCkLCV fxcQboqYoIVG6w5VJaE77Hw3bz6QaxEsS0OKWWLVFmL3iw7o5aRmsctk7qkCasfB /DVzcpVo9utT7XibdMVG3rxuP4P8DbE58IMtmo8jtDsSAwX72csqbttrZopyI9rJ gDRd9djzaxbAZTG5oMXFog== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bfgj0wqn-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:35:06 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UK7lHb020350; Fri, 30 Aug 2024 22:28:58 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2048.outbound.protection.outlook.com [104.47.70.48]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 418j8sb29d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:28:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mVP/4nWcnPyRz/L+fgghjdkcwaGePSWyGGHx4u8FzBqRmjnQfwVdyO64cwV88t+BIKWQXL5UBBwzCSUBhmxCspnyX3OOM4U9rjB9wAciXCzOKAzqWpUXhnaeOag6Ozj13wVOSB/GVVRw2f4nEctFtlRxYj14C7y0BnIZw5tOqEj909KvaTcGDBVQjET4X0gkIZEZknC7i/MQv/E+txdHHT+hYN4sZu1CMGl0FdRovCx+u8QY3pzRC/QF/KU0RAFraPC6uQa3lZtieqRiAihQMfwABbGpcZJVY9r0NBiwInNfeqifjAS92fj/3tg84EtiijDGIitUUAau4Ne+grSmqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XpArr+dKlT52KzClTB9Imo3RBZnDHZrGgtFfqEqhxx4=; b=aRx+HoEbz1k/JVohHG9E//nanNv6dz1lkvXmZeZjRzT5RDrpX5CxsRHGtgtZbT6O0J6q2qYPxBCdTUnOCafB6VZLuAWq376GONi9pJRp4F13SbRnk//DgAOmEz3KcT/aKsUBYdU1DgdnqFEWHsnxfjdu6PensOXtK7Af0IbK+Y6gHAryZSpRHtNckOocq26/Aud0jO6WolcglHaQ0bLfexl8iK6FJcqd64hmOkLp+JS1+xbxcPWp/u2JZXAk5fp9XXsdsbMJkHFNUNDrhVwwqLcPWiQblX1gBEtQdAVG75QlCgJ2bwSBQ4SeeMIDFx9MI38ZDg1AW+ShLqfcFF59aw== 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=XpArr+dKlT52KzClTB9Imo3RBZnDHZrGgtFfqEqhxx4=; b=kyOIOW8x7138qV0ZAA1BEoCPXgb4qtgPrwkXmkLFo3d8bHqPIvO/FIHi4x4IhHALU/xR1UIcm9biUwEgvt8mLQmuq7q7HFQLLR7NeZ0/1+Ey1ttJUucriM6sV3bC9J0fXMkmxafELjVYcRr1AkSrleb2kVvJGuzA1YgIdM0qv4w= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:28:56 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:28:56 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 03/10] Kconfig: move ARCH_HAS_OPTIMIZED_POLL to arch/Kconfig Date: Fri, 30 Aug 2024 15:28:37 -0700 Message-Id: <20240830222844.1601170-4-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR21CA0003.namprd21.prod.outlook.com (2603:10b6:a03:114::13) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: d452a2b9-b749-40ec-d53e-08dcc9432283 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: fbY2/ThWqgnAKSZrMp3+ShtPRKoU+95VB/3tTPNvDyK3/CgrcpgeiwY8kfVMxLoA10E5drTpZF7sfytdbt2gKb44Gc8EBvllD48V1oaDd22bIhey+Ne8VszC5ZFyjaFMTLrxI+CypzC3pJL9POtz5BO7/sV18JdN0WRP7oFVu0QX//vvP67A153daQp6c263JUmZF6Xv8Xrqml7b0jictZTlXJrgZFXLHEC12Tt2dy96kWYWhktm/XLaYlptkVPz9bFt0hWuWSuip4Qt6FFFWltoTL8qk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1X6g== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TlkyqKLeyzM9XqSWBxgCJU3NPKHlcBTqCCYzcXBPpNqtX97TtZtlNC6zUNCkFfIIwa90qT9McZN3fyhjXF2mvBIKuoij73cQulk29lTLidwtZxg8R9B6lH2htCt0TaCKy7VozsnWAlQ7HOlami9ktm2lZ0WhImQ5ehDhuENKTnS3b7OxhoZkNz5Y90Nz6rW5yVswphggm8SxhLmoF2d6GBVaNKJfbM+RcATj1/lAfM5Nwj1vGpVNlK8v3bOHdQADNdfBX+Wcu3vuyq9Ij1Azp4Vxclz3tVlhyzXwwQlmcXfTdtNDQhOIpoRf3ceGUNlGUN4l9Ukp3HMkJ8llDEnxAWSlJ8Dwxc+TORSL8lWF0XRuorXpp9ZtMLcX2Qw3TvaNn3qX/D0rdSRCZU57gSm1ORXyYVuw8tX7IiAL6n0LxQMCKH7cUwaiVg1udfg9cVyvXRrIOoPMP4cL7CkKRCw48dW54jlzvCzPcPMPtavCafycgFhFy6PvpTkzci64NxlQzW4j5xsXiGnoOl/2OPJxyacunZ1IpDtcGklBig5s0ey9Yz0WyJdjhElivtIQsflINqkWRW3wyYlMAo4sGoVu+SWm0vyCdxfSalOu9dIckxxyqk48ZueR1ysN9IDwEV0S9pIG65N6qmt12aVFSE312Oz9xTxhPcCJJ6Ob/8pDSLmQY3l7S03epu389FG3xH8p7+Xag0bXsKhxVOeyK5KvJZTcd0Hraicc+kyIDI+pPeK8azq2dHaCEeudn0Xn58XXpK9DA6JA1tWq907KB8nHFjEJFn9w9+dNPi9lj4gwD3pQquGoevbxfB41cGEmNe1szqaatwYlCHDbULuAmWzyt/te/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Kx1LTTw6MqmTGG8oKlQhAm4QmW3ibKjX/n5IR+s+KR4Y2hbVpZeyib1xRpxU5pahAzhap8tgfB3ZjhiphGqIunla2iM9A3q58NKf2PiMDqv1xKClpRF/oveXKnHbIJAyL0H1uInFiFmZY90eUzzElgHlycRYiJaj+ByG7fIq3g48+EMP7oUQI/qqb+mZBshq59YnxaBWbVUNCgrGWmPa5TYJnMsoPmCQRgjGqRJj+cJyhnK2NEiYGRl+ijXRs3nWPWHWzY6Mw7y0JlrQw/FOJro6o5wG/MkQlz889iqZDskOXtmaWOxV0wgQz2frE2ixZY+T3rHL9Z0Fg6D1bde6zA6yRitmGjzN0hELG5NX8QDQls4vfiMsE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d452a2b9-b749-40ec-d53e-08dcc9432283 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:28:56.0758 (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: I6bFsfsiwUPOoO8bJGmNrH4IAgBp4Z4ECgeNWZNCwsNtz387CKEOpkQNmDSdBKzyevYc9v5WmcBN1bhKCGYcoVRW/gEHdEN7lYTA8hwqKN4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: ib70haBs_1Wiuo1vt-SSg2hDbT9WCq9g X-Proofpoint-ORIG-GUID: ib70haBs_1Wiuo1vt-SSg2hDbT9WCq9g X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_153531_263729_E765C484 X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 975dd22a2dbd..d43894369015 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -264,6 +264,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 c1b49d535eb8..0d95170ea0f3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -134,6 +134,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 @@ -373,9 +374,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 Fri Aug 30 22:28:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC0F3CA101A for ; Fri, 30 Aug 2024 22:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OeVeoQh1HC5YBmuLhbUCgtLoCIJz4hhzdW4bm35kw+E=; b=P+Tp+QG9Ljf4RRMnU4fZCAFsjM McoZXdPSriudi2sskxDK7hIce80qLzpaduM12ePUzdZmSrhdEFTGfCNYfr7RgwDJJrHekkHea+gXe up1mq+vZ88qhJvgdFGCEHtOOY8+nCxn6oGowaIt2Yd+mownxr1s0RpJiOhQjCewAZ5ajKbmR4ZESF knNnC1+mkbIWIiVQKvkkoyqNgRDCGT1CTDTcySIW1Eg+dlZqgruf5ZiUnPk38iifakAVNuFerbyXL yGh07lGcv1peP17jLUFk7j8I7ndDYVDyDt7cQHsisocHiEXz1TBaqon2bbqN5xa6LWD5ExA0P657D hBTwpaag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA8M-00000007syR-191A; Fri, 30 Aug 2024 22:30:22 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7S-00000007sDj-376A for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:28 +0000 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMNgm5027558; Fri, 30 Aug 2024 22:29: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=OeVeoQh1HC5YBmuLhbUCgtLoCIJz4hhzdW4bm35kw+E=; b= Lb52HF8Bqs7aiqutuK5cL7N9OBzw+w7nrITYTZEfcxJkVmzTQyV7juPq84QbWJcM 87QdNvI0KGNnTJ7PzYGnURUF+hgXfRKcGLR+A09E0xN9RdPX3p7++Bz/FzSe90O3 zEYKXrBYFCec+K5IEzczciZlGdheyCx7yh9Sg/Qv76Ue7ObtwGa97Bfd4SQeQwj1 t/Ft24ppFwrMAXiMFKIROkku5l/dcHyF+DLo+wIqE0nFOmvO4Dv1Lfm8HHnAwMhR yE+y9b65URZIbBT206o3zknNMv7xlTIYiCSYLzVGQ976HjqgX7Yp8U7/mB7dPkIm KF3bGSb3o0pLxuf0/ILddg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bptkr06h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:01 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UKEE1Q036519; Fri, 30 Aug 2024 22:29:00 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4189jq3pyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LYOKBzqI5j07Kk+tHVYAQxW4yLvw+pYGCIwUddfEI+saEjVxPybM18d1qbPDNIrZfWE7G2OYSTrq1DBJsiD4Cy8Arxne/5371+9yt6TjEEesEbRBztEUSwDMVuMJyFh7xkKhkdW5Em0V/Pcd56/HXmwi/lsvHKDdR2cj+N2cn97FRdVpMM4DHnlPF1iHuWO1t/Q/3GVgKB2walHDnlqCxuaLmV9JX9MhwbehTxvgJo7WxWXfdzhpLipTKHJOnxsefrr/QgPV6iifOFglT9LrU/OnE8zwKVulQAXZxd/lEpUhAU3oY7qb75WNQKImQpSUD/Fg9ierX3VBk6B2t0T0Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OeVeoQh1HC5YBmuLhbUCgtLoCIJz4hhzdW4bm35kw+E=; b=gV3N+WaVwmQ48uKyGhR/6a04qgbK5Dq3gL7BICmQgaii4u/vDkBqmJZuGGVoFhK5bzFZaSUU3ieghhLA5wskTadf4/twHnoFpeW9ikdw5GbWnmLAGNf41cgNf7C3Nhof6SA8SnzpIEHvUD2BQV8qO1dauy6O5nePtD1uqas3Uq5dr/6yU2Yx+raNIRAQFnh5utoDhWL5eWUOOH55bNQwbpCxV83Rp9QKWFaEQEHWRy4KUJ/jVW2yHSR3TvA9p+rIfoIDTcYiYMsXdqdqrQDYnfafJJhoWx6olISP7W9HtEkkHOV/qrZEhkKJYtFvCacyHrgm65lGmBOGCaUkdrhWKA== 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=OeVeoQh1HC5YBmuLhbUCgtLoCIJz4hhzdW4bm35kw+E=; b=jzuE9I9XCjLAm46pwZ8/UDhVDmbqpY25OEHm4tMzNwepoAXWK1SQl6JkQg68xJXW87XjpOyV18QPBBDVOJMzrtLIp0RvLdlhOYCn9l4sOg51fP7rQpkLwxVmqULGylyi3z6mE11d9C2r3OOBXETYQiwUDrwvUNhHtHhwNtNo5cs= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:28:58 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:28: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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 04/10] cpuidle-haltpoll: define arch_haltpoll_want() Date: Fri, 30 Aug 2024 15:28:38 -0700 Message-Id: <20240830222844.1601170-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR11CA0078.namprd11.prod.outlook.com (2603:10b6:a03:f4::19) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: ae06b130-937f-4c85-fa67-08dcc943239d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: 3OZBj11qn4KeSbI60A8UIm7LEcLVEMgo/It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7xMbE7ayfjfVuCakAvH7gkYZWHq1VM8EzBYXQbD0bSB/koBL+i0iJNQMM2w4gcLNhvlulpZnWguSUDLSMpAZcOFQBO5dFH8KJTOM68YUkUK88Cz1jr7V6VwSmK+GmZgoxHBjDUPz64b3YUGt4sX6fc9BFZQ52tJSfOwg/fvkvqTV4v43sOl4FyE6a3HSm6inpNhGiqBVOaSdDSjbYGn9UQCjFKxMsrh3jwwV5c8Y+m8MnxmkPUZJdXaZktQ== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8iuSZhSYJXSaZCA7X6FJmSBjXln33fVhrLbba+y+JvlmKRpVxatfDiJLbLJ7/vHS+AqwWPCpKMfjANsTF0unRHeXMSgZc581BThDtOBBKXSBwbEqJjd8MAkyYixDc3oMolCFxt4jxkZ2vcX4mVc+mMNkUasniKtP1cniQLojHwH0/k/qqpcCeKF3Z4JvYHJMsI69fHT5qyIk48xjEc+2ib4k/ZRYATewLf/TMNoMYKtj4/TYEw7sRJ7hGy3EUc4W98GwDHtJvGhQsnDaRn+a601/kdUpa2fQdJScEanzBX6GiV8ZRyf6djU5YZxcxNVi1xg0VPW7vPwsujUqzhsU0Wz6ED+O1uLABky8BYBR7nZzQNphN3jDEbkXjk/CueawkEcmO6MFv1JFe9fMUBG+oS7gK93lFHy6WAjk8QxtdYUmMROQvOzHa73GSt2fzuT/df4XSkCvXF2hGprQEPgUuoR6VME684IalWv9zqKlaDU6wsTdu8qcwGATGXc38ZGM7kRIsuGbdTHxIqhcg/20I51B0OE2IoICHhy5JffJUdnbNZA1VTFu06kC3VTsprJleYLvJDIwg/q8DdDowHyQu7ZYERwrG+PkqLkUoA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0: FEU1b7vp4lXKWzBpU1DAU0scMv6Jzlg34SNr1N5+KKnRYJx6nC0HGgLytCXwUN+nmUTA9+TQiPAPjnsrAr0eEGDf1QICC6WnIIwU8TPAmNNr6O8PZsBtJhygjWEi9rEwgqX4CTtLUt5MXVaXKhnRLDyDXPVpCBZW0YPS2f/40gtORq4AVdoROiCn/qNeDjOGVyErvGLe2p0cpQ3H1evdHqw+DD//7DbVMf7RlAkzVURCLz4VJ5luYycpc2Y6j9/qd30QbVvoFdbpSOwWo2UjjO/QLWfr1pkdIeH/6WOyNjQwwrGR/vBurP2IuxY4kNuE3Qhcq2W6kSG5ssxKahSvnzntrrHxEoWca0bcC25+qILdP/c3TcYWGveEn1xiCcraX50+H+601/gT7ldqRQZCUsTxtb7TaVcUbUaPRGUO70WxyK85l4YAHSuAn2YfMP3pxuh1y+elyjIxW+10FoHKhPu83+yDQ0hBp2op2AmN7tIgXHDsTerh3DvTeR6y9GiFC+gWfydcAIFz/DBXK6DbysHGu7Ffd2c/RqeDzsTIj5s29jE2fLX+k10jyIbZ9cj0kFeTJCGpHsXonBm6FidJE8XXDHwn4LxBwQ95m9Ftud0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae06b130-937f-4c85-fa67-08dcc943239d X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:28:58.0805 (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: vg5NNBpg0YPOSRYjiqqhp/BikQUlSFexxkHJXKh3CR6QQBK8VZKBZLhRfubWGvvAipb+t9bY2UZlQDrTpiPR1NTKiFGVXJyk+h2td90QJ3I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 suspectscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: QwkcGUsHCJInD6d7qXTqZDe3pa0bQYbR X-Proofpoint-ORIG-GUID: QwkcGUsHCJInD6d7qXTqZDe3pa0bQYbR X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152926_798576_29F3E24B X-CRM114-Status: GOOD ( 16.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Joao Martins kvm_para_has_hint(KVM_HINTS_REALTIME) is defined only on x86. In pursuit of making cpuidle-haltpoll architecture independent, define arch_haltpoll_want() which handles the architectural checks for enabling haltpoll. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 13 +++++++++++++ drivers/cpuidle/cpuidle-haltpoll.c | 12 +----------- include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/cpuidle_haltpoll.h b/arch/x86/include/asm/cpuidle_haltpoll.h index c8b39c6716ff..8a0a12769c2e 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_want(bool force); #endif diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 263f8aed4e2c..63710cb1aa63 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1151,4 +1151,17 @@ 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_want(bool force) +{ + /* Do not load haltpoll if idle= is passed */ + if (boot_option_idle_override != IDLE_NO_OVERRIDE) + return false; + + if (!kvm_para_available()) + return false; + + return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; +} +EXPORT_SYMBOL_GPL(arch_haltpoll_want); #endif diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index bcd03e893a0a..e532aa2bf608 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; @@ -93,21 +92,12 @@ static void haltpoll_uninit(void) haltpoll_cpuidle_devices = NULL; } -static bool haltpoll_want(void) -{ - return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; -} - 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 (!arch_haltpoll_want(force)) return -ENODEV; cpuidle_poll_state_init(drv); diff --git a/include/linux/cpuidle_haltpoll.h b/include/linux/cpuidle_haltpoll.h index d50c1e0411a2..68eb7a757120 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_want(bool force) +{ + return false; +} #endif #endif From patchwork Fri Aug 30 22:28:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 945B3CA101B for ; Fri, 30 Aug 2024 22:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b=hG1yt19mzn0evLnejBW6wOaOLV 8wrR+jfVai4BqZHb+7Cf9SC18yB1e7Wjo4gZl73K/52l1GF3qMl6Sa16nvSZ2cAgUAFZaCqqZIlf4 zDrK3paQAPDhWZ9AotHuMdjADUYnMzQwhBb1rvJGaSg8QdExzaTK9yOG6EijpDQjDmI8Dm4hezXrl l+pouvS+mZgT0hm2UnrzweIxnDerR3lxCTHw1rVRY//YJSgYLMo3lauxP5LR9fF/eX7TqLIEcxWyT vzbrYlZ8x1vWlvQNNULyTAJAqP4TRKIglilZpMhY1+Ylz+5k8+nCQY+6bMtZ6BSQfZmKyEGRuJ8gu HWmLma2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAAw-00000007uA6-08oQ; Fri, 30 Aug 2024 22:33:02 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7Y-00000007sFx-1maZ for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:34 +0000 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMQJYb002410; Fri, 30 Aug 2024 22:29:04 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=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b= hrGMZKuQTf3+cpESHUBliY7pCt0YkMEfWgZ0/fFClJ2B4GxLoik/hYPMMDMAGm6T RwOO02txsFPe8S9/esWcmSxhQ/w0PqOflbFaCSM1oBRjFcd95pLheCMWE8y+1tsy TFXZzonqqwSVVX1XawXs3U1yzLDFfd4WV2gxHbEOd6J8xEhKZyBZ5nFRtq9tu3iL 5ju0U6lGzY07Dfd2sp2kn3Z4OIrNz7QSOm9Xsiz37KjFg6maF6mBun5NMZpuwwvm tMaRWjlSfGbzcg8g1ZM0UkamaOF/iyUc6oB9iAd1tMZL8eZXPOD/Verv056exxS4 CGScMOi39h0Wl9bTwyuuGg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bfjvgvw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:03 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47ULid8R010476; Fri, 30 Aug 2024 22:29:03 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2040.outbound.protection.outlook.com [104.47.70.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41894sjaq4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iiwRQDDBpLWePKdVkAKRBZ2SPHlWWJxMnZm/SWjoQUwlAIaWjJkUWhZ9eBXMR/TxV/ndT5zQJd06asByKhylcFFbzG5cOXbOQW01A5sNtXCQ4rxtAKYnnCTkuzldaea+MJrl7qUXhlV7Ip6xUrciQlhltbVwgTWTkyeuryuMywX8+wcgYHC/FY6KfkZaBpPdXxtgJWy4HSKf2IIXh6eNK+uwlju3lH+T/nkCOZnEdrVScM//nu5Hl0uHKWbLnSlEogIlC8lun6cub/LC/VKoM2mBfXcySwaFFhGuIZJWHzHjZvtes61k3VmO1d4biEDXDhOu3ttE3Vkjk6d1cThzew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b=F1irZ/2dv/HrujBuMXD5/rdatLrchwwbZ1X760dhzRypLEK7E2hL6uobD7xnEAFvXxE3HfDMFvU3EvSFfPxvjjXpED9HZy4Pp05x0L1RH9Mwl1nk+iqpvgWQTHJtzWEmYXOQsNjSfUIF5Aai3QHcaAJalp/OG0Q9QaeQ1139Z4ffv3J2CS1MG0SenVdc3IyW0bi9srKIthNlYgMn8Comzgjp4JrnSYDUhikpopAh4CyUmjCCGdt/DWYDgd9YPbR9csUyKj3KdbP07fXD5Tu1vQNw+bToEv/8lrBvQ5s7t2L+6nkVv/djAuvvG6+3iCixcn/UAzCuayFjKC/KFlrlHA== 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=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b=rLAgACdtGc0Zwl80BurQKMixJNIjU7MdOS4adshD+uxQfRtkaSJFVnwBrq1CJdvbUHNBQUfETQ4BqM7NFnwU8eZSw6DoTOs86BlusTL1mf7+7TpdTTQhC2T1fbKMESvNp47IQgmhULYq/M7YhhjE6LEdhNKE8QrTqnw5qXpwDHg= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:29:00 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:00 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 05/10] governors/haltpoll: drop kvm_para_available() check Date: Fri, 30 Aug 2024 15:28:39 -0700 Message-Id: <20240830222844.1601170-6-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR11CA0098.namprd11.prod.outlook.com (2603:10b6:a03:f4::39) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dbfa0af-cadc-4451-159b-08dcc94324f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: ZSHXnVkJ+gmrJ4gVqQv0Q4ihsi1vfDLAF6fJJwwDRSy7s110ikLdUIpTt1RXZPSWEfXEpn85apJKUPn5VCSXgG5n16kN3/mVNfdccbkfv3TEvJ6UgmpgljoF13KGb6w5oEV2lWbnabGUP1Du7C+hfBZufUm7xctRBwpEh384RgOSqkRgfCqo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ewKVTgOIFgJ1aPNAEmQrBMDRmxeYi6gDszIJhnQtlv9zWXmzrDR/nDC+YJK/I+Hygt4a1fzKBwL+TMSTOO/siebA9utCl0vH8Adiv9Sakg== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oj95vTV2loM/ND69VePX8L06SW7BIgynvmRa86zOCDAJdYpeKnz19rCuvfYSyRAUSR2dqxkNbpb2FRNw/M5awbHgYxnMGUIZqU4kh67KmjfDN1zd6DIcEp2gqFbfauzd31l8ZLLhJ7BdrmqgU11hYrs2QVHN1Oft7Oawrp0rQGTsF31XAe63Xc83sk1a6geVbSdZS9YGjzbtGXW0AM99LroV+4GX5grqjvqWWJ3O72fsyhz/oHKI3PfsTurhxW3DLCGEoXJNSAcFqQPdDB/xhQGZCvrFDJEjfF1k1biTNrODz7TbUIQeTG09IfNj1If7U/uCbSND+8uZEbj/GAPyAIhgTccQAOnBI5zrTEIyfQYxVxZCe7v8mqPJsQjNCdlEhkemspvOB4Mgf0+oeKYKRwbYMDpeEGfCaNYNXLNG0FF4MMDctKvOETmKTHhXgEeyLBpda3DPOWI30kLaMKIWI4fIWX5YjS98ABd+bDLagOKu4tgdP0HL+ZaVYvghPPCvlR1w1pSeaf5evuGX1Iwy7N2Kab8i4jflJJW+JBWdUZBVPNya4kOnncpBnEhOSSG/wJhlHmOWKXg0Nkk1H6v8lCWCxt8SWWTL7Neo51+gMTCMk1qaao8b+3ANpsgTPU3weAtfWm/CvSvU6hIE5D8VV+Lek1b66EijufeSfKTDv2u0z3VXgG/oX/XTnzP3SzM3MeN8Obz21AlDr8bOaArIvPam0LbaxKibNKZiL94rBwk/uudFKEAN699q4z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kYjBYDT6Id88r50L5fWUo64+n+8ernbIlj0HjM8RYHiMcuqqZawkIAftAMC8KXambVE1T8wLaxHDcAPkFL5wAQBkiohy9FBSmtFRlPaef04PyMpgXcoqcjT4V2MP0oXsJyr+UGzOrN7x4VCw3VquJPBXNOPQQC8ZpdlDM0prIbr9Goz/+21SwiC6K8gmX6uEP0RXd8ly3Iky/nUy+/Hyuy+eyqbu7K6QWEb3xa4vZxth5PepnbcbshbvuPoqdUcHsDdAHCmExCPlNSBPP2OukVNzEGKAo0dsByXf/qXCti70ZxLQRGzGEjvl86orns9LBqFY7AH5VWCSTnmIDqsyLrb9sCaEsrVu9Z3nclx+mctXzel0Nc5wVHT49J70NmO38HEUKXJFJNhsvkVCoR3AH4xp75adCM2V5iskpYMGhG4vOXRzazO/qrg3qb5KGNmqpXaYAU3EFKtcxm5kIJEbAZw5kucE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dbfa0af-cadc-4451-159b-08dcc94324f6 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:00.1135 (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: tKAO8+CZtS13KiJV893XW/ysNQvdbcDkaNES4ASsQLS8lzo+q4QiapjlK/NErSPUCg3Y+UkDn/G9UPkjj5NfyB2koxvwsVVnyZb7E+3/Lwg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: XMFxZcVGtIYqtw95Sk0VatDwdmKF9kR9 X-Proofpoint-ORIG-GUID: XMFxZcVGtIYqtw95Sk0VatDwdmKF9kR9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152932_611779_B43B7F65 X-CRM114-Status: GOOD ( 15.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Fri Aug 30 22:28:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90BF2CA101A for ; Fri, 30 Aug 2024 22:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kliPzWWUuMlufLMM95mgrWmmH+qsRRLUhf6/KNxnbbM=; b=SwlX+PpaIDk7KraydUGvhkyKj3 OsU+TjdBrvEzFOjQkq0X0O0pqKi2cwbUb6BByzO17kkZFK/9fQfD7duKODLVLM32gp1m2ylsaX4JY wDImOP/s1ZkxYol5ITRC8My35+7nAm+UKM0Zt75n58zy0jwn0cXOC0W9prE5uh8H1U7Gq6ScfJ4gp Dlar4lPeGR7+Htt/7bYT6GWVs+zJib4qWt0k0hAQ4lCcAjMZkU0YtLRiS3dM890sw5qiQ/nj5hM7F RvUTXz21GAHNiLzkGc/4gMEwQAi3qYANjFwId/t8EtSVOg9+U9oS2n00Hwq40oArmAFAGQnAbe4tQ FWlukqVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAA4-00000007tto-3TQu; Fri, 30 Aug 2024 22:32:08 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7X-00000007sFk-3Ut0 for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:33 +0000 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMN9M3026792; Fri, 30 Aug 2024 22:29:08 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=kliPzWWUuMlufLMM95mgrWmmH+qsRRLUhf6/KNxnbbM=; b= KnqxjLDk1K7JasvtrxBXSMcTLYX9JXPbmUcPX6cCGnjVXYnOaIwfpc8FAty7251T JUpi6pAz4CBikCsU8IE4b35bMpZykhbK8jJerk+eCzeakF0t6eDe0wK/sxb5Chn3 aXVzD+0VQNuUPECmC6XDEWkTwkhLfLFq92XlKlhqxxJCbewlos7odxKjyhjjI+Vn Lo4UvSW86Ow23z7e8j2kR2bGeUwvUXDZVAJs67CEo9xt9EQaV9ZSGE7kjzHaKnjw iqrj/ZFiRbL9HTn05XGWt29bwiC8gs3RE1qeFAVbQQqp7tdFNMVfSz1lcKi2G3cA /evWG/tzyZD/lVfsnvXA9w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bptkr071-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:08 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UL0MkW010631; Fri, 30 Aug 2024 22:29:07 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41894sjas2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OAOFpb82/8Epd4WXf5Zu6/We1KFQuFt6uq+2OJLeRseiYtsXiG7JmmqTFvLjkJliXZli8QkHq5BOoGUDxNNrWTWaZ4zYZx89z80r+KTKEPRyvdG2+A/cUGGX9qbnGkYK9cBaYbn4v1y0yvuiw/klTw68N5dv59KR9szLrVAUoTsKX2OUFfsDq3Dd0uv4CYNuWELbQp1/b1DDC3R+5usiDehxXM3JIxxdzbdfKRxNv2jEV8Xnz++lFpdlgPKUHF7tv/Ups/eSCDB1Ufwn3njqCSaTROeQoAls77ptY+Xc1SWIOMzXA+alrwZvbNSxqZyAClpvx9EirLLqpVyl+LT8Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kliPzWWUuMlufLMM95mgrWmmH+qsRRLUhf6/KNxnbbM=; b=CprRvssz7QlTPBQ1oREBy3O5O1CMweKAKg2IUqhxrN9/MhhakmpA8QymTUDO+iiVRtYTne97q96cnpFAvF0bD4C6ts+ukLKXQJppqWT5hpE6afmWPKI/ut4CFiwUgPIWxUsxFhTs2bnZmDZg59AiopkVVmZRks03RsznnJaR5YDLFzLZuspQJq73JmibEk+2Vd0bYTRFFNoOmNFHwrwnT2RBDRl5t29Ey8LJWmqieFgC8qH8SDO8HtjwcyMvv5g3g4fp+HBpXt1IE8yA13sGLsA2QipEEZhcJvlhO73w46GqzPqGc9WgMZ32L9643waL4kExROJ/0vYcUjNNhecYwA== 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=kliPzWWUuMlufLMM95mgrWmmH+qsRRLUhf6/KNxnbbM=; b=ZxOXTOmf5k/tX77PPkjCczF0Y0n4b6cQUHvJv7ROrVpNyWwp27eMg/UZhgCBcdh5uE0GdoHKnF/MEWIPNhJbZ+ilV7WDZF3OXVmP5NJNFFwIWgnHlxsX7KiSUKUg1ZednGn9SM+1dTHC+Qqd1X76WQ8GzjP5VxMVOEFfZjmHk74= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:29:05 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:04 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 06/10] cpuidle-haltpoll: condition on ARCH_CPUIDLE_HALTPOLL Date: Fri, 30 Aug 2024 15:28:40 -0700 Message-Id: <20240830222844.1601170-7-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR02CA0056.namprd02.prod.outlook.com (2603:10b6:a03:54::33) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: 691351c6-8196-434a-271c-08dcc94327b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: iq9pJGXsy7CS3SkUFuHbUA7/5uUv9dE8lx8cRG7UXu2h5UVeqp/I7F7jgOz1ujexk043qW0J6/wdwP2QN7Vnug03TOeWr67eCSFrRnFs/zidz5cYgHD32aREj2wlySQrrct3LO7rcAf4bhWToclmQnfbSruAkfWtr/CSLkvdOamWeBHoQL9k+i/8leOjgYQI90s3SpVu2b2eBNCceLIvYTrSJxpo4YISRqHTppbbpPk9hEoquZYK1QhqUlb4DHNuE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N1KW6QuF5WrFYHxKHIYyfSh/owFqGl4pUDy3fVw== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GSW8F9IH+K4UCb0iTw7wQxtC2o5cVFQu9Wre8+EdLclJS8b2D5+FuAFTY/zKXAuQ3u1OPxwYM/b1fyj3DWkzmN3eWkwLS1WU6l/9i7b4ilc/SSTx9V+CO/zHbgjM6Jsm4V8/ASJ41bY3UEMWy2tVE9gleyoGS9S1Z2F0uevWvSboRaB0Sazffuq5mSNvZDuqYu9QZIZOZb9LvU/GDCIFBCcWCvFrBAnCXXRuRFn1OUP0WrkXgAb/D8OkTns/IiwmwuHXSG1y9lUqrhUYVMfZwk8N6/kBtEPizj6AoDp4syRW13ed6YsPB0/GnoRTLUy2snCJ54yvQrFibzAEDsmDQ7Fr7urvM/eMoLiXDa5EGWADGqYf4JL95lANPD4Kn184D1m/9OZ7l7hWUR1UTXJskleClIWGZQh1nBDrQxHu3JZTZUsD+GjNWDUJgU+U3+SCnxFMSgeiNVlAB4ildD3RY1yN0ePUxC9OMOEI9kIo+wtA8rQ2HJuF793x4ejHsC8ovp+s+N49NjUq+dDpZxBsunUA2133Yvu+Zp3tywnsJbVVJLHW/RJCxI1o1GOkv0kPrNo8Trsvt/mDnFAC70lJk4yP315Oq8gQ7VSmCpBrGBa8MY9rxEX7nBU3iYgmAxcoj58Fg5NimCViGgFazvioB3kriGpHoqRLaNNWNBW+mm/dnALfeJ4bY40nzIFhJVQBHOMMBw6HGTTcsUPZqd0n7iEse0lIkpxnHIuqK+i1B66sG0tWJ9bc+F8HS6/AHtYhlsGG5KSawRKcETH+xBmGhIHO9sULKA+DcTp3/x5mShb7iHBYSlqvuvQiPbdl+P043PMzJ9tBSLjBKmVsQNjbeMwENzHhnALknawE6AINWIh4kPcEcsj4vTgzt1aweVPTJ7yD/XVAz+/xDIFjYbx4Dux6MjKL+DFaoUfPMouR8NA2xS4TN9teJFERkubNSJHBNQ0+RNudZrexxf+080iePyHbsySKUahDUcayV10HU9fyFGoj1YEwFGT9tC8TpjOP3sF3g3VraFfQHvzxV5Wm7Uy7LutdMI8h4rSeuCYHwTjwN+pYZLzID3o3J5AaXPXFPsVcxIWwm4KCYu3TVcC0slS5cPICT3EVuc4Y6jLRRDnpIay9v0KySUTzMUvOOQb1670WWlKQPDtLQcK4vjqcA2L/AK/taN2uJFRzSHfVQJM2zXZlzGYQ/LbUfQlp7z7ecIFw6dHTIoDi9gRqWLOlkKf5ZoYNZfYaSGaN42Q/i8kjhJScHuh3BpaZFgrbJhIgK8SgKtk808RIs6W+cV8gfj1Rpi00lI5GXGMp4658ALbxa+iNLVsTUNU+kWZV+KqNjxVyW0piS7fX8CSi79uuhjIdj8G0SB4fNBxcHAetp9lXtFFVQ9yheYKkjXjkHScnxohXsFVv9bFNLxjmmhzMlpTLxDY8NBsaKUEnlro4vfyGG4rkAdllrb9AEGIt63OVxKy1Xxh2KBzeVf8440erjjK9VmyiQSrGC00ncgio1ZjmPRdL6I59wBg/UxswLlcemMlOKfx5IgAyIYzanClPMTKb2chAEP4gOXpfPQUZrSboL0JGRG3NapkIhRRwOoE1ofUMUtf7npVI+fJBH97gcw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6y4P4ORl5ABRG04CmslTL1C9e8Bt5Kw1XegAMYeWT8miwMF86s3/OEc0wPjFPdK+w1MUVhKU7GLhu7swv/nFqQ2iSJ9q64MmnI8ZsGWoNm7grftw8njmkexXpax44oEeHtXwy/E82srAHHokZhVPtF/e0vKQcwrec+ebNieK8yrmcTeRcPsgaiLhDQjukau52eqUq3ryLzn+LMsVrZfoPT1NwW+m987pGiGEury9PPJ1ewZPrG6FYq0nPSwWpPzOyMAcfSuYM1OmnPbDkusQCZ2GPEyHksAwGm1mLgKVLhwuqgy8j63nHfxOlW4eu28ziNy2CybIkS/n3sFtgr/OwlQF9QMDvwz3H8qyOjaiJf2NokIVpKc/CKn9EfjSYvgetRZlHT3btduIGehTy9biRScq1hWYoNNhzHY5FSCCziGe8xgd804qT29WtjoNVyyc6+4CfTSi0oC60b4bnHyfu+NsD18h3EZ7Z1lA+wxdwO0Owwe/nH1/sKzz/KW0xcQpkA0UIo5FS8M/U6YP6PxiEEXUqBLAqovZTeOq2hhQ6GsTXTCh/0BQ3/BSpZjKh0gkoqo/U/UKZ1rU8vd47ULKl8RPkT0D689x8OYlH7dujww= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 691351c6-8196-434a-271c-08dcc94327b4 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:04.8917 (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: SyRYI6bR9ovE7Zg9jm/zAYZzzs+YEDIim2fdiZGjn9F0csH7yh2sxUHpJL/j6faG9JWs2r8DF/tapUOKuj/Pn6ZFciXUMwXn16NnSkS+v4U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: dCpz5w-uluRkZ-CtLxhu0pga3mPXPKgz X-Proofpoint-ORIG-GUID: dCpz5w-uluRkZ-CtLxhu0pga3mPXPKgz X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152931_905068_6E3A5B07 X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cpuidle-haltpoll driver and its namesake governor are selected under KVM_GUEST on X86. KVM_GUEST in-turn selects ARCH_CPUIDLE_HALTPOLL and defines the requisite arch_haltpoll_{enable,disable}() functions. So remove the explicit dependence of HALTPOLL_CPUIDLE on KVM_GUEST, and instead use ARCH_CPUIDLE_HALTPOLL as proxy for architectural support for haltpoll. Also change "halt poll" to "haltpoll" in one of the summary clauses, since the second form is used everywhere else. Signed-off-by: Ankur Arora --- arch/x86/Kconfig | 1 + drivers/cpuidle/Kconfig | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0d95170ea0f3..6d15e7e07459 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -839,6 +839,7 @@ config KVM_GUEST config ARCH_CPUIDLE_HALTPOLL def_bool n + depends on KVM_GUEST prompt "Disable host haltpoll when loading haltpoll driver" help If virtualized under KVM, disable host haltpoll. 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 Fri Aug 30 22:28:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58AEACA101A for ; Fri, 30 Aug 2024 22:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dvXJ5o8iIvTtz4S/Dd5gnOY5EcavTuSun8qAuwbapO8=; b=jqBBSAIg0FrR3s3u6xAq41jCaI yb66VlC5Qi31AnvIQjhCwTEW4k9+n/ZCDJsNnk//HXepJKjh9fL5DFThZl8YXhKLKzk1SzRxaTb9c aCpQ3FGiaV5oOwNkZ+OAMaPk2k5/ih0zisGEVYmebzx1hA/qC5ykSu+xybeA2058gMJtAscTLjm+e G589J88fr5vH5QDdb8S0BN6GuMuGe6BP0dBBouPbMyzC8bdizkFld2QYIK5uhwNIt633cNnI00dkM Genb4LpT+1y+uFGTC4UPhbrw3tYSKp0aNtWZnAfGGfVpCAdXqq9TA2sA7aUeeiOMeJ5hJeOHa6TLm x4attsDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skABn-00000007uPL-2QGu; Fri, 30 Aug 2024 22:33:55 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7Z-00000007sGi-442q for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:35 +0000 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMNDLZ026847; Fri, 30 Aug 2024 22:29:11 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=dvXJ5o8iIvTtz4S/Dd5gnOY5EcavTuSun8qAuwbapO8=; b= BFbQ6cZsQTKKts81st1lOTfXZdNY3a13E9GxK9nUkP6p2jRZFxj0WI6oM/MzNDFU g8ZNBTwtRsYLqOKSDtDDVxRKmVzFK69Wf+APWU0ZxuWeavB2pSe/6Cx5yVo9Zh2W /g+NU2Nz/o+sj53lvMGGw70/GcuH3M2JqDQZ4fJaCR2XprfiuQDYvcoHbn0tE6EM YaaE0VBlwxdT0jHJk3hSSkWVMG4HoyKVIeffeDtgSJ8KHXrXjeS/pwq/gGbc0xLG o++3nLZKRUaZfaNNuynUsZ6tJsRkrPqZ4uVVT+4K0n+rXjCazeILJBjFFSboJrgY IsM8GbTW1GgEE1L4epXihg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bptkr078-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:10 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47UJXoQj010448; Fri, 30 Aug 2024 22:29:09 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41894sjasm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cwZ1pHfCJ9pTJEEVADSwUidHdTpFPoYtekJSx95g0GomXUx2WKSBySQmCHaM0aIp+eiFRprabXkHcroeJpPXu//hKZyalHiS19ZuEKlriJOZAU4Xday00uD0fBdnRaz/tdRCzguslcfRsjazDgR2KeP0sHa+d0w4rh1zW0L9D/dZs5EcwTNRm+KN6NWqCNOQ37uwhG9gZ28kTKaUZOBe2n0C1W+6zj+AI5hsGgFHRIhnDBtf4F3TZ0Xz3R5sYp1ExcP/hLXgervO3NTBNkWvNdNeK5H2+MtgXpwpU0OVdNN4TalvdV5zOKhG12XL8UNiBrEOS6vmWxoALGKm92SpnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=dvXJ5o8iIvTtz4S/Dd5gnOY5EcavTuSun8qAuwbapO8=; b=kJW4uZsPQDK3naMnzTmtqxxGQUl94rfNdGyJmLE4ty0AR2M2k3yYpGzIQ6eC/i6y88ErBb9gWLgsfeEDfMbf466DMMew1vjc1ke0TVtxpPc7P8KC7D76E3FowpQADXf8+4kAw87xOT1SLIcSbA6tGeR7hXs9/BO4EMFEOFyMz+khFNBCmlQbhayWBINS4WPO2svBEIJN9japJSPgZyfP/zKTUFMT1FSriaLfkG2fzNSABd81QWVBwbVshqjW3fi64E80DZwQR9R2Si6oNGVSk2IL4P8HMkdRqmCU7utIBEXV17jjzusZp/TkuOBr4Trri7HQcerYPsILossXxYuOXg== 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=dvXJ5o8iIvTtz4S/Dd5gnOY5EcavTuSun8qAuwbapO8=; b=iB0Yg0crYYJhskeN9UaUSiLeSqqca3ExwoDqfGasrUwbcOInyW9Co6MI+s/JNgtCR8FQWkw5Sn5Rt19DthF8Z1+EsZupmZdAEegeGoL+KQorEzSGEMk+W73Z6/0Fir3bJzruNnEdIb5aVJfOQBG1tQaOi16B8YrTULec7YT15VI= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:29:07 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:07 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 07/10] arm64: define TIF_POLLING_NRFLAG Date: Fri, 30 Aug 2024 15:28:41 -0700 Message-Id: <20240830222844.1601170-8-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: SJ0PR13CA0037.namprd13.prod.outlook.com (2603:10b6:a03:2c2::12) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: aaddf99b-9d94-40b2-3c4b-08dcc94328d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-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5NCT7gBRs7ejRhZBPpZIBzum+qOjbiwi/dS2PE1s69e9xE61jhmsxJzKb6xs5ttt6GDBPtaLGEKOzozLM8cOpNRhYT6vqRNXDiFctAAWv/AhsIEsxh+jBgXrhAtSxbirDdtZRfRYtqevixpzB8beS6IMtbqkoq7xFllGF9ra7OOKSPSd8BkgjteRgLUk6t+Hb/vTJ0FcWvQg/VhJcbc8y4zv4Z8dNNhN04Cx/Sf1eAvYw/7UJvm4Z4eFHW65D60+5F6MBNBc8m3g9ohTHh0OSP43yu9sXzY5xJbP+6idEZ0dc2gRPSbh//dvn4nPimzq+48QAnZicbko3HiGHAzRT1GQ== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q6GqcyaJvpN1s4fQ3S3pRBXZXXryvXH7fGryesM0frz8NxL+S6gxDPkyik3SBrGZQfJW0aYHuEN4nBxHaBz0cUKntW3vumm+XGarRQ5l4e7+WofzQ+ZK/br6PzCY2/XLBTMo6KPnL5U9TFuJN2msuHXl7Ow0ZLFFJtATPBMQeyIZEPtFkA1DwcjrJa+tdVaA4dzx1bnvZLBsd6PJRmAtR3MVEts4SaUn6gCdhRDHQTLqB8rKk0TTwO0dQSl+CAi4oTcZfK7HLNABXdO5ifiVCmM/JkR1T7EeIJRS5b2RvRP+HBhbYIsNpT3nzCnIEq0bHVyqpZDKMV9DjYW5leRvMFgmk7hkcKUakPLyekaXRVJ+SN0iTa1qzZcrQWvBOa1MeC1aj50U/ffGZLvivp0UA77BhmzfYDBLHAwldVdFeqWNUObtkw+2eJE38oAiRUlIvpI0fLouvQbUpBK7UqONSs/LCXKS8nbhgJBY5O/nqUmi8usHrG0mEAZr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XiFQtzJME84DduKpt/nzxCQ9aZwWw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LKQ8vngf5XKS/EUHctOQTmPtyY8iDNTLZUIUkpr9MXSPCD/DYkM1rVfO5jUdjZVd7FpJHoGqkFQ+EQAuHt9tZ+yB/uP5ruG7BXsVCJhEGzZGaM3hDf09/1BDt5SOBObP08NdB+sbBzkGi0/e05i9BbZQiSyF99BCX7e0PLpjRjw3BIwDnSm16C6t+GFsDucMX3qeuns0+wwJTm0n/dTSAB4DC1M0Yislm6rg9FCyUyRyTaxJKufApB5YvzwNOWB1sMnfaIGV+OIsjVM8oA+2gmUjTjPGJZFHbBlqIiGcBTKyvXC4/uU4wF39pXGdkh3t0s4g9hjixrcLnrwY5qz5/DcrF+pBz8XSMhM8hpJXKAJ5HYxK83e1DkEYOnDrdurQ6ZZoZcqcqATNzgfzdhJmu5xTlWXYSkkOjNXBKmINevyI9pEnhyKdLbuvZocz7lWuESEM1Ks45nLRpSKndm2tgl8dhQPUY25QzlGh25Z+I+NXI62yW0N1j503OTa9Qt3F3YA8gpblGJ+lmsuEe8zRUwQllcJYfqfvr6z9/prOFBOKHGPbIj5BlTDY3MdiwKfWGnLU3MiyUMYTs7GAiKejgnGfgjDpL3cL55qai8ClN/4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaddf99b-9d94-40b2-3c4b-08dcc94328d1 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:07.2172 (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: fr9O8Oqy/vaBBRMJnNCYWJZjP6sEdc+wGFqJknpuxaW9LQDaj+qAj25PKO66HrW3EySSy7OjgFriQofILBs5uKDKb0F/Y3xqXdnGMsF9lW0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: 964dIE4GIsVRMxIkxXXjcBbECLNVktF_ X-Proofpoint-ORIG-GUID: 964dIE4GIsVRMxIkxXXjcBbECLNVktF_ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152934_029635_F6249C17 X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Christoph Lameter Signed-off-by: Ankur Arora Acked-by: Will Deacon --- 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 Fri Aug 30 22:28:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F396CCA101B for ; Fri, 30 Aug 2024 22:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b=nK3kbfTN6vmp8o2jyGPR3zn+Nn eU+jA8Hanp5GYBnGZpQMhLDgfNfnp1KGgvE/IPyHblENpp7b2c/evC3OYdOfE/WFd8wTAfHxKNhVU NpCAKGRlfu3jLo6eWzTUOm6PhCgtZzzPNrmhCEJwZvQ/8IC5i0iUFIAhH6ov2vmiAuXCfoj15WMyx vtMSN8+xwtH4ZpwMoy6bgGSWvLVlU4ThTdo+rfg0flR79Tlc+c4vBjkAkbfwa5ndQ8fR97cN5eRKZ 7fLDfHRs/7iMAI+wZooB07XFzWY5esK+F22ji+BvJx6ak0u85L1kmudIa4nzcqPqbTFGjYyvXnY7o EoRkor+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skAKs-00000007wDJ-4AnG; Fri, 30 Aug 2024 22:43:19 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skADM-00000007uec-0ofR for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:35:33 +0000 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMSuj8017381; Fri, 30 Aug 2024 22:35:08 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=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b= PzN8l/4s3QhMt03ChciPi7mPIZDeFFV1t7zUF7r6kGJ/1GNVazca2RT8G24suvbV HU3VaxlrSrZsQE58dsT5pdCG5vXh4nYVYoWNlLIokWPKElmJL3p84xJlDkCxasDr liPoexsAplclYyrwTtpyCZONa/ydKMyzcBRTzQE/G7NyFUTq/UBPbIEO0Bn0P68a A7vmgx8os7bPCbMkYlHZKUB8TooyS2BHK+8gkcggxGrS/RlJcwqZPk9Z3+lt29Mv DosM0VHxYD2zwkCA/uDwxlTgT4sPQJLzSOrxQrCY+NuUMkjV/Sy6LwdkuwpsWUUy ji/9Kpl3UgfyxUoXX/cQXQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bpwcr061-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:35:08 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47ULHxTj020212; Fri, 30 Aug 2024 22:29:12 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 418j8sb2dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QD1s5ZvJACyZMT8PvjU478UMO8s4wRcRxaJmeiGl35Hu+zP3QjIVV0QJo9WmAvjGUft2od07A0W9eYO79lUpv3tUwylZbo+ZWM1DRXoKG+QDxP26c26pdvE2pWLzMJJZTcbwsQI8onv/AHL+TZB1gjk413+/1mCzhVcPFvuZ9u6rVbum41Lidc80Aw0twlqcLwGHqUDcZeZlEymMXh0mGtKShhSZSbkPrIGWaLSF8wNzbpAYtOsT3WaOUzkR372nr5XcjmQgagbrWATPzgdbV+o6W1sNzUCn7rFNF1c/1iLRX2lk8qLAp0UcipmZkmiY9nB4Bk/sKfzYmrQxSwcrXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b=uxK30aKwyjpMZaxNw5XSVMi/G6fBlXYcrcw9wBNllmDqcsVlNISv8MQhDofZl1MvzoiZabb9GNpovjD/76OL6DEbQ09xgEM+5H3pvvHvP+G67QgoRuxg1K0IWrtgWlRWWqG18EgvqLaViiJdJNmrWI8jOHiUiyhLi/UbQ9HwhTntOsbkb6v5cGoRvxM5jjBbgVMbyojTel5SboMJoXmC1s8BHO89XNt7Lu6a2UPK8nHFisBQAewHzrqavQ5fnrh9YVs0cKua5WCylrQoyzpNIFRWLpGy/HAZ77Cj3P+N3NgRGBaepVoPJgHVNANsoP/sYHVMeZVXdz4hfgn0cnF97Q== 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=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b=HUEMw/sCS4Solk+tvqpqxNpDGN7NWJzoaiFfxhiFXpSq121cxuWPwzf4BIs8yAncbT969n2sQfnhBvf84lFDQojONBPbJ2e0a3rhdPdVOj4O9DIfmOTTXJWfy4/Hx2Rh8iMp4VNGiXuRJD35Lr6LoDv6sBFmMXbxHYckXcSyMlA= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by BN0PR10MB5077.namprd10.prod.outlook.com (2603:10b6:408:12e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 22:29:09 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:09 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 08/10] arm64: idle: export arch_cpu_idle Date: Fri, 30 Aug 2024 15:28:42 -0700 Message-Id: <20240830222844.1601170-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0234.namprd03.prod.outlook.com (2603:10b6:303:b9::29) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|BN0PR10MB5077:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e57c8b1-885a-4ad1-d6a6-08dcc9432a76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: xwSXXdCq5/K1PO52MpQIks/agYERE2M6Mlt8NaoH6M6bkRUTmSnltDf7fGFoTBTGxpwYF0BEbp1iUYx6qid581oDgskNRKDFhYluFvMfXAf+M35pB2fjxQniNhLhkyePIIcS5v65TR1IKekqiDp0yjrskGlijoXGx4tbIJN70C/C8sfosRGeya9R++r1tjgXk3/eG8iZJKTcrP++f5/DXqtr0PJfVucKLkomUAPmY3ouJqbelbuC4NtzcROx/1vhk8B8HP8h3C/ZP2izJZ5D/kieYUlPezOiwfUIzBQqvKyfYqmZ1Dq0p082gRlcJXociwEolF2Vj+3wOZ0L+VpdaAGewMjHecRIkAZHM8kozi2Eq3s5NBm7AlgDlXcchcXnedAo7sYY49kIE+Rd68+WcVzoFWhtE9Eshh9spJoqdxN4Z7ATshU91WosptfXe188X56cX+Opz9Tq0mo+brsNw59n/tQfAeh2E+vh63m2ZGCF4a7gzNamFTfRNOPOgYWhaiQnezSH2jWRH7aZ42lAm0FqJZsVO9rR2tIGMO9fen8wpf/G/iNC0d4gtqKaxhxtW4L+yIvCT4vSp2SrgI+AhF3WnlEVy5vCbaVv1xsWunQkGwXVeX197ibKbYOl3TpXy+5WwWmcB/pTHSD/iqigZ4dz9HBhT7hxiVhx63pDNVXElUBcoXnFrluqxvWqV8bQeDJCySQ4y243Jz4fk1IRVJrpJlTHIixiQBd62JOMwiPC1kzYgN/T6LJGfrrrCRmKT+JAOo75cHM/PQ75BvlSIyfZpmENfsS0AVovrKtPYLvn4fV191bJq9zlEdC/ThDBpeR9shKzkHpzW0p5VW57aLOyoXGHzLuy/3/Hp5+4Byotlttsh1IdIq/SjEHXuT/sIqmrKgVSm+REuwzwqJ398hjg8z+Cp/bkQ1MYghijRENx+KGEPkKZrWI4n9dWRGPssfJj1YaQgQrtAxi9nqVaXKG02a5m8r5EPpzSmN4PXUCHCf6uDGmNau+8CwSBprOT+c+buWgZl1leeq2GtgGdoxf0Gu3EeZsUC/Fvw0dmULmo0DzOhPGgz4ENhVjW1ePPtWdoeTOf5EXh+hfxvMnney5xqg2HVITDn5mQlB1KYb9M+5VakQyrB+1q1sJnQPwixSXUUvmm+QbUwLZFFuZ7HoJXEHkr3U1q3v+Lqmf+iq/GDRPjbIvPFM7dy7+J5Y7fqVQdYagnc1Tiu86oq4w9HyFixJL69I27+3gXFO/2L3uTzq4XWRgdulZg44dOQVuWG7oKVejPE3R6aE15pAER5dyycpMhQHaGRrQot1T++6l1tB7UAQ1/qyLQ/VVCR/brCA9kB1dKxlwAnWaveO7r5g== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l0mg05IQraz8fHX++Z8CEGl48IgKlxHJxjKMIMqGmAhpOMmOHIyljzP9xUMWaSxBXfOMNTuEkaFN0gfBXxVV6BXC4E6k3SAtfgh9Vm6h2tFE5lAPECLeNJRz+DyQq3KIUT5ZlVIHYoZEuDmsWP6ApIQjoYtYMql3LCsSA+XERE8ZIYhuSAvbapbQtvThMuxRlzJA0Vm5BMsUvDKpqdN3ah6Kt8Sqt/ZEEI2QP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Bjt8peY3Fz2TUkIul24juS/7RHvzpq66xu4KG4Vq1BIcZe18GbHGwDSL4k955WCK6MiYcsRwB/UOlxxqoDclyZ5A2cJdmMYdCi3EE1Ick0rt+dy9StmwALxibcBX+stDZlRRbBqTvuRngEYuBuWs7tpQiZvtf21u9c9lnzuSzzNNib6JbvQqbeTHHLSV+rRUGpcxwAp/9xOwAseIH3YEaUmXRmLBw3OjqBuDtSq5gC/zIGTHXc6zlspSmUiU3MOXG0I09PIG0DeTZA1X89YBwFmB4kXkds6TMC4bFjICMHt3bu+A== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: NdNR6/ZGTdBfSPLk9WyG6UuCW3K92xfk5eF19rndecLNTtmbKm5Tu47Wiv9Ac8kpsPTnKJtr1ZpDulqhLxcDbkeAp/5T2U98ZbnP1bdIq/2R8K9Q7BUt9GaQMjhbiXRQoIgN3rEM23EE/9MmegvKTatHHLXSK9/y6POKo0nbWYzazw0Gr8BtesNjb1OJRhecBpvPLS3o89J4+kSz1n9dRsPTPhFSM4laC9u6Q87YFcBIkuRLiwiDDvTYgRRdPhlYHMGJJhNvaop085mhKnOdFuFBlSyVUrSj9tAtoq+Auwnh8CROiJU4YRKzffAb2Q+rR2OPKKDUam95inZ28B/50k+praQ8Ele5u/cd2aYR8BWlUmIpZ4ulXWgJAL8PlOf75eYeaQmnhWGdbQeWABiwDwFuJEOjv7ry5V6QCOdJol8wha7ud250crNtQwujHG8A5LCyRJa3koeLFFAB9VRf+s5DE5IeqNvGi3wZyXsz9rvprmQk2i7f0Rfv1n1saWPonca8lE9RgcFK+2TK7KlmLtaUAW8AaVv/nH49XURTfxG63D4yuC4tnQiNmUlGt6W5gRTc/yIneFV3bpPO4/x+rMCSTURyvgocTdaNY9b2N9s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e57c8b1-885a-4ad1-d6a6-08dcc9432a76 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:09.6285 (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: g4vu2W7WzanWYY5JXB0eLfWBkDTP+8A+2HUAjn+Xzt/NgcWq6+GUoHJvDqxRMPTIt6tsd9VBlgSicmj+WuRVQ2zUGVz0GfpyFhMCn/U+pzA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5077 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-ORIG-GUID: b2gMZpWzuaXb4eg-8K9uTMApnjqhrvW- X-Proofpoint-GUID: b2gMZpWzuaXb4eg-8K9uTMApnjqhrvW- X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_153532_369369_C80D7615 X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Needed for cpuidle-haltpoll. Signed-off-by: Ankur Arora Acked-by: Will Deacon --- arch/arm64/kernel/idle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/idle.c b/arch/arm64/kernel/idle.c index 05cfb347ec26..b85ba0df9b02 100644 --- a/arch/arm64/kernel/idle.c +++ b/arch/arm64/kernel/idle.c @@ -43,3 +43,4 @@ void __cpuidle arch_cpu_idle(void) */ cpu_do_idle(); } +EXPORT_SYMBOL_GPL(arch_cpu_idle); From patchwork Fri Aug 30 22:28:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05EDACA101A for ; Fri, 30 Aug 2024 22:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Mo2zoceAXJnd91Af9whV7g7UPhyCEtT1xSWIMyddSQs=; b=oX2eCmd+k1uKZwkDiHtowM3sbT 1WqJN5uYIAo/ztzpZzhTwAXrIrYhaYd3kw/Dqu8eRjPbDiIoTtamMozNw6ut0dd93sU3oTTvG/7Y6 EJwlRIttTgAtdounLP/WDUwFic8dx5VTKWZPlpsPzPSSstiNZDzAJY7PEc9IM2BPTxyra1ihUjRFE ojldqmP2+2MYr42QWzNGy3NiDv04upjOilZ+KV2Bx5K28Si669Bv4+tiEB+gOwwhHd76WUbarZ/Wh aqA+iBGAHnp4qsfEb/dtXgOQfscJf7UAUDQLH32uHtvxxFQPu0tJg7r4TI9Vkhac/vVHybA5ekBlX DFx7sGpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skACc-00000007uVx-1gvn; Fri, 30 Aug 2024 22:34:46 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7e-00000007sIt-1944 for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:39 +0000 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMMUnq004044; Fri, 30 Aug 2024 22:29:19 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=Mo2zoceAXJnd91Af9whV7g7UPhyCEtT1xSWIMyddSQs=; b= QHGa7ggUWV5v0nbdGngfQnUjkJ4diE56krmENEQTh5FEbzNTFqQ7ROnzETrqCSVi t31jKZ6ajF8bEi0LskghlpOinVeq7aP8fbxE/dJDOxKSkvD34aq3W72lKH94TXsP Yw612CgXNunSKhptjCJghm2QBeS4grZfrhqYC1ZFkSW9/0JTzaNfX4BH1Kms1a3F k7WG6AUOR1Cfxzl9Qj1ULuIw7iY0a8YkI/mQHGm2tZiaO2dK2IO15JSuojNhyxKg ZEKIlRm7msrI+FC9BR3nn7Ae/D9yGQscFBKRHMz9K9/pTr6Qw9Vp+NG/ADCmz6i8 taOwnDdSyCi/+r05grKJjA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bfgj0wkf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:19 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47ULj9dO009920; Fri, 30 Aug 2024 22:29:18 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41894sjau8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KKT7enKfDhm2jtQSs69WMLjPH4XUmzWUipdQOE5ulaEdmLgQIOOsUKwCm78zVR4mUrI2KyYwjsrECqW0FwdGDMiRmB8xgEMjV2dD6UZF88SpNhLaPNWPhdye36t9cRCMK9+ZqSWCfAed1ehPaRBTT42G08SPgP3xMIniujnUBz1IgCyOIVWDI+dLsRAKEnBw/njaw4Aa47qWrguw/YzsxVEA8dvB14agzQiaXjE19usGKIOsYXxznpLCjue5ISqkYfgxVqEGQcJxyGCyQNcF8/alj/WA+jmosEH66gZxEsnKEPb16kjfc4nLHQWv8+ZumwCuyqYk7XdMxbLLKEdVHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Mo2zoceAXJnd91Af9whV7g7UPhyCEtT1xSWIMyddSQs=; b=u8IgIvAnwW/bilN4OiJwuDH1lkQczYgOeAyIxVl8WIK4AmH3Kfljqu8PWM21yV2etTWSRK9hO1uQWskzzIx41tJeFOqiiznXiCaLVORyJ90DVDDJAKYfw2IOsxXrMMew4Ywmo1jldLzpdprR4Cs20GlnINOc4qmg9B7n1u8ceQqKRJmcRNBk82c72sjAIjY2fmiFr2xIM0VVt9CHhZbu0adNUy1wMZ7wlHWcaROZztGsCQT4wRUVkH0igKims0WF5yZrYuy/me/Jspbynp+NOb/E0rXTSPNYXVGrNhhRuCvGY+LCkT44WEp7UgAezJTyoXoZ6+znRENLVolKLTDeCw== 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=Mo2zoceAXJnd91Af9whV7g7UPhyCEtT1xSWIMyddSQs=; b=JNFkqIyyx1l9ihLtvfreOqhSfFRveJ94nTiM0rfxRWqgU8VTds+451GQpzTGJm+jRpZjNJtDEW0k4RUtQokqs9S+uSFK2K9UB7LCiwv1B/EUqHbS6Z/e1XzH/Q7aPeyZdpwwFuRiRfrTNG1KedbakOZ6wsOa2eZFPVNs/yqRJHY= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by IA0PR10MB6771.namprd10.prod.outlook.com (2603:10b6:208:43c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19; Fri, 30 Aug 2024 22:29:15 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:14 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 09/10] arm64: support cpuidle-haltpoll Date: Fri, 30 Aug 2024 15:28:43 -0700 Message-Id: <20240830222844.1601170-10-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0007.namprd03.prod.outlook.com (2603:10b6:303:8f::12) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|IA0PR10MB6771:EE_ X-MS-Office365-Filtering-Correlation-Id: 64876a3b-8760-4d9a-0b64-08dcc9432d67 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: Rhcjd/L+IegoYA7KM1LMYFwlohf1RlUX0PoWQ6foQIFoP7BhTiiIp8D9hz293ZPw+Qx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XBFO+S4Km+Cq+t0Nmb62AV8r3bAwxGY3aolwUgtlxsSLa4Ue5/ASXNJWi/g+UgLLnQg8YjZaZTlReOCcHBFvL8ZG5Ek6JKEIp3rW0Y7IXrdXbmvPPCIHIIlDb6nGxxND2J7Y4jOU1ltbp1imKz0Y3MUSUK0gp2EqrU9gEBZYSWBMuSDirKbtM67Mhi3DO8xK1DEbW20Glz4xM20KSub3YQFneZ6+YaA== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OFQQOQmcUzGCPerULB49jNDiOpb0yOUfm9JNf19G/oZTjfKJ0A/OhkLyt5OfjEtH1UB2/hTm87mKHac9hF3c73ZNPdTLT3ZMxQMSx0AvAgavm9L4FT9Ce0RcSvKkslLG5A2ftak+X2Pw6VmOdy1aU+0rSQcrh8oCaZnAjFqKZCRnffmjqxCw4jePRPf+gwArZpPg+9jcXXdNp/9S/dhLzn48KhFeKFwj4PBYMLMWpZhNWwjT0qpIYXdG9QFJgWXJAxdrkJ9VJyzf58/RLGB40k33nfspuKmIMb4zf2vmLzqgkCVtpm2ICYlHYj982gAE5hfNKPqFeRROTABJQcmR1VRxbrkfJTC8ELhWwHF+1zyuF4HDvMSBJh8SMrVCbgt+B2xG+Qwwdak2BVPWIWmQSLbGRsT9FK38xxRkWhPaEgO7F/ZiXP1FItkWujM55GonM+CHDcoMWvsNnUfKu8DNVjQtY10zSH9Qc+vcdol2XWl4cXUALPSHjtv813M6eg7hFNEMJsmZscjo+CCEaFBbpqA2W7wt7ZtGTQo1wg6CToJwsJGZFJjsddNQ9oM2jE/pMSakVi+rtHmQB936yM7WXwZp2bbCnIlb2+uGUFEmqB4+4qss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ageData-0: hZbwkjVY9w4c1MdNKcgG8fFVBCzMrNRIX4u7d6pGn7glbBu0zBhheyzH2KoHQhNd5LfENjE2cLMjLNAQ812mp9tWd/jgJJNvlfoAq5I9LC86bn8cKiwmhX8dJlb/jgbWaTxluCprV9fU5W/e61LtKfz18MRXCEAnTUMqUh3BMAWOd16zy2yPke0BhrO/32lHrBqRwa4T8iqA1/G+iLkOnEdy4edBpNUtXfOq0JyxSD596Wbh3c9jPIvmXM3GJr+NLGsZAEqBFoYPtR4yoViC/ukJVmiKUv2MtyJN15cnaAkEPUVrvfg5exdpPndOoiM26dqeyZJD30Y5OhEQpIMjQXRg5CCyf/cRFMWGrLoR9QKfUnTESRKr6VoGwhnON+8cJRS0Fq1RkbGDvg8IBXmOO2BnNbyYaMKQ3ghEsA6RsY2USbyJou7iKYPYCcAUCtgJTlJ36jtnBRNjPeo7WPUuN9htXvdUnoJLFXHkZdfollitFrG830w6EgV8Ck4qY7e/RUfbw0qMPM0EVxF3nmbcq7eTHLLy3TRNtVCF+aI10solLCNcxFHXRWK7wdn+fgGQKCdKweEijJ9qhw+k3MjaV3LgZZLNEv53DFM6pzj2qko= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64876a3b-8760-4d9a-0b64-08dcc9432d67 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:14.3803 (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: kTKlk5qWhqor+SqoOtJJFUjpnItBhaGHpN7TPYWsKqixAHE0NwrU6YcPwFDdPuWwYotLrmjKEBbeFVcP5iza00OIOYSI8awA5G7XXcWVQ14= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6771 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: kVC9Z_ZoR_oOeSUee3uYhVkMaVG1Jepg X-Proofpoint-ORIG-GUID: kVC9Z_ZoR_oOeSUee3uYhVkMaVG1Jepg X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152938_471251_37FD557D X-CRM114-Status: GOOD ( 19.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add architectural support for cpuidle-haltpoll driver by defining arch_haltpoll_*(). Also define ARCH_CPUIDLE_HALTPOLL to allow cpuidle-haltpoll to be selected, and given that we have an optimized polling mechanism in smp_cond_load*(), select ARCH_HAS_OPTIMIZED_POLL. smp_cond_load*() are implemented via LDXR, WFE, with LDXR loading a memory region in exclusive state and the WFE waiting for any stores to it. In the edge case -- no CPU stores to the waited region and there's no interrupt -- the event-stream will provide the terminating condition ensuring we don't wait forever, but because the event-stream runs at a fixed frequency (configured at 10kHz) we might spend more time in the polling stage than specified by cpuidle_poll_time(). This would only happen in the last iteration, since overshooting the poll_limit means the governor moves out of the polling stage. Tested-by: Haris Okanovic Tested-by: Misono Tomohiro Signed-off-by: Ankur Arora --- arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/cpuidle_haltpoll.h | 10 ++++++++++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/cpuidle_haltpoll.c | 22 ++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h create mode 100644 arch/arm64/kernel/cpuidle_haltpoll.c diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a2f8ff354ca6..9bd93ce2f9d9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -36,6 +36,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 @@ -2385,6 +2386,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..ed615a99803b --- /dev/null +++ b/arch/arm64/include/asm/cpuidle_haltpoll.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _ARCH_HALTPOLL_H +#define _ARCH_HALTPOLL_H + +static inline void arch_haltpoll_enable(unsigned int cpu) { } +static inline void arch_haltpoll_disable(unsigned int cpu) { } + +bool arch_haltpoll_want(bool force); +#endif diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 2b112f3b7510..bbfb57eda2f1 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -70,6 +70,7 @@ obj-$(CONFIG_ARM64_PTR_AUTH) += pointer_auth.o obj-$(CONFIG_ARM64_MTE) += mte.o obj-y += vdso-wrap.o obj-$(CONFIG_COMPAT_VDSO) += vdso32-wrap.o +obj-$(CONFIG_ARCH_CPUIDLE_HALTPOLL) += cpuidle_haltpoll.o # Force dependency (vdso*-wrap.S includes vdso.so through incbin) $(obj)/vdso-wrap.o: $(obj)/vdso/vdso.so diff --git a/arch/arm64/kernel/cpuidle_haltpoll.c b/arch/arm64/kernel/cpuidle_haltpoll.c new file mode 100644 index 000000000000..63fc5ebca79b --- /dev/null +++ b/arch/arm64/kernel/cpuidle_haltpoll.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include + +bool arch_haltpoll_want(bool force) +{ + /* + * Enabling haltpoll requires two things: + * + * - Event stream support to provide a terminating condition to the + * WFE in the poll loop. + * + * - KVM support for arch_haltpoll_enable(), arch_haltpoll_disable(). + * + * Given that the second is missing, allow haltpoll to only be force + * loaded. + */ + return (arch_timer_evtstrm_available() && false) || force; +} +EXPORT_SYMBOL_GPL(arch_haltpoll_want); From patchwork Fri Aug 30 22:28:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13785697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 438A6CA101A for ; Fri, 30 Aug 2024 22:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GoDd3Vvw0olxHaOCVP9OMVVOWSX6s/h3L5eCSJMIZTA=; b=ogEVLyGKSusEYYYHcpHLdcj/93 eYiHYH6VPyRale2hUNPF6FH/oDUMJivFvAUkAyy1HSfYARC2OCMz0UQSNqLIGMQ0fOm43lZvuWKRp Io1pMNiaZ4Vji2RtKDP65r2qH1n0D09ZvphIPhU3ZOP0o0Lkesc/fNHVnvBBsTmtsABkW9t+Oc3s5 +n/TUsdkw6rigUfMoLtLgh7HIXYc9yvsb0AFLwuSbVMoBBNI94gXpj40yK0ricyXyw5LRdy6Ch1d/ /aRmVDcB+OyZAGsMhtFiwiTHY+quL6313aHyRF+biXrPyWs0wiyTfKjzKv3GxfqfQEgdm2j2wu+tS rzmh+QBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skADT-00000007ufc-3AK0; Fri, 30 Aug 2024 22:35:39 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skA7k-00000007sQb-1Zcn for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 22:29:45 +0000 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UMMUnr004044; Fri, 30 Aug 2024 22:29:21 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=GoDd3Vvw0olxHaOCVP9OMVVOWSX6s/h3L5eCSJMIZTA=; b= brcVIV56QmHJLvVHilXE8FQ3OQzZxsH3vPZ/ri7S2BITXTy8gVgR8/m6zuv+yLaP UKPqqlExw4HLElkcGvmIyv0m6rVPrNxEDAFqy7aYD2dWqjC0S+ld+E47FqFbwAGU pH6dmI1DV/Sf4iSapgqH0XXkRbG1AyO+D/m/KY8EgZBDzxlKpeg0Qeaf96/jXc+h Q/s1qaUgT/4fxk9iZyxYKDD0fVhqaWVYVgjJVeibFKE/P/e4h2pouDnj4nJTqF8h DUHxPJypFjyvLT/2cZocjzjMvx4thgOzEVVhZNF46VclrAQhI2c2YIYXsLz8iWBb gVKfpshR/csxDgMwC9SYKg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41bfgj0wkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:20 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47ULj9dP009920; Fri, 30 Aug 2024 22:29:19 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41894sjau8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 22:29:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZbsVq35kPBUNTFpR2c5/5BXnOWSpfqVeoaHiiyy/RLZQzxfcMZg5+vJsHG38DbORZmNOFrbFxclORjZ4paRCcmsekBcYzh7WswDV7R60o53vC5VchpMT6wJGWFzyiWX5HMOwWZQUxwtzvEHZWPuBcBpksy1FUlhQv4EH/fOrQ4407Ssx0usccZMua6k/lveQ80ur50wuv1OivfJ3qFPLXhqZcrdYeqlw+Dcxcj8BIVFt4FaGdXKTLGyBwkY45pBSRVtD5dp4RFkvIouX09B2T46yaG/rrSI5KMqO5+0bA/+kg7VBQWijiXmFKtQg8QrsNz1Q5oDZy0DPOZo4BmJIhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=GoDd3Vvw0olxHaOCVP9OMVVOWSX6s/h3L5eCSJMIZTA=; b=LQG1FUW2gOoapzFbybpKXsXfO0S0dl51jZO9mzY4Y6w49Y3iVNoyMX7iXPMUfq/Vlh7uHAp6JO/gDQ11F7I9ELXxhiwaJbt8Cm5e4wl6+1ngh3fccmrvAsbsq/PijLTpHkKohJTD7G5Q1GpPLEKe1vn0NHcbs0MhCAe5kSTbu+KEsYYxRCkUVmxFkCS7SkRZqdiRKxp0KE2VV58azta6VmOtiBGPYgFle74Z3FhGPYzvIJWJgjZ3MK6z1qnLhvfNsm3VUTs3iz9DqXJrzVrRH1tFQahhtZYvsfjXQe5ox+6qJ8IfS4p9/Ijgd0UCk8LLsXla+cIOEBNFqaqRoLpg1Q== 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=GoDd3Vvw0olxHaOCVP9OMVVOWSX6s/h3L5eCSJMIZTA=; b=Q85vuaqgou/JfwGowLBeXRLqfe84MXClTBV6KlDhTrUySJnKlv541oSqInBjGpG5glB5WHCnEs2xZzyEEdxZV1kbfvUT7GlkcIvUhlyvqq5pUG0ahuXB1+r6VljJA2GhVbjXX1+QNj+m9tKdewQkNhaFXHQzd718OSSfNBWgZkk= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by IA0PR10MB6771.namprd10.prod.outlook.com (2603:10b6:208:43c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19; Fri, 30 Aug 2024 22:29:16 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%3]) with mapi id 15.20.7918.020; Fri, 30 Aug 2024 22:29:16 +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, dave.hansen@linux.intel.com, 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, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v7 10/10] cpuidle/poll_state: limit POLL_IDLE_RELAX_COUNT on arm64 Date: Fri, 30 Aug 2024 15:28:44 -0700 Message-Id: <20240830222844.1601170-11-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240830222844.1601170-1-ankur.a.arora@oracle.com> References: <20240830222844.1601170-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0011.namprd03.prod.outlook.com (2603:10b6:303:8f::16) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|IA0PR10MB6771:EE_ X-MS-Office365-Filtering-Correlation-Id: c9ec3a50-945d-4d9f-0302-08dcc9432e93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: 70pBO1WaLyjtDYN/SlJwrgn4+DNNfy+qlwLWvqCH8C/LPB/R1mzMgzQCmzpO/w6tw+hTAH2JLLBuqAeyECIhUEHZn2P714jHa/i3baBkjip2Pc5qCYMLzHe3Bn+fQ2nhqXtWFJX9c/iWfRqirRkB9IxsU3Kj/Plf6G6YL129ZAAKfRBLZOihUPBKNbaWZ178NLGKcYJ7aZJIG3wI0uiN8/cmCFRTuZaVVVnBfcM2T+Sm3wMqf9/87UMKwzEZh8HkDq5aPXcN0xboJPQGoVst30IUGHnvz/c+z+P6bZu4L8gXUkszyYU6tv+jhDuk/KQv4C2Wr5q4yJS52UaHGGcEGFJNqgCZ1LEQAsC8UovJHK4WixSjb7eSUYsp7WASiqMlvoiTF4IE0l2HgwTkb97O36UImb+ptaZRgkXN9JQF9aKS2WxzLDq+tTx0QX3HZ9gxaHQ8vlqeOI+EvC3mgvnVO7jcvvDhDAOoaKUCiY+8BDyDYBT1NW8uuYD84g9R/zKaSZLJF5wejlRPgaHyP+spOoqMCssLx/6EPFQBsz1t0A6kDr2DR3EGx2nUn3lr4WKbS5D77CxWSajlBFXRgkm5CvtOTSMp9tWNOZMphjh1RLE8Ej1XPcZS1vGW7zHQqU08DS4xbd3dl05s1usEnElrx3+QyEfSCsiR8FE6yQzXqvdNL0ZoyjOYiT5fCX8o9kOh/1d6ZffGD6g74bE5zTCpxRe0ur9zqocSYdCMqzRHRQ3jlFhYW9tBC4VGHUHi71mmvqE9c2RbknsDFdMZdKqW6RfeH9dYQYD/7VFTWCiR3Y/v4eR03ajkQosiKvI6oCm5oX5E6v+u9MsdGwhwJN9IXNoT0uSJN0M/Pu8Wym+WXFGTx/VF4IeWq1kqAryLpBHycnbnPl3OMjFCdosU4TFgCp4vZSvTKvzsFuWxVXkd7JFlbUo9LuAAKK1qheLeI4QK8LqERBCRc3/P/WDaKPFDpkoTxBPlawW037Mro3iaweV1yWjiyZE6Vsm9l230YwtWSq/hAvmIMwGTCQSV3YAQJvwgswDXW08YsFqQH9cbFQwxkr24CEKAU3Zj4uWjIAQkp+hz7FhZNHS8rDQ1CsgY+J4CrfU6PrfGyRgtpKMsTG6t0u2onbRqbE4I4K0gyLlD4sDN5dXmZFnP74ISwvJdC7TqOaRDOy+QlbxnDoWSBPxIUDDBjNMRKdz33gOIZ/54+bH6OiftYOTTqiVm8nURD+ktgR7mxskqE/dT8u25cq22UaBFMfNqAS5IQYeCB56yA2/Q3F1+xUSD2N+VVfimXwcMUK+fw46RRpCtjW///mdmEo+ohllExSFibd4nCyhsyryD6m3cDQcjeG2lk4bZrQ== 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:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: znMxNz5+VVKqyMlTSKuZSR2+iBziAilmTeiVN9K43w+6YuMlIEsGkXP24DL0wKxtfDogYDjDslYt4CSroE/m7hfhXuoI8Z9BGqeLlsjX0WCJjITChtzEOjFQ+i9yKyRrPTmMrKgHCqHzepYoA0I4Ob6oWsg6J3HK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Ud2C89p+KO1YqASrAUHTP9+Pbc9v3Cm3zOqAJ68Uk2kwUE6vnJQ8/j+YIlg0KuS/K9S72lFQgI2poXh0JjEEncCMS7RABJqrMrbnEUAA/SfsidcXIfCQ6VjdV39E583jR+aEfOmC9dd27756sM9O+gmXEqn78DDHLJDGdxRteEfML2SW5msZ6824JPV62fQKQQQNwVgd2aFtuyJNVI3LRiIUjmOXkcVhA9MC1nzNx7+VYZYUkRfwJ5DzjYrUthWHc75orhHnDjO+utx1qeNyX3HNKd4LDbZ8YIP4xHgQ7L3Yn1dC72DKbsVkpfG+kSQmTJknAbrnuSIJsNGtZtMtVYFzB7q0ZpNtRr/p81MJ9TblFm6g== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: R4Zggu8y1bDzglZynSd16FLel3ZznnMWw3c1LpfTzqpal4EoALglDqSJoeihIEOPKO71ly0o407q6rMUfwnj4kQ2hNmSMO1HhsIYFBZk2rtKyJ+VpfpUXLpDny5sQ3uvOggwbsXRp0ROjuORA61eoIKd72LGDZwpm3XqAEbvvAd5kTBeorNM+ea5zc95hK9VjMY8uMUST574IcTW8Qf6wYBPZLDDjfX4N3ya1jTM0UVkixPyzT9nVYTE0Vka+lPlFCsjXPG6vV8097Qm0i9el/a5KlVuqEBYE2Affp2pACGt5nDPpJKFU73cO4SH8UpcIN3Rhg9xdOVp9eUk1FgZY+3fPrqyUFW0bkuQ1eJ3A24bSUA9DHD861caejKC2eOTh0oMZQURrsk0NCkLof3iWLZ9nEQ0ezUmSahvpwacOGJyFKHRpk11XqKEgoyAloaxzh1ZQlx8O4y3IPe3UPeztsL7lkKKKW2EG3rVmriEjFoxuaj1IAmiBGMBSgyLLQNRjIWUASDDhAM6CfjvtxFgYSVtyxjxj775UfMkmuplP2cNVsZtqBTEB214NmN4LT4LK0Y1opA72dx2c0VdEv7/NHh89I3UzXuvJdhDq2pny1I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9ec3a50-945d-4d9f-0302-08dcc9432e93 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 22:29:16.3933 (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: EFX3x6X9v25kWlB+4xFBjD/sEnU0QJiTtyNXVc5tBCefw9lqaS3Bq/ZauMlhzQr3nmGehR3N6w+hOXqvhbXK/Zm/K9+bLq/nVZRcQte6pIg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6771 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-30_12,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300174 X-Proofpoint-GUID: IQSQa9jaSBL212KgZuZrHwbPI5wKn32u X-Proofpoint-ORIG-GUID: IQSQa9jaSBL212KgZuZrHwbPI5wKn32u X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_152944_561404_0F131E80 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 relatively expensive time check it is limited to 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 fc1204426158..61df2395585e 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)