Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218140/?format=api
{ "id": 2218140, "url": "http://patchwork.ozlabs.org/api/patches/2218140/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331131622.30505-5-frederic@kernel.org/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260331131622.30505-5-frederic@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260331131622.30505-5-frederic@kernel.org/", "date": "2026-03-31T13:16:12", "name": "[04/14] powerpc/time: Prepare to stop elapsing in dynticks-idle", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "64f29ad5c743a4e6f3966a67a4165fbfd64a629d", "submitter": { "id": 79411, "url": "http://patchwork.ozlabs.org/api/people/79411/?format=api", "name": "Frederic Weisbecker", "email": "frederic@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331131622.30505-5-frederic@kernel.org/mbox/", "series": [ { "id": 498198, "url": "http://patchwork.ozlabs.org/api/series/498198/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=498198", "date": "2026-03-31T13:16:08", "name": "tick/sched: Refactor idle cputime accounting", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/498198/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218140/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218140/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19084-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=doY1r4lb;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19084-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=172.105.4.254", "lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=doY1r4lb;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=172.105.4.254; helo=tor.source.kernel.org;\n envelope-from=frederic@kernel.org; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flTDL6L8pz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 00:17:06 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4flTDL0jthz2ygl;\n\tWed, 01 Apr 2026 00:17:06 +1100 (AEDT)", "from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4flTDK1kNwz2ydn\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 01 Apr 2026 00:17:05 +1100 (AEDT)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 62E716024D;\n\tTue, 31 Mar 2026 13:17:03 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 0E89DC2BCB1;\n\tTue, 31 Mar 2026 13:16:55 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774963025;\n\tcv=none;\n b=N82BuYc2NXo5+dcpcq9+70UfspmSmUFihD7MvXTa1xx7z6dP8G2KLA4ruKRbXvGIjiWKV8voPSe52dzZ+MVE/qRH6ZA8+X6tOWZ5SgCL/h0uNqG5WiYgqzjI6pdoEJYQaeekdr9vj8K0OHw+12MW5mnyq+4w0Taq3IPTSGT09uqnSyS4Jyab+gMiIMYRQYIDbwcSA2WyMeMqP3iIaPnDcIIc4fL5Lnj2Q6+k1eoA8PtYSawSNp2UC0uTLNy98lGd/tzhhguY7AHzc94mgAQyW8PZgIiT2Cle5IK4HcAWLpOCsFUzGmA9HRuMY2xz8eULdEqlGwRWKyYzZ+ndh/EQYA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774963025; c=relaxed/relaxed;\n\tbh=zIbn/CTHW+V2JNBtOAsFOpf77jUoC5oR4stEzePaGeE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Ds8y1zvvn7nmj5CrCqMwYNIcRY2SpQlk2MkdHVb6nOA3PunFIsxTJDx+DAS2d/HAFGrVZgc0z68LCBD95MCxMOJSIuOlXYuIsa0k+pfOmIZrBOAdehbVmEwUiuulST9rH+YNNam+uTRBf0rxXpetEkxeqgEJxRwbkW/A5DovBZPc8FNOY36eVKnqt9DW00MNJeDMglDGWaz/T0kYCp27/ndxKWte5OgmLBcdsYRhcVWf/BKvbf8khtu0NwG6VOasZxHVePx4UOZFtJVKvaTL+Cj0KgGUS8Gy1aGwSIIMvKnBkjH28nGtANYQE+7LpaLsMTNutgDUB5V7v6vTD4lVdw==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=doY1r4lb; dkim-atps=neutral;\n spf=pass (client-ip=172.105.4.254; helo=tor.source.kernel.org;\n envelope-from=frederic@kernel.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774963023;\n\tbh=3JGza6TEAhXjrijNJ2v2eGWf9KE7T/4fipw25vHTRnU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=doY1r4lbmnoEkhdUq/s6RcT8z+9x9eEAV7C5WI9HDy3AfoCMn0B1xHRV3ENfZJmC8\n\t O4ksxko+GCSlaH3rSSUzugQdojRmm5BLBr0eb2AjWzHIEaM8ltZr8Eilg/JruBmn1G\n\t u35tngVYQjeQZMggBo03qZP5vzr1pnw5ESHSyvnzbmgx052jV35aQ8QB0WyiDsCtdl\n\t JUCfA5rFQ/jtluXSjaMgjeLWwaWDLEV87RJCA6eRNc4G0JgriBeMg7Th/otuFupIfu\n\t cC7ANEwSHfxt2grOivxUGdaiUDbwLy6DJx1h/mnArkKs6kfxB+bH6gV5/J+vg3HnK7\n\t 4SRXMXsaAGqUw==", "From": "Frederic Weisbecker <frederic@kernel.org>", "To": "LKML <linux-kernel@vger.kernel.org>", "Cc": "Frederic Weisbecker <frederic@kernel.org>,\n\t\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n\t\"Rafael J. Wysocki\" <rafael@kernel.org>,\n\tAlexander Gordeev <agordeev@linux.ibm.com>,\n\tAnna-Maria Behnsen <anna-maria@linutronix.de>,\n\tBen Segall <bsegall@google.com>,\n\tBoqun Feng <boqun.feng@gmail.com>,\n\tChristian Borntraeger <borntraeger@linux.ibm.com>,\n\tDietmar Eggemann <dietmar.eggemann@arm.com>,\n\tHeiko Carstens <hca@linux.ibm.com>,\n\tIngo Molnar <mingo@redhat.com>,\n\tJan Kiszka <jan.kiszka@siemens.com>,\n\tJoel Fernandes <joelagnelf@nvidia.com>,\n\tJuri Lelli <juri.lelli@redhat.com>,\n\tKieran Bingham <kbingham@kernel.org>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>,\n\tMel Gorman <mgorman@suse.de>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tNeeraj Upadhyay <neeraj.upadhyay@kernel.org>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\t\"Paul E . McKenney\" <paulmck@kernel.org>,\n\tPeter Zijlstra <peterz@infradead.org>,\n\tShrikanth Hegde <sshegde@linux.ibm.com>,\n\tSteven Rostedt <rostedt@goodmis.org>,\n\tSven Schnelle <svens@linux.ibm.com>,\n\tThomas Gleixner <tglx@linutronix.de>,\n\tUladzislau Rezki <urezki@gmail.com>,\n\tValentin Schneider <vschneid@redhat.com>,\n\tVasily Gorbik <gor@linux.ibm.com>,\n\tVincent Guittot <vincent.guittot@linaro.org>,\n\tViresh Kumar <viresh.kumar@linaro.org>,\n\tXin Zhao <jackzxcui1989@163.com>,\n\tlinux-pm@vger.kernel.org,\n\tlinux-s390@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org", "Subject": "[PATCH 04/14] powerpc/time: Prepare to stop elapsing in dynticks-idle", "Date": "Tue, 31 Mar 2026 15:16:12 +0200", "Message-ID": "<20260331131622.30505-5-frederic@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260331131622.30505-1-frederic@kernel.org>", "References": "<20260331131622.30505-1-frederic@kernel.org>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "Currently the tick subsystem stores the idle cputime accounting in\nprivate fields, allowing cohabitation with architecture idle vtime\naccounting. The former is fetched on online CPUs, the latter on offline\nCPUs.\n\nFor consolidation purpose, architecture vtime accounting will continue\nto account the cputime but will make a break when the idle tick is\nstopped. The dyntick cputime accounting will then be relayed by the tick\nsubsystem so that the idle cputime is still seen advancing coherently\neven when the tick isn't there to flush the idle vtime.\n\nPrepare for that and introduce three new APIs which will be used in\nsubsequent patches:\n\n_ vtime_dynticks_start() is deemed to be called when idle enters in\n dyntick mode. The idle cputime that elapsed so far is accumulated.\n\n- vtime_dynticks_stop() is deemed to be called when idle exits from\n dyntick mode. The vtime entry clocks are fast-forward to current time\n so that idle accounting restarts elapsing from now.\n\n- vtime_reset() is deemed to be called from dynticks idle IRQ entry to\n fast-forward the clock to current time so that the IRQ time is still\n accounted by vtime while nohz cputime is paused.\n\nAlso accumulated vtime won't be flushed from dyntick-idle ticks to avoid\naccounting twice the idle cputime, along with nohz accounting.\n\nSigned-off-by: Frederic Weisbecker <frederic@kernel.org>\nReviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>\nTested-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n arch/powerpc/kernel/time.c | 41 ++++++++++++++++++++++++++++++++++++++\n include/linux/vtime.h | 6 ++++++\n 2 files changed, 47 insertions(+)", "diff": "diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c\nindex 4bbeb8644d3d..18506740f4a4 100644\n--- a/arch/powerpc/kernel/time.c\n+++ b/arch/powerpc/kernel/time.c\n@@ -376,6 +376,47 @@ void vtime_task_switch(struct task_struct *prev)\n \t\tacct->starttime = acct0->starttime;\n \t}\n }\n+\n+#ifdef CONFIG_NO_HZ_COMMON\n+/**\n+ * vtime_reset - Fast forward vtime entry clocks\n+ *\n+ * Called from dynticks idle IRQ entry to fast-forward the clocks to current time\n+ * so that the IRQ time is still accounted by vtime while nohz cputime is paused.\n+ */\n+void vtime_reset(void)\n+{\n+\tstruct cpu_accounting_data *acct = get_accounting(current);\n+\n+\tacct->starttime = mftb();\n+#ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME\n+\tacct->startspurr = read_spurr(acct->starttime);\n+#endif\n+}\n+\n+/**\n+ * vtime_dyntick_start - Inform vtime about entry to idle-dynticks\n+ *\n+ * Called when idle enters in dyntick mode. The idle cputime that elapsed so far\n+ * is accumulated and the tick subsystem takes over the idle cputime accounting.\n+ */\n+void vtime_dyntick_start(void)\n+{\n+\tvtime_account_idle(current);\n+}\n+\n+/**\n+ * vtime_dyntick_stop - Inform vtime about exit from idle-dynticks\n+ *\n+ * Called when idle exits from dyntick mode. The vtime entry clocks are\n+ * fast-forward to current time so that idle accounting restarts elapsing from\n+ * now.\n+ */\n+void vtime_dyntick_stop(void)\n+{\n+\tvtime_reset();\n+}\n+#endif /* CONFIG_NO_HZ_COMMON */\n #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */\n \n void __no_kcsan __delay(unsigned long loops)\ndiff --git a/include/linux/vtime.h b/include/linux/vtime.h\nindex 336875bea767..61b94c12d7dd 100644\n--- a/include/linux/vtime.h\n+++ b/include/linux/vtime.h\n@@ -37,11 +37,17 @@ extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset);\n extern void vtime_account_softirq(struct task_struct *tsk);\n extern void vtime_account_hardirq(struct task_struct *tsk);\n extern void vtime_flush(struct task_struct *tsk);\n+extern void vtime_reset(void);\n+extern void vtime_dyntick_start(void);\n+extern void vtime_dyntick_stop(void);\n #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */\n static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { }\n static inline void vtime_account_softirq(struct task_struct *tsk) { }\n static inline void vtime_account_hardirq(struct task_struct *tsk) { }\n static inline void vtime_flush(struct task_struct *tsk) { }\n+static inline void vtime_reset(void) { }\n+static inline void vtime_dyntick_start(void) { }\n+extern inline void vtime_dyntick_stop(void) { }\n #endif\n \n /*\n", "prefixes": [ "04/14" ] }