From nobody Mon Feb 9 00:55:28 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0472319DFA4 for ; Tue, 28 Jan 2025 14:11:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738073516; cv=none; b=XbJJEeN2aR0PJ/AVVtay4PD3fuh3/0koefIUi1oESJauRuGlSvWzQEispSqYV3dvJiicE0mSrhSTrUzHa8le0o6Oi1Xhtqymno3Qax2DVdQUocrbGm2mYsCQwedGf3s4oDDqGxenHCZjxXIa6YUkc4bm3pNJGL3ouJ4Qa3GbBsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738073516; c=relaxed/simple; bh=4QAS8Yya/YglxdPrX7EdoErmPK5DoXGXlvU07eCU7to=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lGLail23DVE2KHuoxIUjHAwAc2PO2X1zKkfXgTbTsDtgSKNRTWQXi8yrdGoDW6NpUDhoplUt42BylRV9eCymwd3HwpT58GnAEKB2FkiZjPb/UxNiEA09r5y3/bulWkwxqqN62Xn0Mr8Gbli4WthILJu140pkDWwj45VhfwQhXyQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=N4RahzlQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N4RahzlQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738073514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ggFKz2J7jLR0vcLpN1vbxhgEE+/3A/H4er4tPstc3/w=; b=N4RahzlQ/8AAPi3xGAYGjwtbvHLPjh3wLOfFKU5gzvFJrIanL0cN5yxmkkBbAOCC/0X7vd AKhFlUmOO+e50Aeda2VxLAMkDIB3SooXHUf9Kl/yJWW/vjsf8RDluNp3XZDIVc/3mPNtTF S79QaGRd+Jd77TEdoS4Km0bRlPMh+Cw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-383-YyY4FFj4NC-wKg6XiZJ4cg-1; Tue, 28 Jan 2025 09:11:50 -0500 X-MC-Unique: YyY4FFj4NC-wKg6XiZJ4cg-1 X-Mimecast-MFC-AGG-ID: YyY4FFj4NC-wKg6XiZJ4cg Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 496491801F21; Tue, 28 Jan 2025 14:11:49 +0000 (UTC) Received: from dba-icx.bos.redhat.com (prarit2023-dbaguest.khw.eng.bos2.dc.redhat.com [10.26.1.94]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7F7081800268; Tue, 28 Jan 2025 14:11:47 +0000 (UTC) From: David Arcari To: linux-pm@vger.kernel.org Cc: David Arcari , Jonathan Corbet , Jacob Pan , Len Brown , Prarit Bhargava , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] intel_idle: introduce 'use_acpi_cst' module parameter Date: Tue, 28 Jan 2025 09:11:39 -0500 Message-ID: <20250128141139.2033088-1-darcari@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Since commit 18734958e9bf ("intel_idle: Use ACPI _CST for processor models without C-state tables")the intel_idle driver has had the ability to use the ACPI _CST to populate C-states when the processor model is not recognized. However, even when the processor model is recognized there are cases where it is useful to make the driver ignore the per cpu idle states in lieu of ACPI C-states (such as specific application performance). Add the 'use_acpi_cst' module parameter to provide this functionality (not to be confused with the 'use_acpi' module parameter which has a different function). Cc: Jonathan Corbet Cc: Jacob Pan Cc: Len Brown Cc: David Arcari Cc: Prarit Bhargava Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: David Arcari --- Documentation/admin-guide/pm/intel_idle.rst | 5 +++++ drivers/idle/intel_idle.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/admin-guide/pm/intel_idle.rst b/Documentation/ad= min-guide/pm/intel_idle.rst index 39bd6ecce7de..a87238bcf33d 100644 --- a/Documentation/admin-guide/pm/intel_idle.rst +++ b/Documentation/admin-guide/pm/intel_idle.rst @@ -198,6 +198,11 @@ driver ignore the system's ACPI tables entirely or use= them for all of the recognized processor models, respectively (they both are unset by default = and ``use_acpi`` has no effect if ``no_acpi`` is set). =20 +The ``use_acpi_cst`` module parameter (recognized by ``intel_idle`` if the +kernel has been configured with ACPI support) can be set to make the driver +ignore the per cpu idle states in lieu of ACPI idle states. ``use_acpi_cst= `` +has no effect if ``no_acpi`` is set). + The value of the ``states_off`` module parameter (0 by default) represents= a list of idle states to be disabled by default in the form of a bitmask. =20 diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 118fe1d37c22..b8a536b930e7 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -1695,6 +1695,10 @@ static bool force_use_acpi __read_mostly; /* No effe= ct if no_acpi is set. */ module_param_named(use_acpi, force_use_acpi, bool, 0444); MODULE_PARM_DESC(use_acpi, "Use ACPI _CST for building the idle states lis= t"); =20 +static bool use_acpi_cst __read_mostly; /* No effect if no_acpi is set. */ +module_param_named(use_acpi_cst, use_acpi_cst, bool, 0444); +MODULE_PARM_DESC(use_acpi_cst, "Ignore cpu specific idle states in lieu of= ACPI idle states"); + static struct acpi_processor_power acpi_state_table __initdata; =20 /** @@ -1836,6 +1840,7 @@ static bool __init intel_idle_off_by_default(unsigned= int flags, u32 mwait_hint) } #else /* !CONFIG_ACPI_PROCESSOR_CSTATE */ #define force_use_acpi (false) +#define use_acpi_cst (false) =20 static inline bool intel_idle_acpi_cst_extract(void) { return false; } static inline void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv= ) { } @@ -2328,6 +2333,12 @@ static int __init intel_idle_init(void) pr_debug("MWAIT substates: 0x%x\n", mwait_substates); =20 icpu =3D (const struct idle_cpu *)id->driver_data; + if (use_acpi_cst && !no_acpi) { + if (icpu) { + pr_debug("ignoring cpu idle states\n"); + icpu =3D NULL; + } + } if (icpu) { if (icpu->state_table) cpuidle_state_table =3D icpu->state_table; --=20 2.47.0