Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2022 14:08:02 -0500
From:      mike tancsa <mike@sentex.net>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>, Ian Smith <smithi@nimnet.asn.au>, Kevin Oberman <rkoberman@gmail.com>
Subject:   Re: RELENG_13 and min cpu frequency
Message-ID:  <f5b51083-4bc4-2ee2-befd-b2356a781189@sentex.net>
In-Reply-To: <9d17ea30-4b10-2aa3-9d09-017da7423844@sentex.net>
References:  <9d17ea30-4b10-2aa3-9d09-017da7423844@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/18/2022 4:28 PM, mike tancsa wrote:
> I noticed that when I moved from an old RELENG11 to RELENG13 firewall, 
> I was starting to get dropped packets.  Looking at when it was 
> happening, it actually seems to happen at times where the network load 
> is really low?!?!  When I see a high PPS or high bandwidth, I dont get 
> overruns on the nic.  Trying to figure out whats going on, it seems to 
> correlate with when the CPU reduces its frequency to save on power. 
> When its in turbo mode, it scales up to 4300, but then in the quiet 
> hours, it goes down to 800 and that seems to be when I start getting 
> the odd overrun.
>
OK, some possible progress. I noticed that

  sysctl -a dev.cpufreq.0.freq_driver
dev.cpufreq.0.freq_driver: hwpstate_intel0

Looking at the man page

dev.hwpstate_intel.%d.epp
              Energy/Performance Preference.  Valid values range from 0 
to 100.
              Setting this field conveys a hint to the hardware regarding a
              preference towards performance (at value 0), energy efficiency
              (at value 100), or somewhere in between.

it defaults to 50.  I changed the value to 5

sysctl -w dev.hwpstate_intel.0.epp=5


Looking at the freq value

dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410
dev.cpu.0.freq: 4410


Should have a better sense in a couple of days

     ---Mike


> e.g. printing it out every second, I see
>
> while true
> do
> /sbin/sysctl -n dev.cpu.0.freq
> sleep 1
> done
>
> 4308
> 4308
> 4308
> 4308
> 1902
> 900
> 900
> 900
> 4308
> 4308
> 4308
> 4308
> 4308
>
>    Whats the best way to set the box NOT to scale down the CPU below a 
> certain frequency ? I want to see if not letting it drop below 3000 
> prevents packet overruns when there is a burst of traffic from a time 
> of things being quiet ?
>
> Setting debug.cpufreq.lowest: to 3000 does not seem to make a difference
>
> dev.cpu.0.cx_method: C1/hlt
> dev.cpu.0.cx_usage_counters: 229391593
> dev.cpu.0.cx_usage: 100.00% last 87us
> dev.cpu.0.cx_lowest: C1
> dev.cpu.0.cx_supported: C1/1/0
> dev.cpu.0.freq_levels: 3400/-1
> dev.cpu.0.freq: 1302
> dev.cpu.0.temperature: 43.0C
> dev.cpu.0.coretemp.throttle_log: 0
> dev.cpu.0.coretemp.tjmax: 100.0C
> dev.cpu.0.coretemp.resolution: 1
> dev.cpu.0.coretemp.delta: 57
> dev.cpu.0.%parent: acpi0
> dev.cpu.0.%pnpinfo: _HID=none _UID=0 _CID=none
> dev.cpu.0.%location: handle=\_SB_.PR00
> dev.cpu.0.%driver: cpu
> dev.cpu.0.%desc: ACPI CPU
>
> sysctl -A debug.cpufreq
> debug.cpufreq.verbose: 0
> debug.cpufreq.lowest: 0
>
>
> CPU is CPU: Intel(R) Xeon(R) E-2226G CPU @ 3.40GHz (3400.00-MHz 
> K8-class CPU)
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f5b51083-4bc4-2ee2-befd-b2356a781189>