Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2022 09:18:28 +0100
From:      Alexander Leidinger <Alexander@leidinger.net>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: ULE realtime scheduler advice needed
Message-ID:  <20221118091828.Horde.xkZUBiYzzOgubFonR22tMzm@webmail.leidinger.net>
In-Reply-To: <7ad10a5e-29d6-aaef-25cf-407d65f056cc@selasky.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Quoting Hans Petter Selasky <hps@selasky.org> (from Fri, 18 Nov 2022  
05:47:58 +0100):

> Hi,
>
> I'm doing some work with audio and have noticed some problems with  
> the ULE scheduler. I have a program that generate audio based on  
> key-presses. When no keys are pressed, the load is near 0%, but as  
> soon as you start pressing keys, the load goes maybe to 80% of a CPU  
> core. This program I run with rtprio 8 xxx. The issue I observe or  
> hear actually, is that it takes too long until the scheduler grasps  
> that this program needs it's own CPU core and stops time-sharing the  
> program. When I however use cpuset -l xxx rtprio 8 yyy everything is  
> good, and the program outputs realtime audio in-time.

I have something in my mind about ULE not handling idleprio and/or  
rtprio correctly, but I have no pointer to a validation of this.

> Or is this perhaps a CPU frequency stepping issue?

You could play with
rc.conf (/etc/rc.d/power_profile):
performance_cpu_freq="HIGH"
performance_cx_lowest="C3"   # see sysctl hw.cpu.0 | grep cx
economy_cx_lowest="C3"       # see sysctl hw.cpu.0 | grep cx

Your system may provide other Cx possibilities, and ging to a lower  
number (e.g. C1) means less power-saving but faster response from the  
CPU (I do not expect that this is causing the issue you have).

> Any advice on where to look?

Potential sysctl to play with to change "interactivity detection" in ULE:
https://www.mail-archive.com/freebsd-stable@freebsd.org/msg112118.html

Bye,
Alexander.

-- 
http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild@FreeBSD.org  : PGP 0x8F31830F9F2772BF

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmN3P9MACgkQEg2wmwP4
2Ib46g/+MHdv1DNmg2mSrSzPDxYx79Vz/HFnMMe1wSGf9DOJll6nheyouIypoE+O
rZu+Z9dppbNi+hAMnnSbQ5NHSCj2sI7BR/dOJt0B4f5l0SwmNs6Ph28HXQju12pp
/Zmh9AtZZwaw2qCXmbA5uEyEJmkIIsqnXMXQ7HDlPKP+b9q7vj/+XqsO/rE2QCK1
RLYlAGvfdZ2vo/gQovE8k5Bfn+8JtizsNm0Pwj7EZCHNLhgA1vU4QKzjCMWScyhx
0OPxuYiIZcgcKQt3rRBs0ivhodjuEc13BzEiFlQJ8/ILdw7QnWNiWYXxuoKtWC7n
T/wKmfqvv7zRwWAQt3fE4BcQZw9Z9fAkLQPX1S/vwprHzlhHZ6mJukUNxgj5FVXG
dnQ/+gRHi7av8k2ntWSgkKLn3btb2GMjaQBRmcZ+/R+BHxkI/lJV3oEYRLLRA/Bq
SoxURWjJQMBiZcoHsjgCnR62TbPXG1YiJ7YfXMLkgT4pZ19ngIjMSgGALkCS8nGb
u00HyIJoccrQvytgIBHgdInUFW6rQdIW9hfzQun7rvVNQ1noqxs9khbFiqUATbZF
qDWkPP7sF9cn86p/IFn6xIuo2HaiJXzAviGPKTB+jHnJdd2jOPtNdnAW/pdTKT5l
SDm64xoUIaFYqfgV7UsbM+gkdondTeRyC90GYdeOeGEd6ySs4Mg=
=lrgw
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20221118091828.Horde.xkZUBiYzzOgubFonR22tMzm>