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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220813075207.58493-1-yang.yang29@zte.com.cn>
Date:   Sat, 13 Aug 2022 07:52:08 +0000
From:   cgel.zte@...il.com
To:     akpm@...ux-foundation.org, iamjoonsoo.kim@....com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Yang Yang <yang.yang29@....com.cn>,
        CGEL ZTE <cgel.zte@...il.com>,
        Ran Xiaokai <ran.xiaokai@....com.cn>,
        wangyong <wang.yong12@....com.cn>
Subject: [PATCH 2/2] mm/page_io: count submission time as thrashing delay for delayacct

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

Once upon a time, we only support accounting thrashing of page cache.
Then Joonsoo introduced workingset detection for anonymous pages and
we gained the ability to account thrashing of them[1].

Likes PSI, we count submission time because When the device is congested,
or the submitting cgroup IO-throttled, submission can be a significant
part of overall IO time.

This patch is based on "delayacct: support re-entrance detection of
thrashing accounting".

[1] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU")

Signed-off-by: Yang Yang <yang.yang29@....com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@...il.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Reviewed-by: Ran Xiaokai <ran.xiaokai@....com.cn>
Reviewed-by: wangyong <wang.yong12@....com.cn>
---
 mm/page_io.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 68318134dc92..d2f5e0527af6 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -453,18 +453,21 @@ int swap_readpage(struct page *page, bool synchronous,
 	struct swap_info_struct *sis = page_swap_info(page);
 	bool workingset = PageWorkingset(page);
 	unsigned long pflags;
+	unsigned long dflags;
 
 	VM_BUG_ON_PAGE(!PageSwapCache(page) && !synchronous, page);
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
 	VM_BUG_ON_PAGE(PageUptodate(page), page);
 
 	/*
-	 * Count submission time as memory stall. When the device is congested,
-	 * or the submitting cgroup IO-throttled, submission can be a
-	 * significant part of overall IO time.
+	 * Count 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 (workingset)
+	if (workingset) {
+		delayacct_thrashing_start(&dflags);
 		psi_memstall_enter(&pflags);
+	}
 	delayacct_swapin_start();
 
 	if (frontswap_load(page) == 0) {
@@ -513,8 +516,10 @@ int swap_readpage(struct page *page, bool synchronous,
 	bio_put(bio);
 
 out:
-	if (workingset)
+	if (workingset) {
+		delayacct_thrashing_end(&dflags);
 		psi_memstall_leave(&pflags);
+	}
 	delayacct_swapin_end();
 	return ret;
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ