MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bufspace_daemon_wait

Function bufspace_daemon_wait

freebsd/kern/vfs_bio.c:635–655  ·  view source on GitHub ↗

* bufspace_daemon_wait: * * Sleep until the domain falls below a limit or one second passes. */

Source from the content-addressed store, hash-verified

633 * Sleep until the domain falls below a limit or one second passes.
634 */
635static void
636bufspace_daemon_wait(struct bufdomain *bd)
637{
638 /*
639 * Re-check our limits and sleep. bd_running must be
640 * cleared prior to checking the limits to avoid missed
641 * wakeups. The waker will adjust one of bufspace or
642 * freebuffers prior to checking bd_running.
643 */
644 BD_RUN_LOCK(bd);
645 atomic_store_int(&bd->bd_running, 0);
646 if (bd->bd_bufspace < bd->bd_bufspacethresh &&
647 bd->bd_freebuffers > bd->bd_lofreebuffers) {
648 msleep(&bd->bd_running, BD_RUN_LOCKPTR(bd), PRIBIO|PDROP,
649 "-", hz);
650 } else {
651 /* Avoid spurious wakeups while running. */
652 atomic_store_int(&bd->bd_running, 1);
653 BD_RUN_UNLOCK(bd);
654 }
655}
656
657/*
658 * bufspace_adjust:

Callers 1

bufspace_daemonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected