From nobody Sat Nov 19 12:21:44 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 4NDt7Y5dZ4z4hd8b for ; Sat, 19 Nov 2022 12:22:01 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 4NDt7Y12Lzz3HLV for ; Sat, 19 Nov 2022 12:22:00 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-88-210.area1b.commufa.jp [123.1.88.210]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 2AJCLjTR071280; Sat, 19 Nov 2022 21:21:50 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 19 Nov 2022 21:21:44 +0900 From: Tomoaki AOKI To: Hans Petter Selasky Cc: Alexander Leidinger , FreeBSD Current Subject: Re: ULE realtime scheduler advice needed Message-Id: <20221119212144.03c1fbda951b4137b116a6bb@dec.sakura.ne.jp> In-Reply-To: References: <20221118091828.Horde.xkZUBiYzzOgubFonR22tMzm@webmail.leidinger.net> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4NDt7Y12Lzz3HLV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N I've lost track with, but IIRC, someone wrote here, or other ML, or even forums, kern.sched.preempt_thresh=224 was the default for PC-BSD. And found some discussion started at [1] on freebsd-stable ML in Apr. 2018. One more place is at forums [2]. Sorry, not read all of them to confirm. [1] https://lists.freebsd.org/pipermail/freebsd-stable/2018-April/088678.html [2] https://forums.freebsd.org/threads/general-freebsd-desktop-workload-optimization-thread.21853/ On Sat, 19 Nov 2022 10:28:50 +0100 Hans Petter Selasky wrote: > 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. > > > -- Tomoaki AOKI