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
F122027971: D22998.id66297.diff
Tue, Jul 1, 2:16 PM
Unknown Object (File)
Mon, Jun 30, 2:24 PM
Unknown Object (File)
Sun, Jun 29, 7:49 AM
Unknown Object (File)
Thu, Jun 26, 8:05 PM
Unknown Object (File)
Thu, Jun 26, 2:48 AM
Unknown Object (File)
Wed, Jun 25, 4:06 AM
Unknown Object (File)
Tue, Jun 17, 11:15 PM
Unknown Object (File)
Sat, Jun 14, 1:19 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.