psi: fix possible trigger missing in the window
Subsystems (3)
PATCH v4 1/1 psi: fix possible trigger missing in the window
From: Zhaoyang Huang <[email protected]>
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall, window_update will not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
---
v2: modify the logic according to Suren's suggestion
v3: update commit message
v4: update variable name and comments
---
--- include/linux/psi_types.h | 3 +++ kernel/sched/psi.c | 46 ++++++++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 16 deletions(-)
include/linux/psi_types.h +3 -0
@@ -132,6 +132,9 @@ struct psi_trigger {/* Refcounting to prevent premature destruction */ struct kref refcount; + +/* Deferred event(s) from previous ratelimit window */ +bool pending_event; };struct psi_group {
kernel/sched/psi.c +30 -16
76 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 12 lines · Huangzhaoyang
From: Zhaoyang Huang <[email protected]>
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall,
window_updatewill not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
Quoted 2 lines
Suggested-by Suren Baghdasaryan <[email protected]>Signed-off-by Zhaoyang Huang <[email protected]>
Quoted 14 lines · Johannes Weiner
Quoted 12 lines · Huangzhaoyang
From: Zhaoyang Huang <[email protected]>
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall,
window_updatewill not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
Quoted 4 lines
Quoted 2 lines
Suggested-by Suren Baghdasaryan <[email protected]>Signed-off-by Zhaoyang Huang <[email protected]>Acked-by Johannes Weiner <[email protected]>
Looks good. Thanks!
Johannes Weiner
maintainerQuoted 12 lines · Huangzhaoyang
From: Zhaoyang Huang <[email protected]>
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall,
window_updatewill not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
Quoted 2 lines
Suggested-by Suren Baghdasaryan <[email protected]>Signed-off-by Zhaoyang Huang <[email protected]>
Hey Peter, would you mind taking this through the scheduler tree? It's got my and Suren's acks. It's not a recent regression so I'm thinking for 5.18 is fine. Thanks!
Peter Zijlstra
maintainerQuoted 13 lines · Johannes Weiner
Quoted 12 lines · Huangzhaoyang
From: Zhaoyang Huang <[email protected]>
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall,
window_updatewill not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
Quoted 6 lines
Quoted 2 lines
Suggested-by Suren Baghdasaryan <[email protected]>Signed-off-by Zhaoyang Huang <[email protected]>Hey Peter, would you mind taking this through the scheduler tree? It's got my and Suren's acks. It's not a recent regression so I'm thinking for 5.18 is fine. Thanks!
Sorry, missed it, got it now. Thanks!
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: e6df4ead85d9da1b07dd40bd4c6d2182f3e210c4 Gitweb: https://git.kernel.org/tip/e6df4ead85d9da1b07dd40bd4c6d2182f3e210c4 Author: Zhaoyang Huang <[email protected]> AuthorDate: Tue, 25 Jan 2022 14:56:58 +08:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Wed, 16 Feb 2022 15:57:54 +01:00
psi: fix possible trigger missing in the window
When a new threshold breaching stall happens after a psi event was generated and within the window duration, the new event is not generated because the events are rate-limited to one per window. If after that no new stall is recorded then the event will not be generated even after rate-limiting duration has passed. This is happening because with no new stall, window_update will not be called even though threshold was previously breached. To fix this, record threshold breaching occurrence and generate the event once window duration is passed.
--- include/linux/psi_types.h | 3 ++- kernel/sched/psi.c | 46 ++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 16 deletions(-)
include/linux/psi_types.h +3 -0
@@ -144,6 +144,9 @@ struct psi_trigger {/* Refcounting to prevent premature destruction */ struct kref refcount; + +/* Deferred event(s) from previous ratelimit window */ +bool pending_event; };struct psi_group {
kernel/sched/psi.c +30 -16
76 lines not on this page · raw message