From patchwork Wed Sep 13 12:44:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 138786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp1063357vqx; Wed, 13 Sep 2023 05:55:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRobWTWil7yqSDqe/of44vI51vSLzxIQdz4XhLjyZF3iBNfDIL2Z/fqnitCT/qXljXZ9Tr X-Received: by 2002:a05:6a00:24d4:b0:68a:5395:7aa5 with SMTP id d20-20020a056a0024d400b0068a53957aa5mr2509095pfv.17.1694609741703; Wed, 13 Sep 2023 05:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694609741; cv=none; d=google.com; s=arc-20160816; b=mvVYRcGQ+xejy1Dqu1c6w/DjGLe6Xx3XhhNBkwyM3XwvD+GbiyBl1d3idhQXGhlm1r dZRxa+j+SJo+DCbxQvEz89F/XEJ/IXRHc8T8edzcsd9ZPUlw5gL5DN7BUXpQowhW+gTS iNozfUkRdE1uHzHTKNebnjMMPIphSUAkuVRQb7DUwsYWhT/NSq7Cx+nk/5dwqERI9cM8 fTcGIBckCaPOhRLS/9mfHjQplwP4P6huYKgBh/8z3ws0nKCz2HeT73zNm6pWZNZnxJ5J 8JtOGEEMVW/q8f/dVbykAt/lbSFqcRrDYDR5vJYEkBgGcgf8L5bUV/lNMSXy5xteLc8d 46ng== 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:message-id:date; bh=vlpSyhWNVLaOypAYfKQdFVKx3VtEUR3D+0OYGfJC1Mo=; fh=r5HwxOTz5mVwz43BEXCaA8j0rlRGMtjPX4vHrHC7ozw=; b=OmRVqTu1HZHFbbv01sJS+GH9Jdcso4/w9JmhJC6PUctPdhehctDId6OX9HWAkEjdcS P2nv5j0HlNwERxHDA37i6kikJq6pueYSfxPTM9B1t63p9JcOc6w6VSq95QbzTBrr0zng tyK4ZCtIXcVZ+0EVlvMXKvOvsQ8Ziw/zbEoF2hB03VH+IGc5M7J+7EVSDxDcuaHw+Dei XeMbIlyNbqQDAX0hSOqUmYxaX8K2UTZDYgLq/5JzBhGlP5YEWbRJYcaDrl2ysFxsYxVh 2wd3T1M4ek1FltWYNU2TL5ALX6nVzDQ8hrtAya9iFGm6W9Dhnr2sBioFS58BGPD9MRAy sf4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h17-20020a056a00219100b0068e4a0de34csi10507467pfi.97.2023.09.13.05.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 05:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id AD193827D0F9; Wed, 13 Sep 2023 05:44:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234847AbjIMMoi (ORCPT + 36 others); Wed, 13 Sep 2023 08:44:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbjIMMoh (ORCPT ); Wed, 13 Sep 2023 08:44:37 -0400 X-Greylist: delayed 106189 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 13 Sep 2023 05:44:33 PDT Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5571B19B6 for ; Wed, 13 Sep 2023 05:44:33 -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 4Rm0Wv3bX0z8XrRF; Wed, 13 Sep 2023 20:44:27 +0800 (CST) Received: from szxlzmapp02.zte.com.cn ([10.5.231.79]) by mse-fl1.zte.com.cn with SMTP id 38DCiMrQ097700; Wed, 13 Sep 2023 20:44:22 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp01[null]) by mapi (Zmail) with MAPI id mid14; Wed, 13 Sep 2023 20:44:26 +0800 (CST) Date: Wed, 13 Sep 2023 20:44:26 +0800 (CST) X-Zmail-TransId: 2b036501aeaa159-29757 X-Mailer: Zmail v1.0 Message-ID: <202309132044261713252@zte.com.cn> Mime-Version: 1.0 From: To: , Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_sched/psi=3A_Avoid=C2=A0update_tri?= =?utf-8?q?ggers_and_rtpoll=5Ftotal_when=C2=A0it_is_unnecessary?= X-MAIL: mse-fl1.zte.com.cn 38DCiMrQ097700 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6501AEAB.000/4Rm0Wv3bX0z8XrRF 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 05:44:56 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776927104535018927 X-GMAIL-MSGID: 1776927104535018927 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. Signed-off-by: Yang Yang --- kernel/sched/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 81fca77397f6..e4463bb267c3 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -701,7 +701,7 @@ static void psi_rtpoll_work(struct psi_group *group) goto out; } - if (now >= group->rtpoll_next_update) { + if ((changed_states & group->rtpoll_states) && (now >= group->rtpoll_next_update)) { group->rtpoll_next_update = update_triggers(group, now, &update_total, PSI_POLL); if (update_total) memcpy(group->rtpoll_total, group->total[PSI_POLL],