LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* accessing core temp sensors in the kernel
@ 2008-02-15 21:12 Dan Upton
2008-02-18 12:59 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Dan Upton @ 2008-02-15 21:12 UTC (permalink / raw)
To: linux-kernel
I'm trying to do some work on thermally-aware scheduling, specifically
using the coretemp module to access core temperature sensors on the
Intel Core2 platform. I know how to access them from user mode,
reading files from sysfs, but clearly that's not the way to do it in
the kernel. Specifically, I'm not sure how, in the scheduler, to get
copies of the appropriate device structures to call
static struct coretemp_data *coretemp_update_device(struct device *dev)
(in hwmon/coretemp.c).
Can anybody give me pointers where to get started?
Thanks,
-dan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: accessing core temp sensors in the kernel
2008-02-15 21:12 accessing core temp sensors in the kernel Dan Upton
@ 2008-02-18 12:59 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-02-18 12:59 UTC (permalink / raw)
To: Dan Upton; +Cc: linux-kernel
On Fri, 15 Feb 2008 16:12:40 -0500 "Dan Upton" <upton.dan.linux@gmail.com> wrote:
> I'm trying to do some work on thermally-aware scheduling, specifically
> using the coretemp module to access core temperature sensors on the
> Intel Core2 platform. I know how to access them from user mode,
> reading files from sysfs, but clearly that's not the way to do it in
> the kernel. Specifically, I'm not sure how, in the scheduler, to get
> copies of the appropriate device structures to call
>
> static struct coretemp_data *coretemp_update_device(struct device *dev)
>
> (in hwmon/coretemp.c).
>
> Can anybody give me pointers where to get started?
You shouldn't make the core scheduler dependent upon some hwmon module.
I'd sugggest adding some register_cpu_temperature_monitor() function in the
scheduler then permit suitable monitoring modules to register themselves in
their module_init() functions. Use a notifier chain from notifier.h. The
CPU scheduler will walk that chain calling into the registered drivers at a
suitable time.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-18 13:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 21:12 accessing core temp sensors in the kernel Dan Upton
2008-02-18 12:59 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).