lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 25 Aug 2022 12:14:28 +0000
From:   cgel.zte@...il.com
To:     bsingharora@...il.com, akpm@...ux-foundation.org,
        iamjoonsoo.kim@....com
Cc:     axboe@...nel.dk, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yang Yang <yang.yang29@....com.cn>,
        Ran Xiaokai <ran.xiaokai@....com.cn>,
        wangyong <wang.yong12@....com.cn>
Subject: [PATCH] block: count submission time as thrashing delay for delayacct

From: Yang Yang <yang.yang29@....com.cn>

PSI tracks the time system waiting for refaulting pages(or called
thrashing) spent on submitting the IO[1]. Delayacct also tracks
thrashing, but we failed to update it accordingly.

And we then have the ability to detect re-entrance of thrashing
accounting for delayacct[2], so we complete the accounting now.
This will make the thrashing accounting more accurate specifically
when device is congested or the submitting cgroup IO-throttled.

[1] commit b8e24a9300b0 ("block: annotate refault stalls from IO submission")
[2] commit 317bdccd67b2 ("delayacct: support re-entrance detection of thrashing accounting")

Signed-off-by: Yang Yang (CGEL ZTE) <yang.yang29@....com.cn>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Ran Xiaokai (CGEL ZTE) <ran.xiaokai@....com.cn>
Cc: wangyong (CGEL ZTE) <wang.yong12@....com.cn>
---
 block/blk-core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index a0d1104c5590..d722ead0557f 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -41,6 +41,7 @@
 #include <linux/part_stat.h>
 #include <linux/sched/sysctl.h>
 #include <linux/blk-crypto.h>
+#include <linux/delayacct.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/block.h>
@@ -831,16 +832,19 @@ void submit_bio(struct bio *bio)
 
 	/*
 	 * If we're reading data that is part of the userspace workingset, count
-	 * submission time as memory stall.  When the device is congested, or
-	 * the submitting cgroup IO-throttled, submission can be a significant
+	 * submission time as memory stall and delay. When the device is congested,
+	 * or 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))) {
 		unsigned long pflags;
+		bool in_thrashing;
 
+		delayacct_thrashing_start(&in_thrashing);
 		psi_memstall_enter(&pflags);
 		submit_bio_noacct(bio);
+		delayacct_thrashing_end(&in_thrashing);
 		psi_memstall_leave(&pflags);
 		return;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ