From: Guenter Roeck <linux@roeck-us.net>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH v3] hwmon: coretemp: avoid RDMSR interruptions to isolated CPUs
Date: Wed, 28 Dec 2022 07:59:37 -0800 [thread overview]
Message-ID: <20221228155937.GA64676@roeck-us.net> (raw)
In-Reply-To: <Y5zT6B1mY9/pnwJV@tpad>
On Fri, Dec 16, 2022 at 05:24:08PM -0300, Marcelo Tosatti wrote:
> 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@redhat.com>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> 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
next prev parent reply other threads:[~2022-12-28 15:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 12:42 [PATCH] hwmon: coretemp: avoid RDMSR interruptions to isolated CPUs Marcelo Tosatti
2022-12-15 14:22 ` Guenter Roeck
2022-12-16 14:07 ` [PATCH v2] " Marcelo Tosatti
2022-12-16 17:56 ` Guenter Roeck
2022-12-16 20:24 ` [PATCH v3] " Marcelo Tosatti
2022-12-28 15:59 ` Guenter Roeck [this message]
2022-12-23 10:48 ` [PATCH] " Dan Carpenter
2022-12-26 12:43 ` Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221228155937.GA64676@roeck-us.net \
--to=linux@roeck-us.net \
--cc=fenghua.yu@intel.com \
--cc=frederic@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox