Skip to content

Commit 76a86f9

Browse files
committed
block: remove REQ_ATOM_POLL_SLEPT
We don't need this to be an atomic flag, it can be a regular flag. We either end up on the same CPU for the polling, in which case the state is sane, or we did the sleep which would imply the needed barrier to ensure we see the right state. Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Omar Sandoval <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 5d75d3f commit 76a86f9

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

block/blk-mq-debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ static const char *const rqf_name[] = {
290290
RQF_NAME(SPECIAL_PAYLOAD),
291291
RQF_NAME(ZONE_WRITE_LOCKED),
292292
RQF_NAME(MQ_TIMEOUT_EXPIRED),
293+
RQF_NAME(MQ_POLL_SLEPT),
293294
};
294295
#undef RQF_NAME
295296

296297
#define RQAF_NAME(name) [REQ_ATOM_##name] = #name
297298
static const char *const rqaf_name[] = {
298299
RQAF_NAME(COMPLETE),
299-
RQAF_NAME(POLL_SLEPT),
300300
};
301301
#undef RQAF_NAME
302302

block/blk-mq.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ void blk_mq_free_request(struct request *rq)
483483
blk_put_rl(blk_rq_rl(rq));
484484

485485
blk_mq_rq_update_state(rq, MQ_RQ_IDLE);
486-
clear_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);
487486
if (rq->tag != -1)
488487
blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
489488
if (sched_tag != -1)
@@ -2976,7 +2975,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
29762975
unsigned int nsecs;
29772976
ktime_t kt;
29782977

2979-
if (test_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags))
2978+
if (rq->rq_flags & RQF_MQ_POLL_SLEPT)
29802979
return false;
29812980

29822981
/*
@@ -2996,7 +2995,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
29962995
if (!nsecs)
29972996
return false;
29982997

2999-
set_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);
2998+
rq->rq_flags |= RQF_MQ_POLL_SLEPT;
30002999

30013000
/*
30023001
* This will be replaced with the stats tracking code, using

block/blk.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ void blk_account_io_done(struct request *req);
124124
*/
125125
enum rq_atomic_flags {
126126
REQ_ATOM_COMPLETE = 0,
127-
128-
REQ_ATOM_POLL_SLEPT,
129127
};
130128

131129
/*

include/linux/blkdev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ typedef __u32 __bitwise req_flags_t;
127127
#define RQF_ZONE_WRITE_LOCKED ((__force req_flags_t)(1 << 19))
128128
/* timeout is expired */
129129
#define RQF_MQ_TIMEOUT_EXPIRED ((__force req_flags_t)(1 << 20))
130+
/* already slept for hybrid poll */
131+
#define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 21))
130132

131133
/* flags that prevent us from merging requests: */
132134
#define RQF_NOMERGE_FLAGS \

0 commit comments

Comments
 (0)