From patchwork Wed Sep 25 23:24:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812537 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EF571591FC; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; cv=fail; b=pE+UA0twlqBhcfN8CyrbGrvnxrY1N8Fia6ZpeUZ3g4P4kyonyRMHHcREwzxMPG8X+kSzWg9WEW5JN3UY2tgvWQ/DgUk0fdmsF9QubVU1LBRhYumGLNOmqavHJAynXUpJUyEkf7RKiYqGSc4A7CVdJ9xsEQYEMkZlz64LJxxs6OI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; c=relaxed/simple; bh=h+LFmQ5q9LcaGHi0PrPQz7lccrjdn+vfUczNGQ+nieo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=O9CkYP1AaiMw2hHuna3Np6T7zaP+IpkU1YYGeSIih0uwoBgmejSW1Zo1YZtpwGjlG12n3gHJxLpq1e68QgniB8pkXfAKxvvMNBWv+3thJwU4bPytpL3ckK9ohJPKJyNEj4eX4UKIU53iD9zmJDOsLRpYhpVNRnjF4bjK2gyMWHI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=bpb0r6Um; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Bxq4CdZe; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bpb0r6Um"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Bxq4CdZe" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLnNVC028926; Wed, 25 Sep 2024 23:24:36 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= bpb0r6UmOXZ8ypjMGycg+SQjCzXL2wxKVcV5Wx5eo/UarIiGG7xOQkkjuBgStFU5 jV7S8d5D41b9LFRCJDGInoK7v6myRls3ad1wQj6D2nw8fJDPaqhKnMvn96OR7Wjl jjenWIKfwdTWmVeljBmEtBu9jESiBRD0DVIszpO7wxQ//i9Ye88umSJFQ0bqpkjk i2LcNbDDqNb1aYR6OKxEIH2j0SrkxYtXD5xMq/KfoJ7SSpF5lHQlJkDTae2iL2hX 0saGNiP2zb1dJPIv+taeRK8krsZORERolMLb+U3kZH4yxCGTEKxesE75y/irQWaW dWpPcu55tnzHsbpQZ9DUuA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1akkuk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:35 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48PMpuRI032835; Wed, 25 Sep 2024 23:24:34 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkhnpff-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GFVN2SrJHVthfW+E1/SpBpsSlZuTQ1j2hOIPn9HPFH1788MWQ7F6i2Lsp6JI5/HT5lwykSPhBFoI3noHXbg5+jpE6OknWqqhNnyUO8wpt+lxBWlckK/0Qi8sZAPw/y9NRYdMODY77uwnXNHYeVJTvkaFC0QcyqskaxgN6MvwvnAY60n6cKNNlCpKub4HqirGyYi2lu4+3YllU4CTE8U4qszrZJbswLJNIWZABrmpRkwtKG8dBHZ08EjJ/qploI9mEeEItml6S8gqivJarJF8RVLfhH0ta2PaXU9REWQeV/gPLiLm3oN5ypYhYwrF4jHmDkV/x/YLJ0NTf1n+YWcD1A== 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=QCnfWR9zpmxV0Rubh7J+5Of85tzvCXS/OTqYe3tiPcrYq7NXGELUBP+llikF6UeuXQPbtYN/EgfjKWXs+by04hmjLyuu+Ncwl0v/G635ym0WT9GgJbdHVXNteqcNcBmSJAK3zVvHiit5I+mmm+ihSnJesiXhdV/jrqV10BZBS3wURy5iahvH+EZt+FqiNlp0tKOtE1TkNmen+W+yJNOViA2BaY+w+3MKCR8He12J9dtcjS/c2G1K6Kkm1WJOa0bsnJYkq7WFok7i6NYjt1Buwnag+tCVqz6L4FFTn5tT3X9o7bNzBD++FKG0uW40mJVzKz7qh7xxtzE2aODWZMBOAA== 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=Bxq4CdZe2QMbH5Xrv5IMmH6YipThPiyFj57FhBE5WMPeauPJdiAqBIfHKYjc+zrP4Fxi8+7jFE2ls7aIeKs0Mu9hC5Oo+sGPU+PvAh3dS7BxvI+85tHbAg/QRUKs34d/9ZG1RXs2ez+H+kUTWiCOPjmuLamwbdTkVCJlNk/TgXc= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:30 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:30 +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 v8 01/11] cpuidle/poll_state: poll via smp_cond_load_relaxed() Date: Wed, 25 Sep 2024 16:24:15 -0700 Message-Id: <20240925232425.2763385-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0140.namprd04.prod.outlook.com (2603:10b6:303:84::25) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f0a1dd1-0c59-402b-a1a8-08dcddb93404 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: hpne5GUjNew4Z7Ug9NZf25Mw2lAGkwpFoYNKEPHktMal9ZY9g/zV5YBps4hj8Qu2e4MvQGi9OPTrx/BpCNwCYIpTha1Shchl1Llc5DcAM9sN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sbrdFzAMu/bJb7SOK5vjKPUOj8mmCKZkS47KDL6YhvoCFdxFKUR34tBTfdiYshajaQA1+6fnGqrNjtGQt13Z+HSzZDWDq2WJ9mUxyWXwOEM0+mIsvr31thQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8h3R3M8qGKSWvmzhYzvSMLKT2Tkymdlf21g8etj6H8yxX9m+nsNtY+pRenDSQrZL5EPxayjUdFu4yZ5nhixikY4EMKmViNosotO4vDotDiUIeCwjKW4DbAI3vP2wsgyXoB+WKi4kTO1DiaaVuBFkkjwLwSnXaqywveYhtw+MdkYtEoegU42XHOAb4FpVd/q2C2jWl7z2HAvDD2eSUuVhbdVgy4qtc0uDTfhYB6g+15DrH86vS/fO+aWA4uix62B1mSV3UuwogEf2q1p6+C0UfcjGyEXM3KuvNUWMTVpXPBBj5iTA29p7h4GahkoejwYQd60jLAOKGzj6XKyxD9z5H2/ENKZ226OGG+rkSaxY/SwswOC9LWo0JzsW8XnEvnERlMjJLZ+XYqArJIFd3tSmoS3TlYa9EkAPLXkK6R4o8S3RQaa8D/0n0mZhnWKZXH/EdGMzjctA4fu+yeB5z5kZZwBNdGdbpb6ml/eD9Sqj4rltzOP3hFxG4xUn2oJBIVWwIAk8wXnwGJ01cdaZ5dRav4tU618O+Uh0L6Te2l1VkUGDmxbK7l29kmHcTwOdKHmQ6liDjaLT3yWlhXTbuUp1mVXvL3hHv6/dWxkoI/7vnbL93WRPgjGCNVggMWCjhom4NQdoyybGFqI5FNVdVYM2k34DnYICHUG6SAcc9Adl+XyjpGk1Fl3NHDjXjhch1T/uKyG4+FrLU2NEC9B13ORGXrFgQ/Ix6h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mN8t00XhPQgDfchbHQTkIkyME/8XFvJQFV121TOuMdzDYl6yC//YXnv+txSasZRTxmBMES8xVVKGET/AXyypThDDIDjjVe4rdZdrCFfvIGMgefBk82+6/rapBatByFRigLfdp4iWg6TiK+v1URw2dVnryUz1arpOKSCi7OPvnrYc8wUxGH4QAcg2BUd92CDQmSln4hjtNlY19hudjfbxS14Wr8IBooPZd5PdGmrfqc/MTYR+WF+MOHgZcZjEgqzhvukNUFHXI3j2OatKR7E1TyFPa7qYhAczfkf/hTcv3t5nv0/a/ieikBseA3RWxbEr6UTMX9Gb3AWaCNGvBycB8RVzx8PZNdzR/KzF0wwlh8Wwh3AuIXlnEH/VtJ8QZ0krhGsQARR61/ddLghRQwjm9dvOH2AURGk16BXjQNJaeqBAPsdqiJxU8eE76QEmbq2MAg8JpL7jq1PE6aBw35uQxdl4jrI6p0aqdOTdYLzEFBNI0pOI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f0a1dd1-0c59-402b-a1a8-08dcddb93404 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:29.2626 (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: /4S3IaC1GZbTcHBi8DcrgH7KUAd395xYqHiG4WqP2xs7qxyxVos8M/8Bwlfh0l6ehOolTjfr2D9BifHUdvRuNvb9tO1rs9QIpMInqgJOtGI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: OGYJDZ4dxEJd9s9sioHTNniV1czBdFPt X-Proofpoint-GUID: OGYJDZ4dxEJd9s9sioHTNniV1czBdFPt 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 Signed-off-by: Christoph Lameter Signed-off-by: Christoph Lameter Signed-off-by: Christoph Lameter --- 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 Wed Sep 25 23:24:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812541 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCDA71A38F2; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; cv=fail; b=RZNifPcCjZl8QoXzwCHBrsPVjDi3NBvO7YS9z34MbwPkTIuBznZOZevZIEunTeXk+BXrgjXBRUagjJVeCl9C5vSbM2o5+XSGN9fLNJhTT462bqHBm4rIPk6TGJn/0c3YdflTbkZcONchKZxtEtCQyJsc4uc4OJxal+W3H8W9lKc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; c=relaxed/simple; bh=DNK6XVE+FzE3bj2MQnnY55y8voszKiXo6alHM+hQeZw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=D9dHLH9odsG6VAtfAhPthaOfWMTbfwtOjimfDlVxzxSaBZw/YkITwjM8JkY+3YPtoWBBAl8xYswEUbtBqudlHp8RTwWLwwT31i7DaYG2wESJZJ4fupqd5JOF1Hi/+8pPAPbhBbf7Y59J65zwtifm4IDO4q5pZEE8YMj7c/CJhug= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=VUqxm7+u; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=aTgBld22; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="VUqxm7+u"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="aTgBld22" 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 48PLnWPG024761; Wed, 25 Sep 2024 23:24:36 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=Ct41YzkAvMC8w2J1TAKyBcOHPAoVVS1pNFrZqsC0dqs=; b= VUqxm7+uPkMqJwogSkW1T99VoWmUEydXQzOmsdQguoqHb6UTOyUt79ZmQAeR7lyb 4ReIukHC3vY7qpovoXmR+mzJaHcONDJjj4c7tiNzeX3L34Esy5+npLR9M44nLGLV hWK1VlxjxVBU9cUS2uaL9FlU53LJAlFbqxXbbOBtyY331erx9g5ZoWf2ETQJUiyC iF/IP2r9FJQhY0GiKzyELjkk+WP9wvB4LayA5PNKa6Uj1opppEz5QH5+DKRA9ZTn jHaOpZYeTwc+SJRS2CR10rVKgYv7UJ/S09xRVb2edB5RhebWJyNgYexne3/vYTS9 xcSygNU6XNp0NRCsybUiIw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41snrt970n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:35 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48PMpuRJ032835; Wed, 25 Sep 2024 23:24:35 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkhnpff-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oYGx8r5Htk7GEOpFYrH0Zx2dcRDf7Eyc39f5kD/BdlCIyJF4zWAlZ6rIHalFsPIuGWb5UEsqij8XblUfJve/yBwhFyhptIetQQ03sNC5qN2TGhPec4dWD+xE7BQFB4860ABska4FdL9pAVVN3kc44UQCU2aNbWNLrtFG2OY61TM51kf7dVnL7pasLsLSyLHQ5S9Ojo1chXj3EtfV8DzY8SH6UMjIq5YW83gfaW6WGQUywk3NKx/G76rLAJptYSdO4h/tz14jwHDFGsnDVeyqRRpl79erGmTSPfNSBGtZSv6B7YwImQE8spz94Gywm1bR7pdCb+QPR9i+oEsY7Zp+UQ== 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=Ct41YzkAvMC8w2J1TAKyBcOHPAoVVS1pNFrZqsC0dqs=; b=sQrIuFJfu2yQTZtEVrpNRewcGvTRdhF/8GNABw4Umvv/RBVW8Sxkw3bTs5NgP6EIYyh1kjCiLxhdjJr2EpcLnufqaRH1oRmWd07wWLgnUjPA8T7asTyTeZekBwVKHK/DBPVcls05RktLKzcRVTwMVxvbUSPHs7G5aAa5wHzuvV342fQH1bnfu0s36ctwFD2m+3jE+DRBuvlqpmnDewhGhfZj6r2J78aRfCyap8azfYyN2CNEZ5PnqphqqK33WqdTTUQKqujJahyu7LhgpOm3BD94PDttgHEJG2LYxCZysTCpHmEbtQTM4aOoyPaV3Ux56MkcxHVrWA8KXU83l2LVuA== 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=Ct41YzkAvMC8w2J1TAKyBcOHPAoVVS1pNFrZqsC0dqs=; b=aTgBld22KJjdFxJdA+olbeHDf6sBpxmfBZQg46dL07oyIg7iqq6IddDr0QFZQuIizwuL2vAFCWWu4Wzo38rlTbQR/F/rg1SfnuXWZiNc78/mZGIchxduIO1mu0+ycWENslk/F6DGII/S5fxhm+SRQeR0p6/0FtmeMf1UtV3Cxfg= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:31 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:31 +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 v8 02/11] cpuidle: rename ARCH_HAS_CPU_RELAX to ARCH_HAS_OPTIMIZED_POLL Date: Wed, 25 Sep 2024 16:24:16 -0700 Message-Id: <20240925232425.2763385-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0134.namprd04.prod.outlook.com (2603:10b6:303:84::19) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: e83aaf0b-2da7-430f-c81d-08dcddb934f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 8c/XQdMnuB9n5gn5hyBIwg7+esOnDJ1bYR39ECW6kzQGHnyRVTjhuoWlHNIFge691ogqg2kjf8ZFd9saIq/gCZ1iRTzvlhIH8ZBDUVeTcGgd7eGulD1UkL1L/6ZW6YVYnFSnttcRvRXEozWPCsx3xNt79Z7atXpaUidgSuWnpSH8G0AN4cTHjRqIm5FZlXczD7Op09bg6K9wwmylYEEzBkdi48MBfv+MYZiW/T9clFGUNiAaQIMAousYhJ9G6G8wEBgFy9E5tsVPCqf9wAuj0yWfrSZhJVQqkXTiuCdgfg8WGqNF7sIk+gDfOCuOantMKxAOq443yzt7d/COwmTgbS0KWdud5Bg6Kw9hjD3sz7meL3eaOwN433xdN3hzEgN07WPVa9jEcgSxDYp8OIow4xxJ8zhmgHVVjRwZax7crVXUem8tM0j/qb0PArl9dQZrWAbkRIGZQcvDho18C+KJPA/x5JR/ZuDcGVY1hs5S7XGTeFzKClfKxYKwjWSNEvdpTVhvBM+/yTfq4nsUNv+KM+hIEKGwMprDJQpMWFo52/NYdps1atfUc665MdRLEZOZASA1FOwW3OBuhjHf4mOujCRKXpXNy6+CER0+k4dRkjBD/oV1CCLe8UF9hNpbBcYS+rwdysj6wz4lgzul989+EZYwB6dcniikbUq2jTtIBiPZPC5/XeZjNJoXL20DZAOLNSXDNS1eYSzdzhg9DMFV7yqCT9pdpOUdtUMhJKvIj9Wrl7a+FYYJtxx8wADuvDL56Q+tqfnfhwWy7xnpTV1sS1M0CM1h5e0zkuypfPyhaQsHmTDwgg0WwR3E5Zx0tks6/dtZIe0HZnZ2rsdUZ8ekiXW4zsalMKKMNTS/hL9ttr4jSeN/5K4rF5UCGNxZkhI42e6VhQ0cBPlQ7W7+VTh7BN/VgpIcxYDwsuOoH5AXSHwqb4dljMGiLdWfkulzdOyBtcMUuElPIALSHm0S7BPbgmBBP+Mcv0YWPknQqT4ZxxxHvh16FHAzSzz3pAnPQuFr7FIWj5su7pdyeYcjS8cZEI6xWVMD1T6k8R7Lhf7TbLR6HbTtanUjKGIwCI2Y7mViTHMyodE4zdQIbzsTNej5tz89wKPQnFuU5ZBCxD4PmsVOQTMeT6LQIhIHAg8Hy5KZEj9y3s3IVwusHoEDubVQQtoYILMRjfS9VbXMSnX3ONwsXHz+f5xYCmJ72tWm27WHP3H7IPF3NX4E0U3yh79am2BRnrMQws+EGJMudzbY+6OBzk6cUfImocQeCsRInojwBIPU+fYFB1cDLLbWc/T3pA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2FN+Oq2cz39iQBz4bwQ9qEPOeHJZAA3JOpYzHHx8NkW6oea+k76obfyByYhHizo1jSaYtCsOmvSYWFu7Oum3STZ0gF9zYCSS25RAeY5/aYKonNjmBuukdKDJyVufZpN+QmgnbjFBbKeS2Qde4ii6eiYoH4tmIpjiImLMwnuD0v/GE9DcCYGsA2XvAVhyCM0gD5UjAUjzIJsaGKTOGXjhC5jKL68WeL6W+3R48DGgarVI/m/rECxTY+C9nTJvJM5rgEwInMw2GWumwiZurRd2D/En2id3IDNDNv/CoMLk6Zoyu+trVSs1WZi4RdcL3nDJ7vkq5TE3bWOPBIWSWTmjcxnXSwQx6cYdkpkDwaZqbOOqUbr7xprQ1I2A9ghfLth5EY71NQja5cTjW3plDaTbr2EFanpED5HSZBkBB/vXCzUxnKCYMfysJ2qrK1XK7fT1mKo9LpKqONlYK/eVrMIj/oOj+7QsyKHok9xy3SomkzoOO+uk442ehM5v1vTpip8RhX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RmBo/BZyfq5CZaCvLHDsBXnntPTw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5Mqa/Sl5tO1NGxK4sUbjYETOSnzXxWoZhFEtMCjgDEM4J1GpHF7/3O+rTkFF6LRBXT9mZQs7SQIUVVg85RNoi2lSm0BeyijLhIz0rKLI3xxnL2qiF9rniZEIjmhY8NRlnl6RW28RGuojVhxhrj+KLteEJr1lPl8XXC75Wm3Z/RbbYhUK3CHkgNU4zjeE64gQwXFDBWjUXf99VHaItyCPlhODVyBU9DkgEEUImEyHw3hZtSlfNaO89qayDEBg+4Hc9SNWN9I+y9Qn5z+s9Zy+dlXKE2L08wp2Kqskd8hRJ0LSPostr0fc14XFoCy03uNBl6j7rBnEKGpaV/NNcSd8lzsdwEtmRz0JosD4qiYSq7HCL/BZuluLbimNdVUza10bec7KUShicVsgzRhUeaopxXP+1NTCGpvzUkY4nXU2HsFkj2A1PHAz/AOtdbeV0PQ1WN8iqyrOdTKf52gem51ImHPhhWZlmbgveucruChz+86xt5tiQ69DluArGp2B/g1KM+k+uGBBxubnaEyEBs8z90S/iDNKojuDlfw9NiF25IwB4KNIucHh2KcX2U7EhwyuOfq9q2FwF4vaDoniQyUJVqd/fzEkj2L5Fox1bdFvm5g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e83aaf0b-2da7-430f-c81d-08dcddb934f7 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:30.8669 (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: h7umd7nKsGnXQFOCH8N3BSi5TlZVzWpmXUi+YelaKUyf7zGjXXjZhyskC4dPK1ztRFKdcFrbYfl8g82mrMU/rlgBX0jrosqU2VRPt/7YJe0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-GUID: R15o7r0RjoIQQ5HHe6I-U3VOibnUvFEa X-Proofpoint-ORIG-GUID: R15o7r0RjoIQQ5HHe6I-U3VOibnUvFEa 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 2852fcd82cbd..555871e7e3b2 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -378,7 +378,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 Wed Sep 25 23:24:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812543 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D86B11A38FC; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306735; cv=fail; b=qpQFghy5ouj/KYlgs8gM8VsOImK+MH8rXs/s7WKq48c1mH2hYzwkbDdJKqb2RBabv2a+jBWxn96oi0OE0t+xuO6bV1VLF0UtPdWx0+tad+hmG2Lu4XEub6oU1SzC/7n2rgRl0TlkEiAz2r70gED1jChty4VhWZ1iS0PugxZIzW4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306735; c=relaxed/simple; bh=Dvjt3eCBRep3bUPqXObiTVB7aYKpZUEyGrwLFUZIsbQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ie7ttTvHMfOMxogp40muTvYBDBmtSTxAB3kuumRlFgWPk+nV49c9Yu0xy0wnN6K24In3OMkA0paXiPU/6ZOfdmVN9GNWRu/L4wIPGtAZ+gtSedVbaFfm6bp06uHqhWqkxGIZUyMPw+P5XVLXBfFLtsBfK/zQV7CmpWuj8kwLNjk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=fLTaC9F+; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=fZMWTfbI; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fLTaC9F+"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="fZMWTfbI" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLnNPW028932; Wed, 25 Sep 2024 23:24:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=f0X4wMl3YPhGfRvYRntnxnU7wDqzq2ggNFPG5RkSv6E=; b= fLTaC9F+8D21GMI7aIxa4sMTOtWya8W1zFsiz6HryB/tH1X1v5zX3vbxxms9f1Ph d5GlBP7eYLvn+5MatFT7BgDn7Onkafw+bhhRFbCSuJVUtIsL7fdPyL9iX/aIYVFf AaUBn7TYVSAtDsSoKEDApUxUArOTcFb7vKCVF8BBTEruURVDvqDnbklFdGIFakCI KUhOd9hYevidoGghIEd4xtt/0SgX0GGn5S5Evm7/tm1ayQ/5U0Lsk9fJ7G6E/vQD 905v91obLAc5/ZobGaFspXEz2mgXFDa8ERx1kQ1a5XH+RL9drxsyBf7g2dPN44N+ 60Jy/38QWSA61QA8+Mg6nA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1akkun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:39 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48PM9nVH031194; Wed, 25 Sep 2024 23:24:38 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41tkc7x25k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l3Yn47E63sKZ45PZhYQWqJa7Sf6OpWwTG6R3JUayNPa1DlRBRLOh0Klyde1t3M5WEbsC73nDT/rx3nbme4E8+nOidy9C2sRnuk5/NZcyNo5O0Vv7TfeWsIjfMxIALeKrjxc04ZF5NtSEIpWIocZa51czBlvrkf0hs6b/9THi7q9iWT5EF7c0gnPhF8DQVXJFOIXjgYFy8Tqr8nIOE9C0G4dA6+jXI4xTB3ZokCOoz5IwOhpcxJUOcDmIPTT+d0zDNByTGpMJ+xRx7O41MD2D1hB/C/eeSw9BOG+ngpAyK6zVks3sQ3rToUfP8UrgA57UyOx/vywX1Ch2t2xAuoM5Mg== 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=f0X4wMl3YPhGfRvYRntnxnU7wDqzq2ggNFPG5RkSv6E=; b=DNoURymr6rg2oCQ+PgduGR8KpjtA+petRAF1IQ+KDSyvJSXr9Hxb6ma70uAWHJUluJuLdQYGYQKJUJuF6id8fOkYUeqX1HzvY/moOoxZOvyMUqY+ly9fgCSIlzTDE2Dabrn4V4VQzC1qUkL+HU8gpq523HpDN2UFgw9KfNMRxcgnW5DwnOscPIcZbpJvFVaJ7+n4wL5u7MaMpXpWjFF06UAujAWKvHWbQ8B+16uaG4Za0GddQai42G19hZm0R2ZHo32MdRHjx3k0kxRPmrpeY7I/5MPrDtG2syQzFms809PWklGQCWt63Q4y22slNeHaODnwfjTe2mAS2OPo05HqFA== 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=f0X4wMl3YPhGfRvYRntnxnU7wDqzq2ggNFPG5RkSv6E=; b=fZMWTfbIrmQit2DBJKErn/B+hlnMD33UfcaPk9vzlcAt5S1qWZBN4pLrI7rrq6Pulg1SJNodcncHnoBGBLZp6s2+NWHhLFbMQ1kb2bHFL0sdPLO/1MYQ9M8SWKc5SsehnilYpOVopiDhdoU5L1XTeL7sJGBLxGENR+hQkkLcHAo= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:35 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:35 +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 v8 03/11] Kconfig: move ARCH_HAS_OPTIMIZED_POLL to arch/Kconfig Date: Wed, 25 Sep 2024 16:24:17 -0700 Message-Id: <20240925232425.2763385-4-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0141.namprd04.prod.outlook.com (2603:10b6:303:84::26) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d62273d-5421-43b9-8dd6-08dcddb937de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 58Hkb5Z3S1snFzk3D/AhZV5aQZVsyg3irPJm4V9n64eFtd8OqB4Lt9T89GivSS+7tOuerev+HFMY3qxGSpTwXt1Vtmie8bow+MqQaro2lxyxVq/YFJT9vMQlDAu97H2f/bMaca1Lcp2prj153ewqw93OmYZ2kIkf4qCT+KjgRcSGq6Ypd7q3JVRe6FZ9QX2vd4sdE12rl89LOCXJhTp9Ugn5rqCMuRxTadVVJZHtYcikuSz/LhGiH16Gd1r+y2Hw8ihh7mMqGgLX0KLELHYNIsUoRG5XTvwJnPRL7TXbvcsJX5C2jCYzso8eLhlRQi/mHVkMmdU19EU6yPLBft7jbRphGoWb9xT3blQlCiJ5vbGDSBl+4KBN0pIKajm3+D2APZ1FfyNgY6/kx+0GUg7sO0Lw4HucjTLZvbapJT0u27gWcvgG1peNRTP7sYUKFqaOiPgRaDDJO34DYE9bJmX/cBG5MMKePlF1DdVMQM6SKLUq79cl0/ys5HxvFAi6ddqH3lSewh1V8QpXNXDWViw7ljIzOgVIc0plSRqYUQzzx4/G4QuGJGRculbjk5aDqQqc1ahlANzfMzD/fW55E3OmM8Z5v5dtpYQ5wGAyk5wuHqOyR4OheKtc68PYRZKLb6RBXAasoLU6+aYJsHSp0BPuZpnh5y+n8rgxh5bfQ09vbE7kNh9L59Pc+8J0PXBzvUHPaY6ohrBtzH8Fhtq73mYIGNsg1yjPLN9vxAXm0uQt6Ntdlyk9Umfyosin/23Brx80Y/jdTcJ2AmazZwvBcsQAVdivjJ+39Elm8sHUF1UmVV3Zc1OSqqGT16dl7r987F1cZJCoTsylMKWIxL8GfHWXQehTTcyn5XXXKY5P5AkuSQ450IRC/B5Ocd4SWMcy8sxF8jDC5/24tXjjThibH4xySpISHPqHYAK+mm/nM9C8fxrSFPSLi7ECGdma/8FS7drTSdGGKYQfG5nkm6AEHSeJvxyDf0hOSxrXVTlFWWpjEo2JcAE0lVyenxPlkui8QutWCyvW+i8/YjLlNxG2beg6FbgjoFtmphi1jxmIUzdQZ8n3Z813lOvwRG6MUW8ZqvZWJfWX1x3Wyrov5a3NmFRTPnKb4JzpQVsNYj2rwfy71i3QckqBxhW/UoJY1ZkRG6t6GXQwOQ5tB2GGAvLKCk7VAfiI6IKcWbwxB1VfaCDBwo891AWePU5c2s+v9Nl1gaPbZ8y8WA8XU5dj8CtJVkyfN6yK/uFI2atyh9GUN5A2Igmtbq6WMPPIs4b5QGgZoqgQt7W9LQ1WSEWY4E5JfxQEUA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-M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smm2udtndhbvDVRkCskjhO2KB+/NtDeNvuaYd3YrbmTnMSX0GoBOp6yegxGCBUUxIb+hPvRYEBdgPAGf/oLG4WqyU7xQb3BhzYz/ISbN+56WBYqmF/bUMlJTqTHLteDg6EzdGn3writ96FYqpQ7Xli+P7lq4e5H7UxF0of847+gDGClGpitC89Kfjla3r+0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d62273d-5421-43b9-8dd6-08dcddb937de X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:35.6990 (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: DfNQy+wlH7M+ipXyGOxnR65grwzJUImPh1CY+DLg7us84Q54adeckL8oF6VoJGlX1FR2RE6PX1Rg6bVgzSJ8mxpnnx2Cwv3Q1lYAay6cRhs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: ABpAFr3SAWhC1S41HqtlyxxS2iqdle_z X-Proofpoint-GUID: ABpAFr3SAWhC1S41HqtlyxxS2iqdle_z 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 405c85ab86f2..cee60ddee5cf 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -273,6 +273,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 555871e7e3b2..272ec653a8cd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -138,6 +138,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 @@ -378,9 +379,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 Wed Sep 25 23:24:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812540 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D78FB1A38F9; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; cv=fail; b=rNY65RxhVToIUI32RzMGVY4NL/lX/rnMJb+MSUZQlRsuQ4offcvF/fAQUKyqeE3q4k+HzTojaLfvtaMRpaXkqrks+7qvvz+Gt17Cfdh275jDTw7bit4DMz/P9tph16mbhdHs1omId3vKPYvohDw/MHXudzVA2NwZCfXrlUd/s6I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; c=relaxed/simple; bh=ZLsL0I7kpUquRI4Gu1oyEJomlAJfeU7LjobEfUdF/H8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=pYfp4gfOWh6cAr7mCuRD1osME0h3je+915c210MwHzoF8Iy5zrc6jqZlwC4PDcx7TsDi+p3oSmlKpXqebvjzCKTUguWUlemS6+xoNs6TDxLr1y2TV6yhTxkfs7uabaip4DX7iIK5+hZDxWb91bcLC/nbJs67QBWB6SOzXv5bmK0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=AlgG3I4O; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=etsXHiLu; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="AlgG3I4O"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="etsXHiLu" 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 48PLn1jU009861; Wed, 25 Sep 2024 23:24:42 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=vXiJvRI7fnF7e1p9sgK0zH+kDAbVkIQGw9AK7Ri3GtA=; b= AlgG3I4ObtBzRttmLqrlceTqQ8n7DtQJ9PJocLt7lnaU7gPHeaEp9EUIaleyDNba 5zf97SoEf+39iTu0XB6B/kMmpy0n2TqieoMBvv7gzDSTyKfQ/U03OXFCD6gsNPqK MBqt18+UZGFQ7OxykqK90gUr0ASldYB4gR5jF68UWHExTmHDVe6j/Je/o7qnoFna j7oxzuFcY2SRKHc/ofZMJfjyONwKpjd0BHR/hYUKVkstYtSOrbuphfa21nVElFA9 ttAZbaLVFTOKySHObCvC6ojW8Mj3EMmTUGmFopF0XK3k0CHKFoSu4hqpVsnwW2B4 Xxm66q+/GAoCftR6WuKw5A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sn2cutbu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:41 +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 48PMMsFC010115; Wed, 25 Sep 2024 23:24:40 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkb2kfp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MiNkFDQK7OtRT0ca+YPnplwcmdjJuHuG3wsh3+bfZ3RshlwIcG3SklsLCfgsSxMu4sWOb7xvYroHvdpu370VTAc2iw7U/41iypxW9esW8zYCDlUlh4bXOMShYANitDZMo6+doZ4prm80QFY2TEceEsNBqkq8SCqyekRCqfEwJUMw/MkHmCA3YrKwq74LqP6WgWkLyv+2GfuGAg+3qKP1/Xdw1hmjxjIOqzYycs61cmEHYmIk1OwBQ9kBn8dK2TOXBqStlC46CTempIBtifwsykKHKZtEqRkN6goKEFeYaXeXfckGCB5EekIoyNvIIaIgHxJSy6/eqdkwzYG6De6ZkA== 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=vXiJvRI7fnF7e1p9sgK0zH+kDAbVkIQGw9AK7Ri3GtA=; b=tyW3+x14JfTYx0IOaMMhft5VJBU8KkDaInm8Tt6Roh/ZFt5bno2hQbmLGxYFK/K+cJOdxeCU5bGjMGprPhO2Ai1y+c/VBgUsDbBh7K7w5JGo7H2ffwQn0sRpG4XGYm6reMCujYrmnw8WOeShdC4blpLlogwW8C9QwKJjfEFVi2yVMr+LlAMCbp1VAeetiImashhi9JczZW52itLvQ0gLCVYx3vqjlVtiR27RoxwmmSXzpBPo8dRBLX4h3z1suMhIihdx2TqTjQKzPus6J2W/ajcYaKcn4AFuAvDmpvnBVwGCsAJTp0aBqNh95BtPXs56vpGrpnKM6r4x7+gtw1LStQ== 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=vXiJvRI7fnF7e1p9sgK0zH+kDAbVkIQGw9AK7Ri3GtA=; b=etsXHiLuIri8rckrBCDk2CzhYOe8MpRiuT09xrdMRKxUnRKdfmlg/+dM411Ftd7hPkC7kpiyubf0jL70Tn6jQWj9lpFZOtFhbyg/Q6mbaxmEOL3rnoFtynk/AhHDl8df/kUmiM8mGXMuhHdZVV5L/vd1+JysA3OVlhWJ3oSaXSc= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:37 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:37 +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 v8 04/11] cpuidle-haltpoll: define arch_haltpoll_want() Date: Wed, 25 Sep 2024 16:24:18 -0700 Message-Id: <20240925232425.2763385-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0379.namprd04.prod.outlook.com (2603:10b6:303:81::24) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: a994edae-7320-403e-83bc-08dcddb938f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 2+He46q/8wWNfB1VvxgZFMLJ7Yo5fSn4jyLkZ4A1EYMnrMrNsFFFxpHVqEognT++fJbbXtmsarJamNXZ991V0qkFYu7hK/fLyw9OnUDE3KKKaIXZ+FtNXFRjvvwG/1j0WF3P7o5nxDLZa4FPt+ziPXgUfBr76p8pFC5EN0g0dyM0OYCQoM46qOb438rPiwPClFB+Vc6/h2NQ7LfkqpRANAObXsAwUn61HShSksmNhrdy9WYv9vQuEV/sAQ9wocccJYettK2AN9hSLokRRtD+iaP942HNSRQ5LxwFZJm6soOhvysfd+CbqHbOkXdhcJTp0UW3VT9ZxLLpTtfDBt9z7NoSTi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SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c1zWa6P0DMqcNpNxygZ2nbPrQxzF/n/FpZS/XOuDA6QrXkvWL+iblP9vk//HzgjKXLkkordRvx1yVofmNchXTmGTRvZoPwh6pPRLN7jFTeZXGAW458epXJxuBNxvTCfuuHI2gkQjdd94ELJKMhGOivfX2z2QqU+ilaGNs8TQ5JesCuFZb+WQRPwakDjcz3gGyL09S7pUAju8KHNBSQece1inABMTwVQLVAw7FWI3cGPloG5nCvcROBDQMadJ1rcDHutZqAW8kN3DtDbPPJNx7uNfOLfyn1cfvLtZKfvklx5WU0jU7zCjiwBvCqD0JpTWl5RKEXJqnBLXWhmnLoDszOxMjaoiRB790x1eprhI2hjfHxACCfhHmJPGczAkBdcpRbL2fN+KpWci31ib9a3j3nKt9xa4ME6yIFCztg8mKkvTVLD2YoE0ilCVWro/niYq4NVR+kV1g49tmCmKXW/OfQG9tBdLGKseQAfLy2vjywe+hx9gvu8ngzBuS0QOFdTTb37b2/hv+wi6dy7/uMCKqeX+u6i/wXctFRF+A6G+X3trOFimA5UzT0SJXWlbR2/fs/6Hmd3gXyVETvXk4P48/f0AB0O9NCGUUCLxFEKZmPnHd+RqpnSJNNGvIqhXfBjyv+iJ1h/py7Xeum0r99GxW8bKKDZdhhOYK4xwhyJ8Yo90Mr8JUMRO5T6rTbqvEqGeC3C81CVubPDyEfKNcV1srHgtOAurAngbEePc5Fh67tJDrkuzj+FMj7AvTol6BfbN60tOkgwjbiM9c7tJexVyknKfjx0d2B3jGig5YuEZdAVD5uPAOb8lmL3LSN3h1CVAah+KfWgzHF/kgaDTbH6QlIaSn3pFL8nyDnZopQyfXSwz9emyy8jXGcfn2OKUTLtp9cXm0kLKN0dghLMw09mFF2Lw/RmxN2HD0kt5IkXQtAWWryuN2LRK6lMJQNlpgM0Jzgkxf/Zsi74EwWyas29Pr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A7hHrFpzO+O6zgXwOGfRmZV13dv+sBnvCBPa2vihapSmEX0cvZYm7ueWFy/isinh26iQhvDIRGYUZqnISjkdpwUDJPMk0d9WLjeDqS2/icn8Sw4ABVzvJ93rRmWAecFm6nwLkoxbO+ehlg+FYA8g6yTG+qjREtEBGNvqJFpPwNZLhwooXLFwfWfu7fY+sjI4dcipjr4DrwmcAy4JwoJVLNLwauYoM4RwlcJmVhJA0mEtT5DSEAXo4F8ire7ivlHM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a994edae-7320-403e-83bc-08dcddb938f2 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:37.5360 (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: 7BVQsWWAjvrYDk2DMAlAJl4jgEa748hnXenfooKYjlG91hIiJURiLP2B/EiQE4YGz1ZxiaPw16L5k/NVd9ylpIwd4COGx4lWZc7SLIvTW1A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-GUID: KK9I7zk7DLS4dA90WFxBM8VZjcwFjjdA X-Proofpoint-ORIG-GUID: KK9I7zk7DLS4dA90WFxBM8VZjcwFjjdA From: Joao Martins While initializing haltpoll we check if KVM supports the realtime hint and if idle is overridden at boot. Both of these checks are x86 specific. So, in pursuit of making cpuidle-haltpoll architecture independent, move these checks out of common code. 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 Wed Sep 25 23:24:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812545 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 473991A4B6B; Wed, 25 Sep 2024 23:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306737; cv=fail; b=Ld8ae3xw0IO15YDZ6yUQsfekMXBX4FH4ZA/JErck1xZep8RDY15elM8IymwFGIKa7tZ3j5JlU3w//SvEMO//foWXkAv6wjIc9zr0cauoY6/IJabTDR+n/rg3WkhnmcSwi5KeYdGQAwVsaNS2TlNcbvZ3VpYzj6B5/WvdSD617FM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306737; c=relaxed/simple; bh=DVVhYd/WrhOtb8aUDHlylIdNS9AATp/2thz35KUD9e4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=aibKHmsGEVmQMJaLHqbDWDMvNIff/OGZX0DBtoa4Y/PJOrfXnUhZInQEnH7ur71+MVtMgAsAjyzQDEwZsWE3uV1nW4h/+zHsUwnIHoHgycvuuVPSuiUavYoNHa1fsJZczHIVp2EI78FCs+RE/5bKoQ7C6Fo53xmtMDEItonZGM8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Pr1y1kUe; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=UmoxVms8; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Pr1y1kUe"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="UmoxVms8" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLn46Z024321; Wed, 25 Sep 2024 23:24:42 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= Pr1y1kUePTVu1zdOIuAz1oaJ81dwIauchT2pIk3fVThwJzWXp8UWj4ogY9DLNfKD ZrzmRSVpYOsPI3iT0GJP0JrIaPpPd98q3qmfontlUDaSqNw5PKplbwvvsaIvAJuE dMezpE8s3RD39lFlTH/Lm2u4ozulkDXXQ3JhvLCU7ivUy8ovQA/LzU6kZBYL/+r+ aE1FE9kRWYJupdDVPFpslAtmXkgNqENDdU8jD9zz0Ang/DEIpWEk3jjuMMHlrfGn ykcNfAgp7BdeCVfgrhARTz/AGFU5yD5LuxE/Jq+Qz88Dr73rrg118zC8uUf9Z0AB p/JCXmxzo7/jmOHP9FT6NA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sppubpuq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:42 +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 48PMMsFD010115; Wed, 25 Sep 2024 23:24:41 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkb2kfp-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RqCuWlO9tPh3uAPRRG9w3JUImjFqHLU9QY6tL2k9zU7EAvSnT/CIM0JS0JzDTAGC3M4IcNkMg61ntfdjg4e31r2ZtWMyrXIXI4OettkipGToAHOnVqhZVZhNmC+xceiNUNLrxwqmd38tNDGpbmAnXua1ZAABhXN/vMZNJh+r4uTRqDWaNNUGKvVyG5SZwoCLeEOUj8pG1slgYv6YYyMwijq0HpCxGVYUA4t5AQdbXiczDxyVLc4/+gaIR/HbRiaf/by4mq1ug4pQFr8BotiVHJS/UW7UDmJs2vM1LsF8P63zX2pXgxH4m98jw2ju+IsMt3CTxXFhCM/we5AJUGSjow== 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=y8gGHpjukunu3kBH1zAkY6GuTW9CQvMOZK8A9udnN2b4zy8HGZxqa7Peuy+YXFKwfsAhuGOsjLembG9Kqm3jNnj4gNpFOOnAIT7I101BwzQIEaJOmOW92ZRk0ayIXw3zWLhT97X9tjKxBgC41lvasE9jxUW4NIBucMZa0lgqxwVLQP875kvAb684jbUBVLETjm3akxFTf3BR7G9duGb2KTgLAFspLJ9q7xtsibvA63NoVAWBfPo0UZuSugaZwp4IJBZ2PF8of9bfH41vMJEpAc/lVwa4ycwZxGdiZaTjMfD24voR0BKeobFEEOdQCDEBQeKErbhG3jLHIWH3jhs3gg== 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=UmoxVms8/bH1+WquDMAgYpaPixY6epVL5bViMd7iA4Q/7cIiQuuVlaAVf4kMPoPI6r0bgCl2ddcX0fpuKtDwib+TXl9bNJ344OCwjf1Bi8l2eVP3EJ7Hapk+Ncj0TJ4W8N+UJCCt9p68RKGn0FAnJIdUPdPokfBgS+TWC9fWsk8= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:39 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:39 +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 v8 05/11] governors/haltpoll: drop kvm_para_available() check Date: Wed, 25 Sep 2024 16:24:19 -0700 Message-Id: <20240925232425.2763385-6-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0054.namprd16.prod.outlook.com (2603:10b6:907:1::31) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f9fc7ac-fa57-4d9d-5e0b-08dcddb939ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: SQ9x5B+Ql3E6HSnRv+YEmzgBU5mhws2WsXgUhlpJr6VcOGHky94UhpCd+i7bocpYgVKJmyDCvta4HDpLIvZYDIsxG9h7opbRQGmASPYu45gK05KvdErNQPWEe7HOya10pOn/HXoq3BecavIeJCFNg+wNqjk0NZ3Pvdu6GxmqgqtcFQufCkHc8T0yhYHpv/2UaCQM9GIrgX/uH4hYfaspMxKmU8jOlqZ6+OBSJFlr9dnKM2OG7FNc+VV6QU2caPakDBNdCC9CAc/SI8NDsKpFC9Mav1tu037sEqnJ6ZTzCXvldTYgkwSxaQGcvGN8LpWerGojTkr+vLepnDthLvjzd1L9mAbOOwHBds2aNAcBDe9tmi0rwMIIu3HYSwlzJ423uXjSnwOZpNAomaRvISF4E+CV1qKugg0PUrf+iThBSfBiigv350qb2bmYohARQWMxQ48e76E66Wd+exTX2YzMzX1IQTyL3vrkOZVfCJmK2dxiw0j6m1vIRnS+JkUhy+cDsj4IWgy2HC4xm76/eI+GLq9yxHjibpvFbz0sAAIFYTS2daYn/OnUK7yaCKkAmbE6SdUFcq+iftFygFYMMIpVw51zcd9lzqzZ3hvhxHPAxLEdFyPloyjlXgD4c8J9OZoZL6UnfK3fvYzEj+lRcLNn1i42QVXNVgtjpxmRsxlB72+QxCBeodNVd+tR2FKFozqABKq4EgZh5xRQtw0B6fUr7SslL89KAadiWpPVkepuvaOGHekEJx1qp4FYXATQ6vwQY/Wk00yaKKexDnDmQfxYgr+TvbKHfKqvlt6q14HFmaq2+SqLlL9nb3K58tWGZI3m394xMJlMK3m5vUvckaR2X16PamZvJfLPvdYMvwq502B/SfX57+ciymhOG8sAGCRNtlX0H9WSHlaXtmSnhbSPoPWZ0gG0ycUEbhcVe+yBdBi/8JEPWVEXMGEpxEd5xME0V/jTpfULObf0r/RH4P/XfEcJTxATCW9ekwFKtAonnYoVrB97tFDYhRDbyHoG1NZlJfJjN1b08YxH5r2H4INt2UMGkp2wZEZASSKJ39Y9JHf46gKdD82x4jzLbAHcC49AzYB6hqO23/I8W3U5gC7vmMlskCufxerr5G0SFhDZDPpcp3xyCF5Acb/mpWG+DfsHGEFG1vJV4O2VLhPAm7nBEmAHhiJh3PGaoxjrVNsqzT61HDqG4f5mYAa4d3QIyIJImGkcgpK7Z3D0xQ+0RRGQNBcFFjHy5r0co/BjDWeornAKvDXWTVhMnw1gG4h/XMkZt0hquqWBmrfuvX73wEKytg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZBZPqFmXH6hAeH0WzCHcTi7okgRZ4nTKuT6Wgst6738/HDI9AzrlK5vRgtNI4z7brn9ZTnw9QfLHfTFlid9rDDez+mMgOwdML9Tr5ovVE01kyQzJa7zCNu/pwXH7QiXOyIfEJqa18uHKXwrQCK8GrUhmynTEf2+PNSwgi74fR3iasfbiSMpQoa43p+1iOAB5PR8XIViaO2PjkenwJEk7xXPrgQc95fNEajbtuEY49HC5b6y0gWIiHmNslV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VepW36HCUvGBELHA2ccv6ACZn3NBIVelREGI+Dht0AKviC43sn1UYZgh47WMIOFft9N0Drx1I4FwbdWbqfEqT/3atovu26i7OS14AmNc+lIOo8V67za1ZRfPugQiNtdKyGfzcbKZhXk3KcQflu43jFeCHKl+tIXlP7ksR7vHtibMMC9R5sLVtDAwHZMvktscLVkPcxNhxyo8ozXiBQ8lnRcq7QuXfwggXmIitJuTsQZULFaR+E/+WnbrNJ/umeaxBU7MKZLud1ysbYO0Lgmzrhv9HqWQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qaQepZ29eHf2whyHbtZQPf2eCN4pbrGTtVudrBC44z1uGKbj1YZfiYnw0QocV1iJxuoXVGjgBqhrSlc5XF4jCj1psqda3pi0y5cTAgs0IIA6HJBnee2y7wtecvFUgAROHc2UzLqAWJfFsu9/wWGzmNy4m4YCJNsoFVmnD/AZuOR0tv9gTVbPb2U/F4yjAADdlFtQdw+KDirsgIPMGoScNm9WzV4tVDzT9cviVdRoXJXx9581ltEtGZAMFKXzw7ZQBOLAiXn8Bu36ii/NJp6B17yW17Q8J6opERBp3I6pu0HcKBkvR20ArrgRMZmy8qnfY/0V9IBOonCDw4MGcZr4hTUJpL3vE7b7LnTaSvZ53GGYKBMeDWqpSW+uubEhs4yipo3oxoXjpaA9loui0Ys9rb+hHYRVI6o+EZXdG/WE5qKsHZzwW/hA/H6Xqeh5xQ3b7lZWwM+1qbjo6ws9Es2SIfhvYADtaQBLhDZBXYO5obheVkwzixRTc0Usg2r7g7jL8ojxqY28mpOORthYN62vOa175dT/2YieZ2uz9to5M/vs7W34k1x4By4lOhpjxUafEa1HBfOh4xmfv0hc83FyCn2mlbEthzRWk3/vn5/e8FM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f9fc7ac-fa57-4d9d-5e0b-08dcddb939ec X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:39.1646 (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: g93q5qFDgjrB15jUsbARilukUHjBK7xJdf+KlSF8RGZ/MlASmqLV7sXYjEDgHcI7/9b23aYM78M6ERmu8yTI5ovvX4M99YDd3KEp0+O/Y8E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-GUID: 0ij7JiJ6Aq1YDVUgEnRLraiRhdnv41Ae X-Proofpoint-ORIG-GUID: 0ij7JiJ6Aq1YDVUgEnRLraiRhdnv41Ae 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 Wed Sep 25 23:24:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812546 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AAFC1A4B99; Wed, 25 Sep 2024 23:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306737; cv=fail; b=BfYXN+nMNp01zv/kyv79ogfcufhVkoyX1tdR2DHLcRrCcW8KbBx6oSCSLqxGbR3dPxo1jsKnm1sf3LT6/QqEG6fn6h0mPBggjSPgsDph8D6ZhePZJ5yH4Vh4W0ykxnRG26ZrPCyd54u4AaEVyhfhxMrmFQ54uL2bW26LcfEE3MI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306737; c=relaxed/simple; bh=YJUP/CvbgqsBWS0W5UQOOAeB7eZwKHtEVSabMElkljk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=p30b1MESYhpxCnmjtcHGQ+XtiOgSQ6W2g8c60zU+OK6YuqZ2/vV4cLtLjLirYqqOAvjwaM0Ml0I7wyl959P+g9mEvHEImG5YSsiqB4G59JExYYhaSI/28WPzs5Pho/ovE0o0ey40afTa60LagdkKIiwlE/Wcp8cp1JdRyPL3tsI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Mdc+CxkB; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=lBSwyJzJ; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Mdc+CxkB"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="lBSwyJzJ" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLnnqD029312; Wed, 25 Sep 2024 23:24:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=MVGa+3B4OhUxsLpz/bL0vKB8bOonKBM03OwaToGp684=; b= Mdc+CxkBKcDLaUCQWnCOUXRCSmL+ngnlI4gTiHCbNznRA6h6y7sZyaDuOUnM3bVT 6qOX9A71C4vOGxb3EWN+gM37k58tcH56IV1K1p4JOh0sUlQkhuTiX5B6kHcv7LfB P0OQX2Igld0+7tj8fGrUjd87XQIPWugvv9sjfxUhC1BAdv5PSE1aSeRxCEzOJHyj PCtwc751O0u6xvXL08NNrbuQfChuRRpCd7iCNfdfD2SMWJqaX2OMDLJSq1CcSyuO B9QvuO2ak1cVgfp439xuqCV0+CqOLowptipXxImhHDQjvAtJHBItBkVBp8VGqXNH 9uNiwhnLgB65aCRdQ7hbjg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1akkuw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:47 +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 48PMMvD8009787; Wed, 25 Sep 2024 23:24:47 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkb2khk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OSzt23wD3F6LDoY1eNh+GyG5OlMRwX3fc5ZX+jBUEg5KRKQHsVCPhtl/IKZ4BI20podmeL0x0vabwJ5147gB4M8D3Sfu1yRedjqUPyfX3h/h7Mh4KqZH9pViKHCWUq+4ErthvECljrE9Siuva1pgRlRwPOqTTXGWgabmlPY80DxAtCN5AfO7MifgH4xAOWSnRFols3qtghIo1G3GvSui/ynD7DQjBgyGKdVx26MZWJgvG9l8655DJVTj8/PUVZJ1jRkIIvxaLQepB0OJ7P6cju00ugLMsPYJEn7sVKw25RBU+7Pa81BuvUe/R6SdzvFVJ5URAlcw2VU6cqXIge0n4A== 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=MVGa+3B4OhUxsLpz/bL0vKB8bOonKBM03OwaToGp684=; b=n6kyp4NDN796Til4iOoz2CBeke3rNXS2Oj5nVrhEuEFEBPwjbuyn+NoBDLDYkkq9ZIBCGbVeu0JhEem6HaMjXYyDRUAySZMSvb3WGIqsYG9HWDWKXcSIrAn1BSD9Vxe876+0BISUBF7a8ax70k0gboeimxMpfYGBD6uGYGKaASEta6NT0nZzXroFsQK5H2DyHIQi7AHMQsB3s+ZFmmXA/ne2PrzzXg6Xg7r9VvuGOudXrZaf8C/0CPdMmlw+X9lHX0MvowWAeYjlO9wxC4YmbARvV976jWoMvfigCeceZWzx42eM6uCFPvyndUxSfRfovhYc/qbO6hyIh2xvBkpLag== 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=MVGa+3B4OhUxsLpz/bL0vKB8bOonKBM03OwaToGp684=; b=lBSwyJzJp0UZJhkzRO3H+KX4l0UVF1hucmfNnu9TULYQ9uoKifsBx1egqJdH9Mz1tsj1n5aTabSauxOCE5nFU8akb/jKGKqrQrRVN8anKoWpM6iKdYCby12ffbYmN0PaeSFcMTLd0PQLE/6qlMaaRhuFl1L9RJVRqiaa9jdzwI8= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:44 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:44 +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 v8 06/11] cpuidle-haltpoll: condition on ARCH_CPUIDLE_HALTPOLL Date: Wed, 25 Sep 2024 16:24:20 -0700 Message-Id: <20240925232425.2763385-7-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0069.namprd16.prod.outlook.com (2603:10b6:907:1::46) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: e9026ef9-81e2-40d7-82fe-08dcddb93cdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 0nn4wKI0gNYvtBgSb50aWWXoSdCjZPGO0+7oUY1wWGTrRw8C/pX5uzjaJviJewTdEqsK8mQE4YIS810YuOq5/4dRIn6hlALCM7dK2uDbuxJm14owi94ngXy4X5hnyW43RL7ALaVgQ5Zmk9Wh5Djw1PNoph/VOMF8ZsduoXkXs8QPOifKvPfS9D2hFz010PYnvjMd9rQmbl3eL8Ri1aTOwyRkd+UeAJWxen+hAKxzYVGfgiXxqGc3xqFYVTDFnI6pUpsAkf4qcj47wh1HKB/8NHoWtUt+6DT06aZh4Jk1G0X127TyodgFXTbxUjXZO0t9u0BvFmLMngNE2ynvZiILHDVmXeopIsrg7nz8nvVzUPEsgT6i2oIVK4OzxgWBSvGJJEXENROmERDET7krbnyiGdf9HU7KgMUyFZMAi+SpSJnesxPrVzKf5kefFf+HZQCnSU2hX0D+wg3twDlVYMl7y6ejR81w8ywxzzFKkvawp0CF41BaDhIuOlwfW3+O2V+6QCFEbVkzR7uTD5Iu83qC4W2MCIwMdZb77eaBEOA7UZGRsC9CcEadLcDS7RqbUvBD5Q19aoIi9f5ZeweR3aHEZ0Ft/s3e+ramK99p91eZfVZWoVvAROzS3mxaggxrpCSq2MzvfPsd7uDR+VgHQtEdKn1Nmoo/HQZBXodFjfgEbQ8OMuAb8HZwum7S0Ay28rSBeN3ZR7lq7S+Q81Sc3b41BJS6UkTpclJ/nmhYqiO0ewvNrWsVhjreZOOvUN7vDV61TCIbHCMupC+qv6gEOB3eK7wh4fJe8mxN6sNARNBEQcJFOr1uPoq6f2w9EvLdDkJoT4riK2HKwiWuhpvCIZoE77lxbSk/xGb5JaZ7+gNX9SH9SRNts+jDGc09R0RTNV5P/paluPgCtAe/ZfvP+DTA3XyIXKSYvLIM05B9tGWCr9TI09jJtDeMZvhJdqV3PkKRIRYXBrAFqkFK5onqOcRQA/uW7oDpDceCYycqe9FOaArYDC1a9ev4gm8x4BBwfYDhWJV/y1jm9hmI6IHOtlFnVNYqem9Jdk27DboPhA5Z2cbWDwrGE5w1fFpFW+W2eUrarbQY41FxSfgX4sZ/rI9wBKaBn2FKMpVPs3AMjAdtEV99s1kSOsKSCv7foxZrSA+JRIhZ4YsqFpYzke972EkKO5JdfKUL/CvwCtcIc6AAT0CDhF2qLyHWkOQxRUxDBodAKp72usoHrq4eHJHgKsva/Vs08yqQuqi/v6esrFqfcZhz/M4+dGOEhxLu+FqEZyOHdWdZiOqzV2hY9BIOgQKfbQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nD2qttx4P82y1dMmy/21119FTOmrTD4ncgncdPywz6rgMLrKHouskX/ZVaXqUfCkU3RczejzlXKgREnO0RKCcsFvkFbNROWSeG4KNTBTpujFFi2NhN9ZsSjzCTtVbDj8mumIOzO2lyD7GZyDnHCwJ4Aln6OFSbPhe1nEpPJvkwSJqLyZzTOZAcQeX7y0cFbmOVPNgqw5sxacnNj5sanHaky4cuU3DI4oLtY8aTt/tRrloh1g8Wg9BYfnHZIF9+tzdgiCEEQ5tdxLtaFb/Ke/UTgKxC7hwduMe/gz0Aa+uPXav4bNuybgQ58q7LX9TCyIKRy3O3I+NJCmnUcOuS2wUAVJlRjBNoCvy/jZBJPb7D9wwNTdpJ7/wVlmaNHK+hwHeFX1Rfu9uSnDWFOemKu3tUYUh2/Fnhdo0b6UGHO00uVeFqD7t+Qy4OrpvE25WxrUwCcc/MoYqBe0CBSJf7tOucwEJQdC1NK7K/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YefbYighHG4r9zmICzjhTGujCmcYE5+czxgINknqExCSs2W7I1ldcScdLIRKlFkpSfTmVV6Kbjjfg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: mVC34rDHvquHohsZfiI5X6hb8rcB5d5c1uvB5E/dEatTSlLyccRuszMG8CAd/FFoLvGXOkD/2jLca6tBtqo86cfZp5dD3rfhrVlY4h3fx0swHlVNT3+AMvGtt36g1rh2W4ttt4LzbaxzKQaNApWA/7tn/YAu5NID0U0Sg2ER6kd7h3FULt9hJMZjJMUx17x5f31xv3Hii8NxhFGj2A1mkl1YioqNOOcUqf1vjHJFSx3JD/2dIpqXoeJ6DQB2Kr2rmglD5V9PV9on15CcLpxH9yBtuYoEk/jEf2AqLGDDycLneDWJI7MS9l7fAf/WxxETXgIq/XKRNXb3Gd4+WVH4YE9KOqW8SNZhaqM6fhipchE7cXd5G/mnpO1nzavxeDIKB34/r8dV6mhlI21UB+5+ofNLtuCtn2QtHEuufY0sSg27g6xSW7uofjXB33Kkn53q3YSxKaYwwI6BnHMzV0ZN657OsklEFBhAUKQxYgKVI47I2wITzSupcYm2Y6aVRGcR4Jhk6zsVOPI0gedIWEXMo9TuBdaN6XmPXUAFKRXCDCfwdDJ/A9OoiSprkPE1VW+kJmHO4ZuZXQODPtzPRcpv7ea/v05ZBscf74Ouzh15iv8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9026ef9-81e2-40d7-82fe-08dcddb93cdf X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:44.0796 (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: TmkOSveYFqbXY9WOtT/eDxHeuyfsASNkXBLJOTmGAAjgcE9Nirsm41x/FlLtQEi5b08rfmzQYXUdNSJjz2/tNwokxFXSepJQL1MRPFVCwfg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: BLkK7CZHBrcHl2lbt3tT6r_J7YH4tXp5 X-Proofpoint-GUID: BLkK7CZHBrcHl2lbt3tT6r_J7YH4tXp5 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 272ec653a8cd..cd457400eaf6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -844,6 +844,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 Wed Sep 25 23:24:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812539 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8B191A38E6; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; cv=fail; b=hAOjWiDusGmyTatkPeG5zR84CwwCCemV7MhqHau9i49UQ00mArrzzMN3G05l53sPTwTSytPCH8VmiYa7Yt2VcGiVRYybil5JJO9vpNwEDNIw4Sy2EQSAvexHFOz5SSwrENu8MUkLg/TJncoDRA6Ndv8ANMxN1E6Rq72sDEFl3TI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; c=relaxed/simple; bh=v3GaWP172XiLqd+rXefIhasC9+l2FDu3nt3uIc2bu4I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ttCtk16szYDOICNSfkaBE5E1g5Vs/FbjBJ/0Zvh4XxZWqHC3SdZhv5kIrcxYF27wjJi72gXC6pHirRZxdgSBEQNKadXBa8l7GS/ApEOI7dnIyT7Q/7cjLI+yIuVSpw0pIM06DF2PMfLeY8Lpkfc6bfZIDhoB3qOlrkI0XZv0Y1I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=SSZOZzdI; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=tmTteepT; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="SSZOZzdI"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="tmTteepT" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLn2aA022983; Wed, 25 Sep 2024 23:24:50 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=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b= SSZOZzdIlF0LjE8XCMcfGyS5tCif3a6+4VcQxhUBL9+38P26+uB8S5thERexbi6O nzYXLh+K8B60fs2hsYdezfIsWHE8TlNpr9Z62aRVbo3DWPnjoiIbOCxVh1YhG+i0 VP/Pddxr5musyLoG/Uyrj3douIT0FPES6/3g3haxdvxqbRsgmrsw069bQ5TYc2yR UpN09XMVrUV6XEGMAbbIcnVb4LfnKmklc/M2tj4NEoUF7JkAM/YeYFPI7ggeaire eMUWOPrqJCNz7sjJCNF/P304rjlh9eoTJPFGujkWUXKhkyyEeKfixNVIBhISKVJz i0Q4aIeEDVyTdCGPW/MgpA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smr1bt0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:50 +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 48PM4VhK025377; Wed, 25 Sep 2024 23:24:49 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkbd4g0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eSkcxr8YeaxBql9F+jKmHt3t3gyPdMEa3hUDdeZiy0lLkeD3+CupznNTE24goZ46CUquOudgghzJFh1P+o6YzVFE7Jy/qRQuUxBssa8lpJFeRfA2UfMJ7DGZgPWU/sso5VgqWjEctjzmPS7KYVbgDjkHKoSfrsm27gkhH1vArnl6Zf2swTfswFKn0ZOqucBsHumDAKoByyT0nBWIR2GDPEVQM1zee7q6WAekqXM4BQCmTCGvllD+Tq18zfl1cQ6X/CT7du9mu4c5dlfCgiPKsCN+BsraA9/27vcHUy86BZ2OXsyLUVyDEz/PAIjIhsHJVL/3W+8hIes/cOCB8H3Gxw== 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=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b=kaBMNzRnrF8tsxyDuP/orvX3xe1KcCYDvW8ZlCgfwfS4R/yDDk9knu2HMi1dHJelJ3AB5odnNXwEWGU045zZtr51AAxNHkLFK2lNFs8H1I+JWuAyaX5IovoQpyc5Fbp9iQOPCubFFsXbfexpaerLj41/3Bavt4hgngoceTlbjL3rhJvqLCq2d4tinwg3T54Yf426CvzW48N7dFIEuc60tWjI8i1uagGiXTx73EthOyKBSI5UCeeF6A0pncoWHh5GWobiuo6kn2cgKbo5PS4uiHTQT7uIf/MH1C6HKa6KK6L5VHKeKZboU3psHKVhm+MY8ih9gokYmAUlyjks1mAvOA== 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=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b=tmTteepT7CnhvaXA/ZLDF02OJUyeFdqlzAVviOuzocaC+AqCa3SXJM0gpohVMmkEyyJgoVYqv8a2S8ebMxXMJB+e2QgUIncn5awE9skVDkGh5Nop8dgC4L4KOxALN5ybYwzkjqNWXvseZjIwrmRJzn8iNvyQq3qVKGPW8J/dz+U= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH0PR10MB7008.namprd10.prod.outlook.com (2603:10b6:510:287::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.13; Wed, 25 Sep 2024 23:24:46 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:46 +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 v8 07/11] arm64: define TIF_POLLING_NRFLAG Date: Wed, 25 Sep 2024 16:24:21 -0700 Message-Id: <20240925232425.2763385-8-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0052.namprd16.prod.outlook.com (2603:10b6:907:1::29) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH0PR10MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: af997ede-b3b3-47e6-dd68-08dcddb93df5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: Sm2LqOT2PTbuNTN2NKrkL+cdmrrZUFzxuTxPL/8rrzuAndqhhlSpqaXEQOa9kFgLePHZVOJyxVXOYDscDTMMz3TNDlJC5CGbsczOUr4Ayw6OE6FbxNF1N+4XnaCTXjPAZQIh0V+pCLgMnu+mQDi5VpS2L96mN4p3xNVkEnXNvT3MP9ffE2DEqgUKkvorKxN9sJSkQL5YgNMmD6I49J87enmQmsnvLjRPNWXOK/Hv9xfGTJM3reTBly9/zABAQqdkiLeGJZ7Kt3xozB4wXaBkRybCT1uDUAyU2ul5jeRxKy1SeGHQR+BwU28oNPjAm8YDW5USHf7H79W8Ps4JpjsYdo/+IZDbYt7J5/5+MxIzvDvUakVyI9rgZxMjb57uULzZ1iymk6W5ELnnfZffO0GOz56SwSTH+Vk2jq25ep32tGgaK885klbUPyB58+Xvnah622okvWcV56wz8ynXNixuwh4l2rSrR2rJVT2v80c02TxnYADZhZJDGSt6YmkH9E9kQCfp+cA/nlXckjI93WB9Zcf/pqyT4M7Sd/xmIiPwa+xRK//EoA/KvPXO6J8jJ7uKIfBZLS59MzVqAIvr4N7qr/J9E0qriPxw15M6YITbxA/1pQywDtJcgVmlpJ33uieQHsjzcPWHcduNUW/ibioXLufrxOFIn6TpSkg/z0amKe+6cIqqQ5bKlO87qqgSaF9onh/IMnHn8jhRenVHcAbdW8QLfBsbjS1EvkPBcUDGYAmHjVE8eLEDo/JVDpuXPqSDrlQG0HZjyj2/jeeJj4wBO+eTHEKPgPnODlxAmtpqybtT7qn3ZASyqEPKqPz7B7ePUKrdNyinclJX2L3o1SpqMbPAeLahy5XnRme6ZzFFd4n19spsHZCDIo+AMNtJHypw+v51NBw+PV/oQC+lE/vI13Z+M0lUlrVxqrnEYysO/UPMbKhG9gu/qI4m5WS4SDlLJqUy9LUUSTSsmX0UIogVTIF2NHGqLIIPA/mb09coDp2u2RgoNb4sVFKqbNtv20uC1uGmNcx890Oi8tJ5/N7y6XoS4zfv88GwMat8RsKzMnPGQx2h/kKxqvr2RbbeQSXZisG86Ut6QMuAv1QE90iXYb2cnvlhKhZu7k6Wjn7IbDCD8ryBgoFWmalcC2fNIXx4GiW/saFC+iM6h6avj7aBcZKvWBdFIX2iWBAmsyuyzwdmPE0XhjWVFaxUiFZvPfJak9IVXWBlDqKg+lNtIKtl//fo0RrgOXgMbYn1B3qhDex6JyzxkqgCowz1bW1bhTEaUN/AuVA2cDDt3JxdSPa9oA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P4kEJaj0CXe3j6M6EW8faeGYIYURItDaR0wLugK9GZv/Ql4p4faWkJBqmklaeRJN5hGEdsEc0yj1enIs1Rt/WaHU6jhs6ladpIontmTU0JPHGVawJ4XgMQRiRsHguhPxVig8keiedUnDzmz9ZKC13PMxRCm7d1D+HqqmTnqHjIDLhCty4XFC3J16PrFTFunAHrjkaBecTljKiRKDt7VzTlYIgouhTnt+Mqe0lDpZVdCM0Mx89Wywc67HO3gRkrS1EMWYRmqGZNBnWK3xTUEJte1XKkl96FkVK3nmDqxOExnDb84Fy3R3idrXgf6zjSqFkYAYXQ7mN0cqCGGGnQu4Q9t50kv0nnG1WCJmP80g32n5e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XqNOzOf3G066U+bu8xwauSZtkY94aIgNE11y9f0ZAumKQih1eTk+mAMldjEQbY7er0SH7PD56I1NBZPA4aeu5rdtn5I4Sz0qE2C01eRCrMDqo/MzW3iPVKLWlb3JhL68Or3ZKeYSu7wD2uYv7Y3MHzibfIG5wl0DeDB4XqM8s9Ul2TQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8JG11k07YtL0nWoQwsaIKKl5wZLqNmCdddvAw18Z5LiOXHR8RPJYU+bBbNkFTPqzMM/jNDS/9rOWDVsKenetjDQtUtwrjELpawGjiw30d0LrhyEUwTP2Zji+TRKZvaVRduQolLGQr6Rsk/N+/AaGDb5KuR8T0QE5AycYlYlqXca4tKYRyvuuggT/tkeMQA8jBxlVTWUv+ShFFvHpMd8BPB2Q7zakq5wIKodkSLv/z42qBB2OOtc8fvO8vFA4SOAQTjGvVaGGzHUkCQZ9a7gzLZmhG+6yCsdCpfK2U0wv/SvC1nk5C1a/0W6B81i2S3y485BcGHc1GZbRVL/AtrCYVJJpd1d+7ftouxcs9e2YRq/IWPHoW/AQ1PFKgkxZi1y8mDFXW0FxWC5yypzR1WDFEknzeUjNBN6xvkGgppGoQuwNH6x4X3V0XzJLS1TpWKk+ZFZaBCO9sgaj30cdx8uqcx26OEHXsWqLSFg8iOLTkI0P7PchMJQlDnU9R2xuFYLh83N+uDUn/F2BKzakeCMSPr/1CKp9Y5s+LPsNC+LMLbNPHPYGUL6Z0378bINwTmcnn1EZuFI5AlRYYhdGHpYnFIClh3CT5e2s4OY3p9Bp0Ns= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af997ede-b3b3-47e6-dd68-08dcddb93df5 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:45.9459 (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: xSMveraU0n2zT0Zas/bSIxQ8xuXV8+3ccyHSJ586xsTa2+h0J4i4tKUCYxtnZhEdWNmKpxVeoJV0HxgeUBAfbe/pDT9u+C1Y000tDAdf7r4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7008 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: e107NlYvY_n_dBD9ToxvksLNCeJHXUCV X-Proofpoint-GUID: e107NlYvY_n_dBD9ToxvksLNCeJHXUCV 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 Acked-by: Will Deacon Signed-off-by: Ankur Arora --- arch/arm64/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 1114c1c3300a..5326cd583b01 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 @@ -92,6 +93,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 Wed Sep 25 23:24:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812536 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EF0614A0BC; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306733; cv=fail; b=T2IbkjVzNP9lAtJ4d1K7QxeaD61agiRp5cSCcTu4lph/KwzD2y3mMFZ5ciO0M+VG7n0OSosIg7rNeOTmQwBSpXiOSnA4wOpYVh02fyFEUlCUEinmXea7xUEaHxHkqIon2LH4ILYlvGgVdsRACGgJhEnqwcfiUIfKUbbtpKvHWUA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306733; c=relaxed/simple; bh=h+s0zPrbvlVnDP7LgdMF6n/gdbD2X+UkkYRVL3akutM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Y0IruD2VnxyyKoW7hQc52SO6sxtIHkMmrnmA3XxWuxiLpJ5z0etQQf+1HS1w8LD64uLO6GbcupnmXZIWYBTv6SUM3Z6V3i7166PRiVVbmFbpCN9Vaxmx13BdlV9RMtsfydwRLdU93YdRooZ6AmgndNoxaiwFfSIiK4hUve6McmY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=KXlrsJJe; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=V5Osz7bo; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="KXlrsJJe"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="V5Osz7bo" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLnMhq028909; Wed, 25 Sep 2024 23:24:52 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=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b= KXlrsJJebwveCk6kUbzG+jHTxwE4mv3gOTRxmyjO1atgTlxcMx9UCNo8fLKNYikh X11svJehqan/q7xiuVBxKX1kpImDTEhjX4+tvewP0ydOB3x0SnPfV+JiUh/TJ+rA qGPsp7pCnQ5drSnR1mReIRi0P4BEIjPaWRGtrziSmUbWAnNRniWVDPSJYHg++KfY TozT5R6MTkMNeAlYBaokJealL5dmbT+qdJSiXF01Uj1ayV2eD+BL9kdo6XUWVq6w v4FXFQUcq1Z6AplzmpyTH1B9uQBzVI/Uc9SjQWo97A+4qeEWKUPNWimLigEP2W9r B6cCrQcBXBAjfx2oQ+GcBA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1akkv0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:51 +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 48PM8diW009724; Wed, 25 Sep 2024 23:24:51 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkb2kjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jEh9GBpY8pADs+lylcXxvuDaSuVdCWWG8ihgR0ajGSBi1gfhEH44MZPUBsQMeR/ZEFCVRiIEdRe+gxyBCTdBizcNgeq2v4rcypxDb8ftz68x8BPG3+zZHCjQTknrHwXbDBqoNEjoy6EE4si922fVAb+FaOtgCJrWRTREBzCNNEf6crNEjSzLgYOm8yw7ecr1R7jXp8yF9PmA0m7vD0k5vYAq1XWLAg/mX2dwMRl0WQ9Y3z+pYl9SJgpVXmhIXMkNpAZB0Y5nRmTXx/Z23JBU+8uc5b7188y+5GUgg0iJoAlJ355aF5cXUp/7jAeW6JVYRAY+MwliW7rvw0u3Yj5r9Q== 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=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b=EBdpDE9c4bejQbnpWJggRYpj45btZ6TYbutRHL+UMwdEYd3FedbXb6TuW+o9bQaPIZ0Wo9v9et4tYp+WW4ZAY2O7mrUDLWifSSxmtmQgEQrMpCyilKpnYCUo/eGaOA2egX7f/dEz2w+6HlvISfZTUUGcWqdfJeWAxILn5CyXKh2nYV1LyG8NZh/joYCMUx1mTLz9T6wbfuJ8xoUq/wtqQiY/015iKItuzlWW0Llxei8krJjgwXLKr+7eWFwjSjOG954ExTZbcCBqsCZ5Qkz/vJ8b5oodI5C/frVPBS3/vkCPD7uQOi1WqnKPJH1ruGLmC4/Vt0FLDBYY+B73Ai1xqQ== 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=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b=V5Osz7boCQ3lEymbJcPkwbqHxeZy4i2cnjmyVyf/jHngrDIHzk4MBTyEtH1AB31Zp01QCNx+yBD/74DeMLzzEC3mSZ81VE6n94vSDLeKe5tFtjIznzY6AuD3Gi6OMTHdQWie75hZfIvf9jy/ZrL6DfBT191/sK+Eep8lXCb3Yto= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by SJ0PR10MB4509.namprd10.prod.outlook.com (2603:10b6:a03:2d9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.12; Wed, 25 Sep 2024 23:24:48 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:47 +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 v8 08/11] arm64: idle: export arch_cpu_idle Date: Wed, 25 Sep 2024 16:24:22 -0700 Message-Id: <20240925232425.2763385-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4P221CA0005.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::10) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|SJ0PR10MB4509:EE_ X-MS-Office365-Filtering-Correlation-Id: 372da725-2624-4691-ab9b-08dcddb93f10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: tNf9+mA3jokdSPt015uacIy+nsojNOMpdxlwQFQulvvMrJIQpxScFFpWlFnDxDSOrbKRpR76qjTsZ884YmVL0BVDQGPDUQGGMYC4Z9K6JFxdTjeyJBexxbGhwSZFoG8lIKb4845WCQXT/wkI+JBBZf4OYifOKgj1Kv6SuM4BeSKX3hIfLRPL8AMmXYmPgNVoilaq2tu/UBtydWOIhHM2rZgbQlvc0vp4HAzzfzga3g9fBrEpcKnMNGh19i+VeWc7t1PHnz7hz0w89MHyFmWOh49KWDUf4Dbo6VQqBpjqhfdTJ765QEHelhzcwVTQNnyt6aSeFYO2UjblCLR0OTysOcAYlLjJ3UoCsbDMSi9JTEEJRlAhMJiOWoMnkOfFfUQ0m7jwK53izcFXYAs1Uem7LT+6iERxHF5Svf1UsKi4T9NkRETm9ShPRIeTbxpY2SaKXb281hotx5LdAVgsrEyP6nDQovg+D6cMMkTAQtZY6+0SxYLExIU3KaJEJrScpAFGpYcXGXErzXsIY+p8MkuuXCLssQv3RTLpUZhHKe1f6bxALN8poKXpfI9raGPpLgeUWqUwLCoteiFbH0zAPvqObOqVn7xgzqQkgn8rvqXtHhNMpUtk9V+OzVLIz4kYk0Ipg3npYWP3NPsF2lvFVEQi8iCLKn8di2n0iRsDh1Uu6zO+C06fdmuVN0DkNDR08ZBR+aVj51/bUGDTpw2Dez/KU8VjUM4KZRFppahfzHG+sFUfsEiBa/mKx8ijt6N3aw6pZlu1m7YlBRnalQL7zPqeTMir2k5Px1gaxxXDYLAjmLgw0Ojr+CnI/1JEXrZO+NczRgCh5jE5zJqOHRbuXj+TnovhFICH8SR33gt9BGOhfSsQBANwKyffc3KbjH6Z8Izt1UMW8tBNtNepq+WR6cik6T9xNl3ptNA6qz1Xb1b9/txzUBjPSvAjcuQxZZMfRXi2R0nQ+e5qmklVbfLf6uvLjtDR8RNWYAAS3Nb/tY1gFrTT8sWY7lICDA8Rxb15JnQzjAGPgp0B+9olAXcd35RSFgiqUZFp62Ml9hHxufg+N08SL2scy4PTUjZzpGjYxn3KsSMTaxAKfOxV/Y63RtFHBDFQsMZfYOoQCws/tUdOgVCJ7kQIwQWsMw0ahSFE0UVpxpkh7es+XmTuGlzSMDJBOCkmuQhw/0eyrBwert++tQl3mR5BpzI77ShK6Q+DG00aqcWgju+p4vjFcjlUO4gMcaNgXsBqm7rfE8WnxpIdVLCuoOSDuoHr937dHxSQiAmd6T+zUbCWOowXGZxU0Q30OrJgvYP1GKgduV5fg4lUF96ZCBSXVytrXT0OptnarvM4JhGiLl17gimdoYzfWC6uTQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sFiS05VbNa7G59AG80lISzkZK90WaEy0iDkYwOuMDY8PfVRF8yU/CmxVR9Zr2Py7d821WQrRUKOkdST7KyArwDdGWbp5BavAyIvrdvZdrbd5L/p3FVxzdLDPpPSHp86DIg5hm7qrNMuuXKyXKbE0kFFI3TLfBIPe71Mk9GO8S3IpTHR01zYuVT+EyE1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Org: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 372da725-2624-4691-ab9b-08dcddb93f10 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:47.7626 (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: xRN8YABe0og16tJdynWSvraOK6fIBr1fls8hZbu8E4FZm9xcBLGKf1bB785e7sTQKtnZJJTBfup9quDW0L+tbaMPxU1eDsvcLIBWH2LmHQw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4509 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: 17dCEj0FU7L9JPhqvlbhPomThs5cYmL0 X-Proofpoint-GUID: 17dCEj0FU7L9JPhqvlbhPomThs5cYmL0 Needed for cpuidle-haltpoll. Acked-by: Will Deacon Signed-off-by: Ankur Arora --- 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 Wed Sep 25 23:24:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812547 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B87F41AB6F9; Wed, 25 Sep 2024 23:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306739; cv=fail; b=E013leDilG/L5V9JtX6WDACaxY0tqGUgsfUbwAp3etkh1tgeS/YrJTCHrhrqRceEmBVmlGhmgytrIaCTdtGAqelZhc4Pcges0QjDENDfDW/WqcVBmqG1ZmjBCzeHXgByZEjRbGW26VMI1RHYXrr8y4Bv14K2teKQHCKKycbhxI4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306739; c=relaxed/simple; bh=aTzaefCaEwR2s1g5HPtSie4lM54qCmuKdheqjxyIIbY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=BTX6nBZyefL4iNch53Vmoak+NfIxH/lz86vTiq9kxJ7THNQJWCT3L/fP0QiKx0IN1X75TVIxK3qITjBA5TfmwdtR0t/WIDVbCXSlNFR4H56+PO0oc687uT80IX5oCuzfu78FNmom9VEOglKAP3ioCIEK7ELvFQTD3mRT+cZPXGo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=aN2LZRlr; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Ksj+ivEI; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="aN2LZRlr"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Ksj+ivEI" 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 48PLnJkk017210; Wed, 25 Sep 2024 23:24:59 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=7reVVYElkOeJMuk4+zxOqkcajfgv/vNj5UiDIAk/8OI=; b= aN2LZRlrbW3sl6ntvKZjFfRpT57GwUhOJnJQFsdgjXDG4NZnl423DNp9PpJ7/5wX 2AfgIcA37ecun79G8BHQYbfeERigRi8jw9ZdZO3LL/ylIvcaZu0X22h3NikhVksc BV8KoSUy3QMX70lf8gJvuZqCml3kMBTXpD8gqhMTrNF90FxlRoMAjFb+G7aGp3wi /fVJuY24Y3UigBrxyiKtWcWcY6RnbYFolK2QnUaLOKBLhmBa/Uy1pSl7U17cx+I4 gHB61CFVfWHoFUOaHsMc8TWVTsgTXkXF8G0li/vtZea4nU9t4eaBQzAtm79fX2Wn RyJiahKVGTYoxBxjOOMF+w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smx39a3m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:59 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLtpo1032872; Wed, 25 Sep 2024 23:24:58 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkhnpn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZSLYMTAHq4iKbg3mKq2TNtUBX1/ISI5mEGpKBnTPGAj+XLq7rvD73xQRaF3nQTY3S+wyYsYC0bnE8gappkeGUpL3Ph8Dfr21Sm/LcJxfXzq7jXeZLjnXDB+ynIbwoBH/RVBcg4FXgF6GShkiX6wWwV7Q5/5QXi57JFWrtIPyaM9jMAjXE1DpYLARM0WxmliDpe55IWcRKI4PSPgnDgEw+PSn9Px9JHnVuLQ/YV4yjr6HhtVqXFz8WbzBZpw152vjA2rG/+7TOEhr0rIAMIWhs/AL60FPl+HzEqeVNvJTbv675l1Hk5unJLCMei+mqxFbP69pe60kWsStiNTDsKd4fA== 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=7reVVYElkOeJMuk4+zxOqkcajfgv/vNj5UiDIAk/8OI=; b=YjspQ5PW9YYM6vEKKC8L0l8cwu884JEgLof+m64tZ1IqrhoI72EhwoGxYL8wxYtmsjzZtQbKE1Bgo/UTnE9e9N9I2B37/qEK9/WXFka88LT350m1SoJ+PB5DsN42qJ9LRH2ez2YilPrA2ErzDQwaKEuYhKtfKJIN1/RugwtYdyQnmRl3H2tkPfCDIKgLqroR6+11oz10FGhKyQ/7sPcujQ/oe0T18eDJxF9Uwud48NHXP3pKpEcNn8rlQ/qWw2L9W6sLuLm0yTGR4d+IPh7wH3G0GaUXeGivlM1N7u0H3ALtnNlraUmrxN1pyX25U8bqDApvyv1BpJ6E7D/oOc6ZdQ== 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=7reVVYElkOeJMuk4+zxOqkcajfgv/vNj5UiDIAk/8OI=; b=Ksj+ivEIS95YZEs4oEeX387FWRd2xK2D31CZxDPPNJJP0xw9SFtQvpeYzhLB05RfE7Uz2WRTZkD0YR+OWXzli6INuZpiFBQxreNSun158C71ZHTIAB8Dj9IRIUcMUPjXCKVNBkFnP7/kMKNImoiHL3kUcfOE3upik/rCm3BwHp0= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by SJ0PR10MB4509.namprd10.prod.outlook.com (2603:10b6:a03:2d9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.12; Wed, 25 Sep 2024 23:24:52 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:52 +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 v8 09/11] arm64: select ARCH_HAS_OPTIMIZED_POLL Date: Wed, 25 Sep 2024 16:24:23 -0700 Message-Id: <20240925232425.2763385-10-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0052.namprd16.prod.outlook.com (2603:10b6:907:1::29) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|SJ0PR10MB4509:EE_ X-MS-Office365-Filtering-Correlation-Id: e26a4a50-c7a7-46fa-1534-08dcddb941d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: B7Mm+mw4DyVYzzflFIxKeRVkmoiq7tZ6PMnROO12nk/PP+PuZfUkP3XaUFVpcqSGJFS/UTBQ9BZFAsuXr7hp1nIng+mxVNv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Dgrvioc4EePZNaNthtRgWPYV06H7DQLSOusSr0AL2DJHt2hUKgMtQYqZxMmnEsuvAgnorE/Tay/tAWUz379SxqP/RWIsPlLhTg9VTsqT1JGM3xeNLZ/GQP//mOUWjhbC6wIwQ9jY/WYUuCR3fvtbuwGI2SVEYuQ1m0O9+64Pcxbf5XUq14dGAxNFMnXozZRl0w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JQ6myRvqeV3pmEFw31QBpBemR4C7mucM4WMNMBAEmY0TpJHn5O6o3pc0GF04pQmKjmJFMia0sQWS9ySJpAo3qLmRQUZ5rL5o0Ox45CJ7LMHJHM7n4qkJpDGs2YZj58R+iSHqUzH2aYk+zMe1RG5f0IrRwkY57ivVYn7j//P95QbWYMIEDJoJYrZWPTmN4nY28eTJXKRFbRyovdmFGLNM7ci+xNQwMAIzDeIwXUG2szErdpe10/rmSIIqfaQKKR0a7FIHwyZjzfhOD4BHVDw0k/7riHa3Tw44P6UOQzCf+yi6ZF1P/vIOokuLgQdXrFmPcmtCWRRZEXkH2yR0PfkX2+gxPlf3tTjSMGKci7l12haCkWO/xYCXQ5/yZs9Pj32SYrVP8Y9WMV9/52S+/QS3NDWSZIy2aPMYvRN/KKWOy3b39pboczh/9SSpIpvlbsQ5rIoxviz9rFeQheACijviUGE6Q+ye5q8CutmKVIixo0kLn4u4/QGAmwPNaYhH1PDO6+Oc8LILoUtVevGCqDwj1StBv1rNBPrC2Toxu8uW+PFuLi7Cf2YhknXCs8GByZVI2OC6VF1WOerLBU+YwS6sT4G6ipa3oL49yI0kPH8GXDIhlDNbUKrSUSESmVsNDNIadHUyTyxrTH/R3TJR0H2r3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+DPyntRWROJP7f3EkYTH0wEs8/TIZlBNToksAyNkif5IWQrUtAtt0fGDaTBszKuGb1CNtkSmuGUX2ZAqv5L0Hdi3JxzGnYn37woLzkFsuM5/KT+P1PSpK8bXMhZwRc1Ne7b79x6J05KYDzYkmFKZqyuutL3Pq7A8l0g6CSIMISGf+K2BWMgq5krjPCegvSjzEurCl98q1VrC0hnvbkR3NQBJLfoptSMMoWxSCQ50yAdIO8ehlJmGrAlHmyOBledjHS3AH7kxWjmBf4RXqZC9chWzKIowcV+AHC7WCpfyXrCD95EWoHNKtxH9CTFL3Ycbs+Zpo4O1AcM1jUixG3Hyd5rDvfRG4CGq0MiOF9AVLrsL/cKI2wWsYL+eJt/KOG70nzI99kV7H6Y63umc2kXFJ+Ef/B1lJakYY3qdcMsfcfZbE+C8EWJrJlw1nzX6aDbkFG0vjner+QPZAS4vfoh9k5FjdkZiOtPJr9tXm8Ek94h0sBq0ezrpnS3BJhHzk1RTlJR2NVQLj8gifjLFQVkaYhzS9zMO/PJ6n+WJwwYi6Bo6ZotVVe8SdsjICNjOh9uDjLXZUiZ1s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e26a4a50-c7a7-46fa-1534-08dcddb941d2 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:52.8271 (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: E+4W21BKh2WhND4GodIp7XZY6YMDA2BZIzAeESKckSY4XSv+lnx9srKBHuafYSqkrZwgEIl42UG6Lvp7YgORD/LUjmpnIoZlQLS/CpXIDD8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4509 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: oDsw8ZuX9-QiuxtaiMoIGFAu85NBms4X X-Proofpoint-GUID: oDsw8ZuX9-QiuxtaiMoIGFAu85NBms4X poll_idle() uses smp_cond_load*() as its polling mechanism. arm64 supports an optimized version of this via LDXR, WFE, with LDXR loading a memory region in exclusive state and the WFE waiting for any stores to it. Select ARCH_HAS_OPTIMIZED_POLL so poll_idle() can be used. Signed-off-by: Ankur Arora --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 49f054dcd4de..ef9c22c3cff2 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -38,6 +38,7 @@ config ARM64 select ARCH_HAS_MEM_ENCRYPT 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 From patchwork Wed Sep 25 23:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812542 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45A961A3A81; Wed, 25 Sep 2024 23:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; cv=fail; b=qAe5Eij74ZGBHeIF1THnnhPAbrhFhceFbv/g6ksI8y55qVar9wN3yhs/FSQAVYRwMbFzE4Y78I8k8vsG8TI5ht6XxJgjSqdxwIQVJ8OvMTGci8IZ4VWhpSvICMEPqzEXcI8BcMuwS8/4UvyOiE3Qi7c3OACJzfboXl15jKvkTt0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306734; c=relaxed/simple; bh=L6SnH+xB8NM1+C1fI1qkqow/lTdGFhcfjGFMYxe1H6o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=OdU8PywHQERBQFjFT2O4PV22KUb+r6g/e3NVK7Y4CI44HqGlka1sTbZSB5n6hMEP55kkygLkOAxx/Wg3rVNlhCXH75k71ohSXKibyeS1DbecUy7kcFsE6GFkQ8HwhG7RflNlnHSyG8w8KZicdroG2VOsaDN1UV6sGYbFckCTFCQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=MYWKVjxC; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=gxw4Tx8X; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="MYWKVjxC"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="gxw4Tx8X" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLnMb5028904; Wed, 25 Sep 2024 23:24:59 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=HpQlGVX5cSWYd/aQV5y/5lzFvzcVaEGLju/Oz9ou9lc=; b= MYWKVjxC/9w7o9jJWjy0OjFEf3iJN1CfNlBPYTnbiZjQbaD/lJMhH3ECFivU1IX2 Npsc6Outysceo8n6EFNrmnvlZ+odz75rv2jaQtr4M1kVJzBsKyYFCkt+5E3dV5i1 ygkSsT/ZWc/y0U4y9+LG2/vxl0cMrSigTCcbrwKiPAma7/8BgHBrAl6FHAMTsibt xN0ZlpeRg0aeFoLdfnQWIMUcN/xfA7h+n0H66TodLhhbkwdjDA+UUvbrVxwYt4al 7I9HFBbLWqyCmjZP/Izg0/9T1O4kqvP7JjkrJX3AGjjhnNg+p5LIHzDtUSIUHifP BBuiFptLPWTCBoSf8vSc1w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1akkv5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:58 +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 48PMUr1V026114; Wed, 25 Sep 2024 23:24:58 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkban7x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vS+G2J1VxF1QUHwFZOG4a++Y23Nua16NAMQGNy7NTZKBGqaYNzmhFFHZ1XFCDnd0XJ4rZzp/Y2ihugjaPh+pN/EtBFUIWc2BVO4KyyurduePug+0q3Eoudk/uwQNfvSDYGtXqnxghjpN3eFwNpRLjZzzVC6UMyCJgHE1wJpgsC9q4esR/JAOo6tfhJC200ndzXwH2LxAKgZ8W2cG/7YTvCn6q/urGcvr5cIWOioJGCKIQgVwjMXweGdLnCHKwRbnWQgIkZ8W/PTu/RfxOGGEoCOBjX8scJlsFmSV7iW99NminOjGynT3F6TRnVOgIcGwMGAGacKzTC6Wl6WzWyXdLg== 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=HpQlGVX5cSWYd/aQV5y/5lzFvzcVaEGLju/Oz9ou9lc=; b=pY1shfq49Ap8PKZMIJEWVLZBGuybTHV2iR1OQOqjnnOjZ9swCmE+U5Fyyww2uNSxAxQFzllWKLxGL856/08z/xBjrbrtBYZoLl9TZnyaOqRd1KqMmmdKwa3cIJqn+yyTfHAtOXQLxAweyGAz9iAnbQeQqPRGB1K6BvJVBTeVdBPey8PMS9fzV19Hgs9ef+JVp2zzMDPzr3/aiYfpdDBn+kCdG6axuD9zviYNbuxPB7CML3du/ACQjBLErYnyTcEyBwfeUT15q414PLOE/Ic5hBiLVU46hE1jngcI1FD15H6bLO0kVpOOp/hPUJR0DPUMWQMpNL01xSz6DbjMQywAPw== 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=HpQlGVX5cSWYd/aQV5y/5lzFvzcVaEGLju/Oz9ou9lc=; b=gxw4Tx8XKuaUKgmQo4HM5qt6tyiESLPLBKGJs7a51o1Oq55DTpdYT57D+MKQxUu/KVMaDVSFSf80piR5HmAWxfl44HsvrcTgsC1MpRPajRFInhybcWhZRt2WqZShQDAuGiFOW32Wpf3aUf5ATHlXhWbvwsx4D8geVksLI0xzb4Q= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by LV8PR10MB7943.namprd10.prod.outlook.com (2603:10b6:408:1f9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.20; Wed, 25 Sep 2024 23:24:55 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24:54 +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 v8 10/11] cpuidle/poll_state: limit POLL_IDLE_RELAX_COUNT on arm64 Date: Wed, 25 Sep 2024 16:24:24 -0700 Message-Id: <20240925232425.2763385-11-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0065.namprd16.prod.outlook.com (2603:10b6:907:1::42) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|LV8PR10MB7943:EE_ X-MS-Office365-Filtering-Correlation-Id: d173fca9-f558-4387-0de4-08dcddb94326 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: jpOzDQ70Y5ePSEASeM7qAw6KpDh8R1CYNouzP/mLIwfi18bIQM/Sfsdtne/3tAXDjpN1YYkioge5l8dvv+QTvZmtATO0rmtTUqEKXtjOUb2Jn1AJGyAuQ8RdjA8+fWLrL5SQe2iHrCBwqegGuYwdHusRXhL1k1RW2D0vVFOzeI90k/a6/7HjWfRgVBa+ZmtRoryylF/eELlucqj19PU3wkPU4psCdFTgdc3cX4i160ak1FREYTDcrCPR3SgU32Jl09uS2jdB8ZQWuWsAwGPjmGy8nQHm1YSughK9wEx67+WMiyay68AJD8eLAxW/VyzjDxtM/ofG+hrftKVc43i45xMkMDyJjn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7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DGV/5HpowfORnn/kUTUTB+U0GUVHWBB6y+Li9eKUahv36v8x+D/BvUBzYnlD/jmTSQVgNrqUcJ7DzZX91TG43KmCrE6hgCGjKqz6OOM+CgVfxoVjw+QyOnblbhlji2VJpABi0N5OL4mJPEfgP1PolHiqutrPZqfdvgDo1vTTkOW4V2LD7zZnlRn4i7hywah1eUd86uyy+IxeuAfHoiREK0v86//6dZ52Lh9X651Gwv9n6CXFrfPR+DS/ABLDCI3sXXDLzfrh6U79DgVzX5/ZiLsM9IuBHb08Zipfe4wHwr8nV8ZED4wAwJFDR0DuKVUe9ga+J4RO75aOK22vk2MLpLIW452oiAovFCtLjEPP3Bvi34F0ThA768n8TzzidcN0VzH2J9gipk3oTRnCef1zU5+BhIySAzH3eTiUgyxRO+01Bva+YXrqhEOKOcLD/0nthWsMMXohYljVsx+v0i3yKTGY7i0KyPSpcr9zmIZZfElzfSncOHilUDdv8yUbKO7uNuaGUYbo3dI5nM7GxgsTcdUztd7f2l2GV1mZ2r8iBCY7l4IJJsDm+H2jqgsLChu0ju5Uletu/HyHZSxy8napUw5XGNp1v09S+CRZhLk5b4nCZdKMFBy6FmLa696j5q/6v7d1fNJ2TxLK/JQU6Ojun85dcf4VVgBA6YNFRa4ikzbBjw+3bdJ/oay83o5ZE5SF3VWdKSv+MUF/8V59fLX09qJ45JPQLEXqHnrszLA3JVZW22QuvYjrn521N+81XidfnU/wbDBJMdr+/ZhB2288qVWoJQgdsGgkVlAPDujq6JCS57rczHgheXOIDAkWGyBa0kY/EWXPy2e7GjqA0e6Ag9e9NhQBd9siMnoLN3PX6H3IKfVSieVGBu9+Ee29HhXRMZDkiQr70LN1ALuIkjvUd7IhXm6Ph0+x7aGuM4rIVgMiBhL7THaGClJsBZjci3Pbk7ioqK8FODFQoCwn5XttSlK8QMWnMHRom+NGVPrqeDB2XzKK0va5dceZE2dj4tFuegAeNzyJMIU/M7295gbGPMEAVkQBK8rVBcl1RyC7+XUjUVSrwgaAprCcHtObjiptg8tQxP25PCQoJqvThofQN8ahAHV3WK8MIiMt7Y9ealmuTiiOHr6tCGO9Hb/fhYo5KslPFw2eaO2CgaNChDOhjvXnWLVoGNWlwjrESdslh8ObMGwtJu6NELWhBsU6CwZoxfIIFCIsOC5Hsm7nVDLrXGROnnmrS6gTcEG+vdXPAJDpB87shR+53+DsR9D971hM6ZxEX2KwxHwJH0pNpvWeBa6oEsTVQC1PFxnk0W/5K5umCAgvnkc2vUy6hZRT6lahWFxkz1hcjlV4aT9QJyRc3wNqBtiw2jDRcbHmEPY3w8VjzdqY7lHGmf2nThLuU3TN7OqCAi5x81+O0yXNb7HJv+x+brid4ekuePh255UrKbAveCBpICWluzpiC0xTUYKQ7AO+4N/N9hEBrNM3rpnJ4P80S+c23bU+0fk0suXvQOFKtfYNFx7zVTnjtvtuteNdouM/VKBca1+9mJXOu6ig0ZDdneSMeOSJyHuSryENlueCr/qvOAvwbm7sG90dYP7v6Cuecm8vs3w8Kx/+ROzLDw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 1GnALJbNmfSvzIcwKs11dTfH4xqVfwkN695z/EDZS4D8JVBgh1ak2b0inCc75Bc0OMr946N9y+bZGjvRDqYzzAbUx/On/r/HXs7maBI9wqejN8g1MOaHahRNGsUJHFfAi1SyBuOGqYKymte1CxVnfI+smDvvFIc5qop9k2qC6owPEAD4VVDTqKBTYtntQ1VBFIR2HYoNjJr5n/mFnZB/AarryK5qwbNMDzGUNf9vveVLIjrgxQal16TA+KMXTVPP0lldDVafZstovcfNvZhCIMvp3P0OlDLWwaNEWdq9Bgwmje/KIYKAY8e/CFbNzqp0qdrfaGAc8woE9pSUY8wyej5FDPxIJGpW01X17fNDxE7P63FszAzP6AyLaTlyQfd6bNy+IPWxzxTtHuxUvA8X1/6hbPwrcvcInaCzXM+SIzAAqgiOdxwp6W7WjvLR4QPUNy73U0tGfueXA6N0bKkRgTKpeP2aKnMPajBCnXZ6VsdoPv2R55+IHFWIEaqScEtvPYTxhjfrV0RMdKSYnLsvik6GIh2cyhrqaeQgfTpmg9SQZG1Ywbv2eLoQTp168/Rk2lxhU5orDi7A4douLu16hEIjHe+h9otaeoIB4RePFkM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d173fca9-f558-4387-0de4-08dcddb94326 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:54.6651 (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: E9ytTZSA0YpfkM9FHxOjCucaG9x6g0oTI9/a+jy0ijgrYUJxSWcPauhzCxeAZe/vISBOjV/RSTDfVoUbw4D0Q4IXhWkDKczXaChWfMpTEiM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7943 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: vf_4HxHQhXNezCUT64Q4CiXZ-VpikQYB X-Proofpoint-GUID: vf_4HxHQhXNezCUT64Q4CiXZ-VpikQYB 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 a 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) From patchwork Wed Sep 25 23:24:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13812544 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 924131A3BCE; Wed, 25 Sep 2024 23:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306736; cv=fail; b=fwT/cTb6arO/F/JyFUIMprYpykxT5yz7ouHKD/F4OtsF5Wl+5zb8eBTW45nQh2CLEHJl7jKVJpHCl9IC0PSqrRivEcmtsJEIQlhOHEt5BWi5+WMKUC1EqnmGTsmv9/aglfil0Zc2juOFrGuldj9BvxP2E9stLQgpQYlBOu9Y/j8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727306736; c=relaxed/simple; bh=HKQF9VbzfrDmmNAi16NJj7zNQTs3mK9FPNV2eemLJC0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L7Dh6D7FYtJx+zfSu1wpwsnrOhTIEYz3Ro2HsJmHGec2on/XCQtHK3KfOalY1gC0dZuRDlG8BWlBSHcOXgGoyM/iy0qc3PWCiS1buLVT68on0haxe9v/YWoGDITF0nhNmu08b1HHkewYNILIBYxSWhVwCbX/RPBd/+t4sGDYxZY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=nCSR7E/z; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=OMkXaU+n; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="nCSR7E/z"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="OMkXaU+n" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48PLn1ft022966; Wed, 25 Sep 2024 23:25:00 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=B1X78YsN0cj8Fn6HaXRey6YxVjkXUcZi+iwMeNWnMkM=; b= nCSR7E/ziuHEnmWfpvEKs7cj/YOkjjEmAQjOumPrcwUsmPFBRqbYwBOQ/TqVDroX Gk7eNW8MVpBGpRSq19CWkeSxQXsoHmJpHD9XG05bThxmpJamWTEtu/nzdZ+odruS a5rByFQ9RCKeUKGngzg9mz/PALhtk6xUq4FBu0o11fMN8GVtj9+EdRsp0hpPG7d+ 3ZrOKlxRRmRnzXs1BbmdbX8Ab0L2VXN6abqZNh3rIAsqj0G/++k+KyBOEdfowEll sg0wXtNM529OSLs/8DPphivk01686tqAltPCVKZB6f5ZuhUpLjqaceVzlbFHnYIO 3QEmLuDH4UrNVgbkCsCQBw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smr1bt13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:59 +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 48PMUr1W026114; Wed, 25 Sep 2024 23:24:59 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41smkban7x-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2024 23:24:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dKPh2xgLTgPlY/o6K8VIB9OQtS+gDcDSvp6RlrTyGMks18iz9MZu87MfyWCu2d1IckJZyBIIcy20s+vUMMMytCJLFL6qeuh1eJARctH+VAP0APBMQSXd81YldKRYiliTosKcRjz/OgUNwSj/JbSLL1ZkVqqX3qCJR0AEKEzDm8/bhfIstqpSyFq9PO7MnHPhYyq87JI6PccUMV4LTbKWuGzulV8CXE0KrWbzE/HjSoAXsy+ZK8xvESArP/mwXpp24BrGtDD9adD8/EmUgFwfN8JSk/tRyUTUd0ZK+tqGS+LURBY8MxQDgOF/0X7YarAbMQi/i8+JVwAo+RT8vHYyCQ== 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=B1X78YsN0cj8Fn6HaXRey6YxVjkXUcZi+iwMeNWnMkM=; b=OE/SGNuSqjJyXaPJQ+gzCs5gUzcy1UX6plgEGcVjUeqNd4s+mBfWonxvvcOZzil/Ttzt45H093ZYERh5lOKxNtduI0BbefVpFGcG8zpU1Mc/pacmBWlxUvzumojOSmJS/XIsX3P08vuSKWDtf8rdjNIbd2Ne7E7g760R3NYJICha9JHav8ogOEKTOYuTqqycyu1qHUzSvff83Zk909X+EojBeu26PPpyvDAP3k7H4OTtsaEBzZYOuWGSSnW5P/Cc8Q6syz1qKjE7DOTJfAgDod0loMVJ3UUDH7rFA7FwJJpqt0CPBuYMqjc7uvLXpAqyFlVcTyUeaaSh7e96pow1fA== 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=B1X78YsN0cj8Fn6HaXRey6YxVjkXUcZi+iwMeNWnMkM=; b=OMkXaU+nGAblIJAwTtDg/YpoBxmHveWyM2jFJbAHdbAODkqiiRuffpF80SwxZfRU2lHqjKpxQ73DqmXsawvGIiKL01olWdZStha4P7lrLqymKse2lna2mprcD2MyKfL2HgkBKMelyE2MyLLr87NOMbK6LTmZl1wwJlkD+o0vFRw= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by LV8PR10MB7943.namprd10.prod.outlook.com (2603:10b6:408:1f9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.20; Wed, 25 Sep 2024 23:24:56 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::e085:31f:84d1:e51a%5]) with mapi id 15.20.8005.010; Wed, 25 Sep 2024 23:24: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 v8 11/11] arm64: support cpuidle-haltpoll Date: Wed, 25 Sep 2024 16:24:25 -0700 Message-Id: <20240925232425.2763385-12-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240925232425.2763385-1-ankur.a.arora@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW2PR16CA0054.namprd16.prod.outlook.com (2603:10b6:907:1::31) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|LV8PR10MB7943:EE_ X-MS-Office365-Filtering-Correlation-Id: ad64c0c1-981f-4f8c-ddc9-08dcddb9441f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: W3ed6RVZUyP9KJdUvOkfjwXRlrLgx7auS+cAXbXmHKEWgclQshb8Pyk7Kio/bjw4CCcK2htg7ju90BnPQbFPV+ogA4XUazGxQ2pwM2x1zY4iGIBDdY3IJwp2cT0O02XPkjaNdhXDKUJPfNaN+ugnHuxP9xZwoqO+GsBbCuE2Qbyww3hGgV6vDD5bUuv5XIUxrDi2nkl3u2k/UQQ9/XbS3nnByl6Nx2P907aU6OSBowyDbIyI05pCoffDiMop+QyZJIIxBHNj35fTRK5Iaoy6DKL+Q5OyZiXeaOpD6/GehfiYpO9AwGaboMMZW2Jtan+YMi0Rnot967Ej/oVWMgiJwqBfmLq6ZLxf7xU5mgeot0IwQG1vurlLxMfi6wB1cmIYXCNdTcJz9AY4FhvFeIKOFu0vci9kXv65hsY/9pQa4K5HK1O6nIBMjKObBFAykA04C/XdMpfjSyCt2zePgpFpvtqRQFwk7jeCf0O/bnTlm1Z+K8yrgfcMXpwK28qFrTO4i5HnL8Bkl54c91JpWpsOy7naaLAp2L0i7B8sm4N6OT+bGbbsk4vXokIK7ss9cYgFChPb1NMmK/gzkfAcpqJDzPo8dN2qK8nIVESSt2p3UTt8B9KpvyXByHemOUnDTm3iS8aSTPPfs+q2arour9DR5FWt7G5dpWFQ48bnMHqFNQvKSZgIm/ir707aef/qQkFHLf+RF72PNLl6guOnCa6pqIZjObP566ckYP54akOqx4oycz9O36t90DSCEOqV0yX1Xcv9KLpaOk9+e8uq2b1gZQiPutAJwaPOtuByTif3AyU+8RkY9idQTKh2BOp6J/8ZBd3h/4E/7vRxUo2UdqepYLJPie/9RQzmG1w4IwEDPCIIZ7GTfzz+xW3t/zncocwNeGjbWtBIuOysBGrdfejEk58BhgvhIQgCkMapjwWSKxT8m1SKbUtWZu42MlP7obgGBj48af+zFDxJq7eEF6OK/KObu7CJCvlHEBzOjZ8vwZzWM9X7ZABO6iH0Sl4Mu0/pPoAiXVaNjW5+z5JAmHYKov/Xlt04X1jud6QFqVdQRGMjaYZCkUUNGcy7gE95L38r5j9eczJd54uh84Y/TSw/gk6ij4e+Qa1+zHlpMX07YZ0JRM3uFy6MhwzTJRDbtcLt3++N3sQMi5mPqmCsUhPBITLJbiNxQ+vK7gM/B/UjqjsTxVLyQtVQiliQPRjLAUfozcIdBwGab4WzXPBBDjrGo2mrru6G/a5IWplHRI11oY4cYZsi0OHZSww0cYnJoT6L+KZvxOC2YoFRT/zguG4oQA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FHRDxYc85y7OlGSezQSgD8VKlB71RRGVTiWzAZuXXBMpDV3NCmZlfmkgo6kyZl/VQrLCS8E+axXpq2WNkzEmEta6bo0l2YAOb5u68PaVu8FRZX6pkiPnDavXfvKyvvHUJ4/KqY4OmaGsCXS7RS0k9H0ufoZEt5JgxoIAAsvp88qg6XTjNzssys6X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change-CrossTenant-Network-Message-Id: ad64c0c1-981f-4f8c-ddc9-08dcddb9441f X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 23:24:56.2718 (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: n2xT34rneJ/1CHzgFGs6JOjgPsnHbU67geWcPgZptCQqjUgIW6i33zZamdX1LtX5POLrcXMmCPR+x1OrDLi4xLarNovydWuJ6wgQ5DMiysY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7943 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-25_14,2024-09-25_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409250164 X-Proofpoint-ORIG-GUID: 2wcIx7t27r2Q0zq_zn-7MQg59D1XUwjE X-Proofpoint-GUID: 2wcIx7t27r2Q0zq_zn-7MQg59D1XUwjE Add architectural support for the cpuidle-haltpoll driver by defining arch_haltpoll_*(). Also define ARCH_CPUIDLE_HALTPOLL to allow cpuidle-haltpoll to be selected. Haltpoll uses poll_idle() to do the actual polling. This in turn uses smp_cond_load*() to wait until there's a specific store to a cacheline. In the edge case -- no stores to the cacheline and no interrupt -- the event-stream provides the terminating condition ensuring we don't wait forever. But because the event-stream runs at a fixed frequency (configured at 10kHz) haltpoll 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 will move out of the polling stage. Tested-by: Haris Okanovic Tested-by: Misono Tomohiro Signed-off-by: Ankur Arora Reviewed-by: Haris Okanovic Tested-by: Haris Okanovic --- arch/arm64/Kconfig | 6 ++++++ arch/arm64/include/asm/cpuidle_haltpoll.h | 24 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ef9c22c3cff2..5fc99eba22b2 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2415,6 +2415,12 @@ config ARCH_HIBERNATION_HEADER config ARCH_SUSPEND_POSSIBLE def_bool y +config ARCH_CPUIDLE_HALTPOLL + bool "Enable selection of the cpuidle-haltpoll driver" + help + cpuidle-haltpoll allows for adaptive polling based on + current load before entering the idle state. + 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..91f0be707629 --- /dev/null +++ b/arch/arm64/include/asm/cpuidle_haltpoll.h @@ -0,0 +1,24 @@ +/* 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) { } + +static inline 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, only allow force loading for + * haltpoll. + */ + return force; +} +#endif