
Kernfs as the functions/frameworks used for creating pseudo file-systems on Linux like sysfs and configfs have seen some nice scalability work carried out by Meta. After Meta engineers discovered some system daemons getting stuck for minutes on their massive fleet of servers, they uncovered some scalability bottlenecks within Kernfs that now look to be resolved for Linux 7.4.
Shakeel Butt at Meta worked through multiple different issues within the Kernfs code to address their scalability issues and bottlenecks where cgroup-related interfaces could be stuck for long periods of time.
Butt authored 18 patches for Linux 7.4 in enhancing the Kernfs code. The code improves the handling around different locks in Kernfs as well as fixing a few Kernfs bugs in the process.
Some of the most significant work was in this group of four patches:
"Readers walking cgroupfs and sysfs while another thread churns cgroups, renames netdevs and adds/removes devices, on an 8-CPU VM:kernfs_rwsem read contentions revalidate among
acquisitions top call sites
before 48,593,360 1,744,517 #1 and #2
after 1,280,280 429,846 absentReader path-walk throughput improved 35-53% over the same workload."
Quite a nice win and that's just from four of the 18 patches now merged for Linux 7.4.
More details on these Kernfs scalability improvements for addressing what Meta encountered in real-world usage can be found via this pull request.