#asahi · 2022-04-06 16:07
arndnot the exact same toolchain, but both gcc-11.2 release builds#asahi · 2022-04-06 16:06
arndnow (m1 ultra): real 2m35.424s, user 39m17.357s, sys 7m4.134s#asahi · 2022-04-06 16:06
arndbefore (x86): real 4m57.965s, user 128m48.643s, sys 14m33.572s#asahi · 2022-04-06 16:05
arndbuilt my first kernel on the machine itself, performance is pretty much what I was hoping for, about twice as fast as my old TR1950x, while still using 4K pages#asahi · 2022-04-06 14:34
arndI started with arm64 defconfig here, with the intention of adding everything necessary there to make it boot out of the box. At least I own that file ;-)#asahi · 2022-04-06 14:29
arndjannau: ok, that probes the USB, and it now tells me that I created the rootfs wrong (btrfs with wrong page size), but I can deal with that. Not sure how much time I want to spend on finding the difference to my previous .config#asahi · 2022-04-06 14:00
arndI've added printk in both the dwc3 and tpc6598x probe functions, but neither of them gets called with the .config I had here#asahi · 2022-04-06 14:00
arnd_jannau_: ok, I'll try your .config then. #asahi · 2022-04-06 13:53
arndok, thanks. I don't see anything in tps6509x in the boot log. I'm fairly sure I enabled the driver, but I did not check if depends on another one#asahi · 2022-04-06 13:51
arnddoes m1n1 claim ownership of both dwc3 instances to set up the ttyACM ports and then not hand them over to the OS?#asahi · 2022-04-06 13:49
arndI got a much further today using proxyclient to boot into my t6002, console worked right away, but I don't know what I'm missing for the dwc3, it doesn't even seem to probe the device#asahi · 2022-03-22 09:47
arnd"x32" mode on arch/x86 serves mostly to make Intel look good in some benchmarks, but causes way too many problems for the limited practical use#asahi · 2022-03-22 09:47
arndI think what makes the 64K pages so tempting is that the workloads that benefit most are exactly the things that get used in CPU benchmarks. The same thing is true for ilp32 mode, which is something we managed to dodge for arm64#asahi · 2022-03-22 09:44
arndusing 64KB more than doubles the memory usage in this case, but as long as you have enough memory, it's still slightly faster than 16KB pages#asahi · 2022-03-22 09:43
arndAdryzzOLEDEdition[m]: https://docs.google.com/spreadsheets/d/1Y-eeXEHr8Tud2ul4iApn6hLEQoMsl3Bsud-vlW3V2t8/edit#gid=0 has some numbers from an experiment I did on my typical workload (building kernels with gcc). #asahi · 2022-03-13 09:11
arndI noticed the other day that the Mac Studio order form was fixed to prevent one from buying an M1 Ultra with a 512GB SSD. Now I see they also silently upgraded my order to 1TB without changing the price or the delivery date.#asahi · 2022-03-12 10:30
arndIIRC there are also still assumptions about page size in Android#asahi · 2022-03-12 10:27
arndthat is mostly fixed these days, but it doesn't help for existing binaries, and there is much less incentive for x86 applications to care about a random other architecture emulating theirs than there was for arm32 vs arm64#asahi · 2022-03-12 10:27
arndwe had the same problem on 32-bit arm applications that initially didn't work on arm64 kernels with 64K#asahi · 2022-03-12 10:26
arndah, because x86 applications are built with 4K section alignment in binutils?#asahi · 2022-03-12 10:25
arndare there applications that work on 4K and 64K but not on 16K pages?#asahi · 2022-03-12 10:24
arndright, that doesn't sound realistic either. What is the actual requirement for processes that want 4KB pages?#asahi · 2022-03-12 10:21
arndif the kernel uses 4KB pages, it would be a little easier, user space could be treated as using 16KB "huge" pages with the 16KB page table format, while kernel and other tasks use 4K pages or the normal huge pages#asahi · 2022-03-12 10:20
arndand then there is the page cache itself, since all memory is managed in units of kernel pages, having 16KB kernel page tables would likely mean that user space can only map memory in that unit as well, even if the TLB uses smaller pages#asahi · 2022-03-12 10:16
arndb) rework all the accessors for page tables to have separate kernel vs user logic. Some architectures (at least s390, possibly others) already do per-task page table levels, so a 32-bit task can use two levels, while a 64-bit task can use three, four or five levels depending on how much it uses#asahi · 2022-03-12 10:14
arnda) change linux/arch/arm64 to actually use separate page tables for kernel and user space. I forget how the separate is today, but as the kernel normally has access to user pages, they are at least sometimes visible together#asahi · 2022-03-12 10:13
arndmarcan: mixed page table formats per task are much more realistic, the two major problems I'd expect we'd have to solve for this are#asahi · 2022-03-12 06:48
arndMaybe that was before xarray though#asahi · 2022-03-12 06:46
arndI thought we had a "probably working" patch for 64-bit off_t at the time, but gclement's customer preferred the 64k page approach because it kept the performance characteristics of their older vendor kernel#asahi · 2022-03-12 06:22
arndThe larger pages are the workaround that Marvell originally put into their kernels#asahi · 2022-03-12 06:21
arndWe never merged that since the better fix would be to use a 64-bit pgoff_t like Annapurna Labs did in their NAS kernels#asahi · 2022-03-12 06:20
arndrkjnsn: the only thing that old patch does is to get around the 32-bit pgoff_t restrictions to allow larger disk partitions on arm32 Nas systems#asahi · 2022-03-11 14:04
arndyou could probably do it on powerpc (with hashed tables) or on loongarch (with software tlb), but not on architectures where Linux accesses the hardware page tables directly#asahi · 2022-03-11 14:02
arndyes, that was exactly my point: shadow page tables are really expensive to do#asahi · 2022-03-11 13:58
arndthe leaf pages would be fine, but the higher-up page tables would not#asahi · 2022-03-11 13:57
arndagraf: not worth it, the mm code is built around knowing the page table layout at compile time, trying to make it a runtime thing would add a ton of complexity and runtime overhead where we don't want it#asahi · 2022-03-11 10:19
arndthe default for both is 3-level tables (39 and 47), but comparing two-level 16KB tables (36 bits) against four-level 4K tables (48 bits) would skew this even further towards the 16KB pages#asahi · 2022-03-11 10:16
arndThere is likely also a difference between VA_BITS_36/39/47/48#asahi · 2022-03-11 10:14
arndand 16% on M1, which can be a combination of the differences in L1 cache behavior and TLB layout between M1 and N1#asahi · 2022-03-11 10:11
arndok, so only 10% improvement with 16KB pages, or 12% with 64KB pages#asahi · 2022-03-11 10:10
arndj`ey: ah, thanks for digging that out#asahi · 2022-03-11 10:10
arndthe flip side is that a lot of hardware just doesn't support 16KB, and the extra memory overhead for 64KB pages is crazy. #asahi · 2022-03-11 10:09
arndI may also be misremembering things#asahi · 2022-03-11 10:08
arndI think when I tested the same on EC2, the 16KB numbers were not quite as good. IIRC something like 18% speedup for 64K pages and 15% for 16KB pages#asahi · 2022-03-11 10:06
arndbut it's possible that there is something else going on that makes the microbenchmarks look better than real-world workloads#asahi · 2022-03-11 10:06
arndmaz: when I did microbenchmarks, everything seemed to indicate that it was using the full 128KB of L1 and it had hte same latency regardless of page size#asahi · 2022-03-11 10:04
arndmarcan: I did those benchmarks last year and mentioned the numbers here. I don't remember if it was 20% or a bit less, but it was definitely more than I had expected#asahi · 2022-03-09 19:38
arndthat's probably what you and in mind as well#asahi · 2022-03-09 19:38
arndmarcan: I think we probably want to always ignore -EPROBE_DEFER from devm_of_find_backlight() in the simpledrm, but not ignore it in any of the real drivers, so only the handoff gets deferred but not the console messages#asahi · 2022-03-09 19:33
arndso it works when CONFIG_BACKLIGHT_CLASS_DEVICE is disabled, and it works before that commit