[PATCH] block: adjust the judgment order in submit_bio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Liu Song <liusong@xxxxxxxxxxxxxxxxx>

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

Signed-off-by: Liu Song <liusong@xxxxxxxxxxxxxxxxx>
---
 block/blk-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 06ff5bb..7b6809b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -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);
-- 
1.8.3.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux