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]
Date:   Fri, 28 Oct 2022 06:42:07 -0000
From:   "tip-bot2 for Hao Lee" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Hao Lee <haolee.swjtu@...il.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Suren Baghdasaryan <surenb@...gle.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: sched/core] sched/psi: Fix possible missing or delayed pending event

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     c36eae5a86d15a694968be35d7ff056854997a72
Gitweb:        https://git.kernel.org/tip/c36eae5a86d15a694968be35d7ff056854997a72
Author:        Hao Lee <haolee.swjtu@...il.com>
AuthorDate:    Mon, 19 Sep 2022 07:23:56 
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 27 Oct 2022 11:01:23 +02:00

sched/psi: Fix possible missing or delayed pending event

When a pending event exists and growth is less than the threshold, the
current logic is to skip this trigger without generating event. However,
from e6df4ead85d9 ("psi: fix possible trigger missing in the window"),
our purpose is to generate event as long as pending event exists and the
rate meets the limit, no matter what growth is.
This patch handles this case properly.

Fixes: e6df4ead85d9 ("psi: fix possible trigger missing in the window")
Signed-off-by: Hao Lee <haolee.swjtu@...il.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Suren Baghdasaryan <surenb@...gle.com>
Link: https://lore.kernel.org/r/20220919072356.GA29069@haolee.io
---
 kernel/sched/psi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index f4cdf6f..dbaeac9 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -554,10 +554,12 @@ static u64 update_triggers(struct psi_group *group, u64 now)
 
 			/* Calculate growth since last update */
 			growth = window_update(&t->win, now, total[t->state]);
-			if (growth < t->threshold)
-				continue;
+			if (!t->pending_event) {
+				if (growth < t->threshold)
+					continue;
 
-			t->pending_event = true;
+				t->pending_event = true;
+			}
 		}
 		/* Limit event signaling to once per window */
 		if (now < t->last_event_time + t->win.size)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ