From patchwork Wed Oct 11 21:20:45 2023 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: 151558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp821940vqb; Wed, 11 Oct 2023 14:21:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHna5dtLzGiQwwqQvhPL0TntrYJC6CmwmCM1UZj0AAIC1POArjgU6Hz0MNcK6gYUc3DViry X-Received: by 2002:a05:6358:f17:b0:14d:8792:1cec with SMTP id b23-20020a0563580f1700b0014d87921cecmr14666777rwj.1.1697059275901; Wed, 11 Oct 2023 14:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697059275; cv=none; d=google.com; s=arc-20160816; b=ueKUnfR9UCc4GHiJslFKF6951LqPGMn71v8Iop7rOywkSqYLZm/1jPG72SVLasiZrV iJfpep4ZFzFdpHhE8QC7TNf/VptuDL7iIK7EX6bRhpMKQgpQi/fIixngszJog1KM3Qm0 oEZvavkbg5G7E17ExtiPgPFjSbygFOvI+lsdyFM0N5gZA5r9pCDNR4Ha9pXLDYbzIAJm xn9ebvXeDIHoW99U5R9bX+SiQhKOlA7m77GjwLa71zLpdq0HNJTSfkzjFenjdrHWOnhx bkixwr2g3vh7/G8Mrkj3AnOdjnXmAfL8RjrP6RjxhvWM7izYIJ6O3egnkQsOH9GBtq7I 0Q7g== 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=7hZa+WRFW/1sYqrsgg573q1WxZRUNCB2WoM19IwAfgk=; fh=yuboQ46Aw21UJWWE9S0jvHrNpdwNfyhQD5F6w/I8NHA=; b=Zt6ru6zkeNdOZZ1WM08GtTESQvW/IPwoQui49B8dy+ZDD+/B/qu1DB8ns7w/VM/xzA BRBkbr4tLMc+CxlokhcooOsqUySsvneh4koQ5CjmmBoLYzqxoeYl2R9DEeBcNcSVD6xq mvOk7c19BnLo4mNGoiCaqvAC2vRyWYAOXWygDX3v7ryw/ipPbq2NXZFDn0DCJctT6MC+ Ar2bxT2K9Mv6LGol2XY2Ht/fV5THCeABwNuISWHZzKV+frZGX2cYcZ58daUyrt2/06Aa dWT0ly4YlaLK7SRMOaFhhzYfe9IoLb1IcA25MRuEQzms8IT/aQjchsuBTVHFVJ94a7m1 P92A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o2KXbudu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i191-20020a639dc8000000b0056c0e3c77f7si606341pgd.805.2023.10.11.14.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 14:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o2KXbudu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E4CDB811F256; Wed, 11 Oct 2023 14:21:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233599AbjJKVU5 (ORCPT + 18 others); Wed, 11 Oct 2023 17:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233598AbjJKVUv (ORCPT ); Wed, 11 Oct 2023 17:20:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5F8B8; Wed, 11 Oct 2023 14:20:49 -0700 (PDT) Date: Wed, 11 Oct 2023 21:20:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697059246; 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=7hZa+WRFW/1sYqrsgg573q1WxZRUNCB2WoM19IwAfgk=; b=o2KXbuduAxg5P/Ob7zKeL7L6HU26Kq0tkcryAPImRGqXpp7hBKo+HbDFcgMsiIkKZu7YMd gXsGSewopQZPrOylA1q8npRvjkduZCKSBsy6aQENCvmyVtHCY9lk1ERG7QQHlkfqwHgB4L MUtihM4gpjI1A53uAnTf4JdUJc+kddjhv1HvYA7q+ECAPDoPmHsX1gw/C6oDjsXZdSHmcq 4HtlA/TMc1Yt1tCF1CY/2XDcad24ErvY7EZT6oteUUbkegoGudFVcMZYqxT93mp4LNUV/H Q4+UyVdauV8hnfUv5e51XZHkFYmF4nXGA0XfoG2UEdIIJTALFcPrIxGmBuTydQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697059246; 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=7hZa+WRFW/1sYqrsgg573q1WxZRUNCB2WoM19IwAfgk=; b=3UhmaJt7rEek/hkMAIakYDYXlhySPlsY4xbVrQWO4VRMQdxClmiJF2Jw6c0EjQNAMaUxpm fsvwg2rI8JaANJAg== From: "tip-bot2 for Yang Yang" 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: Delete the 'update_total' function parameter from update_triggers() Cc: Yang Yang , Ingo Molnar , Johannes Weiner , Suren Baghdasaryan , Peter Ziljstra , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <202310101645437859599@zte.com.cn> References: <202310101645437859599@zte.com.cn> MIME-Version: 1.0 Message-ID: <169705924586.3135.13461721051414681406.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 14:21:12 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779495627648100840 X-GMAIL-MSGID: 1779495627648100840 The following commit has been merged into the sched/core branch of tip: Commit-ID: 3657680f38cd7df413d665f2b2f38e9a78130d8b Gitweb: https://git.kernel.org/tip/3657680f38cd7df413d665f2b2f38e9a78130d8b Author: Yang Yang AuthorDate: Tue, 10 Oct 2023 16:45:43 +08:00 Committer: Ingo Molnar CommitterDate: Wed, 11 Oct 2023 23:08:09 +02:00 sched/psi: Delete the 'update_total' function parameter from update_triggers() The 'update_total' parameter of update_triggers() is always true after the previous commit: 80cc1d1d5ee3 ("sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes") If the 'changed_states & group->rtpoll_states' condition is true, 'new_stall' in update_triggers() will be true, and then 'update_total' should also be true. So update_total is redundant - remove it. [ mingo: Changelog updates ] Signed-off-by: Yang Yang Signed-off-by: Ingo Molnar Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Peter Ziljstra Link: https://lore.kernel.org/r/202310101645437859599@zte.com.cn --- kernel/sched/psi.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 79f8db0..44a7877 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -434,14 +434,13 @@ static u64 window_update(struct psi_window *win, u64 now, u64 value) return growth; } -static void update_triggers(struct psi_group *group, u64 now, bool *update_total, +static void update_triggers(struct psi_group *group, u64 now, enum psi_aggregators aggregator) { struct psi_trigger *t; u64 *total = group->total[aggregator]; struct list_head *triggers; u64 *aggregator_total; - *update_total = false; if (aggregator == PSI_AVGS) { triggers = &group->avg_triggers; @@ -471,14 +470,6 @@ static void update_triggers(struct psi_group *group, u64 now, bool *update_total * events without dropping any). */ if (new_stall) { - /* - * Multiple triggers might be looking at the same state, - * remember to update group->polling_total[] once we've - * been through all of them. Also remember to extend the - * polling time if we see new stall activity. - */ - *update_total = true; - /* Calculate growth since last update */ growth = window_update(&t->win, now, total[t->state]); if (!t->pending_event) { @@ -563,7 +554,6 @@ static void psi_avgs_work(struct work_struct *work) struct delayed_work *dwork; struct psi_group *group; u32 changed_states; - bool update_total; u64 now; dwork = to_delayed_work(work); @@ -582,7 +572,7 @@ static void psi_avgs_work(struct work_struct *work) * go - see calc_avgs() and missed_periods. */ if (now >= group->avg_next_update) { - update_triggers(group, now, &update_total, PSI_AVGS); + update_triggers(group, now, PSI_AVGS); group->avg_next_update = update_averages(group, now); } @@ -638,7 +628,6 @@ static void psi_rtpoll_work(struct psi_group *group) { bool force_reschedule = false; u32 changed_states; - bool update_total; u64 now; mutex_lock(&group->rtpoll_trigger_lock); @@ -705,7 +694,7 @@ static void psi_rtpoll_work(struct psi_group *group) if (now >= group->rtpoll_next_update) { if (changed_states & group->rtpoll_states) { - update_triggers(group, now, &update_total, PSI_POLL); + update_triggers(group, now, PSI_POLL); memcpy(group->rtpoll_total, group->total[PSI_POLL], sizeof(group->rtpoll_total)); }