Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp483835rwi; Mon, 31 Oct 2022 04:09:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM57yzjb1fSb4L7fe/KYEJBjOI1i9VadzuXrjSl+kCsn4uGnVl4vzJ92S4WC8WX7oy1z6+iv X-Received: by 2002:a50:c302:0:b0:463:26d6:25fb with SMTP id a2-20020a50c302000000b0046326d625fbmr8235109edb.204.1667214588936; Mon, 31 Oct 2022 04:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667214588; cv=none; d=google.com; s=arc-20160816; b=lbnni6raMt25UYbXYz7q/ZCrTS5RSItlvSCnZu5jMXFlAl0Sb3FyrXIIdMKo06pURL AMKQ2vU31nOz0M67590ExslpacEN3vGaQXLTyW34eUNXeVDgjWwHJwhFjJb40fdDW7Wx CSGVRFQ4xXGowFtLtn7yWuRBYCxp02PqcAt3hE0FzsqxczAnfMoBHB7mKnyJIP4BRNDu e2YP94jwtL5sCGG+uQVtKrMHmzv4oo0eIHiVotK9L+dXoWvx5q84oMg1ZhQ/hzy+rxhO f5I4D0c/FpU8Zh0Eu4E3DENPLeg6vmlXKczq8oxEVEj7KOo0wrf1gEOeznHyf3BhdBVS k0ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Hov2Y61IE84s9ZxCrB09rbK/g7ijp4Z6517H7xL3HbM=; b=hh8nfe6ZCXHM2Fv3QQhSx9iRz/YPiXwkgmCZ6J5X2vsf3TaA7u5zyM4MZcmZFsuWRr RpjWSQsvN7zfenZaGhGe5moN3LqTWchNOdjzbWZ7UmYR/zvxPoaPspCmybSQ+7mVltCQ m2WGCZBRmfJhMfOa1BrBO0d8u+Pj+ozXi39vdtSUxY7N833NeyLawIvfY89ZhIWH3cAm GUvT0xszHOxsSfOj4ZonIzNwDvxUug3FtjFtbcPURmbTgTqnb8EbBtWvC3+Hu3f+GggC 1D0FNNQ44FYTr/oi3Bw2IfuVUpMsrdSmIH6eByNgD3ySnY5d1nh6QJq/Q3mrvLe966bI 96ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iQL1H0lS; dkim=neutral (no key) header.i=@linutronix.de header.b=BfZxjJPD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a056402144700b004615937b174si7173466edx.480.2022.10.31.04.09.25; Mon, 31 Oct 2022 04:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iQL1H0lS; dkim=neutral (no key) header.i=@linutronix.de header.b=BfZxjJPD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbiJaKyR (ORCPT + 98 others); Mon, 31 Oct 2022 06:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbiJaKyD (ORCPT ); Mon, 31 Oct 2022 06:54:03 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9A1B1E; Mon, 31 Oct 2022 03:54:02 -0700 (PDT) Date: Mon, 31 Oct 2022 10:54:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667213641; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hov2Y61IE84s9ZxCrB09rbK/g7ijp4Z6517H7xL3HbM=; b=iQL1H0lSl+AewlbcpUgIKu++1odlbofZJjOAICS7cdO6Mynd7pHN+gVM2bfSlL6/+QZIee 1ju0rexJqeTtG+RLn1obcqsIOxinqGnB0Z+7ZwwvdlDRBvpxdMdmnzXa10CbOkumggvkG9 i/WZRG5ubu4TVWIFKl2UPHFLtoHPKJdI+UQUSTQod3cMMafjDvVYnXCYrUojMW6YbxZ4QB LeBx9F41+19TCRTEB4qZL+9MjpM8vxv7IPg5bVhC9motuI52xS8Ai5d7PR7CfjGxdZLMwU bZZE00W15h/XKTi5TwCP1MUBi3pVqGnRsy25CkcgnIzXPxR7kBKWe1VDQ78N3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667213641; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hov2Y61IE84s9ZxCrB09rbK/g7ijp4Z6517H7xL3HbM=; b=BfZxjJPD7dyF1Ys8Rg2+EO86EsPbi0jAiGDcdtmgcUR/Ecwr6ItAH45wigF9wzQ6E4xYG+ fYhdpmo1/qPv1WCA== From: "tip-bot2 for Hao Lee" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/psi: Fix possible missing or delayed pending event Cc: Hao Lee , "Peter Zijlstra (Intel)" , Suren Baghdasaryan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220919072356.GA29069@haolee.io> References: <20220919072356.GA29069@haolee.io> MIME-Version: 1.0 Message-ID: <166721364005.7716.252588638039192570.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: e38f89af6a13e895805febd3a329a13ab7e66fa4 Gitweb: https://git.kernel.org/tip/e38f89af6a13e895805febd3a329a13ab7e66fa4 Author: Hao Lee AuthorDate: Mon, 19 Sep 2022 07:23:56 Committer: Peter Zijlstra CommitterDate: Sun, 30 Oct 2022 10:12:13 +01: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 Signed-off-by: Peter Zijlstra (Intel) Acked-by: Suren Baghdasaryan 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 ee2ecc0..7f40d87 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -539,10 +539,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)