kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf

Operating Systems / DragonFlyBSD - Matthew Dillon [apollo.backplane.com] - 22 April 2018 00:50 EDT

- Use an eventcounter and the per-thread fd cache to fix bottlenecks in checkfdclosed(). This will work well for the vast majority of applications and test benches.

- Batch holdfp*() operations on kqueue collections when implementing poll() and select(). This significant improves performance. Full scaling not yet achieved, however.

- Increase copyin item batching from 8 to 32 for select() and poll().

- Give the uidinfo structure a pcpu array to hold the posixlocks and openfiles count fields, with a rollup contained in the uidinfo structure itself.

This removes numerous global bottlenecks related to open(), close(), dup*(), and lockf operations (posixlocks count).

ui_openfiles will force a rollup on limit reached to be sure that the limit was actually reached. ui_posixlocks stays fairly loose. Each cpu rolls up generally only when the pcpu count exceeds +32 or goes below -32.

- Give the proc structure a pcpu array for the same counts, in order to properly support seteuid() and such.

- Replace P_ADVLOCK with a char field proc->p_advlock_flag, and remove token operations around the field.

d629916367 kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf
sys/kern/kern_descrip.c | 149 ++++++++++++++++++++++++-----------
sys/kern/kern_event.c | 198 ++++++++++++++++++++++++++++++++++++-----------
sys/kern/kern_exit.c | 3 +-
sys/kern/kern_fork.c | 2 +
sys/kern/kern_lockf.c | 44 +++++++----
sys/kern/kern_resource.c | 6 +-
sys/kern/sys_generic.c | 17 ++--
sys/sys/event.h | 3 +-
sys/sys/eventvar.h | 2 +-
sys/sys/file.h | 3 +-
sys/sys/filedesc.h | 2 +
sys/sys/proc.h | 8 +-
sys/sys/resourcevar.h | 19 ++++-
13 files changed, 334 insertions(+), 122 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share