3 ms·
It's also interesting that the perf report for running dut on my homedir shows that it spends virtually all of the time looking for, not finding, and inserting
by jeffbee 2y ago
It's also interesting that the perf report for running dut on my homedir shows that it spends virtually all of the time looking for, not finding, and inserting entries in dentry cache slabs, where the entries are never found again, only inserted :-/ Great cache management by the kernel there.
ETA: Apparently the value in /proc/sys/vm/vfs_cache_pressure makes a huge difference. With the default of 100, my dentry and inode caches never grow large enough to contain the ~15M entries in my homedir. Dentry slabs get reclaimed to stay < 1% of system RAM, while the xfs_inode slab cache grows to the correct size. The threads in dut are pointless in this case because the access to the xfs inodes serializes.
If I set this kernel param to 15, then the caches grow to accommodate the tens of millions of inodes in my homedir. Ultimately the slab caches occupy 20GB of RAM! When the caches are working the threading in dut is moderately effective, job finishes in 5s with 200% CPU time.
- 201984 2y agoAre you referring to the kmem_cache_alloc calls in the profile? If so, that's all in kernel space and there's nothing I can do about it. https://share.firefox.dev/3XT9L7P https://share.firefox.dev/3XT9L7P
- jeffbee 2y agoNo, see how your profiles have `lookup_fast` at the leaves? Mine has `__lookup_slow` and it is slow indeed.
- 201984 2y agoI just saw your edit. You have WAY more stuff under your home directory than I do. I only have ~2.5M inodes on both my laptop drives combined. The difference in the buff/cache output of `free` before and after running `dut` is only 1 GB for me. Also, TIL about that kernel parameter, thanks!
- jeffbee 2y agoYeah I have a TB of bazel outputs in my cache directory. Unfortunately automatically deleting old bazel outputs is beyond the frontier of computer science and has been pushed out to future releases for 6 years and still going: https://github.com/bazelbuild/bazel/issues/5139 https://github.com/bazelbuild/bazel/issues/5139