r/programming • u/petros211 • 12d ago
What it takes to count the Linux kernel's 36M lines of code in under 70ms
https://petros-papatheodorou.dev/writing/mezura/counting-the-linux-kernel/
264
Upvotes
87
u/ArtOfWarfare 12d ago
I can’t tell why this is a problem someone wants solved in the first place?
45
u/mark_99 12d ago edited 12d ago
Nice write up.
However this caught my eye, if I'm reading it right :
> Files of 256 KiB and larger are mapped with mmap, which cut wall time by 9% and page faults in half. Files modified in the last five seconds fall back to read, since truncating a mapped file mid-scan kills the process with SIGBUS.
I think I'd rather have it take a few more millis but not segfault if the files it's scanning are concurrently modified. Adding a heuristic check doesn't seem like the same thing as correct. It seems reasonable to say if the files are being modified the result might be slightly inaccurate, but maybe crashing doesn't seem ok.
-104
u/pellets 12d ago
Interesting article in some ways, but needs a run through the LLM agent being told to make it more concise or something like that. Spend more time on the result and less time on the story of how the agent got there.