#
✕ nick:yuka
#asahi-dev · 2026-09-09 09:47
yukainteresting!
#asahi-dev · 2026-09-09 09:45
yukahow bad is the performance?
#asahi-dev · 2026-09-08 07:23
yukaand they left already
#asahi-dev · 2026-09-08 07:23
yukawhy does this sound like pasted from a slop generator
#asahi-dev · 2026-09-06 17:07
yukathe entire "separate_nvmmu_base" thing seems to have been unnecessary. While that's how macOS does it, we can also just use reg[9] for everything and it works
#asahi-dev · 2026-09-06 17:06
yukaWhut
#asahi-dev · 2026-09-06 16:07
yukaThis is a weird situation. The register at this address does different things for <M4 and >=M4 but the same value happens to be reasonable for both
#asahi-dev · 2026-09-06 16:01
yukathat explains how it can work
#asahi-dev · 2026-09-06 16:01
yukaM3 Max fw 27.x also respects qsize
#asahi-dev · 2026-09-06 15:57
yukaAt least I can set a lower value that way
#asahi-dev · 2026-09-06 15:55
yukaOk, so M3 Max fw 14.x respects qsize
#asahi-dev · 2026-09-06 15:47
yukaNot what I expected
#asahi-dev · 2026-09-06 15:46
yukafw 14.x
#asahi-dev · 2026-09-06 15:46
yukaaccording to the crash log
#asahi-dev · 2026-09-06 15:46
yukaOn M3 Max, I/O SQ/CQ size is 16
#asahi-dev · 2026-09-06 14:41
yukabut the completion queue? all the data structures are allocated for size 64, but it would actually use up to 65 entries
#asahi-dev · 2026-09-06 14:40
yukathe submission queue doesn't really matter I guess, since we can just use less than the full size
#asahi-dev · 2026-09-06 14:38
yukaAssuming M3 has the same behavior of setting queue sizes through +0x1210 and being 0's based (and all signs point to that), I wonder how this even works.
#asahi-dev · 2026-09-06 14:27
yukaThat's cool
#asahi-dev · 2026-09-06 14:26
yukaright
#asahi-dev · 2026-09-06 14:26
yukaunless it's all of them
#asahi-dev · 2026-09-06 14:26
yukawhat I'm saying there would be a new compatible for the ones capable of queue size 252?
#asahi-dev · 2026-09-06 14:26
yukaOr I guess nobody knows if M2 or M2 Pro can already do it
#asahi-dev · 2026-09-06 14:25
yukasven: ack, but we should probably keep it in mind when upstreaming M3 nvme
#asahi-dev · 2026-09-06 14:25
yukathe main change is decoupling the queue sizes from tags and NVMMU_NUM_TCBS, since those still only go up to 63
#asahi-dev · 2026-09-06 14:23
yukaor rather 252
#asahi-dev · 2026-09-06 14:23
yukaDo we think there is an advantage to running the nvme with queue size 256? This would require some more changes
#asahi-dev · 2026-09-06 14:22
yuka*have
#asahi-dev · 2026-09-06 14:22
yukaOr M1 Pro since that's the oldest I haive
#asahi-dev · 2026-09-06 14:18
yukaI should probably repeat the experiments on an M1
#asahi-dev · 2026-09-06 14:13
yukaI wonder if we should rename it
#asahi-dev · 2026-09-06 14:05
yuka(what ivoszbg[m] already reported)
#asahi-dev · 2026-09-06 14:04
yukawhich explains why setting APPLE_ANS_MAX_PEND_CMDS_CTRL to max_queue_depth - 1 fixes it
#asahi-dev · 2026-09-06 14:04
yukaIt's actually APPLE_ANS_MAX_PEND_CMDS_CTRL
#asahi-dev · 2026-09-06 13:56
yukait does not seem to matter what I put in the qsize field
#asahi-dev · 2026-09-06 13:55
yukaI/O SQ size: 65, I/O CQ size: 65
#asahi-dev · 2026-09-06 13:47
yukalet me see what happens if I use qsize = max_queue_size - 2
#asahi-dev · 2026-09-06 13:45
yukaThis matches what Linux does. We assume max_queue_depth = 64 and set the qsize attr to 63 when creating the completion queue, but the ANS still prints it as size 65 when it crashes
#asahi-dev · 2026-09-06 13:44
yuka> Create IO completion queue [...] Command DWORD 10 contains the queue identifier in the low word, and the queue size in the high word. The queue size should be given as one less than the actual value.
#asahi-dev · 2026-09-06 13:41
yukaI wonder what even determines how many completion entries are used
#asahi-dev · 2026-09-06 13:41
yukaand this asymmetry is already present on M3
#asahi-dev · 2026-09-06 13:40
yukawhen we assumed 64 completion entries on the linux side
#asahi-dev · 2026-09-06 13:40
yukablaah, but yes I think this difference is what causes M4 to fail when it goes to completion entry 65
#asahi-dev · 2026-09-06 13:39
yukaso 254 completion and 252 submission entries
#asahi-dev · 2026-09-06 13:39
yukaM3 Max: IOCQ 0x0 - 0xfd, IOSQ 0x1 - 0xfc
#asahi-dev · 2026-09-06 13:38
yukaso effectively 65 IO completion entries and 63 IO submission entries
#asahi-dev · 2026-09-06 13:38
yuka*M3: IOCQ 0x0 - 0x40, IOSQ 0x1 - 0x3f
#asahi-dev · 2026-09-06 13:37
yukawhoops, the other way around
#asahi-dev · 2026-09-06 13:37
yukaM3: IOSQ 0x0 - 0x40, IOCQ 0x1 - 0x3f
#asahi-dev · 2026-09-06 13:33
yukahttps://github.com/AsahiLinux/m1n1/pull/675

plus ›