#
…

2023-04-22

00:00chadmedso again, something that we can probably beat macos at
00:03nopeslide13 has quit []
00:06nopeslide13 has joined #asahi-dev
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi-dev
01:42nicolas17I just spotted "Mac14,8", "Mac14,13" and "Mac14,14" on a server-side config file
01:43nicolas17disabling FindMy "separationMonitoring" so I guess they're desktops
01:49tobhe has joined #asahi-dev
01:54tobhe_ has quit [Ping timeout: 480 seconds]
02:00gabuscus has quit []
02:13gabuscus has joined #asahi-dev
02:24chadmedWFI halts the clocks on CPUs where it is issued until theyre woken by an interrupt right
02:25chadmedoh yeah it does ok thats why the numbers are different
02:25chadmedless dynamic power coming from idle cores
02:26chadmedif i take the turbo states out of the dataset then the numbers line up perfectly with what youd expect
02:26chadmedstill, 3 W dynamic for a firestorm core at full flog seems very low
02:26chadmednot sure coremark is really hammering the core as much as it could
02:28chadmedat least now that i know we're still getting perfectly polynomial power scaling on the cores outside of turbo mode i can do some stuff to compensate for the noise in the readings at low power
02:40chadmed has quit [Quit: Konversation terminated!]
03:01skipwich has quit [Quit: DISCONNECT]
03:02skipwich has joined #asahi-dev
03:07chadmed has joined #asahi-dev
03:36chadmed has quit [Quit: Konversation terminated!]
03:46kevans91 has quit [Ping timeout: 480 seconds]
03:52chadmed has joined #asahi-dev
03:56tsujpmarcan: I see there are yaks in need of shaving for 'keyboard layout cleanup' and you're the contact for this, I'll volunteer but I'll need a bit of a bootstrap since I haven't done this kind of thing before (first time for everything though)
04:02thelounge60 has quit [Quit: The Lounge - https://thelounge.chat]
04:03thelounge60 has joined #asahi-dev
04:07chadmedok we're down to 2.55 W total AP idle and about 5 W system with the screen at the minimum brightness
04:07chadmednot too bad but theres probably more we can do
04:08chadmedi think the next "free" bit of desktop use power draw is definitely going to be doing something about the touchpad interrupts on non-mtp machines
04:09chadmedthe menu governor parks firestorm in the 6th pstate to idle them, which is going to cause idle power to be higher through leakage or watever
04:10chadmedTEO parks them in the lowest pstate but it also isnt great for interactivity so theres our tradeoff
04:14nicolas17is userspace behaving well? I have seen powertop report that plasma was causing >60 wakeups a second despite nothing visually changing on screen
04:14nicolas17but that may have been an old version or otherwise different environment
04:15chadmedidle power doesnt really change if i kill plasma and go to a tty
04:16chadmedthere are probably superfluous wakeups being caused by other stuff, because i managed to ssh into a partially failed boot before and idle was 2.2 W
04:16chadmedi think realistically we're at the limit of what we can achieve by clock gating
04:17chadmedthe divergence between system draw and ap draw at idle tells me that theres other things we need to do to bring down idle power use
04:17chadmedother SIP blocks sucking down more juice than they should
04:18chadmedfor example sometimes PSTR will just jump to 8-12 W with seemingly nothing else going on
04:18chadmedPHPC stays at idle levels
04:18nicolas17does Linux have anything for individual userspace threads to change the performance-power tradeoff?
04:19chadmedwe have UCLAMP_MIN and UCLAMP_MAX for userspace to tell CFS how much performance it _actually_ needs
04:19nicolas17XNU has some "CPU QoS" thing beyond scheduling priorities, which likely also affects preference for p-cores vs e-cores
04:19chadmedyeah, UCLAMP is a rough facsimile of that
04:20chadmeduserspace processes can hint to the scheduler how much core utilisation they will need ahead of time by clamping their util values
04:20chadmedCFS will then put them in buckets with similar processes and dispatch cpu time to them accordingly
04:21chadmedEAS helps with this too as threads which tell CFS that they dont need much utilisation can all be dispatched onto an icestorm core
04:21chadmedwith EAS we already get most background stuff being shunted over to icestorm
04:22chadmedour problem is instead that EAS without hints tries to push stuff there too
04:22chadmedthen the util overflows so it shoves stuff over to a firestorm cluster
04:22chadmedpush interactive stuff there too*
04:26chadmedone way we could work around this, for graphics tasks at least, is have asahi take in perf metrics from the gpu and feed that back into UCLAMP values to force whatever its linked to onto pcores at high pstates
04:26chadmedbut linux userspace is just gonna have to get with the times
04:28nicolas17yeah I was wondering how much such hints would actually help
04:28chadmedtheyd help with interactivity but not necessarily power use
04:29chadmedthe reason i bought the t6020 machine is to test a hypothesis that having more than two ecores would give CFS/EAS a better opportunity to keep the pcores asleep
04:30chadmedbecause sitting around at the dekstop icestorm is more than fast enough for a snappy experience, its just on t600x theres only two of them and they end up overloaded
04:30chadmedhell with the gpu doing compositing and post processing, i can peg firefox to the ecores at 600mhz and it will play 1080p vp9 at 30fps no worries
04:31chadmedthe soc is just too lopsided for the scheduler to know how to use it properly without userspace helping it
04:32chadmedCFS is just not a very good scheduler for HMP systems tbh
04:33nicolas17eg. would forcing a background software update or indexing etc. to ecores, or even letting them stay on a slow pstate, reduce overall battery drain, even if it makes the update take longer (and use CPU for longer)?
04:33chadmedyeah it would, even at full capacity the icestorm cores barely tick up enough power to get a reading over background noise from PHPC
04:33chadmedtheyre _very_ efficient
04:33nicolas17ok *wow*, I didn't expect that much difference
04:34chadmedaccording to my readings they use barely 500 mW at full tilt at 2.064 GHz
04:35chadmedtheyre super tiny and faster than they have any right to be
04:35nicolas17so is there any "this is low priority background work" hint that would cause such "force to ecores" outcome, without having to pin to specific cores? (which would be too system-specific)
04:36nicolas17afaik XNU "background" QoS does that
04:37chadmednothing that simple, youd have to hint to CFS with a mix of UCLAMP, priority tweaking and capacity-dmips-mhz values in the DT
04:37chadmedthe QoS buckets for CFS are all based on UCLAMP values, and if you dont provide those then it just uses its own feedback mechanism to predict what kind of capacity the process needs
04:38chadmedthe problem is that its really optimised for throughput and not interactivity, so bursty tasks will cause its perf counters to decay and youre back to it not having any idea what to do with the thread
04:38nicolas17bah, Apple's ~5 qos categories seem way easier to understand for devs...
04:39chadmedyeah see, the issue is on linux that we cant _rely_ on devs doing that
04:39chadmedwe dont have an army of devs who will hang on every word the kernel team say
04:39nicolas17I mean it seems easier to rely on userspace devs to set a qos category than to set uclamp values :P
04:40nicolas17which sound way fiddlier
04:40chadmedso even if we had a simplified userspace-friendly qos system separate to nice/uclamp/whatever 50% of people wouldnt use it because its soy bloated cucked etc and the other 50% wouldnt use it because who the hell cares about the 5 people using heterogeneous workstations
04:40chadmedintels heterogeneous socs have hardware scheduling so devs dont have to care about it
04:41chadmedand no ones really bothered with a heterogeneous arm64 chip for the desktop except apple
04:41chadmedso all the aggressive optimisations for software scheduling are in android, and guess what
04:41chadmedthey rely on android apis and alternative schedulers
04:42chadmedits bad enough that we cant convince a nontrivial minority of folks that x11 is a ghoulish awful steaming pile and needs to die
04:42nicolas17nice is already a mess on modern systems tbh
04:43chadmedsomething as finnicky and not-user-facing as "please tell the scheduler your capacity requirements" is waaaay down the priority list of most developers
04:43nicolas17I run 'nice ninja' on a terminal and my UI latency still lags
04:44nicolas17because it seems nice levels only set priorities with respect to other processes in the same cgroup, and konsole is being put in a cgroup of its own
04:45chadmedyeah its all just a mess of hacks and tricks and kludges that no one really understands and doesnt really have any benefit for anyone in the desktop
04:45nicolas17the konsole cgroup and the firefox cgroup get equal treatment regardless of the nice levels of processes inside, and firefox lags while compiling
04:45chadmedthey all seem designed for highly integrated server environments where the developer and sysadmin are either the same person or at least in the same room
04:46chadmedtheyre not fit for purpose for modern desktop systems
04:46chadmedintel's thread director is a damning indictment on this state of affairs
04:47nicolas17I had a similar issue with BOINC on my desktop, it's nice'd and ionice'd and SCHED_IDLE'd and it still lagged the interactive desktop... why? cgroups
04:48chadmedyeah again, a "solution" designed with the assumption that people want to spend 6 weeks collecting perf data and then 15 minutes on every cold boot manually optimising all this stuff
04:48nicolas17so I changed the cgroup params of its systemd service unit... no difference, because CPU was still being shared equally between system.slice and user.slice
04:48chadmeddesktop users want to press the power button and not think about firmware or the kernel again beyond that
04:48chadmedany time a normal user has to think about any of this shit is an absolute L for UX
04:48nicolas17I moved it to its own top-level slice
04:48cylm has joined #asahi-dev
04:49nicolas17and now I finally can't tell the difference between boinc running vs not running
04:49chadmedyeah see thats exactly my point
04:49chadmedwho the heck has time for that
04:49nicolas17I think the package could be configured to set up the service like that
04:49nicolas17but what about *gestures* everything else
04:50chadmedwell yeah thats what i meant by the solutions being designed for server admins
04:50chadmedyeah you could package up a bunch of scripts that does all this for YOUR system and YOUR software
04:51chadmedbut theyre not going to work on another system with a different perf profile
04:51chadmeddevelopers need to build this in to code so that it happens automatically, and we cant do that easily or even *well* with the current kernel infrastructure
04:52chadmedthe classic example is balloo
04:52chadmedwhy the hell does CFS give it full reign over my pcores?
04:53nicolas17agreed, otoh baloo seems like exactly the kind of app that should be hinting "low priority"
04:53chadmedyeah exactly thats why its the classic example :P
04:54chadmedthere should just be a bunch of switches that say "i dont care about throughput/latency/either"
05:05chadmedso UCLAMP is probably the closes to XNU's QoS that we have, given the whole bucketing concept
05:05chadmedbut it would be nice if it had a more user-centric mechanism of operation so that devs could reason about it a bit better
05:06chadmedUCLAMP_MAX=[512,1024] is utterly meaningless to me as a user and a developer
05:06chadmedi want to be able to just say "my task is a background daemon" and let the scheduler worry about how it internally represents that
05:08nicolas17too many kernel devs benchmarking throughput of kernel builds :P
05:09chadmedandroid already does this, but again it relies on android-specific schedulers and android userspace apis
05:25nicolas17 has quit [Ping timeout: 480 seconds]
06:21psykose has quit [Remote host closed the connection]
06:47knedlik has joined #asahi-dev
06:48knedlik has quit [Remote host closed the connection]
07:14stipa has quit [Remote host closed the connection]
07:46seb4nihel has joined #asahi-dev
08:07loki_val has quit [Ping timeout: 480 seconds]
08:36crabbedhaloablut has joined #asahi-dev
08:36nsklaus has joined #asahi-dev
09:04pg12_ has quit []
09:04pg12 has joined #asahi-dev
09:04jannaudcp 13.3 FW doesn't like m1n1's dcp_ib_swap_set_layer call anymore. other problem problem was that the service init message is now TYPE_REPLY instead of TYPE_NOTIFY
09:11nyilas has quit [Remote host closed the connection]
09:26knedlik has joined #asahi-dev
09:27knedlik has quit [Remote host closed the connection]
09:35chadmed has quit [Remote host closed the connection]
09:35jannaulooks like there are two new dcp iboot calls in 13.3 but probably appended at the end. 13.2 has already additional calls but swap_set_layer was still working
09:56chadmed has joined #asahi-dev
10:15cylm_ has joined #asahi-dev
10:20cylm has quit [Ping timeout: 480 seconds]
10:38bps has joined #asahi-dev
10:58bps has quit [Remote host closed the connection]
10:58abd has joined #asahi-dev
10:58bps has joined #asahi-dev
11:13bps has quit [Ping timeout: 480 seconds]
11:27bps has joined #asahi-dev
11:35jannaulooks like the swap_set_layer_cmd had layout/size changes, set_layer succeeds now but swap_end fails
11:35bluetail422 has quit []
11:36cylm has joined #asahi-dev
11:36jannauat least there's a IOMobileFramebuffer::swap_submit_dcp() syslog line
11:37jannauso the swap_set_layer_cmd might be interpreted as garbage by dcp
11:42cylm_ has quit [Ping timeout: 480 seconds]
12:08bluetail422 has joined #asahi-dev
12:13bluetail422 has quit []
12:21bps has quit [Ping timeout: 480 seconds]
12:21bluetail422 has joined #asahi-dev
12:21bluetail422 has quit []
12:26jannauworking, it was setting garbage layer parameters
12:27jannauyeah! firmware version dependent dcp interfaces in m1n1 as well
12:29bluetail422 has joined #asahi-dev
12:29bluetail has joined #asahi-dev
12:30bluetail has quit []
12:30bluetail has joined #asahi-dev
12:31bluetail422 has quit [Remote host closed the connection]
13:22bluetail has quit [Remote host closed the connection]
13:23bluetail has joined #asahi-dev
14:00jnn is now known as jn
14:05knedlik has joined #asahi-dev
14:06knedlikI'll probably give the bass plugin a shot unless someone else plans to, seems not though
14:11knedlikI'm unsure what I should be doing it on though, should I compile right on Asahi, or xcompile from MacOS? Also how do I test it... and not destroy my speakers?
14:11psykose has joined #asahi-dev
14:22jannauKnedlik: development can be in the first step fully independent of any hardware. the plugin gets an audio signal (a stream of samples) and outputs an audio signal. as first you wouldn't necessarily listen to what the plugin does
14:24knedlikMakes sense, thanks for the link
14:24knedlikBtw, any idea how I can make my IRC client not disconnect me when I turn off my phone?
14:26ChaosPrincessthe simple answer is 'you dont'
14:27ChaosPrincessthe less simple is 'run an irc bouncer on your server'
14:51knedlikThe algorithm linked in the Yaks page is what's needed, or do I need to modify that algo in some way?
15:05abd has quit [Ping timeout: 480 seconds]
15:46abd has joined #asahi-dev
16:13abd has quit [Ping timeout: 480 seconds]
16:16thevar1able_ has quit [Remote host closed the connection]
16:16thevar1able_ has joined #asahi-dev
16:36cylm_ has joined #asahi-dev
16:38cylm has quit [Ping timeout: 480 seconds]
17:01knedlik has quit [Ping timeout: 480 seconds]
17:01abd has joined #asahi-dev
17:32knedlik has joined #asahi-dev
17:33knedlik has quit [Remote host closed the connection]
17:44skipwich has quit [Remote host closed the connection]
17:44skipwich has joined #asahi-dev
18:49knedlik has joined #asahi-dev
18:51knedlik has quit [Remote host closed the connection]
18:58knedlik has joined #asahi-dev
18:59knedlikI'm guessing the bass plugin should keep the differentiation between left and right?
19:02kettenis has quit [Ping timeout: 480 seconds]
19:11yamii has quit [Quit: WeeChat 3.8]
19:12yamii has joined #asahi-dev
19:22mkurz has joined #asahi-dev
19:41knedlik has quit [Remote host closed the connection]
19:42mkurz has quit [Quit: Konversation terminated!]
20:43knedlik has joined #asahi-dev
20:45knedlik has quit [Remote host closed the connection]
21:01nsklaus has quit [Quit: ZZZzzz…]
21:34lynndotpy has quit [Quit: bye bye]
21:35lynndotpy has joined #asahi-dev
21:57abd has quit [Ping timeout: 480 seconds]
21:57Retr0id has quit [Quit: bye]
22:16chadmedKnedlik: as i said implementation details are up to you, so long as its fast and light
22:16chadmedthat link is just there to give you a high level idea of what the plugin needs to do
22:19chadmedyou may sum L and R for bass since the wavelength is too long for anyone to discern direction from, especially on such a tiny machine
22:21chadmedbut if you want to go down that path, you have to chain off a stream from the main signal and then mix that back in to both L and R at the end
22:23Chinese_soupchadmed: just so you know, you are replying to someone who's not here rn
22:24Chinese_soupbut I guess you maybe know that and assume they're gonna read the logs
22:46chadmedyeah i assume they read the logs since theyre referencing messages i sent some time ago
23:08chadmedalso as jannau mentioned you dont necessarily need to develop this on an apple silicon machine, its just an audio plugin
23:09chadmedany machine where you can run a plugin host and test it will work fine
23:09chadmedmy machine will lay down its life for science when the time comes to test it on apple silicon
23:13abd has joined #asahi-dev
…