From patchwork Tue Oct 10 08:45:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 150577 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp49166vqb; Tue, 10 Oct 2023 01:46:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAjYVMFNJKjGoSBME3WMdgDo2VVar0nN9Og9yBOAUrVaImNx0xAkdrbEWWwvwlZKoGrR/x X-Received: by 2002:a05:6a20:7286:b0:15e:7323:5c0f with SMTP id o6-20020a056a20728600b0015e73235c0fmr22023852pzk.16.1696927596195; Tue, 10 Oct 2023 01:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696927596; cv=none; d=google.com; s=arc-20160816; b=fac7/sqW20ckRVnTPFW81HWuTKETmaauX0r8YqaFGw4/zQbG3vv/Jo+47LwhzfmHAx ScoCoAbj9/q660+QRsTQVZMy1xzzfEaxrciVcWN2/9mATHHmrMqnW+eMKtKKEAcUfoog 2TuzBD5EBBzuUehhdh+h6anc24RynlYx+yvtv4GUrfAksv5tpJgs+/QgqTrs2hGbS3q6 NRYxbkn1Hw4zxCYhq0b3rcb3EjuJj7ShSq7ILJkUCS1leRxehhIdbgwppb8ZmmoVcE1I 5Pg94SCb4jkijHqL/E0M9f7w0CWH2S427h/v7LE8W2eNA4Qy/57JzXdeotin/8MhNlZ3 gFwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:references :in-reply-to:message-id:date; bh=Oua3NXj48WW4n1+zO9ED9XrvXDdI3ZgTl7eCGtsZ/Os=; fh=P1Be0mhPXrh3Y0w+jDWaRBcE7E3uPVE+GmHjwBK8Qd0=; b=B7tdYef0SEFLakzt3LVTUS48n5bumEIVr2B9nQxeT1+0a7J9J0uQNU0tqxCx9ZREBT LDEXS1cHMJWFiOzS+3AYTIjuTlQt5XizVhNIOf/1OeWFNI0Y9YeHmRVD//cNsOikOF/v Dyio1lf5QaFQPa5COn9LNnlQjY0KzK9v8ktas2BnviBqYu+payXy7pX0LrmFmX1DLQcZ i5jMojAwvat7T0F/qwFWARNxopKrJqd9jkEOL63RpkE962ZFfwUC9Jzc6nwddeoqj3z8 D7pkI18eadS79U66HEOisnvA539EI3aypGbbQDZgbagvfK2M2h+Lqyzge9619d7J/knt AXFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h3-20020a170902680300b001c747cafce9si936836plk.231.2023.10.10.01.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BEE5F80C5F9A; Tue, 10 Oct 2023 01:46:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjJJIqD (ORCPT + 20 others); Tue, 10 Oct 2023 04:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjJJIqA (ORCPT ); Tue, 10 Oct 2023 04:46:00 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798CBB6 for ; Tue, 10 Oct 2023 01:45:55 -0700 (PDT) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4S4Ty90xVgz8XrRN; Tue, 10 Oct 2023 16:45:53 +0800 (CST) Received: from szxlzmapp05.zte.com.cn ([10.5.230.85]) by mse-fl1.zte.com.cn with SMTP id 39A8jeMW045370; Tue, 10 Oct 2023 16:45:40 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp05[null]) by mapi (Zmail) with MAPI id mid14; Tue, 10 Oct 2023 16:45:43 +0800 (CST) Date: Tue, 10 Oct 2023 16:45:43 +0800 (CST) X-Zmail-TransId: 2b0765250f37ffffffffa05-766dd X-Mailer: Zmail v1.0 Message-ID: <202310101645437859599@zte.com.cn> In-Reply-To: References: CAJuCfpFabCn8gcuLV322RKC=xzVm0C+64HQP+CkFNJZ4VO42ZA@mail.gmail.com,202310101109350209198@zte.com.cn,ZST/WggW4hSVs9d4@gmail.com Mime-Version: 1.0 From: To: , , , Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next_v3_4/4=5D_sched/psi=3A_Delete_the_fun?= =?utf-8?q?ction_parameter_update=5Ftotal_of?= =?utf-8?q?_update=5Ftriggers=28=29?= X-MAIL: mse-fl1.zte.com.cn 39A8jeMW045370 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 65250F41.000/4S4Ty90xVgz8XrRN X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:46:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779357551361129529 X-GMAIL-MSGID: 1779357551361129529 From: Yang Yang The parameter update_total in update_triggers() is useless after patch "sched/psi: Avoid update triggers and rtpoll_total when it is unnecessary". If changed_states & group->rtpoll_states is true, new_stall in update_triggers() will be true, then update_total should also be true. We have no need for update_total to help judgment whether to update rtpoll_total, so delete it. This makes the code cleaner & simpler. Signed-off-by: Yang Yang Acked-by: Suren Baghdasaryan --- 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 79f8db0c6150..44a78774ae87 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)); }