On Mon, Mar 17, 2025 at 01:21:43PM -0500, Brian Conway wrote:
> On Mon, Mar 17, 2025, at 1:16 PM, Peter Toth wrote:
> > Hi all,
> >
> > There used to be a -C switch for apm/apmd for "cool" mode, where the
> > automatic performance adjustment mode would throttle down CPU
> > frequency regardless of AC power status.
Actually -C has been an alias for -A ("auto") since some years
already. But "auto" slightly changed its meaning back in 2021,
> > Currently auto mode goes to highest frequency (+turbo) while on AC
> > power, this is good when connected to mains at room temperature, but
> > not so great in hotter climates and/or while connected to a power
> > bank.
> >
> > Is there any appetite to perhaps introduce a new hw.perfpolicy=battery
> > or similar to retain the same mode as auto with no AC power?
> >
> > Looking at sys/kern/sched_bsd.c this should be a fairly trivial change.
> >
> > Any thoughts?
> >
> > Thanks,
> > PT
>
> The following is in -current, does it help you or have I misread your
> intention?
>
> https://github.com/openbsd/src/commit/cc51e07cb96c0af80015d0d86e1e7f01cbaab662
This should indeed solve Peter's concern. Either using apmd -A which
will force "auto" mode even on AC power, by directly using sysctl
hw.perfpolicy=auto.
This reminds me that the documentation of apm(8)/apmd(8) is lacking in
this regard, something I'd like to fix before the next release.
--
jca