Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2260197rdb; Mon, 9 Oct 2023 20:07:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEh072pyYUVCcDSSvvZIQwN7W/Q6oLfWWDcwSjstMHiTwd2hsMCHr5JiPFPgZPXCrx9FRP7 X-Received: by 2002:a05:6870:d681:b0:1ba:cc77:1d81 with SMTP id z1-20020a056870d68100b001bacc771d81mr20016738oap.46.1696907223451; Mon, 09 Oct 2023 20:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696907223; cv=none; d=google.com; s=arc-20160816; b=NYDcwsYmqQ1ippmMFeCGi03fGPHfFUUgFr4Yk36svowjM3KAUMyQSQiwgjkcjzSIjC ViNFMEHSgUz9GQIAikxNV34fKpQWGagZmQtE2ln6jsJ6YxLVawPLmooFLDdJGwNy62bq DZWNRVQfxAoJAr2xI/SnTa1I2kdj6gYfdh6V1dx4dQW58piCFGxp8L38Udfv3pnfzzNR FjukDgRIPNEzPU+P7yoarzatQpqk6tW/WCBD19Q5avF+rEyOHfLxD/ewDhC891yFeGP5 MzeIv4GLC/tTU/Gxme9h+kfNZCq1S1NEUx7WP+OiodoYA9Ju06ThFAbNMZMrrRqf74+T yx0Q== 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=Vef/89URDEpaFk5S5wUwe5K6LhEsVblENzXhcp9yrjI=; fh=g66mwGaaEwasfANWCPBZJhFXmC0KrsU+d88cLge1kZM=; b=J+r/AGYlN2uvyRwi4KPsO3Zxu+VwtRvDEldTXoxgDheSWpeep58b+Ch0WwQ363dy3q 4zvff+LtnaadvYjJmuvyeFAq/0lZUe8NPiDf3uI47pUSsJg5dnghvpdoPi2qr1QwoFAa M8UupUazu3UVpd8L7mt5mfqFYFvK9/nezGe2xRMEQj6Juh9I7lBM4P7azUKJMbbM4Oul j6l7CPLuhnawEqCnHZo2YhgJCG9XOfTYOBGXKP8WXRbCIzpubHiAaL0WyKKgmKT41ld3 WQIb2bRNyd/RjucdILvTGgt+hnuAfIfM+ty/W6ZKhxE6mzoBlRs4WTFvMYub3eB/wc+b a0Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u186-20020a6385c3000000b0057806be7290si10782870pgd.451.2023.10.09.20.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 923BD8089869; Mon, 9 Oct 2023 20:06:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441902AbjJJDGP (ORCPT + 99 others); Mon, 9 Oct 2023 23:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378482AbjJJDGN (ORCPT ); Mon, 9 Oct 2023 23:06:13 -0400 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAAE993 for ; Mon, 9 Oct 2023 20:06:10 -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 mxct.zte.com.cn (FangMail) with ESMTPS id 4S4LQ66L5tz4xVbp; Tue, 10 Oct 2023 11:06:06 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl1.zte.com.cn with SMTP id 39A35vK4078952; Tue, 10 Oct 2023 11:05:57 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp03[null]) by mapi (Zmail) with MAPI id mid14; Tue, 10 Oct 2023 11:05:59 +0800 (CST) Date: Tue, 10 Oct 2023 11:05:59 +0800 (CST) X-Zmail-TransId: 2b056524bf971e2-8eea1 X-Mailer: Zmail v1.0 Message-ID: <202310101105590891853@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?B?W1BBVENIIGxpbnV4LW5leHQgdjIgMC80XSBzY2hlZC9wc2k6IE9wdGltaXplIHRoZSBwcm9jZXNzIG9mIHVwZGF0aW5nIHRyaWdnZXJzIGFuZCBydHBvbGxfdG90YWw=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 39A35vK4078952 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6524BF9E.000/4S4LQ66L5tz4xVbp 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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:06:36 -0700 (PDT) X-Spam-Level: ** From: Yang Yang When psimon wakes up and there are no state changes for rtpoll_states, it's unnecessary to update triggers and rtpoll_total because the pressures being monitored by user have not changed. This will help to slightly reduce unnecessary computations of psi. There are also some minor related optimizations, please see below. Update_triggers() always return now + group->rtpoll_min_period, and the return value is only used by psi_rtpoll_work(), so change update_triggers() to a void function, let group->rtpoll_next_update = now + group->rtpoll_min_period directly. Update group->rtpoll_next_update after called update_triggers() and update rtpoll_total. This will prevent bugs if update_triggers() uses group->rtpoll_next_update in the future, and it makes more sense to set the next update time after we finished the current update. The parameter update_total in update_triggers() is useless now. Since 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 update_total. Change log ---------- v1->v2: ---------- (1) the line number of group->rtpoll_next_update in patch 1 remain unchanged (2) split patch 3 from patch 2 Yang Yang (4): sched/psi: Change update_triggers() to a void function sched/psi: Avoid update triggers and rtpoll_total when it is unnecessary sched/psi: Update rtpoll_next_update after update triggers and rtpoll_total sched/psi: Delete the function parameter update_total of update_triggers() kernel/sched/psi.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) -- 2.25.1