From patchwork Fri Dec 20 21:36:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sohil Mehta X-Patchwork-Id: 852769 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 9625322687C; Fri, 20 Dec 2024 21:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734730760; cv=none; b=ITZKiH1dkc1Wz1Uix21Ulh/jrMY4lvnHme4rjP+ZrN6mBfdMWZkBjq18hFEXNCsbYlrrQqR2IqyDmetj9N2nanL6W2XOv5jHzl3hZoOmGV5wP4qnHFaOZc4LGsoNzIMqDlr1fChMz4oJ3erNfrXlsBCColEvtcAN8JkzNJ/jnYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734730760; c=relaxed/simple; bh=2gP+CtCrc5rkz2Pvmazx/u1oV3mo36Q6cxwLGcuRBdY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ThomjsgHZ4dvxYug8eAsCegcqMueQhKqwItrcwZUSMUurGbB/dnT8i0seqEhu8HaawdYGZFwSsBqOlQNnHrqxC7cCvy0JuzYuGyM+kEryAbGCWrS/DhSAhflo2Uvi3vvhb5wT2SpeVVB4c45ryEwOXqfGyFS8dcAAtP4jE+RLPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RJOMpupn; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RJOMpupn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734730759; x=1766266759; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2gP+CtCrc5rkz2Pvmazx/u1oV3mo36Q6cxwLGcuRBdY=; b=RJOMpupnvjYzQNkOSesviR4Q70w/ENCWkGjwuNkRXSw0YG9+X3OA4vvK WCQkK92Ury+iwrwULk/wRhstInR3S3eZk9t6ZmJQdAeYVavqymXYUR7P3 MUhmIfW/7iZtAE372tn/Y/YuoFdxKKjOr29H3eeHKq4qCbMdPBTrdGw8V sgKDe0HaExtqlqlLl7MfHT3qDuMPyNVOxA/aTQDW1LK2omjsU1m22/qhQ S/eB0+Z6veRj4ScsujvGneiOaZpKvqx+D+b1h4gG9WPMceUNdURLFFPaZ 5KL4Ok+/BJyP2/42nqSKtPgDmWjc0Zs8vZ2a5Em8ArB+3E9D2mDd5oN2F g==; X-CSE-ConnectionGUID: h8Io7ZpiSxO5nxL6rG8KpQ== X-CSE-MsgGUID: KKhG7lGxSP+a44zw33qSRg== X-IronPort-AV: E=McAfee;i="6700,10204,11292"; a="39070654" X-IronPort-AV: E=Sophos;i="6.12,251,1728975600"; d="scan'208";a="39070654" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2024 13:39:16 -0800 X-CSE-ConnectionGUID: z1wT93DdRuafVZNCbYP0Ig== X-CSE-MsgGUID: G3ak4Tt9TOq/u2dy0GsdVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="103223838" Received: from sohilmeh.sc.intel.com ([172.25.103.65]) by fmviesa005.fm.intel.com with ESMTP; 20 Dec 2024 13:39:15 -0800 From: Sohil Mehta To: x86@kernel.org, Dave Hansen , Tony Luck Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , "Rafael J . Wysocki" , Len Brown , Andy Lutomirski , Viresh Kumar , Fenghua Yu , Jean Delvare , Guenter Roeck , Sohil Mehta , Zhang Rui , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: [RFC PATCH 04/15] cpufreq: Fix the efficient idle check for Intel extended families Date: Fri, 20 Dec 2024 21:36:59 +0000 Message-ID: <20241220213711.1892696-5-sohil.mehta@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220213711.1892696-1-sohil.mehta@intel.com> References: <20241220213711.1892696-1-sohil.mehta@intel.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 should_io_be_busy() only considers certain family 6 CPUs as having efficient idling. However, Arjan (the original author) says that choice was due to the lack of testing done on the old systems. He suggests to consider all Intel processors as having efficient idle. Extend the check to all processors starting with family 6. Signed-off-by: Sohil Mehta --- drivers/cpufreq/cpufreq_ondemand.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index a7c38b8b3e78..dfafb161f1c4 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -15,6 +15,10 @@ #include #include +#ifdef CONFIG_X86 +#include +#endif + #include "cpufreq_ondemand.h" /* On-demand governor macros */ @@ -32,8 +36,7 @@ static unsigned int default_powersave_bias; /* * Not all CPUs want IO time to be accounted as busy; this depends on how * efficient idling at a higher frequency/voltage is. - * Pavel Machek says this is not so for various generations of AMD and old - * Intel systems. + * Pavel Machek says this is not so for various generations of AMD. * Mike Chan (android.com) claims this is also not true for ARM. * Because of this, whitelist specific known (series) of CPUs by default, and * leave all others up to the user. @@ -42,11 +45,11 @@ static int should_io_be_busy(void) { #if defined(CONFIG_X86) /* - * For Intel, Core 2 (model 15) and later have an efficient idle. + * Starting with Family 6 consider all Intel CPUs to have an + * efficient idle. */ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && - boot_cpu_data.x86 == 6 && - boot_cpu_data.x86_model >= 15) + boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO) return 1; #endif return 0;