Page MenuHomeFreeBSD

7/7 vfs: per-cpu batched requeuing of free vnodes
ClosedPublic

Authored by mjg on Jan 1 2020, 11:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 5:18 AM
Unknown Object (File)
Jan 2 2024, 9:38 PM
Unknown Object (File)
Dec 20 2023, 3:21 AM
Unknown Object (File)
Nov 7 2023, 9:54 AM
Unknown Object (File)
Oct 6 2023, 8:49 AM
Unknown Object (File)
Jul 12 2023, 7:05 PM
Unknown Object (File)
Dec 5 2022, 10:37 PM
Unknown Object (File)
Nov 28 2022, 11:23 AM
Subscribers

Details

Summary

Constant requeuing adds significant lock contention in certain
workloads. Lessen the problem by batching this.

Per-cpu areas are locked in order to synchronize against UMA freeing
memory.

vnode's v_mflag is converted to short to prevent the struct from
growing.

Sample result from an incremental make -s -j 104 bzImage on tmpfs:
stock: 122.38s user 1780.45s system 6242% cpu 30.480 total
patched: 144.84s user 985.90s system 4856% cpu 23.282 total

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

  • rename vnode_defer to vdbatch
  • consistnely use vdbatch* names everywhere
  • add more asserts
  • fix a counting bug reported by pho
mjg retitled this revision from 5/5 vfs: per-cpu batched requeuing of free vnodes to 7/7 vfs: per-cpu batched requeuing of free vnodes.Jan 5 2020, 4:07 AM
jeff added inline comments.
sys/kern/vfs_subr.c
305

We are starting to repeat this pattern in multiple places. Might be worth making a new api eventually.

3220

I would leave this pinned until vd is unlocked. It probably won't matter but it will potentially reduce contention.

This revision is now accepted and ready to land.Jan 12 2020, 7:59 PM
This revision was automatically updated to reflect the committed changes.