Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-06 Thread Lev Serebryakov
On 06.09.2018 4:15, Benjamin Kaduk wrote:

> Okay, "system openssl" and the FreeBSD version is enough to nail down the
> code and configuration, and I see the processor type is in the subject
> line.  I guess posting the CPU features bits from dmesg might save whoever
> tries to track down the codepaths being used some time (unless that was
> posted already and I missed it?).

CPU: Intel(R) Celeron(R) CPU  J3160  @ 1.60GHz (1600.05-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x406c4  Family=0x6  Model=0x4c  Stepping=4

Features=0xbfebfbff

Features2=0x43d8e3bf
  AMD Features=0x28100800
  AMD Features2=0x101
  Structured Extended Features=0x2282
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics

And here are two outputs of turbostat with additional settings:

turbostat, Turbo DISABLED:

CPUID(0): GenuineIntel 11 CPUID levels; family:model:stepping 0x6:4c:4
(6:76:4)
CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM TM
CPUID(6): APERF, No-TURBO, DTS, No-PTM, No-HWP, No-HWPnotify,
No-HWPwindow, No-HWPepp, No-HWPpkg, EPB
cpu3: MSR_IA32_MISC_ENABLE: 0x4000850089 (TCC EIST No-MWAIT PREFETCH
No-TURBO)
CPUID(7): No-SGX
cpu3: MSR_PLATFORM_INFO: 0x60002001400
6 * 133.3 = 800.0 MHz max efficiency frequency
20 * 133.3 = 2666.6 MHz base frequency
cpu3: MSR_IA32_POWER_CTL: 0x (C1E auto-promotion: DISabled)
cpu3: MSR_TURBO_RATIO_LIMIT: 0x
cpu3: MSR_PKG_CST_CONFIG_CONTROL: 0x0014000f (UNlocked:
pkg-cstate-limit=15: unknown)
NSFOD /sys/devices/system/cpu/cpu3/cpufreq/scaling_driver
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x (performance)
cpu2: MSR_IA32_ENERGY_PERF_BIAS: 0x (performance)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x005a (90 C)
cpu2: MSR_IA32_TEMPERATURE_TARGET: 0x005a (90 C)

turbostat, Turbo ENABLED:

CPUID(0): GenuineIntel 11 CPUID levels; family:model:stepping 0x6:4c:4
(6:76:4)
CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM TM
CPUID(6): APERF, TURBO, DTS, No-PTM, No-HWP, No-HWPnotify, No-HWPwindow,
No-HWPepp, No-HWPpkg, EPB
cpu1: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST No-MWAIT PREFETCH TURBO)
CPUID(7): No-SGX
cpu1: MSR_PLATFORM_INFO: 0x60002001400
6 * 133.3 = 800.0 MHz max efficiency frequency
20 * 133.3 = 2666.6 MHz base frequency
cpu1: MSR_IA32_POWER_CTL: 0x (C1E auto-promotion: DISabled)
cpu1: MSR_TURBO_RATIO_LIMIT: 0x
cpu1: MSR_PKG_CST_CONFIG_CONTROL: 0x0014000f (UNlocked:
pkg-cstate-limit=15: unknown)
NSFOD /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x (performance)
cpu2: MSR_IA32_ENERGY_PERF_BIAS: 0x (performance)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x005a (90 C)
cpu2: MSR_IA32_TEMPERATURE_TARGET: 0x005a (90 C)

-- 
// Lev Serebryakov
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-06 Thread Lev Serebryakov
On 06.09.2018 4:15, Benjamin Kaduk wrote:

> Okay, "system openssl" and the FreeBSD version is enough to nail down the
> code and configuration, and I see the processor type is in the subject
> line.  I guess posting the CPU features bits from dmesg might save whoever
> tries to track down the codepaths being used some time (unless that was
> posted already and I missed it?).
 I'll post it tonight, but I don't think it is very openssl-specific or
thermal throttling. I've monitored temperatures, of course, and
monitored frequencies with turbostat. With Turbo enabled freuqnces jumps
wildly and were lower than with Turbo disabled. And anyway, even
frequencies jumps were not large enough to explain x3.5 difference.

 Another thing which puzzles me, that with Turbo disabled (!) I see
frequencies 2666MHz accroding to turbostat, which seems impossible, as
it is higher than official Turbo frequency (!). I don't know how to
explain this. Maybe, turbostat fails?


-- 
// Lev Serebryakov
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Benjamin Kaduk
On Thu, Sep 06, 2018 at 03:02:29AM +0300, Lev Serebryakov wrote:
> Hello Benjamin,
> 
> Thursday, September 6, 2018, 1:32:46 AM, you wrote:
> 
> >> > I don't think you need something accurate.
> >>  Ok, here is results. I'm working in single-user mode.
> >> 
> >>  TL;DR "Turbo" mode make "openssl" much slower (x3.5)!
> >> 
> >>  I can not properly interpret this result.
> 
> > You need to say more about what openssl is doing (i.e., how it was
> > configured, what architecture it's on, etc.).  In particular, there
> > was for a time an AVX2 implementation for some primitives, that ended up
> > being a net loss, since heavy use of those instructions would cause
> > overheating and throttling.  OpenSSL has a lot of custom assembly for these
> > common primitves, with some logic to select among them both at
> > configuration time and at runtime, so results such as this may or may not
> > be widely transferrable.
> 
>  It is system (very fresh ALPHA4) openssl, built with default settings.
>  Simple single run with one thread, without AES-NI:
> 
>  openssl speed aes-256-cbc
> 
>  It is as simple as that.

Okay, "system openssl" and the FreeBSD version is enough to nail down the
code and configuration, and I see the processor type is in the subject
line.  I guess posting the CPU features bits from dmesg might save whoever
tries to track down the codepaths being used some time (unless that was
posted already and I missed it?).

-Ben
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Lev Serebryakov
Hello Benjamin,

Thursday, September 6, 2018, 1:32:46 AM, you wrote:

>> > I don't think you need something accurate.
>>  Ok, here is results. I'm working in single-user mode.
>> 
>>  TL;DR "Turbo" mode make "openssl" much slower (x3.5)!
>> 
>>  I can not properly interpret this result.

> You need to say more about what openssl is doing (i.e., how it was
> configured, what architecture it's on, etc.).  In particular, there
> was for a time an AVX2 implementation for some primitives, that ended up
> being a net loss, since heavy use of those instructions would cause
> overheating and throttling.  OpenSSL has a lot of custom assembly for these
> common primitves, with some logic to select among them both at
> configuration time and at runtime, so results such as this may or may not
> be widely transferrable.

 It is system (very fresh ALPHA4) openssl, built with default settings.
 Simple single run with one thread, without AES-NI:

 openssl speed aes-256-cbc

 It is as simple as that.

-- 
Best regards,
 Levmailto:l...@freebsd.org

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Benjamin Kaduk
On Wed, Sep 05, 2018 at 07:27:06PM +0300, Lev Serebryakov wrote:
> On 05.09.2018 17:51, Cy Schubert wrote:
> 
> > I don't think you need something accurate.
>  Ok, here is results. I'm working in single-user mode.
> 
>  TL;DR "Turbo" mode make "openssl" much slower (x3.5)!
> 
>  I can not properly interpret this result.

You need to say more about what openssl is doing (i.e., how it was
configured, what architecture it's on, etc.).  In particular, there
was for a time an AVX2 implementation for some primitives, that ended up
being a net loss, since heavy use of those instructions would cause
overheating and throttling.  OpenSSL has a lot of custom assembly for these
common primitves, with some logic to select among them both at
configuration time and at runtime, so results such as this may or may not
be widely transferrable.

-Ben
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Lev Serebryakov
On 05.09.2018 17:51, Cy Schubert wrote:

> I don't think you need something accurate.
 Ok, here is results. I'm working in single-user mode.

 TL;DR "Turbo" mode make "openssl" much slower (x3.5)!

 I can not properly interpret this result.

 But "turbostat" properly detect Turbo/No-Turbo mode, so it is not
mistake in BIOS.

(1) Trubo ENABLED, powerd IS NOT started

  dev.cpu.0.freq=480 no matter what.

  turbostat shows DIFFERENT speeds, like this (I've removed IRQ-related
fields to fit in one line):

Package Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c1 CPU%c3 CPU%c6
-   --   2   0.30  135916006.18   0.00   93.52  31
0   00   2   0.36  863 16000.08   0.00   99.56  31
0   11   4   0.47  1462160024.56  0.00   74.96  31
1   02   2   0.22  167016000.05   0.00   99.72  29
1   13   2   0.14  179216000.02   0.00   99.84  29

 "openssl speed aes-256-cbc":

type16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes
aes-256 cbc 5653.98k 6159.49k 6356.31k17271.70k17517.23k

(2) Trubo ENABLED, powerd IS started

  dev.cpu.0.freq shows different values, from 60 in idle to 1601 under load.

 turbostat shows same values, but at idle Bzy_MHz drops low.

 openssl is the same

type16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes
aes-256 cbc 5580.78k 6155.97k 6349.23k17273.51k17511.77k

(3) Trubo DISABLED, powerd IS NOT started

  dev.cpu.0.freq=1600 no matter what.

  turbostat shows higher numbers:

Package Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c1 CPU%c3 CPU%c6
-   --   2   0.21  180716001.44   0.00   98.35   38
0   00   3   0.28  176416000.06   0.00   99.66   38
0   11   3   0.24  205216001.72   0.00   98.03   38
1   02   1   0.09  162916000.02   0.00   99.89   36
1   13   2   0.22  166416003.94   0.00   95.84   36

 "openssl speed aes-256-cbc":

type16 bytes 64 bytes 256 bytes   1024 bytes   8192 bytes
aes-256 cbc 18939.95k20638.71k21281.24k57836.36k58736.39k

 (3.5 times faster that with Turbo ENABLED!)

(4) Trubo DISABLED, powerd IS started

  dev.cpu.0.freq shows different values, from 60 in idle to 1600 under load.

 turbostat shows very low Bzy_MHz on idle, but high (suspiciously high)
under load:

Package Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz  CPU%c1 CPU%c3 CPU%c6
-   --   147592.22 26661600 1.66   0.00   6.1241
0   00   147592.22 26661600 1.62   0.00   6.1641
0   11   147592.21 26661600 1.41   0.00   6.3841
1   02   147592.21 26661600 1.78   0.00   6.0138
1   13   147692.24 26661600 1.84   0.00   5.9238


 openssl is almost the same

type16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes
aes-256 cbc 16277.18k20620.71k21272.10k57998.35k58687.83k

-- 
// Lev Serebryakov
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Lev Serebryakov
On 05.09.2018 17:51, Cy Schubert wrote:

> I don't think you need something accurate.
 1.6GHz and 2.48Ghz.. Maybe... I i'm trying now.

> We don't know whether it is implemented through ACPI or similar to the
> old turbo jumper on the MB, which increased the clock rate and sometimes
> the voltage ( required to maintain stability when increasing the clock
> rate). We don't know how your MB manufacturer implemented this.
 I thought, it could be implemented only in one? official, way, as it is
Intel's official technology, and not MoBo's one.
-- 
// Lev Serebryakov
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


RE: Celeron J3160 with enabled Turbo mode stays at 480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Cy Schubert
I don't think you need something accurate.

We don't know whether it is implemented through ACPI or similar to the old 
turbo jumper on the MB, which increased the clock rate and sometimes the 
voltage ( required to maintain stability when increasing the clock rate). We 
don't know how your MB manufacturer implemented this.

My guess is it's probably through ACPI but you don't know until you have some 
rough measurements.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
Also, this old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Lev Serebryakov
Sent: 05/09/2018 06:46
To: Cy Schubert; Eric van Gyzen
Cc: FreeBSD Current; freebsd-hack...@freebsd.org
Subject: Re: Celeron J3160 with enabled Turbo mode stays at 
480MHz(lowestsetting) forever and can not lower frequency without Tuebo mode

On 05.09.2018 15:53, Cy Schubert wrote:

>> 1601 is not the actual frequency.  That is just how it is reported.  It 
>> is almost certainly running much higher than 1601.
> 
> We don't know this until we can independently verify it. Do you mind 
> running some benchmarks with and without turbo mode?
 What could be adequate benchmarks for this? Something likje "openssl
speed aes128-cbc" or I need more specific one?

-- 
// Lev Serebryakov

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Lev Serebryakov
On 05.09.2018 15:53, Cy Schubert wrote:

>> 1601 is not the actual frequency.  That is just how it is reported.  It 
>> is almost certainly running much higher than 1601.
> 
> We don't know this until we can independently verify it. Do you mind 
> running some benchmarks with and without turbo mode?
 What could be adequate benchmarks for this? Something likje "openssl
speed aes128-cbc" or I need more specific one?

-- 
// Lev Serebryakov
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Cy Schubert
In message <43d68d5a-d8b7-965d-52a6-3eff6cdae...@vangyzen.net>, Eric 
van Gyzen
writes:
> On 9/5/18 4:35 AM, Lev Serebryakov wrote:
> >   BTW, these four settings in rc.conf(5)
> > 
> >performance_cx_lowest
> >performance_cpu_freq
> >economy_cx_lowest
> >economy_cpu_freq
> > 
> > do NOTHING. They are not used ANYWHERE but rc.conf and rc.conf.5!
>
> They are used by /etc/rc.d/power_profile, but not in a way that grep can 
> find.
>
> >   BTW, "Turbo mode enabled + dev.cpu.X.cx_lowset=C3 + powerd" works, but
> > gives only 1601 Mhz, not 2240MHz max:
> > 
> > TURBO ON:
> > dev.cpu.0.freq_levels: 1601/2000 1600/2000 1520/1900 1440/1800 1360/1700 12
> 80/1600 1200/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 640/
> 800 560/700 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75
> > 
> > TURBO OFF:
> > dev.cpu.0.freq_levels: 1600/2000 1520/1900 1440/1800 1360/1700 1280/1600 12
> 00/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 640/800 560/70
> 0 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75
>
> 1601 is not the actual frequency.  That is just how it is reported.  It 
> is almost certainly running much higher than 1601.

We don't know this until we can independently verify it. Do you mind 
running some benchmarks with and without turbo mode?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Eric van Gyzen

On 9/5/18 4:35 AM, Lev Serebryakov wrote:

  BTW, these four settings in rc.conf(5)

   performance_cx_lowest
   performance_cpu_freq
   economy_cx_lowest
   economy_cpu_freq

do NOTHING. They are not used ANYWHERE but rc.conf and rc.conf.5!


They are used by /etc/rc.d/power_profile, but not in a way that grep can 
find.



  BTW, "Turbo mode enabled + dev.cpu.X.cx_lowset=C3 + powerd" works, but
gives only 1601 Mhz, not 2240MHz max:

TURBO ON:
dev.cpu.0.freq_levels: 1601/2000 1600/2000 1520/1900 1440/1800 1360/1700 
1280/1600 1200/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 
640/800 560/700 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75

TURBO OFF:
dev.cpu.0.freq_levels: 1600/2000 1520/1900 1440/1800 1360/1700 1280/1600 
1200/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 640/800 
560/700 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75


1601 is not the actual frequency.  That is just how it is reported.  It 
is almost certainly running much higher than 1601.


Eric
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-05 Thread Lev Serebryakov
Hello Cy,

Wednesday, September 5, 2018, 3:12:34 AM, you wrote:

> Are you running powers?
 powerd? yes. With "adaptive" strategy"

> Do you use c-states?
 Oops. My fault. I've forgot to set cx_lowest to C3 on all cores.
 BTW, these four settings in rc.conf(5)

  performance_cx_lowest
  performance_cpu_freq
  economy_cx_lowest
  economy_cpu_freq

do NOTHING. They are not used ANYWHERE but rc.conf and rc.conf.5!

> What happens if you boot in (instead of switch to) turbo mode?
 Sorry? I could only turn Turbo mode on/off in BIOS before boot.

 BTW, "Turbo mode enabled + dev.cpu.X.cx_lowset=C3 + powerd" works, but
gives only 1601 Mhz, not 2240MHz max:

TURBO ON:
dev.cpu.0.freq_levels: 1601/2000 1600/2000 1520/1900 1440/1800 1360/1700 
1280/1600 1200/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 
640/800 560/700 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75

TURBO OFF:
dev.cpu.0.freq_levels: 1600/2000 1520/1900 1440/1800 1360/1700 1280/1600 
1200/1500 1120/1400 1040/1300 960/1200 880/1100 800/1000 720/900 640/800 
560/700 480/600 420/525 360/450 300/375 240/300 180/225 120/150 60/75

  But I could live with that :-)

-- 
Best regards,
 Levmailto:l...@freebsd.org

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


RE: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) forever and can not lower frequency without Tuebo mode

2018-09-04 Thread Cy Schubert
Are you running powers?

Do you use c-states?

What happens if you boot in (instead of switch to) turbo mode?

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
Also, this old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Lev Serebryakov
Sent: 04/09/2018 13:50
To: FreeBSD Current; freebsd-hack...@freebsd.org
Subject: Celeron J3160 with enabled Turbo mode stays at 480MHz (lowestsetting) 
forever and can not lower frequency without Tuebo mode

Hello FreeBSD,

  I'm installing latest 12-ALPHA4 on new MiniPC with Celeron J3160 CPU. It
 is 1.6GHz CPU with Turbo up to 2.somethingGHz.

  If I enable Turbo mode, after booting to FreeBSD it locks at 480MHz
 according to dev.cpu.0.freq, and simple "openssl" test confirms it.

  If I disable Turbo mode, after booting to FreeBSD it locks at 1600MHz even
 if powerd is running.

  It looks like some bug in interaction between cpufreq and Turbo mode of
 this CPU.

-- 
Best regards,
 Lev  mailto:l...@freebsd.org

___
freebsd-hack...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"