FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
/*
 * This is the list priority from which the L2ARC will search for pages to
 * cache.  This is used within loops (0..3) to cycle through lists in the
 * desired order.  This order can have a significant effect on cache
 * performance.
 *
 * Currently the metadata lists are hit first, MFU then MRU, followed by
 * the data lists.  This function returns a locked list, and also returns
 * the lock pointer.
 */
This is the list priority from which the L2ARC will search for pages to
cache.  This is used within loops (0..3) to cycle through lists in the
desired order.  This order can have a significant effect on cache
performance.

Currently the metadata lists are hit first, MFU then MRU, followed by
the data lists.  This function returns a locked list, and also returns
the lock pointer.
This is the list priority from which the L2ARC will search for pages to cache . This is used within loops ( 0 .. 3 ) to cycle through lists in the desired order . This order can have a significant effect on cache performance . Currently the metadata lists are hit first MFU then MRU followed by the data lists . This function returns a locked list and also returns the lock pointer .
static multilist_sublist_t *
l2arc_sublist_lock(int list_num)
{
	multilist_t *ml = NULL;
	unsigned int idx;
	ASSERT(list_num >= 0 && list_num <= 3);
	switch (list_num) {
	case 0:
		ml = &arc_mfu->arcs_list[ARC_BUFC_METADATA];
		break;
	case 1:
		ml = &arc_mru->arcs_list[ARC_BUFC_METADATA];
		break;
	case 2:
		ml = &arc_mfu->arcs_list[ARC_BUFC_DATA];
		break;
	case 3:
		ml = &arc_mru->arcs_list[ARC_BUFC_DATA];
		break;
	}
	idx = multilist_get_random_index(ml);
	return (multilist_sublist_lock(ml, idx));
}
static multilist_sublist_t * l2arc_sublist_lock ( int list_num ) { multilist_t * ml = NULL ; unsigned int idx ; ASSERT ( list_num >= 0 && list_num <= 3 ) ; switch ( list_num ) { case 0 : ml = & arc_mfu -> arcs_list [ ARC_BUFC_METADATA ] ; break ; case 1 : ml = & arc_mru -> arcs_list [ ARC_BUFC_METADATA ] ; break ; case 2 : ml = & arc_mfu -> arcs_list [ ARC_BUFC_DATA ] ; break ; case 3 : ml = & arc_mru -> arcs_list [ ARC_BUFC_DATA ] ; break ; } idx = multilist_get_random_index ( ml ) ; return ( multilist_sublist_lock ( ml , idx ) ) ; }
This is the list priority from which the L2ARC will search for pages to
 cache.
This is the list priority from which the L2ARC will search for pages to cache .
/*
	 * Return a randomly-selected sublist. This is acceptable
	 * because the caller feeds only a little bit of data for each
	 * call (8MB). Subsequent calls will result in different
	 * sublists being selected.
	 */