Skip to contentSkip to conversation

block: adjust the judgment order in submit_bio

PATCH In review Liu Song 2 participants 3 messages Jun 15, 2022 – Jun 17, 2022 Block layer

lore
Share & tools
lore

Liu Song

author
#0 lore raw

PATCH 1/1 block: adjust the judgment order in submit_bio

From: Liu Song <[email protected]>

BIO_WORKINGSET is rarer than read, so adjust to the first one to judge.

---
 block/blk-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-core.c +2 -2
index 06ff5bb..7b6809b 100644
@@ -901,8 +901,8 @@ void submit_bio(struct bio *bio)
 	 * the submitting cgroup IO-throttled, submission can be a significant
 	 * part of overall IO time.
 	 */
-	if (unlikely(bio_op(bio) == REQ_OP_READ &&
-	    bio_flagged(bio, BIO_WORKINGSET))) {
+	if (unlikely(bio_flagged(bio, BIO_WORKINGSET) &&
+		bio_op(bio) == REQ_OP_READ)) {
 		unsigned long pflags;
 
 		psi_memstall_enter(&pflags);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · Liu Song

From: Liu Song <[email protected]>

BIO_WORKINGSET is rarer than read, so adjust to the first one to judge.

Can you explain how this matters at all? The right thing is of course to get rid of this check and I need to finish the series to do that.

author
#2 lore raw
Quoted 6 lines
Quoted 3 lines

From: Liu Song <[email protected]>

BIO_WORKINGSET is rarer than read, so adjust to the first one to judge.

Can you explain how this matters at all? The right thing is of course to get rid of this check and I need to finish the series to do that.

Hi
This change do not involve functional changes, I just feel that it needs to
be emphasized that for example, the io triggered by refault is much less than the read.

Thanks