From nobody Sat Nov 19 09:28:50 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDpJ11jR3z4hBhM for ; Sat, 19 Nov 2022 09:29:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDpHx5L9tz4Vrd for ; Sat, 19 Nov 2022 09:29:01 +0000 (UTC) (envelope-from hps@selasky.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org; dmarc=none Received: from [10.36.2.69] (unknown [84.210.222.10]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 92B662604E8; Sat, 19 Nov 2022 10:28:52 +0100 (CET) Message-ID: Date: Sat, 19 Nov 2022 10:28:50 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: ULE realtime scheduler advice needed To: Alexander Leidinger Cc: FreeBSD Current References: <20221118091828.Horde.xkZUBiYzzOgubFonR22tMzm@webmail.leidinger.net> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: <20221118091828.Horde.xkZUBiYzzOgubFonR22tMzm@webmail.leidinger.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.29 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.989]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[selasky.org]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NDpHx5L9tz4Vrd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Hi Alexander, Thank you for the pointers. I will try it out. --HPS On 11/18/22 09:18, Alexander Leidinger wrote: > Quoting Hans Petter Selasky (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. >