Worse performance when power supply plugged in!

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Wed May 29, 2019 10:04 am

Hi,
I tried my luck with cyclictest:

Code: Select all

[root@agantergos ag]# cyclictest -m -Sp98 -i100 -d0 --smi
# /dev/cpu_dma_latency set to 0us
WARN: /dev/cpu/0/msr open failed, try chown or chmod +r /dev/cpu/*/msr, or run as root
FATAL: Could not open MSR interface, errno: 2
WARN: /dev/cpu/1/msr open failed, try chown or chmod +r /dev/cpu/*/msr, or run as root
FATAL: Could not open MSR interface, errno: 2
[root@agantergos ag]#

it does not work as decribed, if run as root or not.

The problem still persists. System performance is terrible when battery is loading, ok when running on battery and ok when plugged in and battery is full.

My workaround is to use a full battery only, which is a bit difficult at times.

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Wed May 29, 2019 12:14 pm

Is the msr module loaded?

Code: Select all

lsmod|grep msr
will tell you.

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Wed May 29, 2019 2:59 pm

Yes.

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Wed May 29, 2019 3:29 pm

OK. To at least get some output from cyclictest leave off --smi:

Code: Select all

# cyclictest -m -Sp98 -i100 -d0

  • -m locks memory so it doesn't end up in the swap space
  • -S use smp. Use all cores
  • -p98 run the test thread at priority 98
  • -i 100 sets the base interval to 100us
  • -d0 distance between threads is zero

To see why --smi isn't working you could try

Code: Select all

# cat /dev/cpu/0/msr
The screen shoulld fill up with numbers. Use crtl-c to stop it.

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Fri May 31, 2019 2:37 pm

Hi,
the first command works (meaning: no errors here), but I do not get any output. I probably miss something, but I do not have any knowledge of cyclictest.

The second command only works as root, my terminal-screen fills instantly then.

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Fri May 31, 2019 2:56 pm

This is what I get :

Code: Select all

$ cyclictest -m -Sp98 -i100 -d0
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 2.24 1.94 1.98 2/577 2087         

T: 0 ( 2084) P:98 I:100 C: 112156 Min:      2 Act:    2 Avg:    3 Max:      35
T: 1 ( 2085) P:98 I:100 C: 112039 Min:      2 Act:    5 Avg:    2 Max:      28
T: 2 ( 2086) P:98 I:100 C: 111913 Min:      2 Act:    4 Avg:    3 Max:      31
T: 3 ( 2087) P:98 I:100 C: 111792 Min:      2 Act:    3 Avg:    2 Max:      25

I ran that as a normal user since it isn't using --smi.

What we want to find out is what happens when you plug the power supply in. You could use

Code: Select all

# journalctl -f
to watch the journal 'live' while you plug the power supply in.

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Sat Jun 01, 2019 1:58 am

There's another way to find out if plugging in the power supply results in SMIs. You can use hwlatdetect, which is another part of rt-tests.

Code: Select all

# hwlatdetect --duration=10
hwlatdetect:  test duration 10 seconds
   detector: tracer
   parameters:
        Latency threshold: 10us
        Sample window:     1000000us
        Sample width:      500000us
     Non-sampling period:  500000us
        Output File:       None

Starting test
test finished
Max Latency: Below threshold
Samples recorded: 0
Samples exceeding threshold: 0

This works by stopping the machine then looking at the CPU time stamp counter. If there are gaps, the gaps must be caused by SMIs. My result above shows I don't have any SMIs.

Run hwlatdetect --duration=10 as root or with sudo without the power supply, then with the power supply. If you are getting SMIs I don't know if it's possible to fix that. :?

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Sat Jun 01, 2019 8:36 pm

Hi,
I get

Code: Select all

sudo hwlatdetect --duration=10
hwlatdetect:  test duration 10 seconds
   detector: tracer
   parameters:
        Latency threshold: 10us
        Sample window:     1000000us
        Sample width:      500000us
     Non-sampling period:  500000us
        Output File:       None

Starting test
test finished
Max Latency: 22us
Samples recorded: 10
Samples exceeding threshold: 10
ts: 1559420907.061897788, inner:19, outer:22
ts: 1559420908.090908167, inner:14, outer:14
ts: 1559420909.104236691, inner:17, outer:17
ts: 1559420910.117565292, inner:15, outer:14
ts: 1559420911.130945201, inner:16, outer:17
ts: 1559420912.144232982, inner:0, outer:14
ts: 1559420913.157591537, inner:16, outer:16
ts: 1559420914.174234547, inner:14, outer:15
ts: 1559420915.184247384, inner:14, outer:14
ts: 1559420916.197586449, inner:14, outer:15
[ag@agantergos ~]$



I have gotten cyclictest to work (with smi), too:

Code: Select all

sudo cyclictest -m -Sp98 -i100 -d0 --smi
[sudo]
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 1.70 1.59 1.38 2/591 7902         

T: 0 ( 7897) P:98 I:100 C: 222798 Min:      1 Act:    3 Avg:    3 Max:      19 SMI:       0
T: 1 ( 7898) P:98 I:100 C: 222746 Min:      1 Act:    6 Avg:    3 Max:      19 SMI:       0
T: 2 ( 7899) P:98 I:100 C: 222677 Min:      1 Act:    3 Avg:    3 Max:      22 SMI:       0
T: 3 ( 7900) P:98 I:100 C: 222642 Min:      1 Act:    3 Avg:    3 Max:      23 SMI:       0



I had the hwlatdetect once running and got no latencies (all below threshold). All other tests were about like the one above.

It is now late in the evening here in Germany. I have not used my computer for some hours, and the battery is fully charged (and charging is over for some hours, too).

When I run my stresstest-project, I get no xruns, whereas I do get xruns with that project both when running on battery and when charging and when fully charged, but not cooled down (like: short after charging).

So I conclude:
- my system is not as reliable as yours, maybe due to the power-saving processor
- I have a thermal problem

Is there a way to track down where the latencies come from?

Thanks for your patience,

Andreas

Jack Winter
Established Member
Posts: 376
Joined: Sun May 28, 2017 3:52 pm

Re: Worse performance when power supply plugged in!

Postby Jack Winter » Sun Jun 02, 2019 3:37 pm

Musicteacher wrote:I have gotten cyclictest to work (with smi), too:

Code: Select all

sudo cyclictest -m -Sp98 -i100 -d0 --smi
[sudo]
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 1.70 1.59 1.38 2/591 7902         

T: 0 ( 7897) P:98 I:100 C: 222798 Min:      1 Act:    3 Avg:    3 Max:      19 SMI:       0
T: 1 ( 7898) P:98 I:100 C: 222746 Min:      1 Act:    6 Avg:    3 Max:      19 SMI:       0
T: 2 ( 7899) P:98 I:100 C: 222677 Min:      1 Act:    3 Avg:    3 Max:      22 SMI:       0
T: 3 ( 7900) P:98 I:100 C: 222642 Min:      1 Act:    3 Avg:    3 Max:      23 SMI:       0



I had the hwlatdetect once running and got no latencies (all below threshold). All other tests were about like the one above.

When I run my stresstest-project, I get no xruns, whereas I do get xruns with that project both when running on battery and when charging and when fully charged, but not cooled down (like: short after charging).

So I conclude:
- my system is not as reliable as yours, maybe due to the power-saving processor
- I have a thermal problem


Maybe. The cyclictest results look excellent, was that while running on battery, charging, and on mains?

Does the "dmesg" output have any thermal shutdown events?

What kind of CPU is it? If a recent Intel maybe the "i7z" utility shows something?
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Sun Jun 02, 2019 8:04 pm

Hi,
that was fully charged + plugged.

Here some more runs:

Code: Select all

[root@agantergos ag]# cyclictest -m -Sp98 -i100 -d0 --smi
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 2.89 1.42 0.56 3/455 4597         

T: 0 ( 4297) P:98 I:100 C: 488698 Min:      2 Act:    3 Avg:    3 Max:      36 SMI:       0
T: 1 ( 4302) P:98 I:100 C: 488616 Min:      2 Act:    5 Avg:    3 Max:      38 SMI:       0
T: 2 ( 4308) P:98 I:100 C: 488524 Min:      2 Act:    6 Avg:    3 Max:      42 SMI:       0
T: 3 ( 4314) P:98 I:100 C: 488438 Min:      2 Act:    3 Avg:    3 Max:      36 SMI:       0
^C[root@agantergos ag]# cyclictest -m -Sp98 -i100 -d0 --smi
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 1.64 1.17 1.01 2/568 6965         

T: 0 ( 6958) P:98 I:100 C: 238984 Min:      2 Act:    3 Avg:    3 Max:      15 SMI:       0
T: 1 ( 6959) P:98 I:100 C: 238886 Min:      2 Act:    3 Avg:    3 Max:      13 SMI:       0
T: 2 ( 6960) P:98 I:100 C: 238820 Min:      2 Act:    5 Avg:    3 Max:      17 SMI:       0
T: 3 ( 6961) P:98 I:100 C: 238733 Min:      2 Act:    3 Avg:    3 Max:      14 SMI:       0
^C[root@agantergos ag]# cyclictest -m -Sp98 -i100 -d0 --smi
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 1.97 1.33 1.07 1/572 7064         

T: 0 ( 7055) P:98 I:100 C: 356867 Min:      1 Act:    3 Avg:    3 Max:      57 SMI:       0
T: 1 ( 7056) P:98 I:100 C: 356824 Min:      1 Act:    4 Avg:    3 Max:      49 SMI:       0
T: 2 ( 7057) P:98 I:100 C: 356750 Min:      1 Act:    3 Avg:    3 Max:      39 SMI:       0
T: 3 ( 7058) P:98 I:100 C: 356736 Min:      2 Act:    4 Avg:    3 Max:      47 SMI:       0
^C[root@agantergos ag]#

The first was on battery, after the notebook was used for some time.
The second on battery, after the notebook was turned off for about an hour.
The third is shortly after the plug was plugged in.

It's an intel i5 8250u . I use i7z to watch processor speed + c-states, what should I look for?

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Mon Jun 03, 2019 12:56 pm

Current status:

The performance with power-plug is no longer really bad, just worse than when battery is fully loaded.

The worst combination is power plug + loading + performance-mode on cpu.

Yesterday I was playing some piano (with pianoteq) and forgot to turn off kde power -management. As soon as the screen was turned off, I got some xruns (that were clearly audible), so it seems that power-management somewhere gets in the way.

The trouble I am having is that performance is not reliable. I have a qtractor project as stress-test with a large number of plugins. Sometimes it plays without xruns, sometimes it does not. This is what bothers me, I would like the performance to be predictable, as I use that notebook for live performances.

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Mon Jun 03, 2019 1:35 pm

Something that @CrcoDuck suggested earlier in this thread was to try a different kernel. To go back to something before 5.x you could use linux-lts or linux-rt-lts.

Musicteacher
Established Member
Posts: 167
Joined: Mon Nov 13, 2017 5:54 am

Re: Worse performance when power supply plugged in!

Postby Musicteacher » Tue Jun 04, 2019 6:00 am

I had a rehearsal yesterday evening. I took care that the battery was fully loaded, and everything went really smooth.

So while from a technical standpoint I would like to understand things a little better, I will leave the system as is until after the next concert and take care for the battery being fully loaded.

Jack Winter
Established Member
Posts: 376
Joined: Sun May 28, 2017 3:52 pm

Re: Worse performance when power supply plugged in!

Postby Jack Winter » Tue Jun 04, 2019 8:34 am

I meant that maybe i7z could help to show some relation ship between xruns and C/P states, cpu temp, cpu freqs, etc.

I'm still curious if you see any thermal events in the output of dmesg.. :)
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux

merlyn
Established Member
Posts: 369
Joined: Thu Oct 11, 2018 4:13 pm

Re: Worse performance when power supply plugged in!

Postby merlyn » Tue Jun 04, 2019 11:22 pm

Musicteacher wrote: I will leave the system as is until after the next concert and take care for the battery being fully loaded.

Sounds like a good idea. I had an idea you can come back to after the concert.

Have you gone into the BIOS and looked for power saving options? hwlatdetect shows that something is going on with your laptop's hardware --the BIOS. Normally the BIOS can be accessed at bootup by pressing 'delete'. Once there look for any power saving options and disable them.

Have a good gig!


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest