6 ms·
> Systemd is ~1.5MB - the loading time for emmc is 100ms Surely not all of systemd is faulted in immediately, is this really an issue?
by newnewpdro 7y ago
> Systemd is ~1.5MB - the loading time for emmc is 100ms
Surely not all of systemd is faulted in immediately, is this really an issue?
- amluto 7y agoIf you want just the important parts faulted in, you need to get the important parts into their own pages, preferably in order. I don’t know whether profile-guided linking is a thing.
- newnewpdro 7y agoOn my long-running debian box, /lib/systemd/systemd is 1.1MiB in size. In /proc/1/smaps, I find the following executable mapping: 55aa05f89000-55aa06076000 r-xp 00000000 fd:01 1823 /lib/systemd/systemd Size: 948 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 752 kB Pss: 489 kB Shared_Clean: 504 kB Shared_Dirty: 0 kB Private_Clean: 248 kB Private_Dirty: 0 kB Referenced: 740 kB Anonymous: 0 kB LazyFree: 0 kB AnonHugePages: 0 kB ShmemPmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 0 VmFlags: rd ex mr mw me dw So it appears 740KiB has been referenced, 752KiB resident. There's also the read-only mapping: 55aa06076000-55aa0609b000 r--p 000ec000 fd:01 1823 /lib/systemd/systemd Size: 148 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 148 kB Pss: 74 kB Shared_Clean: 0 kB Shared_Dirty: 148 kB Private_Clean: 0 kB Private_Dirty: 0 kB Referenced: 148 kB Anonymous: 148 kB LazyFree: 0 kB AnonHugePages: 0 kB ShmemPmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 0 VmFlags: rd mr mw me dw ac Another 148KiB, so 900KiB, a good chunk of the 1.1MiB - though this is with a substantial uptime. The really disgusting part is all the dependencies; `pmap 1` says 57MiB total, and there's not much anonymous memory to blame.
- PeCaN 7y agoPGO detects hot/cold functions and places them together¹ ², but I imagine whatever it needs on startup is probably not especially hot. …Though it might all be cold, which would have the same effect, actually. ― ¹ At least on GCC but I would be very surprised if clang doesn't also do this. ² You can also do this manually with __attribute__((hot)) and __attribute__((cold))
- the8472 7y agoPGO may not be the right tool for this. Mozilla used custom instrumentation and linker scripts to achieve symbol ordering optimized for startup. https://web.archive.org/web/20100223202038/http://blog.mozilla.com/tglek/2010/02/19/teaching-ld-to-optimize-binaries-for-startup/ https://web.archive.org/web/20100223202038/http://blog.mozil...