From patchwork Mon Oct 31 10:54:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 13202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2238423wru; Mon, 31 Oct 2022 03:55:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/jqduYi05A3mfoaQlk3kadMIlX2ECtaRnxig//TI3Nm2upBBjGQFa+U07x29JTSrT3ntR X-Received: by 2002:a17:90a:3ee5:b0:213:8550:72e3 with SMTP id k92-20020a17090a3ee500b00213855072e3mr20918710pjc.49.1667213729995; Mon, 31 Oct 2022 03:55:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667213729; cv=none; d=google.com; s=arc-20160816; b=UTGX+ubU45tcuWisXA0E2dW2oZKyYffz5R+pGtPtcE76JnnTzuacKVeHLuSBUPa8lD 4ORfPZFUF6IsgXbcWMgakp9WCZacG781H1ireDx/g9m+zqvZChp5OThwU2zIdPRLf4pY /SmAs4jXwOb47XEEad3fcjsIda08nKPnqoAZqdE94b+2lxK/uOhNaeK6n0r36oEOj0dB zm71Gt2KL7IruKpH0JAkmcQd8KEeC3klCsFy+e5BxYTgZMSBbAYJ+Vouul619o3xidrM i/TZoan7wjp32kEjwuH6pO5ZT6+YqLKtDPmKkWRjKgzVUBbizbwktfeugXQzr/ny1Spg u9nw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi13-20020a17090b1e4d00b002008d0b0838si6495308pjb.178.2022.10.31.03.55.17; Mon, 31 Oct 2022 03:55:29 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747912677651935698?= X-GMAIL-MSGID: =?utf-8?q?1748200304169443469?= 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)