Re: Confusion about hw.cpuspeed

2024-03-15 Thread Christer Solskogen via misc
On Fri, Mar 15, 2024 at 2:02 PM Zé Loff via misc  wrote:
>
> Hope this clears things up.
>

Ah, now I understand. Thank you! :-)

-- 
chs



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Zé Loff via misc


On Fri, Mar 15, 2024 at 01:07:22PM +0100, Christer Solskogen via misc wrote:
> On Fri, Mar 15, 2024 at 11:43 AM Zé Loff via misc  wrote:
> 
> > Your cpu*.frequency lines show you that it does.
> 
> In that case, what does hw.cpuspeed mean?
> 

Jonathan Gray already told you that:

> > hw.cpuspeed is only updated when a set speed is selected by the kernel.
> > With turbo mode the hardware continually changes the speed without
> > notifying the kernel.

You have

cpu0: Enhanced SpeedStep 2693 MHz: speeds: 1701, 1700, 1600, 1500, 1400, 
1300, 1200, 1100, 1000, 900, 800 MHz

on your dmesg, so you have a CPU that is meant to run at (up to)
1700MHz, but can go to 2700MHz in turbo mode.

The 1701Mhz speed ("normal max" + 1) is the speed that the kernel needs
to set to get it into turbo mode.  So, when 

hw.cpuspeed=1701

it means your CPU is running in turbo mode.  If you or the kernel wants
to throttle it down to save power, hw.cpuspeed will change to something
lower.

As Jonathan said, when in turbo mode, the CPU it won't tell the kernel
about speed changes, but you can always get them from the
hw.sensors.cpu*.frequency readings.  Which, incidentally, might not even
be the same for each CPU core, as they are throttled differently:

   $ sysctl hw.sensors | grep frequency0
   hw.sensors.cpu0.frequency0=245000.00 Hz
   hw.sensors.cpu1.frequency0=27.00 Hz
   hw.sensors.cpu2.frequency0=285000.00 Hz
   hw.sensors.cpu3.frequency0=235000.00 Hz

Hope this clears things up.

Cheers
Zé

P.S.: I'm by no means whatsoever an authority on this matter.  I'm
replying because you asked me directly.  

-- 



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Christer Solskogen via misc
On Fri, Mar 15, 2024 at 11:43 AM Zé Loff via misc  wrote:

> Your cpu*.frequency lines show you that it does.

In that case, what does hw.cpuspeed mean?



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Zé Loff via misc
On Fri, Mar 15, 2024 at 10:09:37AM +0100, Christer Solskogen via misc wrote:
> On Fri, Mar 15, 2024 at 10:00 AM Jonathan Gray  wrote:
> >
> > On Fri, Mar 15, 2024 at 08:49:14AM +0100, Christer Solskogen via misc wrote:
> > > On Fri, Mar 15, 2024 at 1:15 AM Jonathan Gray  wrote:
> > > >
> > >
> > > > The 1MHz higher is the turbo setting.  When speedstep speeds are shown
> > > > in dmesg it is the highest.
> > > >
> > > > The sensors use cpu_hz_update_sensor().
> > > >
> > >
> > > I don't understand. dmesg says this:
> > > cpu0: Intel(R) N95, 2693.79 MHz, 06-be-00, patch 0015
> > >
> > > But hw.cpuspeed stays the same no matter what happens.
> >
> > your dmesg will have a "Enhanced SpeedStep" line, for example:
> > cpu0: Enhanced SpeedStep 2494 MHz: speeds: 2601, 2600, 2500, 2300, 2100, 
> > 2000, 1800, 1700, 1500, 1400, 1200, 1100, 900, 800, 600, 500 MHz
> >
> > hw.cpuspeed is only updated when a set speed is selected by the kernel.
> > With turbo mode the hardware continually changes the speed without
> > notifying the kernel.
> >
> > to force the lowest non-turbo mode
> >
> > sysctl hw.perfpolicy=manual
> > sysctl hw.setperf=0
> >
> 
> Ah, yes.
> cpu0: Enhanced SpeedStep 2693 MHz: speeds: 1701, 1700, 1600, 1500,
> 1400, 1300, 1200, 1100, 1000, 900, 800 MHz
> 
> I wonder why it never reaches 2,6GHz.
> 

Your cpu*.frequency lines show you that it does.

-- 
 



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Christer Solskogen via misc
On Fri, Mar 15, 2024 at 10:00 AM Jonathan Gray  wrote:
>
> On Fri, Mar 15, 2024 at 08:49:14AM +0100, Christer Solskogen via misc wrote:
> > On Fri, Mar 15, 2024 at 1:15 AM Jonathan Gray  wrote:
> > >
> >
> > > The 1MHz higher is the turbo setting.  When speedstep speeds are shown
> > > in dmesg it is the highest.
> > >
> > > The sensors use cpu_hz_update_sensor().
> > >
> >
> > I don't understand. dmesg says this:
> > cpu0: Intel(R) N95, 2693.79 MHz, 06-be-00, patch 0015
> >
> > But hw.cpuspeed stays the same no matter what happens.
>
> your dmesg will have a "Enhanced SpeedStep" line, for example:
> cpu0: Enhanced SpeedStep 2494 MHz: speeds: 2601, 2600, 2500, 2300, 2100, 
> 2000, 1800, 1700, 1500, 1400, 1200, 1100, 900, 800, 600, 500 MHz
>
> hw.cpuspeed is only updated when a set speed is selected by the kernel.
> With turbo mode the hardware continually changes the speed without
> notifying the kernel.
>
> to force the lowest non-turbo mode
>
> sysctl hw.perfpolicy=manual
> sysctl hw.setperf=0
>

Ah, yes.
cpu0: Enhanced SpeedStep 2693 MHz: speeds: 1701, 1700, 1600, 1500,
1400, 1300, 1200, 1100, 1000, 900, 800 MHz

I wonder why it never reaches 2,6GHz.



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Jonathan Gray
On Fri, Mar 15, 2024 at 08:49:14AM +0100, Christer Solskogen via misc wrote:
> On Fri, Mar 15, 2024 at 1:15 AM Jonathan Gray  wrote:
> >
> 
> > The 1MHz higher is the turbo setting.  When speedstep speeds are shown
> > in dmesg it is the highest.
> >
> > The sensors use cpu_hz_update_sensor().
> >
> 
> I don't understand. dmesg says this:
> cpu0: Intel(R) N95, 2693.79 MHz, 06-be-00, patch 0015
> 
> But hw.cpuspeed stays the same no matter what happens.

your dmesg will have a "Enhanced SpeedStep" line, for example:
cpu0: Enhanced SpeedStep 2494 MHz: speeds: 2601, 2600, 2500, 2300, 2100, 2000, 
1800, 1700, 1500, 1400, 1200, 1100, 900, 800, 600, 500 MHz

hw.cpuspeed is only updated when a set speed is selected by the kernel.
With turbo mode the hardware continually changes the speed without
notifying the kernel.

to force the lowest non-turbo mode

sysctl hw.perfpolicy=manual
sysctl hw.setperf=0



Re: Confusion about hw.cpuspeed

2024-03-15 Thread Christer Solskogen via misc
On Fri, Mar 15, 2024 at 1:15 AM Jonathan Gray  wrote:
>

> The 1MHz higher is the turbo setting.  When speedstep speeds are shown
> in dmesg it is the highest.
>
> The sensors use cpu_hz_update_sensor().
>

I don't understand. dmesg says this:
cpu0: Intel(R) N95, 2693.79 MHz, 06-be-00, patch 0015

But hw.cpuspeed stays the same no matter what happens.



Re: Confusion about hw.cpuspeed

2024-03-14 Thread Jonathan Gray
On Thu, Mar 14, 2024 at 03:07:22PM +0100, Christer Solskogen via misc wrote:
> I've got a hold of two iKOOLCORE R2 today and installed OpenBSD(latest
> amd64 snapshot) on them, but I can't seem to wrap my head around if
> it's running at full speed or not.
> 
> hugs# sysctl hw
> hw.machine=amd64
> hw.model=Intel(R) N95
> hw.ncpu=4
> hw.byteorder=1234
> hw.pagesize=4096
> hw.disknames=sd0:d93f521d3c55b907,sd1:
> hw.diskcount=2
> hw.sensors.cpu0.temp0=44.00 degC
> hw.sensors.cpu0.frequency0=27.00 Hz
> hw.sensors.cpu1.frequency0=27.00 Hz
> hw.sensors.cpu2.frequency0=27.00 Hz
> hw.sensors.cpu3.frequency0=27.00 Hz
> hw.sensors.acpitz0.temp0=27.80 degC (zone temperature)
> hw.cpuspeed=1701
> hw.setperf=100
> hw.vendor=iKOOLCORE TECHNOLOGY
> hw.product=iKOOLCORE R2
> hw.version=Default string
> hw.serialno=VME50IKLGT8
> hw.uuid=20231018-4682-2636-0882-000392308688
> hw.physmem=8272797696
> hw.usermem=8272670720
> hw.ncpufound=4
> hw.allowpowerdown=1
> hw.perfpolicy=auto
> hw.smt=0
> hw.ncpuonline=4
> hw.power=1
> hw.ucomnames=
> 
> hw.cpuspeed seems to suggest that it's running on 1701MH, even if
> apmd(-A) is running and/or if I have full load on the machine. While
> hw.sensors.cpu*.frequency0 seems to suggest otherwise. That seems to

The 1MHz higher is the turbo setting.  When speedstep speeds are shown
in dmesg it is the highest.

The sensors use cpu_hz_update_sensor().