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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <252cd5acd9bf6588ec87ce02884925c737b6a8b7.camel@gmx.de>
Date:   Sun, 28 Nov 2021 11:00:59 +0100
From:   Mike Galbraith <efault@....de>
To:     Alexey Avramov <hakavlad@...ox.lv>,
        Mel Gorman <mgorman@...hsingularity.net>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Rik van Riel <riel@...riel.com>,
        Darrick Wong <djwong@...nel.org>, regressions@...ts.linux.dev,
        Linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux-MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] mm: vmscan: Reduce throttling due to a failure to
 make progress

On Sun, 2021-11-28 at 04:26 +0900, Alexey Avramov wrote:
> I will present the results of the new tests here.
>
> TLDR;
> =====
> No one Mel's patch doesn't prevent stalls in my tests.

Seems there may be a problem with the THROTTLE_WRITEBACK bits..

> $ for i in {1..10}; do tail /dev/zero; done
> -- 1. with noswap

..because the bandaid below (made of 8cd7c588 shards) on top of Mel's
last pulled that one-liner's very pointy fangs.

---
 mm/backing-dev.c |    5 +++++
 mm/vmscan.c      |    8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -1055,3 +1055,8 @@ long congestion_wait(int sync, long time
 	return ret;
 }
 EXPORT_SYMBOL(congestion_wait);
+
+int async_bdi_congested(void)
+{
+	return atomic_read(&nr_wb_congested[BLK_RW_ASYNC]) != 0;
+}
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1021,6 +1021,8 @@ static void handle_write_error(struct ad
 	unlock_page(page);
 }

+extern int async_bdi_congested(void);
+
 void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason)
 {
 	wait_queue_head_t *wqh = &pgdat->reclaim_wait[reason];
@@ -1048,6 +1050,10 @@ void reclaim_throttle(pg_data_t *pgdat,
 	 */
 	switch(reason) {
 	case VMSCAN_THROTTLE_WRITEBACK:
+		if (!async_bdi_congested()) {
+			cond_resched();
+			return;
+		}
 		timeout = HZ/10;

 		if (atomic_inc_return(&pgdat->nr_writeback_throttled) == 1) {
@@ -1079,7 +1085,7 @@ void reclaim_throttle(pg_data_t *pgdat,
 	}

 	prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
-	ret = schedule_timeout(timeout);
+	ret = io_schedule_timeout(timeout);
 	finish_wait(wqh, &wait);

 	if (reason == VMSCAN_THROTTLE_WRITEBACK)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ