From nobody Mon Jan 19 14:57:18 2026 X-Original-To: freebsd-hackers@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 4dvtpz4KJpz6NvPg for ; Mon, 19 Jan 2026 14:57:31 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Received: from mail-24428.protonmail.ch (mail-24428.protonmail.ch [109.224.244.28]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dvtpz0nQnz3gsB for ; Mon, 19 Jan 2026 14:57:26 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=w4wlqjrtybdhfpwesi5dc5vlb4.protonmail; t=1768834643; x=1769093843; bh=0Hupc3acU04NqueEdv19bKw50ch89qolxzRAy9fnzj0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RBozMPqEe2+qY5Uuz7D7YZtKaWixWrp8qOdDS3Ofct/4QNCHOjYpM6zflZt0VWMwp 14iTHRt1MEBknLQLU2XUzctU5EnYb4ldNQU7nguwq2g+5oIFW4HGJybQ7pjmVsTn4g 8EtHVxAAQZXp6BGjT+fSdWw3oUNia9PGw+UOw6jmzGUbe6T6Dal6l94BJPC7W3bEXN vefU4OlJQJGX1cgHuDzUN9BpY9uaaVm6aK/HzqvLfsLdNQ7feHRl5Yy9rkesygymiw BjK1HM0FF1FKounJmefUmOwIdCdAGKFvR9WxUhUPUQWEmZw1xmd7qo1v3SjDc/5FEb U/n4y3u7HZa3Q== Date: Mon, 19 Jan 2026 14:57:18 +0000 To: Olivier Certner From: Minsoo Choo Cc: freebsd-hackers@freebsd.org Subject: Re: Current ULE state and plans (was Re: HMP scheduling on FreeBSD) Message-ID: <5U1e9TGv3Jdrbn74cB_2pvAhC_O0kCNTrSeGhPsydgBZZNpFx2fB7wKIqB28sV0FG0mlTDnWMHduaSkviPkjHELH6cTqQ-OtXNNLko87B28=@proton.me> In-Reply-To: <5507816.iRejcm9W5r@ravel> References: <0Ng09S3rEB0BvT9vzHqVKU7rWxoad96kjEc7U2LCwDFJKmmswXujip7qbRlo_BIhNKcI7d-2CUHdp9Dxr3-7hhafpD6uagJSFUCjtC9qRr4=@proton.me> <1886427.OVFmXjEfDW@ravel> <6tOKBjzm6105PhWG7uokCxT9_vl6KFcdZlDDZqLtJHLinaU79t1KirKeB0BU0PNg0iMFOQrbQoLLrfGQGw8ku2M-xpvO15tXI1WzdLAQ4m4=@proton.me> <5507816.iRejcm9W5r@ravel> Feedback-ID: 45891198:user:proton X-Pm-Message-ID: ea545c6da8e98804fbcc39e03bd6e775d52ae800 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:109.224.244.0/24, country:CH] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dvtpz0nQnz3gsB On Monday, January 19th, 2026 at 9:17 AM, Olivier Certner wrote: > > Someone in the thread said the interactivity score is "bogus": although= I wouldn't go that far, interactivity score sacrifices fairness and we def= initely need patches to handle edge cases (similar to what CFS experienced = on linux side). >=20 >=20 > Not sure what you had in mind exactly but, as is, this statement about CF= S makes no sense. CFS works by maintaining an execution time which it uses = to ensure fairness as it allows to check whether some thread has been less = executed than another. There's no interactivity score at all in CFS, so the= re certainly aren't any patches to fix problems with that. Sorry, I meant "handle edge cases" because CFS was TOO fair. Now they parti= ally solved the problem with EEVDF. > Now, turning to ULE's well-known main problems (which I've analyzed not o= nly with merely running examples, but actually hacking the scheduler and su= pport programs that produce statistics): > 1. The effect of nice values is too low, to the point of insignificance. = As a striking example, a thread with an offset nice value of -20 competing = with one with a value of 20 will get the CPU only 66% of the time. A nice v= alue of 0 against 20 only gives a +4% CPU time advantage compared to total = fairness (nice values been equal). See https://reviews.freebsd.org/D46566 f= or details. Yes, that's what I meant for "polluting" nice values. I didn't mean nothing= should override nice (no sane scheduler does that these days anyways), but= ULE should respect nice more. I'll take a look at the patch. > 2. There is a fairness issue for threads in-between interactive ones and = CPU hogs, i.e., doing a non-trivial amount of computation so that they are = not considered interactive, but at the same which frequently do not use the= full quantum. In this situation, with the current code, the amount of not-= used quantum is simply lost. >=20 > There were earlier attempts to fix point 2 but they were not satisfactory= enough. I have been having a solution for it, which I ran by Jeff who agre= ed it was worth testing. I also have a solution for point 1 as well which i= s relatively simple and most probably will turn out to be sufficient to giv= e much more weight to nice values, and change the scale to be an exponentia= l one (so that the effect of a shift in nice values is, from a relative poi= nt of view, the same whatever your current nice value is). In terms of codi= ng, each of them shouldn't take me more than a week or two. What really tak= es time with scheduling matters is rarely coding per se, but, beyond high-l= evel analysis and design (already mostly done in these cases), tests and ac= tual measurements, as well as comparing the behavior of a variety of worklo= ads before and after the changes. Having exponential nice conversion table like BFS/CFS/EEVDF would be great. >=20 > These have been in my TODO list for a relatively long time now, without e= ver reaching the top for various reasons. They still probably won't in the = immediate (as I'm mostly working on Power matters at the moment) but since = there seems to be some interest, hopefully I'll be doing them in a month or= two. Once these problems are fixed, it's likely that, experiments confirmi= ng, there won't be any more reason to keep 4BSD around. One of my personal = goals is to deprecate 4BSD in 16 if possible, as it is more and more irrele= vant on modern machines and seems too lightly tested. I think I read about ULE being too reluctant on moving tasks between cores = (or higher topology level). Is that problem solved? Anyways, thank you for correcting my misunderstanding on ULE, I was too pes= simistic on that scheduler. If possible, could you add me to subscribers to= patches for issue 1 and 2 in future? Regards, Minsoo