From patchwork Tue Oct 10 03:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 150467 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2253707vqo; Mon, 9 Oct 2023 20:29:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeFscvTSvsbrNGvVIwPzpzDo9rax1gkmYokxFX14CrLEldiLXTut2W9QGbXcWO5rKGC0Bt X-Received: by 2002:a17:903:41c1:b0:1c4:1cd3:8068 with SMTP id u1-20020a17090341c100b001c41cd38068mr21632965ple.5.1696908569483; Mon, 09 Oct 2023 20:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696908569; cv=none; d=google.com; s=arc-20160816; b=CrsEpMwO5As7CDXWOy+S08+IY9MZ8dVNrx6LXyCfU+1AMSTFfcR8q4HFYkGadkThKp JkS6qCFMH/oPOaA/XKWYKNNQvCOZqmiGzGudNJ3I9Cbn2tGonCI03OVXO1qvipdALx7q oLwXKIv2bITNBczhrTbi0drrST4E885xBxQhwtSWiZ64NvgUHwC3lp+Yu0XAVtQhyxCu E4x8R5j8hwjPzK90syDl64cNEA/X2Bl32VuxC6Lx96tiGYx8menaLpz+aCwpkS0eHGzL Kd4goSyfxb3MuSBF5zqZwB9rGhBCXXxObC7q5KEIHyOH0mb62sbh5JK3qNPwpc3KrH9m O3oA== 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=g66mwGaaEwasfANWCPBZJhFXmC0KrsU+d88cLge1kZM=; b=GEJ+L91CU6YYpi0O3L+4F+knGSNjAzvyJiiMnNC8wMFp2ClUAQKcmPEpaH9cLA8FH4 lBkrTaoUefbFU6SMSYG1knlq8o+or4sHXUOx3OfSuK2yn3glBV260Ak6mTPyz/zrPJb1 GPYd4xCMUe3IKnRPOoOVnxHXIt6uMzGlTdTE3tWzdCSzi9kBVvto8xcC6iMYbdxyaIpn uyWXkp+bCCeNiw941GT8k1j1uNoURBmQKmLunfD5voMpc2CJTEOff0ELuIKdYOwI3X70 1K4WZw6n5y2jZ2x1+5rOKJ+nJSxgLlCtEhuqXOXJvef2TllTBTf3p422W4fPU5/0X4x1 FFMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id d8-20020a170902654800b001c3e9b0baeasi10825431pln.430.2023.10.09.20.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 0ADE180C2562; Mon, 9 Oct 2023 20:29:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442017AbjJJD3K (ORCPT + 20 others); Mon, 9 Oct 2023 23:29:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442029AbjJJD2x (ORCPT ); Mon, 9 Oct 2023 23:28:53 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6441BA4 for ; Mon, 9 Oct 2023 20:28:51 -0700 (PDT) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (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 4S4LwH3YXvz4xPYZ; Tue, 10 Oct 2023 11:28:47 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl2.zte.com.cn with SMTP id 39A3SfR2081972; Tue, 10 Oct 2023 11:28:41 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp04[null]) by mapi (Zmail) with MAPI id mid14; Tue, 10 Oct 2023 11:28:42 +0800 (CST) Date: Tue, 10 Oct 2023 11:28:42 +0800 (CST) X-Zmail-TransId: 2b066524c4eaffffffffb19-8be99 X-Mailer: Zmail v1.0 Message-ID: <202310101128424095908@zte.com.cn> In-Reply-To: References: ZSPayGSz6HQBp+3W@gmail.com,202310092030430136422@zte.com.cn,ZSP3cuEsgwWcIKRw@gmail.com,CAJuCfpFabCn8gcuLV322RKC=xzVm0C+64HQP+CkFNJZ4VO42ZA@mail.gmail.com Mime-Version: 1.0 From: To: , , , Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next_v2_4/4=5D=C2=A0sched/psi=3A_Delete_th?= =?utf-8?q?e_function_parameter_update=5Ftotal_of?= =?utf-8?q?_update=5Ftriggers=28=29?= X-MAIL: mse-fl2.zte.com.cn 39A3SfR2081972 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6524C4EF.000/4S4LwH3YXvz4xPYZ X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:29:27 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779337600102397298 X-GMAIL-MSGID: 1779337600102397298 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 --- 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)); }