Page MenuHomeFreeBSD

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

Authored by mjg on Jan 1 2020, 11:00 PM.

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

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjg created this revision.Jan 1 2020, 11:00 PM
mjg updated this revision to Diff 66297.Jan 3 2020, 12:36 PM
  • rename vnode_defer to vdbatch
mjg updated this revision to Diff 66299.Jan 3 2020, 2:52 PM
  • 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
mjg updated this revision to Diff 66450.Jan 7 2020, 5:14 PM
  • rebase
jeff accepted this revision.Jan 12 2020, 7:59 PM
jeff added inline comments.
sys/kern/vfs_subr.c
299 ↗(On Diff #66450)

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

3261 ↗(On Diff #66450)

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.