linux/block/blk-mq-tag.c
/*
 * For shared tag users, we track the number of currently active users
 * and attempt to provide a fair share of the tag depth for each of them.
 */
For shared tag users, we track the number of currently active users
and attempt to provide a fair share of the tag depth for each of them.
For shared tag users we track the number of currently active users and attempt to provide a fair share of the tag depth for each of them .
static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
				  struct sbitmap_queue *bt)
{
	unsigned int depth, users;
	if (!hctx || !(hctx->flags & BLK_MQ_F_TAG_SHARED))
		return true;
	if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
		return true;
	if (bt->sb.depth == 1)
		return true;
	users = atomic_read(&hctx->tags->active_queues);
	if (!users)
		return true;
	depth = max((bt->sb.depth + users - 1) / users, 4U);
	return atomic_read(&hctx->nr_active) < depth;
}
static inline bool hctx_may_queue ( struct blk_mq_hw_ctx * hctx , struct sbitmap_queue * bt ) { unsigned int depth , users ; if ( ! hctx || ! ( hctx -> flags & BLK_MQ_F_TAG_SHARED ) ) return true ; if ( ! test_bit ( BLK_MQ_S_TAG_ACTIVE , & hctx -> state ) ) return true ; if ( bt -> sb . depth == 1 ) return true ; users = atomic_read ( & hctx -> tags -> active_queues ) ; if ( ! users ) return true ; depth = max ( ( bt -> sb . depth + users - 1 ) / users , 4U ) ; return atomic_read ( & hctx -> nr_active ) < depth ; }
For shared tag users, we track the number of currently active users
 and attempt to provide a fair share of the tag depth for each of them.
For shared tag users we track the number of currently active users and attempt to provide a fair share of the tag depth for each of them .
/*
	 * Don't try dividing an ant
	 */ /*
	 * Allow at least some tags
	 */