From patchwork Mon Oct 16 11:20:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 153344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3385805vqb; Mon, 16 Oct 2023 04:21:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMy+/xouI30Say1p2uOGDf5KK9GjyqfhGn6QUOafeRJnwIVAnHvPYn1sCEi37/7uVRZEOG X-Received: by 2002:a05:6e02:60a:b0:34f:7ba2:50e8 with SMTP id t10-20020a056e02060a00b0034f7ba250e8mr32935109ils.2.1697455279395; Mon, 16 Oct 2023 04:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697455279; cv=none; d=google.com; s=arc-20160816; b=xtVgnpXKPXt3p3a2FWK+sUJ7IvJINMR3uhHXQuujPXKA51SD/6g6iX5hkg3Dao9j6G eQG6wO7O/f2knf6E6qRpUbnHagYSsYGNbJGLyv2nlTzJT9GR1uwUJbmyQWRfavClS0WF xaLPIiRqQryh8GDySb1P2X0acY+5X3tfrjKIOH1TgOJnaauzcgttLV9Sjer5LWWMFxwl umbskrnXOE3/QwMBu18m2mF5WRkadk3AFiIU+xz/z7w6mLVZ8LrTdH6Hxmwjvg0JvWQl 078ZfRtPWMzCVYNwyIXgC+dtCiDGZRlH1mO5Lb3pQ98Ffr9OvFKrblpYRCRdpBx9g/SC CgGQ== 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=qKDzBYLPx9z1TlFPa5nB8Izc4WKPnTmtf7CDS/KhwdY=; fh=LVJexwwevicNxPyqAHrsaR3JcIS81pO6CzM6ULxr838=; b=0klrA1sx12QM8FUEwmKkWaNUs2r3HBRDsefkirhbOZclyZ72ycd44rDzcylWxu9VsL BMZjxeyFhiuk8v3zVyD7s+FVvUuvUGt2xuRvvr9FHbRjOXn280ZAwRnpc4sDlbqJ+Pq5 L+ZWZx/k8R3AjWVJSMhMbNMoRYJgeq6YD5WEwWMqGYpOjmmM16uxkqhWig55/wUfYIpu J1vC7cn8wZllNiaP+eANRm8QRyGGgExexQvYdSeoriNaZ5HPZ+LpNm2CdnLh1v5/5Uch 8MyrCyaRzEpWyBpI2epbErvqEHoH2OBCzCgaXXNPHit8bkvR6OIBqMfllqS3/NAvCK49 //oQ== 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 x5-20020a654145000000b0057d08dac75csi9824621pgp.517.2023.10.16.04.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:21:19 -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 A54088061B58; Mon, 16 Oct 2023 04:20:58 -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 S232693AbjJPLUw (ORCPT + 18 others); Mon, 16 Oct 2023 07:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjJPLUv (ORCPT ); Mon, 16 Oct 2023 07:20:51 -0400 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 151EDE3 for ; Mon, 16 Oct 2023 04:20:47 -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 4S8F606VXcz4xVbs; Mon, 16 Oct 2023 19:20:40 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl1.zte.com.cn with SMTP id 39GBKaTY026390; Mon, 16 Oct 2023 19:20:36 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp05[null]) by mapi (Zmail) with MAPI id mid14; Mon, 16 Oct 2023 19:20:39 +0800 (CST) Date: Mon, 16 Oct 2023 19:20:39 +0800 (CST) X-Zmail-TransId: 2b07652d1c87ffffffffe0c-49d3c X-Mailer: Zmail v1.0 Message-ID: <202310161920399921184@zte.com.cn> Mime-Version: 1.0 From: To: , , Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_sched/psi=3A_Update_poll_to_rtpoll?= =?utf-8?q?_in_related=C2=A0comments?= X-MAIL: mse-fl1.zte.com.cn 39GBKaTY026390 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 652D1C88.000/4S8F606VXcz4xVbs X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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]); Mon, 16 Oct 2023 04:20:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910866769561539 X-GMAIL-MSGID: 1779910866769561539 From: Fan Yu The trigger code is distinct between privileged and unprivileged after the previous commit: 65457b74aa94 ("sched/psi: Rename existing poll members in preparation") But some comments have not been modified along with the code, so they need to be updated. This will help readers better understand the code. Signed-off-by: Fan Yu Cc: Yang Yang --- kernel/sched/psi.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 519bc922a960..23927ed34f4d 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -596,7 +596,7 @@ static void init_rtpoll_triggers(struct psi_group *group, u64 now) group->rtpoll_next_update = now + group->rtpoll_min_period; } -/* Schedule polling if it's not already scheduled or forced. */ +/* Schedule rtpolling if it's not already scheduled or forced. */ static void psi_schedule_rtpoll_work(struct psi_group *group, unsigned long delay, bool force) { @@ -636,37 +636,37 @@ static void psi_rtpoll_work(struct psi_group *group) if (now > group->rtpoll_until) { /* - * We are either about to start or might stop polling if no - * state change was recorded. Resetting poll_scheduled leaves + * We are either about to start or might stop rtpolling if no + * state change was recorded. Resetting rtpoll_scheduled leaves * a small window for psi_group_change to sneak in and schedule - * an immediate poll_work before we get to rescheduling. One - * potential extra wakeup at the end of the polling window - * should be negligible and polling_next_update still keeps + * an immediate rtpoll_work before we get to rescheduling. One + * potential extra wakeup at the end of the rtpolling window + * should be negligible and rtpoll_next_update still keeps * updates correctly on schedule. */ atomic_set(&group->rtpoll_scheduled, 0); /* - * A task change can race with the poll worker that is supposed to + * A task change can race with the rtpoll worker that is supposed to * report on it. To avoid missing events, ensure ordering between - * poll_scheduled and the task state accesses, such that if the poll - * worker misses the state update, the task change is guaranteed to - * reschedule the poll worker: + * rtpoll_scheduled and the task state accesses, such that if the + * rtpoll worker misses the state update, the task change is + * guaranteed to reschedule the rtpoll worker: * - * poll worker: - * atomic_set(poll_scheduled, 0) + * rtpoll worker: + * atomic_set(rtpoll_scheduled, 0) * smp_mb() * LOAD states * * task change: * STORE states - * if atomic_xchg(poll_scheduled, 1) == 0: - * schedule poll worker + * if atomic_xchg(rtpoll_scheduled, 1) == 0: + * schedule rtpoll worker * * The atomic_xchg() implies a full barrier. */ smp_mb(); } else { - /* Polling window is not over, keep rescheduling */ + /* Rtpolling window is not over, keep rescheduling */ force_reschedule = true; } @@ -674,7 +674,7 @@ static void psi_rtpoll_work(struct psi_group *group) collect_percpu_times(group, PSI_POLL, &changed_states); if (changed_states & group->rtpoll_states) { - /* Initialize trigger windows when entering polling mode */ + /* Initialize trigger windows when entering rtpolling mode */ if (now > group->rtpoll_until) init_rtpoll_triggers(group, now);