[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5zT6B1mY9/pnwJV@tpad>
Date: Fri, 16 Dec 2022 17:24:08 -0300
From: Marcelo Tosatti <mtosatti@...hat.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Fenghua Yu <fenghua.yu@...el.com>, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org,
Frederic Weisbecker <frederic@...nel.org>
Subject: [PATCH v3] hwmon: coretemp: avoid RDMSR interruptions to isolated
CPUs
The coretemp driver uses rdmsr_on_cpu calls to read
MSR_IA32_PACKAGE_THERM_STATUS/MSR_IA32_THERM_STATUS registers,
which contain information about current core temperature.
For certain low latency applications, the RDMSR interruption exceeds
the applications requirements.
So do not create core files in sysfs, for CPUs which have
isolation and nohz_full enabled.
Temperature information from the housekeeping cores should be
sufficient to infer die temperature.
Signed-off-by: Marcelo Tosatti <mtosatti@...hat.com>
---
v3: do not create sysfs files for isolated CPUs (Guenter Roeck)
v2: improve changelog to mention that an error is returned,
and sysfs file is not disabled (Guenter Roeck)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 9bee4d33fbdf..619dfde7a712 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -27,6 +27,7 @@
#include <asm/msr.h>
#include <asm/processor.h>
#include <asm/cpu_device_id.h>
+#include <linux/sched/isolation.h>
#define DRVNAME "coretemp"
@@ -458,6 +459,9 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
u32 eax, edx;
int err, index, attr_no;
+ if (!housekeeping_cpu(cpu, HK_TYPE_MISC))
+ return 0;
+
/*
* Find attr number for sysfs:
* We map the attr number to core id of the CPU
Powered by blists - more mailing lists