Thread (2 messages) 2 messages, 2 authors, 2017-01-23

__blk_mq_tag_busy() weirdness

From: Hannes Reinecke <hare@suse.de>
Date: 2017-01-23 14:07:35

Hi Jens,

while hunting yet another queue stall I've been looking at
__blk_mq_tag_busy():

bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
{
	if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) &&
	    !test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
		atomic_inc(&hctx->tags->active_queues);

	return true;
}

Is this some subtle usage of bitops (and I just didn't grasp it) or is
the first test_bit() pointless?
If the former I _really_ would like to have some comments on why this is
required.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help