File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,20 @@ void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
39
39
{
40
40
unsigned int users ;
41
41
42
+ /*
43
+ * calling test_bit() prior to test_and_set_bit() is intentional,
44
+ * it avoids dirtying the cacheline if the queue is already active.
45
+ */
42
46
if (blk_mq_is_shared_tags (hctx -> flags )) {
43
47
struct request_queue * q = hctx -> queue ;
44
48
45
- if (test_bit (QUEUE_FLAG_HCTX_ACTIVE , & q -> queue_flags ))
49
+ if (test_bit (QUEUE_FLAG_HCTX_ACTIVE , & q -> queue_flags ) ||
50
+ test_and_set_bit (QUEUE_FLAG_HCTX_ACTIVE , & q -> queue_flags ))
46
51
return ;
47
- set_bit (QUEUE_FLAG_HCTX_ACTIVE , & q -> queue_flags );
48
52
} else {
49
- if (test_bit (BLK_MQ_S_TAG_ACTIVE , & hctx -> state ))
53
+ if (test_bit (BLK_MQ_S_TAG_ACTIVE , & hctx -> state ) ||
54
+ test_and_set_bit (BLK_MQ_S_TAG_ACTIVE , & hctx -> state ))
50
55
return ;
51
- set_bit (BLK_MQ_S_TAG_ACTIVE , & hctx -> state );
52
56
}
53
57
54
58
users = atomic_inc_return (& hctx -> tags -> active_queues );
You can’t perform that action at this time.
0 commit comments