freebsd-nq/sys/ufs/ffs
Konstantin Belousov 1bc93bb7b9 Currently, softupdate code detects overstepping on the workitems
limits in the code which is deep in the call stack, and owns several
critical system resources, like vnode locks.  Attempt to wait while
the per-mount softupdate thread cleans up the backlog may deadlock,
because the thread might need to lock the same vnode which is owned by
the waiting thread.

Instead of synchronously waiting for the worker, perform the worker'
tickle and pause until the backlog is cleaned, at the safe point
during return from kernel to usermode.  A new ast request to call
softdep_ast_cleanup() is created, the SU code now only checks the size
of queue and schedules ast.

There is no ast delivery for the kernel threads, so they are exempted
from the mechanism, except NFS daemon threads.  NFS server loop
explicitely checks for the request, and informs the schedule_cleanup()
that it is capable of handling the requests by the process P2_AST_SU
flag.  This is needed because nfsd may be the sole cause of the SU
workqueue overflow.  But, to not cause nsfd to spawn additional
threads just because we slow down existing workers, only tickle su
threads, without waiting for the backlog cleanup.

Reviewed by:	jhb, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-05-27 09:20:42 +00:00
..
ffs_alloc.c Limit the number of cylinder groups that will be searched when 2015-04-24 23:27:50 +00:00
ffs_balloc.c
ffs_extern.h
ffs_inode.c
ffs_rawread.c
ffs_snapshot.c The VOP_LOOKUP() implementations for CREATE op do not put the name 2014-12-18 10:01:12 +00:00
ffs_softdep.c Currently, softupdate code detects overstepping on the workitems 2015-05-27 09:20:42 +00:00
ffs_subr.c
ffs_suspend.c
ffs_tables.c
ffs_vfsops.c Limit the number of cylinder groups that will be searched when 2015-04-24 23:27:50 +00:00
ffs_vnops.c
fs.h
softdep.h When mounting SU-enabled mount point, wait until the softdep_flush() 2015-01-30 11:41:46 +00:00