[RFC] Patch to enable temperature ceiling in powerd

Alexandre "Sunny" Kovalenko alex.kovalenko at verizon.net
Thu Feb 7 03:19:31 UTC 2008


On Mon, 2008-02-04 at 23:20 -0500, Alexandre "Sunny" Kovalenko wrote:
> On Thu, 2008-01-31 at 05:35 -0500, John Baldwin wrote:
> > On Wednesday 30 January 2008 05:56:19 pm Alexandre "Sunny" Kovalenko wrote:
> > > Some time ago I have put together patch for powerd, which allows user to
> > > specify the temperature threshold at which powerd will lower CPU
> > > frequency no matter what the load was at the time. I recently had to
> > > adapt it to the 7.0-PRERELEASE for someone with the overheating laptop,
> > > which got me to think that it might be useful for someone else yet.
> > > 
> > > Basic idea is fairly simple -- check temperature in TZ0 and, if it has
> > > reached certain value, either override frequency with the lowest
> > > available (in the case of 'max' setting) or change idle time to 100% and
> > > let adaptive algorithm decrease frequency gradually.
> > > 
> > > I imagine it also could be poor man's substitute for the low noise
> > > acoustic policy ;)
> > > 
> > > If there is an interest, I will go ahead and submit a PR, otherwise it
> > > will live in the mail archives for someone to find. Any comments,
> > > suggestions or criticisms are welcome.
> > > 
> > > Temperature threshold (in Celsius) could be set by means of '-T' command
> > > line option (as in '-T 60').
> > 
> > A couple of suggestions:
> > 
> > - I would make the default temperature 0 instead of 200 and just disable the
> >   feature altogether if it is set to 0 (i.e. don't read the current
> >   temperature and don't do any checks if it is 0).
> > - I would allow the temperature to be specified in either C, K or F with a
> >   suffix to indicate the scale.  (e.g., "80C", "120F", "300K")
> > - I would let the thermal zone name be configurable with a default of "tz0".
> >   (e.g. "-z tz3").  You would then snprintf the sysctl mib name that gets
> >   passed to sysctlbyname(3).
> > 
I have filed 

bin/120336: [patch] Enable temperature ceiling in powerd

with the patch, implementing what was outlined above including
suggestions from John Baldwin. It should apply cleanly to the version
1.21 of powerd.c and version 1.10 of powerd.8. It has been running on my
ThinkPad X60 for a while, and some older versions were used by at least
two other people.

Thanks go to Ian Smith for reviewing it from the functional standpoint
and for style(9) compliance.

Patch, attached to the PR, is the combination of the two patches,
attached to this E-mail due to the fact that PR web form only allows
single file to be attached.

-- 
Alexandre "Sunny" Kovalenko (Олександр Коваленко)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: powerd.8.patch
Type: text/x-patch
Size: 1438 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-acpi/attachments/20080207/c417f09e/powerd.8.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: powerd.c.patch
Type: text/x-patch
Size: 7278 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-acpi/attachments/20080207/c417f09e/powerd.c.bin


More information about the freebsd-acpi mailing list