From patchwork Fri Jul 26 20:13: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: 13743141 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 9166947796; Fri, 26 Jul 2024 20:14:57 +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=1722024899; cv=fail; b=VL06RH7M53N2+ZMBCUjhREbKhqTgNDEB2KU1Om9NoJGXVoInISxUynujcJvI2/Wv9rMrXPzJqGRMRQSlOswEszf1HpdDY+LuP9HkrC+fmp2wF0GqN+ypWza/B5C/BGqpU0BXj2q6PkYj77BwljdipRmzOofJjGppg0kcbi9bq/c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722024899; c=relaxed/simple; bh=oUCwPSHkqbs8HTpQ7YkFJ+Wx6p6dfqJwH1BigO55Yss=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EFHG8Gu6Z+A2fS8ZePgizTBztMRGhxrnewfyYOswm4jaM38rI0QVUOr1XayewsPhnSw/GhdxDUn9bpKGRkiYcQ7OAx6xck7wLrsbZnYlFwUDP/31EqhbJ5j7rA3W1qyhbvqN59j31iKs+AYRKhrODih72vlK4xZuTfYD1IDkLFA= 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=CL+SfTfY; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=y4IMmHKF; 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="CL+SfTfY"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="y4IMmHKF" 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 46QJcB7v005341; Fri, 26 Jul 2024 20:14: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=Rbm08n2ELVMR0+299G71Rl4lvAiZTAexxu1pETLxiyA=; b= CL+SfTfYzh4BKyuwVw6Bm7tqJRw4/tjUHmu+H9tZf7WdrjLgDMAFFp+vD14xJBcF lZRkk0HA5yH/j3q6Ro7nEQHPgmPknkHzNhOfPqEP+Vhgd4wx8YrlwHH4JHhtV8lT 87QjeiNsd2SeOs0xcjPqhJFQr4LjkPJMU5dicwFjphD15EEDZz9TcMq6Zh/TPLyY u4JlSdAZRZ4YR+kTisUMT2HgmIwg2/nPm3L58+FvYUGXv3JssOIFDn2SbfWHrQ08 6fwR2IZjLlg/m3Uq1XBjK6piTUwSHjN7Dw/IkH/SQOQ+4y3d6YfwGPIHB20oRSDz 2a18cy7aRvwuNWmqn6MrqQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvhrb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:14:00 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QIOjJO013515; Fri, 26 Jul 2024 20:13:59 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h2a645qs-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:13:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sdN0O6Zscny2PEeHiWfBYgQOvXo46arzDAmflfapNxlFA/GVkCGAAXHKri3LRC1fc+Q0/75dywkEGe4yL7gS21hmKq5Ewd7L8P0VzSoMrh3ashaoZqM0K0eMOtOPaklygSF0z3JAYJ5cyhdKxnXp2O1qXuh/nVI9i5PvHWn5KbhjY/WEleHYt5S/bHtmSeVxmJh2P7JefDy6Onu4iTynRllCFdabsSeh2wiUMwAYPasryayAChxSX9yJZBjZfM0bJFSknt46muKemOiQYSuVFlJgmpXN8COsfyCQYOTyauRv2/UdrNrx1Y2kaem5AM2Atet/wPD3FaGf+ovPk2joSw== 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=Rbm08n2ELVMR0+299G71Rl4lvAiZTAexxu1pETLxiyA=; b=Z+R1VL/soUAtvg3D5iCihhjr7d+8FIUuEnYfGmUZKvJDwqSufULOUzNNNdHMnCwOEpSGZLNzzunsZ9UgvYZAxXFQCvdKMZey6gdkSalrQiXAYokKim2cqSLjNtlkYDXnt15NG4rv7AdEMME8Rigp0HwAjnvvFcxLGFVC+WfaHcSPfZvdeKMXr7FjTX2+aOEFbPHJsfwDt5J4O6Bix76FKTdlM+hwEryBfiKm36vNQxUmSJjQ9nULDw+Bc3tFldGuKgMiup21VKSkvKJEjQLY1bTwZjJHfHLKvzwdup9Jig7yGA1A4DvInu+eBULh6jwn/QlBWjK9ijk2peYLAgQ13Q== 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=Rbm08n2ELVMR0+299G71Rl4lvAiZTAexxu1pETLxiyA=; b=y4IMmHKF5DyFsD6+xus4/0PFLSVM7CLd2j+BNsVEYn7xkaTqxNuN2wxIAXJTsVibZVkVgh9UqYn1ZEKaM09hqfEz27HBUr4Hww5XXhZd/ChFhWhsk/QH7vzYiYrITrkTlSjdgFmTHI94nksveRqTbaB/Eo8/tz5cnLmubAcBFy0= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH3PR10MB7715.namprd10.prod.outlook.com (2603:10b6:610:1bd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.29; Fri, 26 Jul 2024 20:13:37 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:13: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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 01/10] cpuidle/poll_state: poll via smp_cond_load_relaxed() Date: Fri, 26 Jul 2024 13:13:23 -0700 Message-Id: <20240726201332.626395-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726201332.626395-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR07CA0072.namprd07.prod.outlook.com (2603:10b6:a03:60::49) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH3PR10MB7715:EE_ X-MS-Office365-Filtering-Correlation-Id: c242c406-aec2-4757-cc96-08dcadaf6eeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: 4ZYVwNd84f/W7+dRgio6ln6P6fzbp8/wHDvGTXfMERHnHYy/W+3FTglj6RJIYT5EL3JFlufj2ryblfiisY5z5ds7YhVPBUEzTIBFuls/hMaTjBAsTgw5sHXIqA8TQPaMu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nW0/OeARAE/lXpriZ0rSuAbfcyexU6RIkm00R3ZkexMN/KnZq4hLaeL3z6uHRy/ioGlMLkRxz6zUOg6Byt1BTvAU57d/XrnUZr2g+Coj+DvGDA6GfHTgItN0zOqh/WKx8YQjPEQkjqenMhvBExCGf+giA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LYh2GfkFBp3OtEtMZFBrKiKwTfhtLinoqN/2syp67uABAtdAaPKyEl+wdbwHZCRAwYAqxnokHrDvitiJdoqHHqjHhPXxM8FJwdqQr4SVxId4/lQh4NJXQwhyfxjhbVKnkjbK8HlDGpsRPjONI5nhTAbWoJKXVBQ2OmT60v6U8JiN1ZmGmI+JWRtzNMikYHfrQiTym5Vyagmr5SxazbTKDSpLzixpDjo0t+nDTi/0M6OsDUPze9AlKHFuiPjp5MzVQwjmW5HhR6CkinwJyQgFVEwa/YRvXhSwq+2YZiaBUYtNI0l/KabHaUC0A4cywZGaYcjpKrlekUYN/4DRQprDTfZhlTordzJuNa2II8CCZ4Wl7jb/ifjIdfca/S8dax5F+lnBFjkVcMu8HJN8OgsKrCnoJfnxmltyvZ2o7oFkKzBsMrnwcTYJcmTFjzHPJO0aVhNfjLjrf0Y/R3rAko2LLnzdbVP+oE4Le4gd0Vjonf4RXh1iYOYYhH+ZtvkPANfyVEklRA1/ha5V+myf+Wn0VmEtqX+KueExmngu5rLPUbU1UD36gq4/bte39P6XCow/p8+H/177dU6TUcSocgmghoQp/X8LIODS+7XsqG8OzolOQbDPtiRcLyJ45H6hEJvrnzv7jxrkmpgbt0wBttca30rBJ0cJIsJxCWvzWXkyl7KTGuZ3ztgdmKo6LB7fcR2rbyM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odxfHQ5SimGjAOsJ8MT8UnBQgpLC2W8g6+w33wYL/HqglgGWksHkPOkhifUfvKcvFTd3mMgA1Zye4S3pStThG3UPh1Fy5XBF9tbmAAVaMyxbu6Bo5jfWMoXTMrHg9PxtNmXrXhKNkjyX/nNwFDD3Xpfzx90Ea2iNEORxRO8fYu7Jql3d7i4RL3e6223KPh/dMyZU29BGsAs4NrTiglvrzLdGsIM2sgbthnQiYiG50pr7oHQjJMjvJjGMdDbU+COqe0LMD2RRUUmlrVN4XtULk2cQyai2j2QhougoVJQvSoQ+6Vv+747Z2X1a4JmB+btoII7Dd6HoNwl1nA87hZVZwXvbGl/AXqua/mli4cRB1it1XWUeFgbkpFcInHz+3nv3SKqvLM2sGOJ0iEEZQOXpnC8pRdsXEwMCjP8S4b1GoKb2RrdFbp4YPtk4tIRA1z3bAayKiwj6b8v1KDp49sxrFZPTU7J6l+MKffdjPnXiOox/pHvEd2b2fb1OWJxrf8975NFyRV9QxY16pwmcevtJRcWuPUka8ctlNB1vKvtujmrA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c242c406-aec2-4757-cc96-08dcadaf6eeb X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:13:37.3405 (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: 55HJWIBgr6sgZrONIwVwxg9cIXZ56ZsPGfGVoC1Lo0MUCQOFr/DfNdWXWrNuE1yJS4ZotfGurfNfZmmfnvGb4w7iTh+6dtfUqyGrcMgp8tI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7715 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: JpL54Q8T2gI3l8BBXwNZlj62GJ2zXeMK X-Proofpoint-ORIG-GUID: JpL54Q8T2gI3l8BBXwNZlj62GJ2zXeMK 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 Signed-off-by: Ankur Arora Reviewed-by: Christoph Lameter Reviewed-by: Misono Tomohiro --- drivers/cpuidle/poll_state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 9b6d90a72601..532e4ed19e0f 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -21,21 +21,21 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, raw_local_irq_enable(); if (!current_set_polling_and_test()) { - unsigned int loop_count = 0; + unsigned int loop_count; u64 limit; limit = cpuidle_poll_time(drv, dev); while (!need_resched()) { - cpu_relax(); - if (loop_count++ < POLL_IDLE_RELAX_COUNT) - continue; - loop_count = 0; if (local_clock_noinstr() - time_start > limit) { dev->poll_time_limit = true; break; } + + smp_cond_load_relaxed(¤t_thread_info()->flags, + VAL & _TIF_NEED_RESCHED || + loop_count++ >= POLL_IDLE_RELAX_COUNT); } } raw_local_irq_disable(); From patchwork Fri Jul 26 20:13: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: 13743143 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 009B0146A8A; Fri, 26 Jul 2024 20:15:00 +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=1722024902; cv=fail; b=LMtFpQt3sddcizEQI2aF4ocnRUZK4RcftgWrWj+gtfUyT6/Mak3qqFIGeAdeVCSYMk4NwHyzJzu6OJ2KUJzY4DEmW3JPsubpTtGo/XKw4SXf+qYCu+pHpT/X6v3WOEFQ5FgjXHmKxZ4HHm63AL+YwJ9sL5spIXdgAhQWMiZBvPc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722024902; c=relaxed/simple; bh=HR+nvPtfvYLZPK6ySgLLzkK9ap2BhiTVDG8FJTtEnr0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=q4VK0+GovhwNQs0Un6JuMgfKH2+2jLwQMQ5zsviPE8nO3w6bOGhlJbKPt/qMYY+rm0KFXH31uYtqG6lDOIVKQQ7UsncFTC7TaNd/saJB1fvVbLVd6gOsaqHNPKIJ/snjjAbWw0FKFnXxO2h6WCTHy7nakengg33tNJe7mIvHyIs= 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=gTZ8n/0Y; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=UdDEyEQ9; 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="gTZ8n/0Y"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="UdDEyEQ9" 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 46QK0sUl009764; Fri, 26 Jul 2024 20:14:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=aoyWqPSKiDqf5o3M6Ag6M4Rv1F2lpwQF9ASKFidwTD8=; b= gTZ8n/0YCgK4+E6lyWUiJy/SHPeroZLwLrgF9hgRvba9QNz8j648jZ2ZuwGvTsfO F5tz10Af30z9gIDLzvSeWBxW2x2btvuMywLIkZ+BjODiX5oQCyRUO1HtSHKP3VIS CTvtZOUN7SJb9PZTaBwI6CLwvKgyMDRyg6XUvQ9zu8wC4TUStERAX5Wc18oM5/NU dBH4lGcZTKuD3Ht0IhUq6ACEHAWYWDyt3MrteykiqBjCzhRuH3g4x6THUUW77ggs Y2itCIFZsge0DGyT79tXFAIaYyZei50/L2gNMfhG8qI9VrxFBE5Bqn9HCt8u6HLO s2OHHLKZZFdrPxVe3SPzMA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40hft0p9j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:14:01 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QIOjJP013515; Fri, 26 Jul 2024 20:14:00 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h2a645qs-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:14:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R8gwzikSzeAjLYhX4wo8SRaKH8lt/fOWIcHaDlWVtWAoYzVtdNQZ7QvnuTFCP2+BiP9qSzIbhfdaOXlCw2jSIWm/meiAtdv4ESkO0eq6amX5tOc8eaLl9m/b3JUGF1uFjDeLBALfDT8UtulTISwMddtx50yYSQAd642shZ+JVAyUb5SRTZWpGlYCgBaKBam6oxWdLF1C6rfcjv62NVCOkrD2AGFAiiMcoFhXnNEIYNmQMuj1OGqFSKvF9aDCv2CWzYlQUUxRJfZTLKvt7oodoDgbPs29MJsB2pVJPU2j8b3bwFJ1gp5CJvTQmACn6jPUfLmF83lwBOLVFKpaTvYL2w== 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=aoyWqPSKiDqf5o3M6Ag6M4Rv1F2lpwQF9ASKFidwTD8=; b=ofdWKOl31wpT83I1iJUDsPGv/Ebks944E97aXDSJxmDudhNeTVAQvSiF6EObKHaeqEfwaSwOLmEFgYi15iPoJY87hZY1tbhgRE3jX3p6j3arLMwVQ5KlYYQzabz3Pm8KDkMSUqPIGJH7DCFgn0p7oS7Q00brDxPuAKW/AbyzhH3enakuknv/Aw1a8crUX6EzWtDKx846EgW0a9KXpFwRc1xhjA/6f6GgQGs6QMLotV3nL1jRrBtVVaXofOYTqij7KCMtn0OegLZORWWuYnRkt0E3jmnuWjOyh6DQzBZjmiPHfcUtif3fTn9vPJaHKPWQ7jpHSOEPEemv9fD/UaVd/Q== 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=aoyWqPSKiDqf5o3M6Ag6M4Rv1F2lpwQF9ASKFidwTD8=; b=UdDEyEQ9ZvkgsI5cdprgArTTuugp8VaHjc52rVwgFyUnj+KeX60t3Gy2Yw1i0IiaVZB7nbstdJRv2JnKz6GZufSjIKZjt2aTaQds7qOgauVbWbVijUy+elgNrcaGpfcHT5pv4ZF1En5NgXlJ2PuG/BzdWfDkCMfPvF1pASny5oU= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH3PR10MB7715.namprd10.prod.outlook.com (2603:10b6:610:1bd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.29; Fri, 26 Jul 2024 20:13:39 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:13: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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 02/10] cpuidle: rename ARCH_HAS_CPU_RELAX to ARCH_HAS_OPTIMIZED_POLL Date: Fri, 26 Jul 2024 13:13:24 -0700 Message-Id: <20240726201332.626395-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726201332.626395-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: BYAPR07CA0062.namprd07.prod.outlook.com (2603:10b6:a03:60::39) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH3PR10MB7715:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e03474b-c240-4f57-cb47-08dcadaf7052 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: QklIwywomBQ77HpMIiax+TZT147U/1RLfM1FB035L55pybzICnbMf7zVfd/iACWQdbJsFL2xny8foh5kV1gBLtvW2An1xRUCfAcceyE6Jc7kbo+3t7CqOJeGikoXErFrFS9sTWUBzA1Uk+L+LUzw4aW+T8EiiHaiiB7iJKoef9NiOvfmmFEmj5DPHYuwg2I17YWdbATfLfUVO5PLxp/ABQh4yN/b7AuF5/CqOGf6ACD/ytMfhZ6Y7vSzhMJunxESbxFd46Gp5GsukC36bYz8PULgNYUj+lg993tayWIr9ktjnPPiGdWXChw+YGlGrmPh3d3z5sKRIBFUddSIUZ0Zqer3pxTMWxyCxsR1StkOtndAwCIzwP7K1wvQDt0OOtNyzEs2Ss7AfO3YQuYm0Xu4qyrabbDa2PfjjIqtr1PC4LjrjtflLjQC5TjJO/1K76dT5whYAYnZnjRnN0LwuceXDRUeW8ATPo1RDmJjBZqEO8ZPuOpWTYb2SDpSaP/Glxd2lFHI72lSmlvQBbTG+kByqFxIcoIBxahfiZRmbuElp6ztwEbxnrRXJAJC9pC1/EmRr6EXjEUD3PTfHRPzs8ud230SLbtLmRNYngQHUU8II6If7NB6L5pwE+e+UisM9EHPicDvJ7KBpDSF9qTcbXf/IgD00u0oF7ntvUTti33YS2d6sCodBJluZLfyjraxan1LFGPUGeBhHHrciZtt/hYwfLYeHD4bcKMGyFGiTsP1Vsh2REuRRU8rniqvBTw9LvRcrJLkqIOEuPjF7KkHJrzkCFHt8vsujdR0mKzrPC+slQ/W1KzZygirX4pcqxTvJSg6sJjEX1frbFhhO1qujicGP9IJ4qOMj+MkNs5cq3ZmrE3Ed8ijkS0UEvkiLNfEJLT9ImKg3mPbwUeDG1dKLT2+GrjhZ5M5bmhJ1Uo7ATvhX2apbEPE7yJjrDU3DtGpDz0VL67X3veL4Tb9BX46N/BSeE4Va7Q7WXj5C7zfNGuFpxS1P7m9BAW2zy+WiuCHV+U/RgP0E60iZF6wWcV6d108ErmtNkqsBAiEaBYva1h9k2oCwW4m7L5qnm07nLm0wHze8gAL6itdrIH0uajAri8rH9tnzH/VHHNlUsVL0Nz4rGZh+SYgyKIRf/K35TptiwoxBTOplBjs1uwaJvcYMC8j/oQga71Ix/wZRsZ/5uj+l7YCsSzBPyDrx3e1rTfv2TKheMaH0u3mkHFp76A8m6zD9mmejZhPhaxajS5NypmG1qq+hNbsJAUJ+INhLiP97io0sXbMlmZrwc49vVzwhZeCbnfRkCik0jXkPKHiVQ79m7tZKZiYTh/e1Vtz0cHVPLrq19/HY8+dUaTaCAUjOhgp7g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o7/zw7EgJObKuL6sViXXm6O+dbvDY6G+NWL32hDhIM3nAoY3hA9LPInBWdFfsFHh/wyVAoqu+z2+Epx73QsQTCXs+E5ieJFRF/JQLd33rjzco+gnImwKzu0zPY8nA9By1qJFQ5qM9jFGruNMU6RK1iMw4iOtRTR6BzXTFfV23dVk58aECnLPPYRZ3DEJQP6X2HHQq9FHTreffoQllV8E6/Z+oHUevoVrvABIe9/E8Mte75wc9ngDqK2BAR7Wk1bn3kjNUwpC4zGkxFkoEbJSN8Uwi5/SWjeY5Fri1Ifo7UIkFBVOXBrlCQvSy5Z6GrpcTLSdGQ703I1b1kiZLjlnw4zaIx0samdaSxlo9v9Iqx5wn+2ZNDj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fHhXEPj1vcxygI0lcmGKnMybm+k3lXMx+1W5KptyLNNP88sRI+nEqNA9SClWv7JVIxrcnHCObE7uD7YJFOfeTi1NuY06/WWw7VZbdcXZlR5R03xL7VX/KTIZdqsWBnTvYVhzsvPU65+BMs+88dBTooDiJYwAoT0loQwuWg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: fsFTWKCKfg68glMWQpqhBloGPqFVkwq8/G24CqjrUTxITimp8dnfxuj12jJyhy4cFVShutA5SuCHSUn1vZJ7qDzL0RjnPYbWAB117nWqZal0C0RixUY8LI5n6LxmUL7I7rcrWdJb2lfVbPTlAKj1fAkJE7bwK27tCGFSXQz6sQxRllu2mkcbJq2jDW+Y//0OlTj0n9cC02jinP5MVu30NBpwCgMtLBMCb05K1LU6LhACHSUWjK18HVwfvr/WwnAgqHMZ+H7XZXYPCuIAT0mUFY9Z1Imgfa1UEITWldvjPm9yhsXAHmG5B5KIv9gOKkzHkr8pjIe099Izutgd9o7/9PqgXp3FrRf329Q/AymQHW8xqhgzk7s+p+vjvx1YZoo+M5Of4LGCC1bfg4ITzjrjr7w4A6BR0oP6hmMgoONB8/RgeVmuLDvY50C741r5TjwZJBCMBTZK9EfpbRUUA10rw2qLIZn5bkCYFiNw4jSSvaAHEMnohV1c6+AnVKDRlp5lDKCIBFBqA2122dv0lpE65I6FKr+nxNE3P22cUtlhj9JaHGdT9eRLl5yKd9QWKGujS45i3TJJBphx9s+maf4MasuvhgEqtN6CFTWZR8yLjxg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e03474b-c240-4f57-cb47-08dcadaf7052 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:13:39.7850 (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: lTNRmD+vxATPskRFDpgnSWDf62bHBEzhRH7eYP6vNAv06eqaqTPCTKSN8zoPJHWpLpPohTVJzjq8oOVw2jajLH1127iO+JpdFvvBpiWuyjQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7715 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: QxlJRlzr6QLPVBNIDrvH8h8zrd81cvNo X-Proofpoint-ORIG-GUID: QxlJRlzr6QLPVBNIDrvH8h8zrd81cvNo 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. 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 1d7122a1883e..cf78da2ba8fb 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -372,7 +372,7 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_HAS_CPU_RELAX +config ARCH_HAS_OPTIMIZED_POLL def_bool y config ARCH_HIBERNATION_POSSIBLE diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 831fa4a12159..44096406d65d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -35,7 +35,7 @@ #include #endif -#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) +#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL) ? 1 : 0) static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0400); @@ -782,7 +782,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) if (max_cstate == 0) max_cstate = 1; - if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { + if (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL)) { cpuidle_poll_state_init(drv); count = 1; } else { diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index cac5997dca50..75f6e176bbc8 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -73,7 +73,7 @@ endmenu config HALTPOLL_CPUIDLE tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST + depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index d103342b7cfc..f29dfd1525b0 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -7,7 +7,7 @@ obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o obj-$(CONFIG_DT_IDLE_STATES) += dt_idle_states.o obj-$(CONFIG_DT_IDLE_GENPD) += dt_idle_genpd.o -obj-$(CONFIG_ARCH_HAS_CPU_RELAX) += poll_state.o +obj-$(CONFIG_ARCH_HAS_OPTIMIZED_POLL) += poll_state.o obj-$(CONFIG_HALTPOLL_CPUIDLE) += cpuidle-haltpoll.o ################################################################################## diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index 6707d2539fc4..6f9b1d48fede 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -4,6 +4,7 @@ config INTEL_IDLE depends on CPU_IDLE depends on X86 depends on CPU_SUP_INTEL + depends on ARCH_HAS_OPTIMIZED_POLL help Enable intel_idle, a cpuidle driver that includes knowledge of native Intel hardware idle features. The acpi_idle driver diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 3183aeb7f5b4..7e7e58a17b07 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -275,7 +275,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, } #endif -#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX) +#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_OPTIMIZED_POLL) void cpuidle_poll_state_init(struct cpuidle_driver *drv); #else static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} From patchwork Fri Jul 26 20:21:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743153 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 EBCBF149C65; Fri, 26 Jul 2024 20:22:25 +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=1722025347; cv=fail; b=rsJC3FvYVHb4IFOo7Adto1YiJ828cwK0loQxTjFvmwsvd+ddKQHfgBHyNUR55kdZ5+h9gxxIc/ow3L18S0MJ1y4cYBeTo6ZVQo98cww+wvT2AO8pTe8YYrFHipSvp1EhCXB1k0t6doxfWAWDiyTPv53tJRIpygJtEBUrBLAhzi0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025347; c=relaxed/simple; bh=kXqtAKyKpXWvBa13Bl/o19PbkTs1oCdWB6MTqVPthwQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lWJdnO67BEoW+F2kO1rH2ghH65H2IbSK9lseltJ8TyKE6ORWWKvZ/LRbtSD7WW0NVeu50Ei+NJ4nvO0Xg+1no5q8NuIEc3UDTL0gyDuZ0GER1HxvFUQupOqtX93GdhpYGya7ifhOMoXvdkQIl6P3VMfOvDmbXyqPMivZtIO2DRc= 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=jMkXtZgP; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=cpHDYL0u; 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="jMkXtZgP"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="cpHDYL0u" 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 46QJjCaV016177; Fri, 26 Jul 2024 20:21:39 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=qwSDgHOa1l1LP0iLbQEfeSr6irj4/SU4wrBCgZ/JL/o=; b= jMkXtZgPZKqemkPcYi6e2JzOkPAbT39Bskawj4C8aPhd3Hb+IAJrP8uh9oTFBQXZ 9SD4wmTw36PiO7XO4bNDgk+b/6ZU2azEwFCAJqaKoJlVjqoWQ6hjHDuD29wDv8LY 0TY28iazqbgRFgwiNwY241Ins78OLaAMBDswManGgEdPNlzJhWVr23fnyY1TLIOP OnoChBHY4tBZkC1k1hqxmI/DNlmM0loBGrdZDVythZya8yBv+Q1fBCKoccdwENlZ tajJup7zrRJZenilhOir9UnDNo9uD7VoO/aX6CIp09pa97Ae40uBr8AqDPcYyLLY 9tVPvVModxbv+Z47utrQog== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvj5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:39 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJ0rDG039027; Fri, 26 Jul 2024 20:21:38 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h29vvse8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e6m3BzU8IX62NUPHrGPL480nSbFBvnu5d7s682iXVTCk+Xh4DpGKRh7eOL/eUZJQW37aNIkymrDk0D0IEDH2xrip+J2kqWR1Exo2fWg6wuy/vD/Bqhh+PyXE5l6+OQzZKYrhKIk+WCFhbYi2JMDROc2QRvTlJq3WwJG0mcXJIqd2ujuyFZXjVUBQcOmwZSOpkze34spuRfOwSHPb+k9VurrJPlPEB+mgn9DVcuvqhen1qfqczfZ9HJZdVBAdeSFOTd8USg02Wh0j+lbUrQDEPS1Uyfm8G7XKoYYx/lTLEZJtijlADaIp1nywt6m1nndspFuj7TmkaHEcc2QutjkLaw== 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=qwSDgHOa1l1LP0iLbQEfeSr6irj4/SU4wrBCgZ/JL/o=; b=srUJN7XfkvD02VVkYo1dOFRv+l0puOqnuBxN/8tLeqTxeh3DBa2JLP8tczLh3989MxfwtY4fxLTVXGFsfErFXUlHPSvETAhFI6uSNz4CmR8+x6c9yY0k7OrcITOmy/LFFHP/1AnbJLw4DOmZ1EFOSixymlgI+gOZbX/Lw5CQUUMyHLKO0e4RT0NZ5bipUouWB3utrtQF/yUqWUjEgjiQa4qh3j5Kc1C9ZNsex55nIIFOD5RvVYq3iyopq/ZnsNMrocpY03coXlpceBs1pDQo0QtNpl+AgDrzS+JPmZHrf10kv6lNQBcp83o+FG+Ddg1rC4l3Phe+lH5i+a5kb3KFPA== 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=qwSDgHOa1l1LP0iLbQEfeSr6irj4/SU4wrBCgZ/JL/o=; b=cpHDYL0uGt9eDPPlQK7Tu1/1v8CU/aDGjND70XGgtAgc/7MD8vpd3bG4nvyMi0Fo9xSXzBUBsvAOCgO1nCwhdJ3x7/Tex7KnH5aD/sWGVTry44C9ZxcPC+nAZlJ2H+SjiC2rRbHK510IpVYWH1PptdAZLnv/LiHkEp/cqXWOWoI= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH0PR10MB5178.namprd10.prod.outlook.com (2603:10b6:610:dd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:36 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:36 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, 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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 03/10] Kconfig: move ARCH_HAS_OPTIMIZED_POLL to arch/Kconfig Date: Fri, 26 Jul 2024 13:21:27 -0700 Message-Id: <20240726202134.627514-1-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726201332.626395-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0275.namprd04.prod.outlook.com (2603:10b6:303:89::10) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH0PR10MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: f7249169-6d45-4e10-5dbd-08dcadb08c84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: ZjH2i9Pg+m1uoz4va3V/UVxkoCOHC1dyfTk1IY1Z+BFCW2BWq539/ENdaZm+xpM458mSPQWnWXZBDHZTswxm+uWyEfv6ssB0QmpsyFHGrFibDUYtD5BF1bWetvyt3GlqiEkMi+sgs7QPLraiDD0nONVdOeQsK5MYBaR/Us7hOUGwKvekC8U9somG6ALCKlsamtN54YxuBbtQqNIdA5BsboZDvN17IgyepyQYtXb5t8ITqAp0sJqL6SwoBYZKDZMQbaUazWlPI3baksHS21F4P+2IyRfIDc4iTgVTulLSiQHioo0c+3mQ+xkcaE2v2xApO1jT3SZCkamWY6gwYdG7YeD1W0xo4rOmwL9HY20lJ1g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409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MpTvoi2J0ysyE0r/B8dcKxzVhoSDQtpTFkMmNGSNjg5LYkj3EyBWtOe0VTFjYP1p5Vg6FMdTdSWOCU+/daZprSO+fU5PHRg5jSxIDIxXOQDiKV+sMp8/PcJj9JTA8SByPUPpQElsEYQjzPppurYbBBNeOAIeQCx11EcZRFDs9QFQ9J1uUawZe1CBoyg5KK37Qi74bx3pvj7vQLlm8MfoEFWE2jIFeorZsbknjZ00GIliF6JFTpQojAmITvUTOVGd5aIltY4YB0R+fDi+63ZE24bUpGeBbtMQ0Vqr1T7C11DVDc/OdtNPmOMm7oAQzqiuDI881INnbSNZl8L/i8qdmpFaTLcYUzyuqAbr0pvOlOueb9edfOoV5oHp3JhEduPA86mo+VnmbeXSRENx5uKZDAvTyPXQNy1MX65LelSVH/J5HgYoeEtgDL/fCgNjE/e+vjCA4dj3h55RUlgPxG9lbEFT+IaeIgd6PZrZwNFqBN617CL42wSQEedFu2LGYr7O9aadjQXNcVSJXjj/J+UCuFBaoxE/09sHq1yrWamBionj7Pg1W+HR3aQvzH7lI+fR3EKBUR65nHl8ExGM4b3JI6SkGwCvBiILZEps1/EpHfZ3Ak0pEYYli/sKxoAP60cCqMhd36iRsjSdT+QDlbEywmE2aEil/oktZMcwmAs9+YzgNP+N18YFxzIrIEdo5/2rEWRzcWvz6fnBZyKaIFOSOa2zF+puq5D92+GzZgQl/GZcm5w03K+71AVcMHlLWuz+LhF7+Mv6hXWPgshu0MCRrkiQxqyA44tEKHb87fqzCA+3H5jBZaq/1R6KFvmHvV5B08RJn5UMlf9iPtURP47ABIn57t/njag5sZM7fxPV1G961ewdUe/NUgC9isjFIjtUgDsktvOAHE+2Hh7NugXZ8DcgbRtp1q0KU81bm4DtNuD8t1q79pnz/o9k8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z7hk16VyVzCwAU4nIP/Lb1X31+oAA7+3tpQlk5f/9d3tn9977L2RLzySUyNRWZcsvRk2PJUp3SDWLnOg0vTUsMndsbBltTdLaLZ0eLC0XBprSIrCeqkdqmNYrH8vrq5kwfc/w/OwPw4Pb7RF7UBi9yJSC31RCi24+u+p28ur34e8Xy/QcpJWlLam+TNlzBIhPACa4jeMudG4He3VtME1kV64fObf3C6NXaK2GNJ744V1YDQqJepz4Cbdeh7erMONzwOAuXks8hR8ORc1REvGKs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7249169-6d45-4e10-5dbd-08dcadb08c84 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:36.4527 (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: FRrmaWJALA/S0K/43susPq66Pe7iCGp99EqlREet1zxWPWiYRNKXBtWzMBwyHYjlSK7YGgUIKzCkvWRafb9IhYOV+SXpMyxf2VCwD9Oh2kU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: swFHH1trryiba7FJ6l-WEI-duPfGEXhr X-Proofpoint-ORIG-GUID: swFHH1trryiba7FJ6l-WEI-duPfGEXhr From: Joao Martins ARCH_HAS_OPTIMIZED_POLL gates selection of polling while idle in poll_idle(). Move the configuration option to arch/Kconfig to allow non-x86 architectures to select it. Note that ARCH_HAS_OPTIMIZED_POLL should probably be exclusive with GENERIC_IDLE_POLL_SETUP (which controls the generic polling logic in cpu_idle_poll()). However, that would remove boot options (hlt=, nohlt=). So, leave it untouched for now. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 975dd22a2dbd..d43894369015 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -264,6 +264,9 @@ config HAVE_ARCH_TRACEHOOK config HAVE_DMA_CONTIGUOUS bool +config ARCH_HAS_OPTIMIZED_POLL + bool + config GENERIC_SMP_IDLE_THREAD bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cf78da2ba8fb..efe59741dc47 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -134,6 +134,7 @@ config X86 select ARCH_WANTS_NO_INSTR select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP if X86_64 select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP if X86_64 @@ -372,9 +373,6 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_HAS_OPTIMIZED_POLL - def_bool y - config ARCH_HIBERNATION_POSSIBLE def_bool y From patchwork Fri Jul 26 20:21:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743152 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 8BFDA383BF; Fri, 26 Jul 2024 20:22:22 +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=1722025344; cv=fail; b=IYPeO2tt/QvhYc0s9D23JXjtW6MNK82zVqu3wo42rBgHdotfwe4iTFSw9NA/lDKn4HZ268gXEir6+/v4WcIab0rdkqiFizWOvR+XF66gEJbgOqJeLyuzL4E4jmcpepZvGygT8gzsi7FofNmuDO2v65kIxrsL4IfefpUxRqPHFf8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025344; c=relaxed/simple; bh=GCoDdKRU2x/lcp0D9ko4fzveB5KVhWbqcLKRqZxqWfw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Yqu9mKIZbug3NxkamV5yPvCsyJ/JtetXHb6gA6Z4M2NzCaWhvVfE0/ZYcGtHOY5IDz+R4o/FIhyvj/IfF9fdK0TWNm4oEY5AhJwpMZF6MQQG8/NtfrFyoaSpNdQUgZ0isbI3AQLaYC3nbqPNIodCd4sdO3MmTpqg56o/M3XupME= 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=JJit1hjW; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=xlgGU40+; 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="JJit1hjW"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="xlgGU40+" 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 46QIM28j013734; Fri, 26 Jul 2024 20:21: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=24qhyYScmzk3VEy7btky5OmyKHeAi8lc5bpEIXdQe9s=; b= JJit1hjW3UcHcl2HjnrTff2/TtwocUo2+khhtl6187T8UntJ4d9v/g+Jjtd7drAr NsF20kLX92zpHvrxgNslAymqk1AoNgM+5HdXTuLDM3csJeDRJlFwWDAEIuUGPI5N zDfL2LI8f1U6M5GFTSq5eoAfCITM1KkFqyqv8ndXN74KcdiGzr63g4o7HMZQPEN3 rbysSF9WBDIwJMKeU4UVOQMziOXSxDyc7Ccagc1fVypH4kiyp/2g7DSdiY+aw6sP Za8nHcO10iXfwVVjjNXj/OSyynYEE/y3R0mpRk+m65nMKz9z73MdjRYkbh2V8q4y WjHIA4JEwtJ9v2bK2PSTUA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvj60-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:41 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJ9tZI038883; Fri, 26 Jul 2024 20:21:41 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h26s48f4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sji5RGEtOsg6iSKoxtznzLeAHqj4jlEl6yaAh2Vbsj5Ej6sa3QN22ZlJXnoXw5gxQFU+3QmLV+stkOak8zp7oZeqOnFs5pYBaYdwzJfylmcSWpVA28spaftaZv7dnZ2yHma79aQ0MJ+/CGI3MDtmhSB76qo789KywlQ1P7FXn1V/vGVbZD8T+6eoFfnW4Fd8/CuNNtNfhU906pkR15RX9Sf18ezvST8p2jTL7k2z9rLdJD7fQcMr+xbkw99OKUSnY0MHqeuGtigTnqeKj47mJMQz2uG8yjRwND4u2RicMgTMItiFWMRqfnwFjMJ+hQaV9lx+/Jj/p8YdHjhUWfYwLQ== 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=24qhyYScmzk3VEy7btky5OmyKHeAi8lc5bpEIXdQe9s=; b=a98/bX58FAk6y+asRjvBl+UBGEpgnAOcTcY1yw61lFetKkNWpMK3izQ6TixlMLD3Y8tMeJjzVfeWv/Es2MGXR+BSMdCF+KaAIbYGq6IKx53t5x+zUTB6l8NhWOcpxe7vvsCPyohWqeBUHvyzWBCphZUMvToartnw7ic9Mbs9EBGOUfhq0rD6Xz/9ilFQtBKR3oNAoo1i5nWGS89Ov0FwSMDWgMU51BUoNw+bvJWU1wV/qwzgXnjadeytGosnjF2adF9iU0r7D17KmOFIMnvmf18JdSFyYVJVVxcjj+4mMoCt/Vu2zW9LXAPNWugJ4cbuZYG/zZLbsXrG8kgeDLUT2Q== 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=24qhyYScmzk3VEy7btky5OmyKHeAi8lc5bpEIXdQe9s=; b=xlgGU40+JhR7PzwElpEmUTB0mZvN1EPq+DYhDEK4K2deWz/VUebfr+zf5HTrYgfPN1XpEgebzIchtmJKA8n8Mc1k9YFJtSci9EGqezxbvGGgHwdVn0PhCE4LdO0XW8ygJbKZKzRu3TY/8Oojr5pmEG2F88YV/Io7hdL1HuwbFMI= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH0PR10MB5178.namprd10.prod.outlook.com (2603:10b6:610:dd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:39 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21: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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 04/10] cpuidle-haltpoll: define arch_haltpoll_want() Date: Fri, 26 Jul 2024 13:21:28 -0700 Message-Id: <20240726202134.627514-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0276.namprd04.prod.outlook.com (2603:10b6:303:89::11) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH0PR10MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: a78bd68e-d46f-4848-f43a-08dcadb08e0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: i/P1+v7KXQCtMoO37y9O26qry5XCL+4umVZrinHGlxNAz7vf6x49J4Z/GUOLt1LLDO/esE8IA8JXIcRZexqj3GYrzRereLY27GBN2pZNqMd57jhUIrvInIk0iDbyoHzkYqDw+osfNkQPeNlHYTfsfIGA1f8wyXuPB6GaIV2hKncUjEMe/89pyJ10/9Hmr+1pXD/cc4IJarJFUCPh0ONBKz7XgNfM1kAtreZBK0IzEy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61xWYupQ2qAKG5463046uRhNhfOfZawZe6QgJoJYA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z7BAT1JK926VcN866NbhAqcu5YRP8dIGnrB1BDizRlbz0hUPMPMBqYIyR70HeNX9UuPI5R/a/8QDqWo7t32e9UTiu4TXnU5Y/u1NyXX4UUnwxUcshFSgtr63SAm7rzWmKBIzPkm94MUMilD0fDPOOwly7T/EASjaVBf0XhkGIK9dbjSLVtgQB8PjiXvicBTvcJgI3BhFcbUiNuSsKcBlDay4aPVxNAlQ7pGcXSr/qfGraeY1d+Q7wfOKwILXq1cUL6hzABY4Q1T7bHbFqK+3QaHpZdyQkPc8+7UgC4g19Xrv6puvNp4hqTTinAbe6mS8G8AhTWkwtVN6tsAdjtxpGtwU8y4vnk8N0+WcbhM+e19uRkpaXpt0dcSBqXOBO3Qtl1iyXt3IGAhb3IDVxTdfMaxdzvo+GB3E2b/x/uz8fk/oD/b28uAdWJ8kQJIcvhq5fDmcGbwpmLq2uptlYA0RMZ1F6bfx3Mr2fMCbkAc5eqKCDJIJjueq5V8+YtZkXl5iWkLSj3EVxvpFfFi0RsVjmpQR8u2Ob77RJcVtlY+MCMs/Sz1BpujqHUjyf2VMPbxOVZ6OyzYIl3Qv5LQX49w4y8+HuloFJffLhya4qq2VVGlB5R3Smjqh71QHKpGtSqdyQiqB3Frv2hk+ClHoN9caIhWWuIiN8YaEoJiXEmhD4qUyEuzR8KAnNCgGuT0pMWpQ9qJD8hXQTQz3wd/wkXkpnT5TGEKty/87ogON75VxXSokiSjRG099D4WwASy4kFTZw8g2TyIsV6kdmm+KWhG4fad0USw6ACPG0PPDTQfF3gUfHEliN4FBenLza5N8FP+G8f0J5FuNWhjQPofAksvBi6Y6avSj5kPov7SQNF8osO6XkVJ5vsxjEvJymARLTleBCD/WkybkRriWCzhYNJw8SJc/GPitzoU5oxizZnr/56kcMgUF5CNpsyPtrBYIXGFHF11iETKLcla4MnMr+JaIB5moo/ErKHh5pcp+DgT2bQ1b/MzjpGhZw5cFgiy6KD7R6+aqC/iFEXVQz0COoiqDqWoWaSyORlDwaZGDiep4vu15eXEtKxBPdY0SfQ+VSa67DmBoNKsaFSOW7kSDh27r1DcrXIVqBEg28BNIIByw4b6nCGMdbqaT+RImEGRWsAw93aO39NZQ2IoBZgYRlLPOKZ9lklsSG5igtYcRp42Hb02zGLPzJNssaHyil1EJOPs4VwYNb6At/Q2kfTcFPLWaQz06GlCh1ijHZM+b2Fg3ddQuDKx+ebrEodrkhdlIAdtWpH6DuypYg6EoXLTkky5CBqW6XS7UzlSzQx9Qz8GDX+o7+54W4oILOxnN0JzD7Z75X4SMWT//bSKBSenDugUwAWT/TVP3a21XPBHrf6V1OzTPBojFtpDHNVdzcDutgUfzj6+PxlFZZxQ5TtDMDORZusMPU9GFhh1/7TBD2oRhR+GdsqzMHmx0v09lF+mPMGNXSELnkv0oSjT5IA+sRfxNIoQK/wchL3xhNWbgfjuWjGaCpepNwFlwJ0+Un+pXY9D4kG2Cppg/AGWx4Al4qAN2tUClr6nujcT5sNxubJF1c+YBxMrwy1tMzus5BemENWDu38LtidBzxJyCBBYzw8Y0XQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: GK4WXGUZX2L495JETTpQKb7Ob7wD2UMXUa/3DhQroviDTz9GB/i12h1i57u39aXnHfkXDqLwyfA4VMkV3siplY75tE679Q8BiQ7RzgUKPUTPu5xbq+h5VuuZmEEAQTb0fhERjnWX9iJwjGEKCNJoXaH81a6j1vdBWf6I0A6P3Vm943Hfm7Us2fG6JbOIpfigenH8t05YeayF764mNFYqPyU4vuEwtgmQQHzRGi2ihdDmTiIQy9K8kyCwdF6wB2pzPnbWudkJXnBd7Caj/lXpGNKD7aw9dhJTbfWXeKvOW9qEUdA4AiVJBNcfzBaVso+Ky0Eqxixlftj/68FM5BQJXfitNDN7qPkK2J3q8a/3CVFPGFRbusQ8VLKFzcYbqKRTI8o3GMrxkrepXUFz40nutRwHbxMGoXvJq5f1VDlQZw5IDAPq5FG4P+S5xO0mWSs9juqColWzgyPC+UzuiAnVvWG5kD2TJgJR+sbyN/1ZF1hCpcFHzGywYmgoPM6/WUpa0rPybzo6c4JPffN0YZQYEgpYkemsPd8jDViU4GftjcxXdeeVG20NPeVSfhTeSNWYRANYLpWhXO5CcWRu0b6wH9NmWCYjZCz/bfiKgNnDYrE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a78bd68e-d46f-4848-f43a-08dcadb08e0d X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:39.0193 (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: zVW6G2yLrilTZihQF4+oTIE8xdDP+KMoii30DSoM34QPcJMDdSgZGdFUqeYrWLui3gzlzAQdmk+CP5HmCF9J3WrBH1ktbiY/croS7OkLGAQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: Sh1GbOIojTupsAvChn0gUfpuMNy70GFE X-Proofpoint-ORIG-GUID: Sh1GbOIojTupsAvChn0gUfpuMNy70GFE From: Joao Martins kvm_para_has_hint(KVM_HINTS_REALTIME) is defined only on x86. In pursuit of making cpuidle-haltpoll architecture independent, define arch_haltpoll_want() which handles the architectural checks for enabling haltpoll. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 13 +++++++++++++ drivers/cpuidle/cpuidle-haltpoll.c | 12 +----------- include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/cpuidle_haltpoll.h b/arch/x86/include/asm/cpuidle_haltpoll.h index c8b39c6716ff..8a0a12769c2e 100644 --- a/arch/x86/include/asm/cpuidle_haltpoll.h +++ b/arch/x86/include/asm/cpuidle_haltpoll.h @@ -4,5 +4,6 @@ void arch_haltpoll_enable(unsigned int cpu); void arch_haltpoll_disable(unsigned int cpu); +bool arch_haltpoll_want(bool force); #endif diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 263f8aed4e2c..63710cb1aa63 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1151,4 +1151,17 @@ void arch_haltpoll_disable(unsigned int cpu) smp_call_function_single(cpu, kvm_enable_host_haltpoll, NULL, 1); } EXPORT_SYMBOL_GPL(arch_haltpoll_disable); + +bool arch_haltpoll_want(bool force) +{ + /* Do not load haltpoll if idle= is passed */ + if (boot_option_idle_override != IDLE_NO_OVERRIDE) + return false; + + if (!kvm_para_available()) + return false; + + return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; +} +EXPORT_SYMBOL_GPL(arch_haltpoll_want); #endif diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index d8515d5c0853..d47906632ce3 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -15,7 +15,6 @@ #include #include #include -#include #include static bool force __read_mostly; @@ -93,21 +92,12 @@ static void haltpoll_uninit(void) haltpoll_cpuidle_devices = NULL; } -static bool haltpoll_want(void) -{ - return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; -} - static int __init haltpoll_init(void) { int ret; struct cpuidle_driver *drv = &haltpoll_driver; - /* Do not load haltpoll if idle= is passed */ - if (boot_option_idle_override != IDLE_NO_OVERRIDE) - return -ENODEV; - - if (!kvm_para_available() || !haltpoll_want()) + if (!arch_haltpoll_want(force)) return -ENODEV; cpuidle_poll_state_init(drv); diff --git a/include/linux/cpuidle_haltpoll.h b/include/linux/cpuidle_haltpoll.h index d50c1e0411a2..68eb7a757120 100644 --- a/include/linux/cpuidle_haltpoll.h +++ b/include/linux/cpuidle_haltpoll.h @@ -12,5 +12,10 @@ static inline void arch_haltpoll_enable(unsigned int cpu) static inline void arch_haltpoll_disable(unsigned int cpu) { } + +static inline bool arch_haltpoll_want(bool force) +{ + return false; +} #endif #endif From patchwork Fri Jul 26 20:21:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743151 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 913361CD06; Fri, 26 Jul 2024 20:22:20 +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=1722025344; cv=fail; b=FnUY9CzM6SjrZiflK1EOw6QyHdS/1IlgrNVcXqfsF46kY2CBvl7czfzy3twUg0leyO9tOubSV6BuoVlCOxKdx06bXLth0QwbyriNFRqyrqz6vIeXdpgSE6NksJprihyG1ldrki1+tLXpbUXUtgwl9e/bjfCjNwLgY/R+j8fu5tk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025344; c=relaxed/simple; bh=dtqWUhhQRnpdtvFhlQCKDOJAkt/QjiEVPXae+BIx068=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HSTWQU0BAsEEYkTs0dUgrcSs1x+p8tZRm2AFEHuw5aqpnCxMa4zUUnWMEUsCxHNflDMK/MNtqpUiZjVnpkIZSkqGAxIiaifzsreEnN9z8EhF76jxFweWeZmfEDRvRZL12F5OkSJ02+bfHIWaGS0XLJRdHFmpTOPgO/5+O2CYUig= 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=R3jexl8I; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=FFD8++XJ; 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="R3jexl8I"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="FFD8++XJ" 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 46QJjnmF018706; Fri, 26 Jul 2024 20:21:46 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=L/RLO7ggk8a9IEwP5MtfZ0+ERZpUQIcc0gGW55jQFC8=; b= R3jexl8IIbmE4ZxVOjHDmUL5458LGy8JuYLvuTtff9ZN53wm5FYvdZ/kYWYQsIyN Ty8klEIyTnqB65yQcDTP3q3xwe3J1tys6JXK4jCtfrIAmWwWLeEJGBUDvdBV1ei4 KY2R3Y+x8wzm+ulqeNm6ZJU+hc9gtQZgzJQWFJiwK/mmvzE6imi290qPXdCcE/mo Pklhi1dV+aDAhZdKQeQ1BTpxXH5HHsODzOEWelYk3EkGhpo9qTLeZaGk0qwkP0ov YVRzZiPkwsWVMFwE7Ygu9gxQMKh7PATjY9rcflXjwDpgshBna63BNzaC0DJDMgjq SBgRUR1OI5f3z0ghtpzCVw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40hfxppjg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:45 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJAGHf010678; Fri, 26 Jul 2024 20:21:45 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40h2848f2p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gw1N8rYb68dU/mSPUKXj3BnzKtt3tQnN6tRjy7QR0HD3vynWgLQ+JSN7K47TSC2bnBwuwTMa/Uj58HLFLPgUl6dS5AS9xtRlEP5WVIW0fZsEc5F+QWKm5zfEYHP5RVdHLxBwfF//y2wRZhMq8c56cHxlsKNpdc2D+YUgNbTnCrHrb65m7gyYfV7L/cLZj3J5YW7oBJ0CeKNM/NqjEVopWM1OBQQKeWi5jdV+wfrr7RdhU3jgwPE0z/bCYeH5gdyhFYvE9nt6S2oXuUGQGvMBda4jEiv6BYu0e/kzQ+wL+sVtdmqpkUTYADvn0LoVaVMWSCbVG5/dJdrSqhlcRT2xbA== 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=L/RLO7ggk8a9IEwP5MtfZ0+ERZpUQIcc0gGW55jQFC8=; b=Gv7dAt0B9D+7kD5DRqIxWWA9Rrczt9ajMNiJcX40lCZN4zdUhjoMFdxsoQm+RIYszDeqDNVaGlGI5jTknWgQkwXFnu1tfHlxOII314q+Tyk5a5hr14nlcbO/3fC/k0LA+k5/ox9Sx4RrO3YDXTtLtmLqfjxnp5A9H+Oa9Vlvt9O4McmIhQivKnWs505ZgDZaAoar4ij7wLkTeS2wGK4EfUx/bopp8c3vy5sL8QPrBGvtECTzouY/LOsKAWRH2xY8vHqycJfHfXprXcoFPw4Pyd/MP/lbxszTjBTn4QqO2ZC71qOO3arbMHzf8SP3Eqe5QNzfB6XKmIMX2O5YE2F/oQ== 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=L/RLO7ggk8a9IEwP5MtfZ0+ERZpUQIcc0gGW55jQFC8=; b=FFD8++XJJprwVBacej5vJSZN/4UHllrQX+GkspHHHukScyGrj2gksh2fJUSMQANsJK0P4+yBs1hi0d1KjTO+YyYhtG65BeAq3vEDkvh+w1Mc0lEQI6N1wqS0R5wdtKXxWNiwcLhsUuihYxV8ywVBQ/BCbFpr7/4nGUOmauad/uY= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH0PR10MB5178.namprd10.prod.outlook.com (2603:10b6:610:dd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:41 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:41 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, 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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 05/10] governors/haltpoll: drop kvm_para_available() check Date: Fri, 26 Jul 2024 13:21:29 -0700 Message-Id: <20240726202134.627514-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0278.namprd04.prod.outlook.com (2603:10b6:303:89::13) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH0PR10MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e08d501-3332-446f-ccc2-08dcadb08f81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: Gs78HvmU6eBSPDAPquMitnJUzMy9S8avDJoDGBGVS3ACDaog0wzYi7C02ou/IhUosChwdJJcCcUnvIDzG2vqvzqE8+reJZfsApgo5IrEtryawOZYgQ2kB0b3bUjJ0xMDz/SmdfkVBHlLDWcT44rf8ykJ8f91uBOmAjSiRjL0JjjNOmZYKZVqY3xnVHt4RWXl1ns2MeL9iJ9bhjyaJYqdXzLT1tZW7WdfIsHv0czs40ylbsqhNy5qMTeyWLU6Fr3Vb9i1dQO+SY7RpcIRfZB/X0RhfHIpKXZ/lHEKKrQnoDlbp06GIvu4ntgqm6KxBwBtQQUUpJEOFvnOEUQHHyZzildsl9y30SAzfDRLypP8fPHBY1YZqFMnGLu3gVXU0W8CCc7qeo3cAquoaUVRma7O0vVLETUUIkJHJkcyR1EAeF+B2oUyDcswVA/nvvddWKy32zHQWUHBLBiMu6+A1yhR+GCCxlHnKQtIUo8ysFkTpYDUnyDdTOqqXgifkBEDFNv8ZHZmXO+z8ikBI0UAH1a0VRQlCKiqqpDynMDhgM2Kw7WTBXe3sovFoqCnr6GBvfQ8+D5Q7BmOEjBoUItg+5ctpw8jbR5Ztm7V6fmH8VNHmyVpnCHY3TCakYxG7uk0yjFFqHbtTWwvcpKLdlCweU07n04xmihIcyYA9qsvLk8IonXmiA7cs/Z3/moL1jIMFiis1DqDOEWylzYzh5OwyWk8txRJ19Tp1U6ilblYDU962YpdTxYr9z8b4kBSEXYf1vyJ73mY0TFGJDaa1dzh+dqxpWeV5RpemIojAZuDbzCI/Tpi3VF+TB3oLclBNd3Xf3Fb/MVhczjAquwK8FtOchaI82AVDaDpZOq0H0gZlwRA11zQwMRgiVXoHYhSUaSlmLr9+VVAFwP7GVDa39gsYWHcMDPtDhTipisybHxVpOeu9s0xcQCTpZd1myalJWUXiJCqGHTqjtYXatjbCTPfpNOVC2X3ccpJgMVr2uoin6wNB1FRoeoUNvyvGLtHo4J3NToGkonw0/83yjxv3Br9+fc1qsqopbRvUaZRxvu0wi/JpOvYfyVd9l9U9f98rlFm5jDPBPx8atEgsgcsbwVDv9UI4dGsL+WyThejMCCEEJurimJZp3Qq/f6jSkskNHOtVO1UsUtk82s5c7ho0joLa2bo/j0o60G4DhSTEpuG9gYPqeOAh4Lkn+2d7vjLk4s1bqr+SC1hw7LL28yixIVfXzpP1FtYNG/FCvrWr3Zmy9R2X+PoleHOfzgadCDrYdiG0thMzDypri/NOpXCgVtc72h+OGk5nvAbTHhG2fRn1fsimOJ6Pl3SVQemnYXS/wW5YsJ4fLb4tiXNX9Sb0ewz7aCOTQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X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lpyMZzio+GO6FFEgbFQ9XWoyDc5GRT82uXEMclknn64cnAlM9dNi0OW63SkM5WHB244BBZiVvMWUqd0wBNorXg6ZhgNkU9gMQG6gHJLZ8WJjW2KcghSHUHnqo2wDJiB+Xgd0hF95kTh2QJjskRX3O6wKvtZusabT5QB9s5rR9tNcrREYvoFpxoZCCLQaG8XAeseOiYPiHQ3jjexd7++Sjxt0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e08d501-3332-446f-ccc2-08dcadb08f81 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:41.5308 (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: stjn/1cn6TEuakpKtXOHqpp/vCsTME99nLvJ/MLZctilw/0YYQkM0LiFP+cfcx1t6H4wL9UHs2XwY/1PVBkGmUumhMPUMUYwEXkl+vbQ8OU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: _E5U6SFuPY46d2ADlzHP0uOPI6BcwXmw X-Proofpoint-ORIG-GUID: _E5U6SFuPY46d2ADlzHP0uOPI6BcwXmw From: Joao Martins The haltpoll governor is selected either by the cpuidle-haltpoll driver, or explicitly by the user. In particular, it is never selected by default since it has the lowest rating of all governors (menu=20, teo=19, ladder=10/25, haltpoll=9). So, we can safely forgo the kvm_para_available() check. This also allows cpuidle-haltpoll to be tested on baremetal. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Acked-by: "Rafael J. Wysocki" Signed-off-by: Ankur Arora --- drivers/cpuidle/governors/haltpoll.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c index 663b7f164d20..c8752f793e61 100644 --- a/drivers/cpuidle/governors/haltpoll.c +++ b/drivers/cpuidle/governors/haltpoll.c @@ -18,7 +18,6 @@ #include #include #include -#include #include static unsigned int guest_halt_poll_ns __read_mostly = 200000; @@ -148,10 +147,7 @@ static struct cpuidle_governor haltpoll_governor = { static int __init init_haltpoll(void) { - if (kvm_para_available()) - return cpuidle_register_governor(&haltpoll_governor); - - return 0; + return cpuidle_register_governor(&haltpoll_governor); } postcore_initcall(init_haltpoll); From patchwork Fri Jul 26 20:21:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743154 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 EBD0D149C6C; Fri, 26 Jul 2024 20:22:25 +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=1722025347; cv=fail; b=LaQXifCnlj1ycw1a5sWL0hWTVJJCPUFik9x2mqidti7K5IAM5VEaMc8xEKRiguukb5SOmToIzkW0XuGbc4OM0x3WLlVmFp8BrnjM8rnKfDZBaqS/uSCGDQpI9fh/lqRIyHsDX1WsIBVHXw2zN16KROlpvcOe3WtKLR51ZqYVj9M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025347; c=relaxed/simple; bh=MTDPoygB9rdHRUHDLY7oP4om2dlj0IbFTqqKjixmjfw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dLXLQI/+IPos55ZjOLEgZ4F4ljeCcX2jBF0a7zAYedSBPVY4G0/rinV8CwKg7gQ+qibMMqncVSSeRr2pIWtDQg62AtPU3y3M3iLIJbkQOJrixK0i6eajs0bs/5H+itZCQOJ0KUFWJyIpfJ/MbdGyTSDzpCh68el5o+N4z3IVgeQ= 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=CXo+gWso; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=tq/xRtqm; 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="CXo+gWso"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="tq/xRtqm" 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 46QI4F2q013735; Fri, 26 Jul 2024 20:21: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=zRnxNCfl74MxuSNGsro7Z4dqMVSHezXxO0enoFHozAs=; b= CXo+gWsopexKwHmv4REhUv7osl5FT3W5A2VreKLXWw7DbwuzII4uXjYVJB2LXHLw JR9VovoaLap02yyFAM41dvH75xjnSvT5rULo2kUUlb8FIunGdrOoPsbSW+0GlGy0 qH5Tv8z+/x3rDd5DbNFxeVNBFLa9xlxlRlYO2Bi/0y0IxEdnZAY0Esf0yLgB7sYa iVt7KLsSQNAji1/3oIHvJLl8/DC9dxGVbUT8xFBjuljRLSLYNbPE5xFZ8jLDuLKU /y34t5jNq7ZGV/ZR+iMmddglomX8dBZ63VKt4wSeKsH2iCCm9Y3JXXF4TK80reaW 4secm3jXH1Bfluoy6iLnXw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvj6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:52 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJGGUk038916; Fri, 26 Jul 2024 20:21:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2040.outbound.protection.outlook.com [104.47.55.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h26s48n1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m+3xVHBNg8z4T0mlnpQ94lxWFHGlEFccfJ1mkQUw5/MXQLKu/4cdFSfgxksjUY4e6o2+0zbaaTkNNJon/R7uido/Nvup3vpBhpCXQrfOzHYmzT7PbNm0Q3wdwwO/5jTk5IGm8X7rF1HupBmNWTYgDiGEWgSoYOAJ1utjfVPYppchaxIGspkd87OljIrH5u0O47LPH+im3kQkPHpv5WLbu5sTfs8NM3pCdplbWlpQC2dtXtZGLqAlJcYIZ1IuCAUQ6SLwO5PBWi47AGUBsMf4s/kTLELft2fL6fyDJeQRgHNkA9RIEWzKOVdyPmVz+GKsw09icrx9wEZBXl8Z3/z2hA== 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=zRnxNCfl74MxuSNGsro7Z4dqMVSHezXxO0enoFHozAs=; b=NHRw5sUFeg2gLV9VI8HoFSN7gjw2PDAWDJRTov/rXFbEVZUXZ0urY3P7XntAi9RKl9Y0A+ZQmuxBwhTGcWXLQeyqsVja2G5juY8n5vaZA08Q+RJUSVjzgwwtNJZDFUa+ZfWq2e6gX6dF+teyQ6+rtBNS4BDWB3tFGFfEcAQbvYiPraEKXX6KwoHitYiQqb/IVWXchcx4XFCYivAx01pcynYU+nb16qJFyhvcGB4rYKSuLO2bz6IMEnTJCODS6nnVpe9Tek59wPIZCIrda5CNe0dHCQ7yI7kTMq8TjbSHFW2bplOBkgpAtF2KgE04SqAU6uCrNwjzduAaMxHsw12RUA== 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=zRnxNCfl74MxuSNGsro7Z4dqMVSHezXxO0enoFHozAs=; b=tq/xRtqmaM8WpV4jN+LXy6W50BeXHz6+7G6ZPAy3Qy2jNCx9aVQh1Ko7ktSKxTkJZBhodrQlopreTpHcf2gAUaumpIM2iOW6i1SlIbOJRiy7e1TXwJfW61G4VMQyjNJNcmxmQYiTCPYTo7imlGG0q9NtlbbenBVR0zb5vPWmUE0= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH0PR10MB5178.namprd10.prod.outlook.com (2603:10b6:610:dd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:47 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21: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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 06/10] cpuidle-haltpoll: condition on ARCH_CPUIDLE_HALTPOLL Date: Fri, 26 Jul 2024 13:21:30 -0700 Message-Id: <20240726202134.627514-4-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0189.namprd03.prod.outlook.com (2603:10b6:303:b8::14) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH0PR10MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: 650e67f6-3b72-4846-3a8e-08dcadb092ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: IT2m5N0RJ3FhRvqMwzvEzWESz1UzuGrUpaBqZTeFjw6Fl9LzueRlDPri6Io+MVTkAZaaR4Pe3FqliCI9rR/hDli2Ig6Ls5+jFk7QtGcBZw6jV9qPgjIciZxqPsKekM9AsdSdG8AUAhqxB2FGIsAHPdC5Ax9RRJ+GPxNS84rziGgWDmI6WVhoX7GbD7gwjlQ0kPxFurQpEQbe3TENvDrht46aI8xWehn5qJiEBuJ1B0qhDGGU9fWMbY9qvz4uqpOyTwXzs+hVlSwSAmTiLhVExJhvQpzkEZALJhbP2D2xoScZcjYUAO+gptwfxXdvoBNjHWyg0LANsO9trsUAgYS2B32tbvGzowLYQo3nnEi5cDrd211yFCkHPOsNKYzG54+Ypvz3B9xfmR7X3k3Aw+/JXZAnOUTLNvUJcfziNIvy2UfWDjAOU3N7+VrOw+Jo8sorPqY/KbY1BXFCtcaFfYU+xFQ+vwQjAqDUbzC3zhfM1sukZywSzl71FHtf7Tk/3kHljMCENrP6eNa8pyxA2EtMOoL0EEjyLgW3jhQ0EYTmX8vpegqVxJCYx4u2dsuwfB8HYFCc5BnqU2zKlMSyPKtf7R7y2m3Ms3uo21algimaOFhBVi7fEmUu+K4Wc9ubkFa4akDP90zj/6eawJn5hVgvSVAXffMQLmn1aBPV6UeYblZUAabX7WxGEpq0MZmW04elcVnR0POLMCnBn3y5JNX2gEZHHJfDZ9+YxQ9ChDNfFPi+iYUVYWRY+DV/QStGxUGh3925WfBqTIvvX++8SlhTD6nQd6Za8nZQJHNl5FKBwVuyLa/ej22WCgqVwIA03gfCNjug+xg+cXeFDVbF2WlQ2eb/4ZljQ2Qm+dnxuV2LizJo4u/ynFSuN8uGMlUcOvRrCCBP3sR4jRLbZQ0M2UQr0+WQdcH9PKuvQtW6/Qj+NdjnqaFeHB3EFCRb3nVsfEXvtX0Wc6EnAkoDIeDVUXyj/+nCKZqdXr0XP+ITiztklMll/4WkRdQ6pE4hsS5gVhddWuxNOQxkaWKVomj7kFBWJ8kloG3CpIBQXADP39hz+UxS0LGFlGzilq5savicCXlOMDqQdCC1Gs9/hU2lgFO8R+XlRd2+lpSiV5Lx3SLttVPBy/HRUTdZXFJvtjthQcrhLljQ8u1hk7awUrHR0nbSk7DQt//o8ddPcMizULbl9I/UYcPJdnq+JWBZnsduPVQqkb5DGP99SrRMI11MC9u2lwGVSNFM/Uv5pSSNh/Gneoh3PUforr5VgNUFcHOrJ4zb1Kx3bNpjPu6P0eQgyGVpLazZ/FVvimEqHQ5F1pdb0EKMQS5yckQYc0Hj1ArOBN/nnb2DG+vVUNxhMWwQOL/pYg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0bq2e0HNCtvV7XMWn8/veVKbdpLYcSIKLp/eaZqTMzOW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pHktc9rHnbfPu+/jGCmLnlPn/4IVATqzQqcC79kEfE0gNJ749/ktqDYTv8u0DIzdWyIhvxpltzeZoMZIZPrQF6vV0gY0A0pO0mW59tsiavtmYm7UUH5GpwMJSveG+LTg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 650e67f6-3b72-4846-3a8e-08dcadb092ca X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:46.9828 (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: L4l9ZWUvOEWU2f55lVlS/accVqdSP9UoIHdhQLFxZCNLGgaLOzvy8ZV7xTQbu8cKXEX0pw8sas6yY9RSxV627gT1+quBSIs3pZdoGOOCyRk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: eKAoemIe3o6_eW6aUdclPUpK4JLmd77k X-Proofpoint-ORIG-GUID: eKAoemIe3o6_eW6aUdclPUpK4JLmd77k 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 efe59741dc47..153535e6f55d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -838,6 +838,7 @@ config KVM_GUEST config ARCH_CPUIDLE_HALTPOLL def_bool n + depends on KVM_GUEST prompt "Disable host haltpoll when loading haltpoll driver" help If virtualized under KVM, disable host haltpoll. diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index 75f6e176bbc8..c1bebadf22bc 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -35,7 +35,6 @@ config CPU_IDLE_GOV_TEO config CPU_IDLE_GOV_HALTPOLL bool "Haltpoll governor (for virtualized systems)" - depends on KVM_GUEST help This governor implements haltpoll idle state selection, to be used in conjunction with the haltpoll cpuidle driver, allowing @@ -72,8 +71,8 @@ source "drivers/cpuidle/Kconfig.riscv" endmenu config HALTPOLL_CPUIDLE - tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL + tristate "Haltpoll cpuidle driver" + depends on ARCH_CPUIDLE_HALTPOLL && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help From patchwork Fri Jul 26 20:21:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743156 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 2E8FF14B07B; Fri, 26 Jul 2024 20:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025349; cv=fail; b=Q/82w+T1YxZfgJwZPPDaNfdS9kOvrERZUq8JMQ4ze9Jg/5fuaypAL00QdY9WM2T4Nqt5gF3a8/9paunsBEDjo2gqkvhY58bsrfYkVo05F/atRAnjEnN24mcRDsxRBp7J+MzYbypy6ykBS/b5aENcl15KVPeErUntvz7VU3WH8lY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025349; c=relaxed/simple; bh=G1EB51mc7WEC6aeP17DTZqrTGwkiA8it+MyTC00o3kE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=E/odu9UNDhzrhnKJ7fm/WaylmK4uLFKCf1KWh+YkGfiWV1NESHgA3WrIdWzmLhGYrk98aErF7WtzJ+U2hIxWBFIeZz2yuHGAqZ90z2hEBIw0XvK4zZ30Snq+f82SuAT83nPLuyad3ImLdMCBpN3hMwsjabv/WuNruM9fNJsbIaw= 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=aflmNA/q; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=uoEZdvDg; 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="aflmNA/q"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="uoEZdvDg" 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 46QJjvIY018752; Fri, 26 Jul 2024 20:21:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=hzptKXz9W9c9WZCb7zy3uwikGyU3kBX6eeGGRRqMVXA=; b= aflmNA/qBSH7qh4PxNLq3eJMuFUsQcSlT6uB3PJ9/WV4YQPSRBOXZUGBBWlMyi98 9ULzVIAN063FFmQm1MDaJgf6DCM3y8Et7B4htk/jLvmu9Cqas3WWMCLhNKUwapm8 RiGUnBLyZis8xpKWpqp2vy7xVdjZiv2eEGVGNBgl6SxqIkiyA28N3r6IHznHZf6W kEF50UYct6I/Eb9gX3C1y3lbD90F6JLkNAyrhAPoZqI92rr1Yese90Z4Ak4pCSRH 1CbDB7qiJE/HpM0J5SvobqroMe7Dafy9lB4SmkZNG3STFa1c5SJlSWc3+iFMXFSh goyi2///r8Iu4qFmBkSidw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40hfxppjgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:53 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJGGUl038916; Fri, 26 Jul 2024 20:21:52 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2040.outbound.protection.outlook.com [104.47.55.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h26s48n1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YoJT/n5IHake+URNR12r09uYFcFt64ZS5/ZzS0+N92mtTg2sePjSWNHkkXUW8EHAdWWOUvbU7qydF6JfPvPEgnMMPmH1JyyBfQgpG/MQoNXtcTFNHVcroDUxetq+vkSceAK1M/BURIHRw/qxwgd+fSFgRFTKNrjSilWL75++RuQBxRjfisKYJmU5C4BeRpdSLRWayU0bTnc5wTgIKTmhehoYXzex746EdH6QmtV6cG9cI9VoXNUOpZKokKAiecSLrDrEaXzomtz1N4rBRkTkT6OG3jN7NLdCObsBcOuScivHpSnZCfV4L0KsIlNIvztD1lGsKcizgzwW8hY1LF1xMw== 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=hzptKXz9W9c9WZCb7zy3uwikGyU3kBX6eeGGRRqMVXA=; b=H6QHZoVz8H1uxkoxnNXXsHrlhHMrd7axbij4Mj1ZSiMaz9QY+LZ8LtuuDVYbek7/MVgjKFBbHjxXGFbeYDTcxCeY58kkWDNMGYCgILcB6QovXJ+cYPVzo3FUT/ZeHbPA/3mnaMIdIqbcblZbGMsWNZYzPXdyWZ8H0qS3GFnNbqCYlZujQOiUKvlHCYOSeZr24xoxTPouIQXcyJ+3XK0h2XXTj9Bm3vIBYajQiBiN7GZTNXCyEYKwavYcbAHioGUTa1VbL0SpKFjBC89zyPepboSvljSDlU3gsrKekL3RASPB+UEouWJqkpcSEvpsynotdDgNhUeuvPt6azJFDwk1GQ== 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=hzptKXz9W9c9WZCb7zy3uwikGyU3kBX6eeGGRRqMVXA=; b=uoEZdvDg8dgqBJnMKZX/4tfa1aa4sbfLWGRPp69i3py4ePO4Ab5wQq+3GieA1jwX2NgNm37Ph+O6myu5jcu+wdfRDoq/KhUbQ2nIRw9wfmGCs2lblUzEeAxs9jF5w2mG+3rm24SufmlKundQVSVgjWA0uhtsAKOED4wpQo37GT4= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CH0PR10MB5178.namprd10.prod.outlook.com (2603:10b6:610:dd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:49 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:49 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 07/10] arm64: define TIF_POLLING_NRFLAG Date: Fri, 26 Jul 2024 13:21:31 -0700 Message-Id: <20240726202134.627514-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0181.namprd03.prod.outlook.com (2603:10b6:303:b8::6) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CH0PR10MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: 4aafe9b0-e1aa-40e6-4240-08dcadb09435 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: BgPMWV4RWlwaT6zYcV9Und9aw4vum2lfHT4ITVyKELRraW7VwSKcoEM0FVdgyjssa1EOdqvq3mnTANkgCicXjFr+ngn9N/baPnBhsPsav6oIi1pYNzY61cEcrGK6x+wt95y28Fk7NnuOGKxeWI9QuwaFpupVM/0UKvaz8ufYTEtnEWLGVK2+uUpq5inekdO1Yben58r9XAcq3+TYE7AJlktOwKrUYn5fYStF7UDz56B3nwL8DGFL4aqOUbQ1mUVh72uLASPpsUo1Gru4ejrVjFmOXnsLssk3Q19Se8BbLKjtkQ2agGZPZcexh1eNKGZuq+olsQphPEN8Eg8X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V:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wCy2U8YYayHw9DL30elUKIkz/XydIOJkwD0LxccNOlkS5uHSXeoJ/L4KMF8573F01fLSrwa2Nb9n78q2TYIXsmIX25B2eq+aEC74/51Pi/+Q+aHt5NLPpJo/4ObA49dLo8yeupr2TJ8bfXwzYQCUQOXNdQ2aAUxG+SwpdgjVJRKJGuMwkWBNutHHRyxEsnSGxGZ3AODtU5Kdeif4XA+/5ALx4EjdP66I5gfUoZGXckgZqAcZJAgllMdJeHVJZBDbjHlTTB8inJyjWPeUL+va3RcykKMgKFo7Tc9MhixR7ETb1/gRL309aOd6ir21KDlPznVqsjZPYUnaSDOJpAlfUdl3YgKrgFtzS+DWvLXoUH7meLnxQa0XnH+4qcbWRnnMdBonLcGyuoumNvenMWO0ivorWg424S94sR608JYjaSUK1Jtd5eC8AKKKA6BWOB/ZJu9aLrFHF1a1ADe90YKuEQzeXVCp+mlymZ5aLTOmPfPIGrhlZXZgWhHUTIQ48UMF1xTXE2G/Y6zL3nCMYxL5pS/ZzmWP0HzEwI89O3Jb8+CC9ib7ZnCyMmmn9yUJdrffCGz77MvZ39vhG8FCwRLyuVOOW+S9osZMn9uweVtlk3Io2H1G6i4SZuKfVkguoFp6uSjDkX9YwOzptVWz3pS7Va8C/Q4X9T1rigzkGUjTVbfSgm3h1IhiAtyXYrOXN8IFSGvPSPUG9vKTAZcJeYvHaqXorjPZqTVCnnXHZUhLJ4JMTq6EBahQPQAINdHTvYPnOyrR5YsbKnHU121fNq/DJbM0yKFqyG7piwtTFhZAdKwhkhcUy8E3v0ZdY8A0H4QLMoRiA/XaaIy9Yv6h1kp7ootMykThPrUXwnKvh3mvdE+SguHAr/2yO3FCPl7s5SbcRlOXSVhCe/1LO2WiJ56/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qUlyE4a9ZU0qyQKDYPo8X09mDiDExbq/nxBf7HPOniKUj4uc5Rv6PWInxCJyzwOv2Sm8/BjcPOgVn9/uhw+dO2bV2rOqrWzfC3Tq5uJTA6J0ze/BT7zaQsF8J3Cvt9wGkGl/tapJsWP4z+lqH+ESjDQX2lrMbkwtqPT2Loc4bNZcnEW3jzHgzoXPOat1OfuyXqHz4f9ufIYrB4Yk879gEf1wAFVSrQiPRIox/AFMXMUdv8JXWz3SFrk/UZZvhJ51W5Pp2CWUE+23epdPCELFS8wzM/xUvxXZx4BvoMKq3NKjFZy+z9PEpj2BMry3vnNgoOqw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4aafe9b0-e1aa-40e6-4240-08dcadb09435 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:49.3530 (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: hSHoCrR5VuxPf7dJyckV2gH+NtYnJq6uLfR73UPuMN/5TGL7SFCDTWlN7fKhkCkoFW0TeHvQB96kRmyhwiNNEWL3k256Sw1YM0vtxUSbTxA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: ozDLU4OUXYKSOjqjmV8l3Ksa0JLkRwmM X-Proofpoint-ORIG-GUID: ozDLU4OUXYKSOjqjmV8l3Ksa0JLkRwmM From: Joao Martins Commit 842514849a61 ("arm64: Remove TIF_POLLING_NRFLAG") had removed TIF_POLLING_NRFLAG because arm64 only supported non-polled idling via cpu_do_idle(). To add support for polling via cpuidle-haltpoll, we want to use the standard poll_idle() interface, which sets TIF_POLLING_NRFLAG while polling. Reuse the same bit to define TIF_POLLING_NRFLAG. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora Reviewed-by: Christoph Lameter --- arch/arm64/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index e72a3bf9e563..23ff72168e48 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -69,6 +69,7 @@ void arch_setup_new_exec(void); #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ #define TIF_SECCOMP 11 /* syscall secure computing */ #define TIF_SYSCALL_EMU 12 /* syscall emulation active */ +#define TIF_POLLING_NRFLAG 16 /* set while polling in poll_idle() */ #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 @@ -91,6 +92,7 @@ void arch_setup_new_exec(void); #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) +#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) #define _TIF_32BIT (1 << TIF_32BIT) From patchwork Fri Jul 26 20:21:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743155 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 34849149C77; Fri, 26 Jul 2024 20:22:25 +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=1722025347; cv=fail; b=XlQHqCZRJ1rZx0i4HWqQ9nFI4uQGaOsye0QOHtNqvvEf9qNgFW7WA1A4a1//xToYyd95PvabYWju8vRe+Ee0QQBpFIudrzn+9Z/vsLOMC+uXPYQrvRV8C+XnMJAAo/EVBTvVNQHvJBygWOLQ6DVsusV+oyXhi0Va2712WwRIc0w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025347; c=relaxed/simple; bh=khSTJY/llFO781W+oRrGsrt9Ari9F/wxcNbjXtabusk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fkanr7Gej8cQTOBQDLkiLNo04PL+71EyRbmQ7+4hw151cZgPPvNiLWW66w5XdxMZU0nJVXMKiK6B+nAnu+W7vyNU+naKCkrBOCHUQi1B7Tnzz1UlOdi7AVGxWDB25MWW6yKUApI0k1c2orjVdUM9zmJMvv9jQLrOoNMuLRYLbgU= 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=VW8+1wa3; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=QIQIgJCE; 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="VW8+1wa3"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="QIQIgJCE" 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 46QKAhvw022201; Fri, 26 Jul 2024 20:21:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b= VW8+1wa3f0gTExdGeAiUBfFHBYqto0aaF8+Jr6nKzLURXpkw6Xvj+uTIoCA4lA9Y PgkA08v/DTOzdJfGpvBj1/XEH5HYQp7UMwg7p6olQxciXvJYxwHCaPRRbSjoRd6b kfeHhL/jwRTNUuG/HKA3Z8jcjy7QhTGwyFrnJ+03DOyzyXczC7XTVq56FVCzdsqZ Oq2X1FF6Ox5+6j7kNmz+75/CMfUbq443aDhVzJQEeUJ4CE9gwH0uBWqa4lsx0Vam 4nGHVch/o1mvVb91m/iwHPvKmso664DJ1utXuKOAdWASC51UgILiLC08fqxHBz3a JcHlKgMwoBSQRGH+mNFI1Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvj6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:55 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QK138D010718; Fri, 26 Jul 2024 20:21:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2045.outbound.protection.outlook.com [104.47.55.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40h2848fa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:21:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sqoxEoMvQmaLMA4i325fN74ycqoCv0V0NJQr148Gm6ijIU+dGl0YItxuAg9dL1mUzLQae0FtpX537zth8voO7isN++aM8liFP/QG+0TiyjzD6KWqFo35IkUOQUI1alRn68m3yLMES2yIMwFtVpIOfhIZ8XcKhXFmgLDcfyw8nCDRErZdr7tMo8Sfr1P7QJ+fneR02Buv2o0nbmpgZzcDrf5FAWW3SCa2TqP+9qqk/zeOgdcaHQ2SQ5tyMbWn9yDtV8zrvwCtW+gG28o+Bu5/gHORCf9FM2cyCMytUAkH48K6yDTXlNj78l5jSJI6rDny8jTT7e7+sbqLDsSLMTY7rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b=oQy858qewAHsKZwk8esLHoAwJbLnw4Za7CJYb6wersz+qYoc6WclgwB1NTSLeAeqRhg3wLgJsi0NvbklfP0xrpFLVvAk3UU1WA412PEjtjNyi2BrSlwMo6GTg7iNw6T65OELUjGM+doRGCMUkTpItxKBuI/hQ/wNWhBRJPnyrW7+3YMEcej5VcsMOIBXHDPxSdLNB7I5A8n0hDL8//rMhiLdtvIf0E9X9shfBe9WnQznMgNMhYPiQ845/a6jjTtl9YQTOxfx3jeX8Ii7n0PNbpGI91j+vcaCBPhn1uoq7fkNgKuZQ01oe80yB68g4ZRinFsltE4p2Hz+cu5KWRihMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ffXvkV+mRWAxyKYRSz1YPBNnPlHXfBa9sCaF3inIVgA=; b=QIQIgJCES4JmMToimeNbeLJgNgZ4BC6o2JDQ/xCjgqCOoM4DXVU4Eh2R2SYTL7E8dhz1eWhqGDoALazc7xKfsJeEt8HjFxVZr8sOf/pFaHCuq8xEolWAzEeYvD0+Zh/wS8q2oi5QPbVdiVhySMgQi4v8Xz2OFYBB3WEvcmCNGQc= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by IA1PR10MB7485.namprd10.prod.outlook.com (2603:10b6:208:451::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:51 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:51 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 08/10] arm64: idle: export arch_cpu_idle Date: Fri, 26 Jul 2024 13:21:32 -0700 Message-Id: <20240726202134.627514-6-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0209.namprd03.prod.outlook.com (2603:10b6:303:b8::34) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|IA1PR10MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: 049b8a9b-80a3-4e97-6e2c-08dcadb095ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: v/tBVqc6w3K7j/MzN6qbqTv+YGpULz82NdAXzBVhPL/tUkPemY/P4OrQSUe2Nb5Y+fXJITcrsLuNuxqYK3OSnV8O5gIh0VmgIDCDX8rSAduX3tKSh03GUsNDvTEY39FPZ8ZOm6uIhA69g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E9eZF/M9tFIu/U18aUXVDKm7OvV0hPRADliPkp9H0zGNdH+zwsEZpCd7FRuJ8nNbYXjaBPCKL4pHyKmR3eAYdU4NaqFOeZba10Qus9RHWc87P/KT962bXz9oOy8MXhOnga0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vPMqYYF/ip6gJ+xLpgbV3B4Yf1xFPrYgslG5qHGr6yyggPRBjGMLXZjd/31b2XvCqM++T6a1NiSWBIu1p8ynZTOe+kUyhzX4b0ldfZyjXUntn9HR8voxpYN/EFVGnEUlwlMRVI1X4rHSxSnfPSxzr21jO4AWhlcPuvsftMBRmwRucS3suY4x56B/9kOhdhnEfmAElWU62eQvNU5vDc8ReUwcKZQogYPRaSEB1hKueLjhdNj7Ai3k5C5tU2XSVoTYLIBr1u4V6UhLtEjDs3tQP0bCqh9j9nImtNE0KB9a70qzReVqrfAljcBq/tvyU/JoeKEjWhAdbtoi0UBypXsX+ktfTU0QzBCAPnBiO5sgHcjXhRmzKp25sQ11A+OBvPUSYPRPmrWQD3JL/dA6qcGHpIS5lnEPBhnjYKQ3UhqTlC4vF1kFbD2gqjTqFf5NpbAMAKuk5MiuSusyfs8LN09viLHlKh9v9rA6FZXatzz8zIOx4VgdfjZnQjD8v8HgBPlLZKYPgXT+9Ztli/Q5mhUOm5FmEDgiFJz5gPTmeP3BoYCRbJNlYNFsn05QaCqW/k+RUGvgZ+/7yKjbv5UaC8P8kG632lJj5Rl3m2U0hI3znJv9L3sC4q741SRvq0hP7GTNz3lGObig/1XnCdE8dQIblZTHa9NYMZ6QVsXx5ujVO9emsNUNvQYVK4FSsu+MZDNPl2X7Q4+CoIotp0EU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XbnPSW3o0F+WLpJabU5Ur26fRKQlNIbnHOvYGOeiyOYk12M8wE2LuTPGWdLiMUwzFOcG6Rmj5C1HtEKj4krzj+2Rz8106hwaVoshwNxlLZC68bQstrrXn/wiB5NL5YqAEIfVyMyTdE4Wp/+cyCF7MXJ7Xpk2AnND464b8ESbrTRTABKqkBAuYI/8gVDtcrwJtY3RPz299dnJQuwY8zZ/Tmh9J1dRyr4OyMtJbW0Jh282q+gYcEB4+4zJWarTdP0zf24Ml4Tv3KGzhNBfEhJyXuZfbv2RVOjYgCAiita6K/AFhsUUXIJQfYQ7dzzoK9K8DUQ4/GZ54tbipiC/3SefwErhGyN1Ni+shA2fHJE+KR3/y8TU7XF+YlNir/PEMfp98r73N1eeKDmxNaEWO5IhIDBOIorG/lqrYLidPkisCY/vk3VeP8yQliJ89QLBraj5IBiJjQz1/AYiGPeaRFO4trGKAro/zlZSzQy3f0IeJKlIZCPG24hBKZJSWAwVqTyGVmF/cycW2g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 049b8a9b-80a3-4e97-6e2c-08dcadb095ae X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:51.8305 (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: SD34RvZ7udOhmUuHm3olU5Zi8zMJkdPxeyVbGqV6MC4VLW4TjLFM6lzteXKl4AOQr+7ZUM4L0LtVx9PhTEMT6gLNGxS6VKiH2DE5Ck+Ea+A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7485 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: kaBN3B6PkVJAEJVvcyaBeDXM50Imrm_X X-Proofpoint-ORIG-GUID: kaBN3B6PkVJAEJVvcyaBeDXM50Imrm_X Needed for cpuidle-haltpoll. 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 Fri Jul 26 20:21:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743158 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 1B27B1552E4; Fri, 26 Jul 2024 20:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025353; cv=fail; b=qbvZ+mmPR0ITBQ2biNFK7pIUvryVjPRWuNx+VCzDeFHch4+ytwExhyf4gWS9iK5q4OlZjS2PVVRSFQrvihVyVIJARE0wRPtrjbpT5H0dhbdxBuPlWW57McCGMCn25glI5IRH3Qqu8p5tiBzG08kA/paTO3tYUFfD6F9shf2FWPg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025353; c=relaxed/simple; bh=423Bu8Tb8C43QLyjQ2XTu4Fv/p2H+MdxD2CIU7Mykj4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Gin+F5ZBm0qJaeZAdfw9Iz3LSQmyRdgqzVV4WbqxWBR8eKh4b/fEXYpmuW2mDqe6HlHFLJCNs8EPaTCFcmnSjBd5vmthTDFp191NJ+DhoSvemwnp5aCPtP7BDTtM9xrj37Jf1p7WkB91DKtemMOwdi5A6o6yUeeFsNl8zh9HoDU= 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=d4GlpcLr; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=L8nOAh90; 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="d4GlpcLr"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="L8nOAh90" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46QJkOd3010642; Fri, 26 Jul 2024 20:22:01 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=0Y5iQq5AlfaXHODFJbhwAtwyWEbdQAvsaddyAJxEonM=; b= d4GlpcLrF0pcmUbCUhvanPUPFWTTBNADkOj8TMOY1XgFbR5w97OfhQw3XSwPIjn6 PrfRL1c4IzS8o4WBErUcOJS5l7kYt3wIvvewRmvscCfC2qal/fU0mIL7ZA6uIhH6 qXNKLcFx8rR+HH7BizI96lIr+mDJtYy1XjTRB0XcWerxi8Yz+G36DY0k9mAUf8jH 5wtzPe9Zr6FTGQcOMOeHdiJ2nYLucAvstAb7x0O9jIvkS+m84ZeSfI2Ni6/Rd6rm xu7CRgstTNcyp+Qlvmbs/8fYL16tRA5W5bHt/OGjf/qf94lHjhbGDHS4qq6itlGS a9C7pCECFN3yNjGNy5ExSA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40hg1161j6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:22:01 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QJUlLG022353; Fri, 26 Jul 2024 20:22:00 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40h27sf01v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:22:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u1ut5/c3ZGTB35fh+51ysTyI80OV4NLN/vaul8ylTX8vNtRaMS6bOLfjQVZBr4m2Uu1qNZ1Jpi8qKAHS2C1oIlAmaCVoTqJ9xB8lSEBynG4U77ksuTWIbGGcs3mwU5NQ37Ne2Dm3+CCPrrqSGJyhiXfbd3cwZg7J1WGZie8tArsGBIkdRufDq3IVBegCEU08Asm9CG0tEk5OYQam99MeLxy7qsb6rtNp/L84+Cxen6cm6BA+EkG/mmMcou51p4yXhQ4Nq2stWbeMfGCr6NoA3P+T0FzFUdc5lZjhtiqu7s8yhfQb0i6RElATikT3wKhIE37x8396GATXsNsb4Qg/Qg== 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=0Y5iQq5AlfaXHODFJbhwAtwyWEbdQAvsaddyAJxEonM=; b=jwitmADPuNkLkW3x/2rMDfbRSAw1XbRRTJAv9dGtTnKLzJfBaoraXg5B2DvmnAOuaNPRDGFsYKn38KcRAnHgi84NznWsUz8AF2gLWQObA2j4yxvThRkmwwjKF7LZTvdZPbOslO9IKp5pwxp8Al8TwfUpldxZAlHp4d0lhQ59LgGi/E5DFtKFSF7u2bXJf2lRUCIt5c0UddJj7oXBS/i70RzieAqrM9YKY3ATBsRq3qDjTlMbrFayDw2EFFWrpoJtbftE3HnBVujVLMjArvi4F/ul0Uijdk7BTIV7Hnqy1+y/PYuDOl9ZF+dMh33kxvt6BDi/9cYmt2hgKb99klAnVQ== 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=0Y5iQq5AlfaXHODFJbhwAtwyWEbdQAvsaddyAJxEonM=; b=L8nOAh90ItiNOAf5/k5UbUsWTPKam+pyqN4xRgYLMc7bGsy3vV1GeqlrHih6OgGlkNGOOqV8CBuPqskhJTU16nUW/vBJEjhJqjkByA8lwroUoRxguBLWtatzw5uggdT8675kQTQzQYO2MVCQJxWFcA+V50pfQXEM+l1NfWwRiAA= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by IA1PR10MB7485.namprd10.prod.outlook.com (2603:10b6:208:451::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:57 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:57 +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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 09/10] arm64: support cpuidle-haltpoll Date: Fri, 26 Jul 2024 13:21:33 -0700 Message-Id: <20240726202134.627514-7-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0133.namprd04.prod.outlook.com (2603:10b6:303:84::18) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|IA1PR10MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: 6eca1415-992e-4c09-e687-08dcadb09908 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: VVedSUvFUOFwTfPZfK5YY9gvuZl6iOi9QcGwrvdkdni9OAgpUMNSH6WwFoAZREGL9i6X5R/Q1UUoNhYaxBv5y10uFlIPj5Dvr0mJrA8d89OuU5mpLbP33dWVW+AXYHPsLJkOQ1hH9tbB/ddrXyrYxWbGBBYPxeLY50pjUIgB4Cy7TxOO8PHMK83oMwd6zU11D89z57Z2jq4RZ5xVtx8TR96KyCVzCM4qL2hlT3hWMTmvuoKR4fRGhSVyeINLdr97pRIpGSYz9f8ObrLVJphxxZQrt32GSf/dh+1UWPrmDenMnb9tURc8kRI/S/JIquFEMEmHSQ9SVbuHz3K016Mbn2pKGkslnDtzKna2iSxQcz9Ay3C9u2v1GXOnCba/Jh9jllJFNxb9ZYXcyDh+nQPmKfr6SZjzQSk32aJzepZkxoAO2RrQ3bty41U3hrmAVkzW/BiKzyE6FcVFUSTByhBcL0EjiqJjUcbPhtioYyuAk8JsPfHZUdV8FdpKkUiGjvthj6Q24TSEijcnIRC8iPI9aY6VbhUeeGx+9XFR6HYRSsd24wC1TPDJ0NL8LFc9lL32cKYBRtNV3gq/E+ExnqoHBL27p8tKIHiAIDIsTdPrnyrUzdhtpLjdcLnnOkGlle9yZkerLRzXKTsk7r55sFVTzq9fQRo5iMG9MKmTjwiSrcqwvRip3yGlHHVGSQ7LCUr2JQjtg/dW2FY5RfsP2BajLX9DuCVAIUhB8cboMsI+bCdpqK+L8hDjsRJx8+Gi9fOZF0zIBSsdPBhJTwmlsbK9RU/9plqIvmR5jl3EJbh+dMQkGKBPybXEYIJ2EgWBVTZF7gfVb6pENG2KAtFWQnm+yqKMEg9yUCSDV7lRBdz7D/ftDbf5SpKJEC2ldpR4K0CDGgRWK/HNuIoAadaUIMn6XWERItpIjsW8ij6cMM5NdtBB/qIrOoGxhrVgiDyTCrijuFufHIu0k2h+Ru77iLKLlfsSW9i1TB47BYfDA/l4Ql2rDnTos9By+GdsqiYT4mHdAHKAacc6U9QkODBeC5JbJnuk7wudHu+f4U0p1ME8s9F/TxS1fnzJvRHfpJLpTQtTr2XfoF11pUYGxOJIm3KmYUwYMoq9XH9kyiGc9oc/EP+u/vxnpJt+sPmpqtmkktzAOFUaZIOdG+pSDHRhqKfOd6/mPDHFFPbpijjCkzfKBTjHDuqJvkmFQgUZjpgauuErkPTQO8CxQDSuY9vANLnwgDm+Q5omy6gnK9JDfmN2n81tusG0noyWfLvtJLR7nIBS9ffBe8zfifa0aOeVa//7jiXeFGZNX+v/S1sK3PdnvVyL4rBw1Mme4nprRwWLZti1mQ9j6A7Y/GShbL3V8yZ05g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4uGGjfQB+7jqx5B31Gu8n0WYjnEim4NsZjEiIlLyBGOreCX+zVu7d5CsECvJfw2fIOgEc/gkGilq6vpOFQKJX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NE7b9elrxvBFx6t7eyWKTmNTb/ndR2zZFXUa+nGcGgAcmXfN9EEe6pSUpqRm0umj8tq6o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6eca1415-992e-4c09-e687-08dcadb09908 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:57.4669 (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: bqCinqdqOxU3cAlWs5s2VaDOqVt5zVmyCqlqo5MQ1mMOYmMhKgw1xNMkXGgiCzkr8JlbDtYKrSGhlYrSiLqvDY3TQwvYUt1+RMklz94F+94= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7485 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-ORIG-GUID: r3VMDMiEYHbrCo8naZXvtr6jsELcjEH7 X-Proofpoint-GUID: r3VMDMiEYHbrCo8naZXvtr6jsELcjEH7 Add architectural support for cpuidle-haltpoll driver by defining arch_haltpoll_*(). Also define ARCH_CPUIDLE_HALTPOLL to allow cpuidle-haltpoll to be selected, and given that we have an optimized polling mechanism in smp_cond_load*(), select ARCH_HAS_OPTIMIZED_POLL. smp_cond_load*() are implemented via LDXR, WFE, with LDXR loading a memory region in exclusive state and the WFE waiting for any stores to it. In the edge case -- no CPU stores to the waited region and there's no interrupt -- the event-stream will provide the terminating condition ensuring we don't wait forever, but because the event-stream runs at a fixed frequency (configured at 10kHz) we might spend more time in the polling stage than specified by cpuidle_poll_time(). This would only happen in the last iteration, since overshooting the poll_limit means the governor moves out of the polling stage. Signed-off-by: Ankur Arora Tested-by: Haris Okanovic --- arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/cpuidle_haltpoll.h | 9 +++++++++ arch/arm64/kernel/cpuidle.c | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5d91259ee7b5..cf1c6681eb0a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -35,6 +35,7 @@ config ARM64 select ARCH_HAS_MEMBARRIER_SYNC_CORE select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_HW_PTE_YOUNG @@ -2376,6 +2377,15 @@ config ARCH_HIBERNATION_HEADER config ARCH_SUSPEND_POSSIBLE def_bool y +config ARCH_CPUIDLE_HALTPOLL + bool "Enable selection of the cpuidle-haltpoll driver" + default n + help + cpuidle-haltpoll allows for adaptive polling based on + current load before entering the idle state. + + Some virtualized workloads benefit from using it. + endmenu # "Power management options" menu "CPU Power Management" diff --git a/arch/arm64/include/asm/cpuidle_haltpoll.h b/arch/arm64/include/asm/cpuidle_haltpoll.h new file mode 100644 index 000000000000..65f289407a6c --- /dev/null +++ b/arch/arm64/include/asm/cpuidle_haltpoll.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ARCH_HALTPOLL_H +#define _ARCH_HALTPOLL_H + +static inline void arch_haltpoll_enable(unsigned int cpu) { } +static inline void arch_haltpoll_disable(unsigned int cpu) { } + +bool arch_haltpoll_want(bool force); +#endif diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index f372295207fb..334df82a0eac 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -72,3 +72,26 @@ __cpuidle int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) lpi->index, state); } #endif + +#if IS_ENABLED(CONFIG_HALTPOLL_CPUIDLE) + +#include + +bool arch_haltpoll_want(bool force) +{ + /* + * Enabling haltpoll requires two things: + * + * - Event stream support to provide a terminating condition to the + * WFE in the poll loop. + * + * - KVM support for arch_haltpoll_enable(), arch_haltpoll_enable(). + * + * Given that the second is missing, allow haltpoll to only be force + * loaded. + */ + return (arch_timer_evtstrm_available() && false) || force; +} + +EXPORT_SYMBOL_GPL(arch_haltpoll_want); +#endif From patchwork Fri Jul 26 20:21:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13743157 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 0AE741552E0; Fri, 26 Jul 2024 20:22:31 +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=1722025353; cv=fail; b=PLX64XZuLDMSsz0d0eRPRpdUxPz1reuxq/m5TdjZfRaZqJpNfeWTiFJJeOlGEGCiuterJCUa0WYOlXUI2PBCh5s7l98dwm/aXk6gTpzuJvOOHCw8vFLSTHvmqT8ZqcddnwcPK7uRU6Ay/BU6Ntf1ch8V1JmrphLe3TxCNHUlDLY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722025353; c=relaxed/simple; bh=aDcCA9Qa7DdQVIrl/V/FInAGrpfDVZvltSoMhbiT9D0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IxoE4xu0guwbZp2/3U1wtSIZwbZHIgNpcYHFVFuAG48Da46Q1d069s7JnIRi2LIlrb/RO1HH8MSJHa6oM+M0V9EX4EbFWyLT8/qgzZiEP2hcXjZ+L9BARfbZ7Bcm4bsxtili1ENfbE/eF3NKGO4NY5hkGF9LDp1iPqaqIhmk3/o= 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=H4f4255H; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Gy2cTacv; 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="H4f4255H"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Gy2cTacv" 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 46QI5Ws7013755; Fri, 26 Jul 2024 20:22:03 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=RNan28hZrueRUqN0lQfwdbjRDfPEGYlHsBOvYRqz08U=; b= H4f4255HhHS+2cryxkTkzWhFXLbzQlkC8iI6A/yNfRsGI7aBW6KhZJlP9ZSqlYk6 RA0l4RIyVUObyUa84Gt7k0ICHhY2xlfogH/4869iG8knLfY70LZUYnQ60saqk7GM qAzcHVQJlB1WsWRjRzt3qK+A6WgPzdstZj+gbC3+Q5bhyV+GOvhEqLQs7mFjGsFq XBHMdZR+hg2UCTB8J/ZuOTOVDs8KzXAm468yIF07lanBETYHmZsn6LrJDPIeGXdU zVx0gwvZ1Iq7bwodUWm6ZbsxAKm5+zoxUf9LHLZCHxQwLPtOui6igDo7CxjWwdPR AXcrE2gd1B6wQ/LOaBh/2A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40k7yuvj6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:22:02 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46QIZnkZ013528; Fri, 26 Jul 2024 20:22:02 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40h2a64dcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jul 2024 20:22:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oFV1FiTSmeRZm+axLo4G94clt6T++hmsWIQwzc4KabZtRCC8HNWw4Jm0hZdXAL9LDfqFph8txv2IOl+psesc92BOnXXRC8h3XkcFTqRlPtwDX+HxNPhnxuo/X8qnTH/n47no4NR+24x1J2K9123/J9LM/Tv4jL2GDxROQSJwL0j3HnhDgw5EclxBzOkn+a2MgyvEdfT4RYNBEoIo+cQ+GasGImwaoaUQWqMmpqGqDm7PGfUMd8fiTtdpNAkxY32hSNF9WLwygLtXHtNumy2svFQvmbPL5O71pUqlOIKfncRdzxSmkvk29KA73C2iVrN3LzweYRkd6Wj3AKvxjuGdtA== 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=RNan28hZrueRUqN0lQfwdbjRDfPEGYlHsBOvYRqz08U=; b=Jw57y2zeC12jszBGwaxEjasr7LkRDfn0HwaJR0tsGzZGfY61QAjUQ0H0QKWlLnz0sKbGuhgjnv+b58tbVtEWrkxYY7HVGOA5UAi0jAZY75SI9oQHXxf57RAqfsjvD8IWzuPQ0WRhPhlG+eAS3K+Y/4zKZGAHjoJIlgIS8htPlyZ+3b3yO6m4tKnQui8G1eNHL0GtcrlEoxolvbqhrXzIQpdEL8ClyfeYP8/P8Ih6stTa59zqGFtJYBC+ZnCvt9r9G/pCdhBNVbL4yp1WMlpJI8SlkLBerPsAdS2gG8uP8p+3R3Xx+l9/00NrEMBb3qKg5dLW4XWiG4Bq2vEtg4x0Gw== 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=RNan28hZrueRUqN0lQfwdbjRDfPEGYlHsBOvYRqz08U=; b=Gy2cTacvT/oS/tMQtnC+zQgpX90bN+fllpVc81lqV77HvcVPUELoyflXkNCVjAMbqbMtJPL6M/4lPOwkd6OcTdiqBz+b0x/JMNp/VZxGURgye9YgDrpaDWAnWOl/X75/h5KWsTdNzQzQdEQD8qr2gquW6fxCR1ZR63gpgpOmtXw= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by IA1PR10MB7485.namprd10.prod.outlook.com (2603:10b6:208:451::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 26 Jul 2024 20:21:59 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%4]) with mapi id 15.20.7784.020; Fri, 26 Jul 2024 20:21:59 +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, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH v6 10/10] cpuidle/poll_state: limit POLL_IDLE_RELAX_COUNT on arm64 Date: Fri, 26 Jul 2024 13:21:34 -0700 Message-Id: <20240726202134.627514-8-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240726202134.627514-1-ankur.a.arora@oracle.com> References: <20240726201332.626395-1-ankur.a.arora@oracle.com> <20240726202134.627514-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4P223CA0020.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::25) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|IA1PR10MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cb70980-cab4-4aac-00a0-08dcadb09a40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: CNc8g+aPhAhfjJ8HGg865vkx/Q9L1tqTJPhlNDj8JGufLzZX2LZb75MbtV173uynIqW2w1AzSO2O0pYne7BXbNTXPt1i2WeFuNj6Ax9S+Kqr3fLc/KXaTcpS1wq+UYmk57W/c3JTh1xEL/AViHb0J1ooTFfvb8UMyDb2PHFKW27lszChUgJt0a7Cf/MCqR9kE0EwnqiGdWA67ulK639PmincbZh1wQXaPJoq8enMHDRUqVYJYvLePCpLSlttLZVR9QqXmbd4PGKxDu4oOXL4RT0mZmW/YmDueZn7SH/l/gPlrb2YTgY26aXyRI2VIPDe0ndzVj4r+ZeOrwOHmf4RN4AyfHkViPdVk3Yd2RTdu+/LHe4n/a8JAX0CdfXT/3V33qT5JPkgeiXWiHU/7HjqDSXgE4pdxGwr1PAX68zYmaJHoTkwFkvh44066DKNGbf/RGv0UgpInr/P7WUXqcniSqyloYtli1jPeHXEckvwqPjFqhajzKCxMfThajJ8z+UrS+f2HMquC9PaEIvcnGCqN46aqY5FUNb0HdxwwU9p7Lzz12IrMnQyH6w7BU78EsnKxUfWvTa9vED1uoh0lgtVqkNJ4rvEryDG4IJmP5Wz6gi2xzAm0gJdZNFLY0z8UxgbtJ57p/ov2mPTCROwo7Yb2spbRF189GYJjf7a6dEB4bOp5QIyT11voQij+D+xHM364KI4fzHDkI/3XzyfRyiBZ+IHj4NLOOhoVJF7UnMy+r90Q6oXNTq6VVmRoWB2yc1TxexAtK4O5fp0dUjkGRZGzgzfHsi4u5rVbm9EUyjr1MXuheSRfkPBCGB4EjFlOS8pHauUi+7zLpkltkO5GVVjsu+hPaD9ne6ugRl+ZlfLGWexq/GFCT7jhara8FoHEaxZ6uoR547d3SIr7+B9oKxecp2h+DFAq7AWleKwHoWuXbw5sKtbEoEN+n0R0f1p+e/xf95LSklCE3BtItEwsY1sPuDWlPsaFaRgzE9js7CJ7zo1/YgxVQUhaqPyerRvdJbkECXALUKfNeZJwdaLbI6lYqxxPOo6vN04PxcgSCGdyzPNRYwKyVQwKnM/YfTUwF/0MGLaLMUibllUf+ozL/tw+YMz8ugiBTWxHda7sj92HTUPNSlOEyhK+O/+QahbBfmBh4y/hah+c8Abhfq9+4HhdybXPYxd5o+04j9wba7t7W34meKx+Xm1NAuVHzvDFZNPiDTAtCkAtsz7P8pHpi0+5zLQI8YV2GU3c9S5NUZwJvDqf+WlDSlPTuL3Z9CAl3mpbs2G4cjmFobRbBNJyWnHV8gQKm/EKXmqDIaL6YYTV1w7iG3y+RDEFAveshzyNQE83LlUfzDjS6KpqnnElTWr8Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bJPbBKgc2S+bVPNm/vl5+V2NnePXqDdoM2f6cwSzZSOCoIzciJtJ0wans37ig2FxWBCM7OYxcfIrsQkeApjr8hVIHrupf3vfDvkEclRQy/54itabNqTVf1ni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aUawi0CiHtaVAeyD3IO+nTjfqfDSDIgbMcPb0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cb70980-cab4-4aac-00a0-08dcadb09a40 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2024 20:21:59.5409 (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: v1jxBKoiGlTYWdlDi3SJ/NIyrCCkZRfq5jxuJCZ3SQTggkZdLSogcGZLqiSeKVIbIasbkydD9r2P2Um4YZ/ne8F7qcNWwCyNtCf+ptvtbM4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7485 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-26_12,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407260138 X-Proofpoint-GUID: BrdyzMIRI4n0FY-6kuAmnN4GFVO_HxOw X-Proofpoint-ORIG-GUID: BrdyzMIRI4n0FY-6kuAmnN4GFVO_HxOw smp_cond_load_relaxed(), in its generic polling variant, polls on the loop condition waiting for it to change, eventually exiting the loop if the time limit has been exceeded. To limit the frequency of the relatively expensive time check it is limited to once every POLL_IDLE_RELAX_COUNT iterations. arm64, however uses an event based mechanism, where instead of polling, we wait for store to a region. Limit the POLL_IDLE_RELAX_COUNT to 1 for that case. Suggested-by: Haris Okanovic Signed-off-by: Ankur Arora --- drivers/cpuidle/poll_state.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 532e4ed19e0f..b69fe7b67cb4 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -8,7 +8,18 @@ #include #include +#ifdef CONFIG_ARM64 +/* + * POLL_IDLE_RELAX_COUNT determines how often we check for timeout + * while polling for TIF_NEED_RESCHED in thread_info->flags. + * + * Set this to a low value since arm64, instead of polling, uses a + * event based mechanism. + */ +#define POLL_IDLE_RELAX_COUNT 1 +#else #define POLL_IDLE_RELAX_COUNT 200 +#endif static int __cpuidle poll_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)