From patchwork Mon Oct 9 12:59:56 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: 150075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1848474vqo; Mon, 9 Oct 2023 06:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdCxzc9D925MWMPIKeRxI+kXd3OwUqlidLKNzUYZovc1ZVz9ag530TpwOnc1ooaXAmossP X-Received: by 2002:a05:6a00:814:b0:686:24e1:d12e with SMTP id m20-20020a056a00081400b0068624e1d12emr17699101pfk.30.1696856449541; Mon, 09 Oct 2023 06:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696856449; cv=none; d=google.com; s=arc-20160816; b=yjw8mvoe2S0TJXF2FQC+S9+1yXXxW+4oDcn7bWgPB9mr5bUOzQOXW29Tz5OcqZtTXS U9gV4zt1zd3+JsCEuSqH4YWRM6bjrkOWChTXIWvCvjqyWKwqpwDllNeFLeQddW59XWmx vkdidlH93EqqsGR0hp57dz3g1UNX22Jzn2JVmrTHfsMvm/yFr6wtXWOdp6kjEd434HuQ uwHL8Q8N1fgkLg+rDCzQpGwL5BQXXcpVXW33HKgVKoQGKueweDgKrbsg4wyy7c+Pdc6G k0yRlHG8zGeYjzP+/aQoB8Ig7haVTJndjgMgva/y5wiv7CzXjIsuRi7BHSAKl/I9XNS9 rDXA== 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=004py6dV+Hxp9dA+Tj1mSJV1eqQXyR+S3HHuVu00MT4=; fh=JMNEMyVod4uXpTdva6ZRaQ57tu+jd2+pFRGR9ufv7mg=; b=lHZOstl5OcMxA6lmiED7MuJXi8FStVBXY/rtV7HUJiuDOTFnKBfbOYExVYfGZ8d2pj R7KuO0OkQz+uEq00RDIarkCWCVNa0LzY1W018WwKaukbyJ9+9sUkM+hFgBkLYiHZH/EI 5REaPc2TYjMrh+ZD8dYY4M5ll7vUSxwUVR2+oOmHbVt3mdpAy1kMFSmFf71O/hMNbdHZ E3xLQvzsQEZ9Nv30ZEntDDztgjl3RQDLZf+bW3hQZt7eal+VJS9EEjg248Dbdh52y6Xr w7jNYPLKX1G2NsqflcNCdHM9VRsOFBIqV65vNbI+PgTR6FMr6p+ZZO2Hlglvu6l9Fsw5 wqsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Alk+/e0E"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fh4-20020a056a00390400b006902507d409si7371102pfb.174.2023.10.09.06.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 06:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Alk+/e0E"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 07EB2807AC65; Mon, 9 Oct 2023 06:00:17 -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 S1376620AbjJINAA (ORCPT + 18 others); Mon, 9 Oct 2023 09:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346514AbjJIM77 (ORCPT ); Mon, 9 Oct 2023 08:59:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A18518F; Mon, 9 Oct 2023 05:59:58 -0700 (PDT) Date: Mon, 09 Oct 2023 12:59:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696856397; 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=004py6dV+Hxp9dA+Tj1mSJV1eqQXyR+S3HHuVu00MT4=; b=Alk+/e0EzjqlUsVxw6danKB7BdZbOSQ2q4KFNOOdz+44tVS2JpKnWusk1HXflL9fno4NkN 8NGbN0Pllx74i5xHlRb7ah9j+eZx+/qVYaryldb24B4VRuvTXRlA7T02+DQPN3t/W/7BbO iv03tDac6rKZwwXBXn6bE3tfAk7MI0nbGUU9E+6wgdGNxpvtGH2PPrL4a3qNUJ4ZT0riIp XqfjDf+YeWbnZRvFh/DZfORCxHEeAN4p5qxq5krnbUeeU6kh5hJ8OHUNKi6K+I8dJZD3xs brRX45SYYBamJYty1Ws662zb3j90XKNdvjf17IxwH+wCfhJzK8uGMv/gBcWCXA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696856397; 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=004py6dV+Hxp9dA+Tj1mSJV1eqQXyR+S3HHuVu00MT4=; b=+ZOfWFN3nGPujckryXTPbetjst23UX9lGaFCT32HgzNX7RRdJvwsJtuNDrKSEDh8MumI4a 2fIL9AziB0Ysw+AQ== 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: Change update_triggers() to a 'void' function Cc: Suren Baghdasaryan , Yang Yang , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <202310092024289721617@zte.com.cn> References: <202310092024289721617@zte.com.cn> MIME-Version: 1.0 Message-ID: <169685639641.3135.6956705844549112349.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 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]); Mon, 09 Oct 2023 06:00:17 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779282948102154421 X-GMAIL-MSGID: 1779282948102154421 The following commit has been merged into the sched/core branch of tip: Commit-ID: e03dc9fa0663bc303383170e961561462ff00c93 Gitweb: https://git.kernel.org/tip/e03dc9fa0663bc303383170e961561462ff00c93 Author: Yang Yang AuthorDate: Mon, 09 Oct 2023 20:24:28 +08:00 Committer: Ingo Molnar CommitterDate: Mon, 09 Oct 2023 14:54:50 +02:00 sched/psi: Change update_triggers() to a 'void' function Update_triggers() always returns 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. This will avoid unnecessary function return value passing & simplifies the function. [ mingo: Updated changelog ] Suggested-by: Suren Baghdasaryan Signed-off-by: Yang Yang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/202310092024289721617@zte.com.cn --- kernel/sched/psi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 1d0f634..be853f2 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -434,7 +434,7 @@ static u64 window_update(struct psi_window *win, u64 now, u64 value) return growth; } -static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total, +static void update_triggers(struct psi_group *group, u64 now, bool *update_total, enum psi_aggregators aggregator) { struct psi_trigger *t; @@ -503,8 +503,6 @@ static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total, /* Reset threshold breach flag once event got generated */ t->pending_event = false; } - - return now + group->rtpoll_min_period; } static u64 update_averages(struct psi_group *group, u64 now) @@ -706,7 +704,8 @@ static void psi_rtpoll_work(struct psi_group *group) } if (now >= group->rtpoll_next_update) { - group->rtpoll_next_update = update_triggers(group, now, &update_total, PSI_POLL); + update_triggers(group, now, &update_total, PSI_POLL); + group->rtpoll_next_update = now + group->rtpoll_min_period; if (update_total) memcpy(group->rtpoll_total, group->total[PSI_POLL], sizeof(group->rtpoll_total));