FreeBSD/sys/geom/geom_kern.c
/*
 * G_UP and G_DOWN are the two threads which push I/O through the
 * stack.
 *
 * Things are procesed in a FIFO order, but these threads could be
 * part of I/O prioritization by deciding which bios/bioqs to service
 * in what order.
 *
 * We have only one thread in each direction, it is believed that until
 * a very non-trivial workload in the UP/DOWN path this will be enough,
 * but more than one can actually be run without problems.
 *
 * Holding the "mymutex" is a debugging feature:  It prevents people
 * from sleeping in the UP/DOWN I/O path by mistake or design (doing
 * so almost invariably result in deadlocks since it stalls all I/O
 * processing in the given direction.
 */
G_UP and G_DOWN are the two threads which push I/O through the
stack.

Things are procesed in a FIFO order, but these threads could be
part of I/O prioritization by deciding which bios/bioqs to service
in what order.

We have only one thread in each direction, it is believed that until
a very non-trivial workload in the UP/DOWN path this will be enough,
but more than one can actually be run without problems.

Holding the "mymutex" is a debugging feature:  It prevents people
from sleeping in the UP/DOWN I/O path by mistake or design (doing
so almost invariably result in deadlocks since it stalls all I/O
processing in the given direction.
G_UP and G_DOWN are the two threads which push I / O through the stack . Things are procesed in a FIFO order but these threads could be part of I / O prioritization by deciding which bios / bioqs to service in what order . We have only one thread in each direction it is believed that until a very non - trivial workload in the UP / DOWN path this will be enough but more than one can actually be run without problems . Holding the " mymutex " is a debugging feature : It prevents people from sleeping in the UP / DOWN I / O path by mistake or design ( doing so almost invariably result in deadlocks since it stalls all I / O processing in the given direction .
static void
g_up_procbody(void *arg)
{
	thread_lock(g_up_td);
	sched_prio(g_up_td, PRIBIO);
	thread_unlock(g_up_td);
	for(;;) {
		g_io_schedule_up(g_up_td);
	}
}
static void g_up_procbody ( void * arg ) { thread_lock ( g_up_td ) ; sched_prio ( g_up_td , PRIBIO ) ; thread_unlock ( g_up_td ) ; for ( ; ; ) { g_io_schedule_up ( g_up_td ) ; } }
G_UP and G_DOWN are the two threads which push I/O through the
 stack.
G_UP and G_DOWN are the two threads which push I / O through the stack .