get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2235042/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2235042,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235042/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260508131647.43868-7-frederic@kernel.org/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260508131647.43868-7-frederic@kernel.org>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260508131647.43868-7-frederic@kernel.org/",
    "date": "2026-05-08T13:16:38",
    "name": "[06/15] s390/time: Prepare to stop elapsing in dynticks-idle",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2b3e1e63970fa261e791bdff41e285748ed4f3ff",
    "submitter": {
        "id": 79411,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/79411/?format=api",
        "name": "Frederic Weisbecker",
        "email": "frederic@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260508131647.43868-7-frederic@kernel.org/mbox/",
    "series": [
        {
            "id": 503389,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503389/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=503389",
            "date": "2026-05-08T13:16:32",
            "name": "tick/sched: Refactor idle cputime accounting",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/503389/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2235042/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2235042/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-20616-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=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=qEupoMp8;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-20616-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=qEupoMp8;\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\n [IPv6:2404:9400:21b9:f100::1])\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 4gBqRs1pggz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 23:18:01 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4gBqRs0z0Vz3bdD;\n\tFri, 08 May 2026 23:18:01 +1000 (AEST)",
            "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 4gBqRr06Rsz30Sx\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 08 May 2026 23:18:00 +1000 (AEST)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id C2AF56057A;\n\tFri,  8 May 2026 13:17:57 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 56691C2BCB0;\n\tFri,  8 May 2026 13:17:49 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1778246281;\n\tcv=none;\n b=ovFGJDDKxumCcs46o5519ihN+k2G2hO8/YurABSLEDxR5b/cp/iMLhvDtffX/7cIpMZIeVlWcK/c9HVnwagYuMvH2vwmINvJu7JiSFQ/rZjh7hpNv3jin5xrr9JRWs+HoJEkmzu2gggPKoI1+97EiqS9Fc4Mx9GdlUpTMOqXUPvUin9wifGj1+a3t6CdbR2aI4ZibCDbZB8ShZFcPZi0cv3LmCWRjUWRTxRcgiZwPoFtsNE6+Q5X9xTa3Dt8uGun3ABaHQTR0O91z8yNPSkILwpi3z5WCsEs/e8/2ae7sjU8WgpyUhXv261TwxFtCXD0P9/h1hg2TM9LRITX1yyt6w==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1778246281; c=relaxed/relaxed;\n\tbh=pCHluMdRCZO6zuuyp7KpQ9p3Nb+eIOOdeqVIaWUC0PI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=N/c6LuCicR9/I1MIua3fLF1yrXrWgFtQAUMYv4YxHzQV596Q0ki+k/AqGRGIA6V9c3TZNI4ahOHcsnK3P0OT6UJVuQRlr+76W05/grKTpqzmZQonJLHHh8tSy/YGeEE2IDc3tZMO0OY2gLqOyBVuRnzMx4jQ2RcPFrhAT3t9/Qu2FvMxs4jDeAvwbN0oQZAlCnJuDd5kEbqqcHy8zSZpLqLAfU5KItc4guzEWke1O3Lx17nQpYEhbmPHKIRUQzXZGgO7htkXBGsLnVzyvNi/mpQa6s7pXCrQ/Forurmo2XspOnB1MNek3GAt4hU/gY6Eh0yPby0AMkQPSlrebt1/nA==",
        "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=qEupoMp8; 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=1778246277;\n\tbh=M63ShCX7zqb5AHp58Bm1+/s5JI8DPbHl1tMtnbJNrS8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qEupoMp8veMBv7bKoFjQb/HHLcQFnZgJICjroGoAB5EJzTOICKGlyxAFBQp/5Tc7q\n\t gYbxWHkesd/KGX7EnKN+CfdfLhO3P8XNTUUwtODinS8KsbW3Cl30Mi+AScIYNV0Zma\n\t WwCkedwTSqjfpiOhi6ZXDeA0IRG3vWd12zycXxKCijk+dfMsE9n/6pmSPcBu3FTFc8\n\t R145rVOyDaV90+natkFLU0SdGT0Hp0oWgZ2kWtb5VYP5mtGU31tR97/O9Ed6fyoQW2\n\t TAvGFs1WA/+SsoQ87vdQAl1HomAxl6K4ub0y53p7pLji11MtbhZCtU1LBYQOj1R3fm\n\t /WEOK7Nwm9vIA==",
        "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>, Boqun 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>, Ingo Molnar <mingo@kernel.org>,\n\tIngo Molnar <mingo@redhat.com>, Jan 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>, Michael 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>, Sashiko@lists.ozlabs.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>, linux-pm@vger.kernel.org,\n\tlinux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org",
        "Subject": "[PATCH 06/15] s390/time: Prepare to stop elapsing in dynticks-idle",
        "Date": "Fri,  8 May 2026 15:16:38 +0200",
        "Message-ID": "<20260508131647.43868-7-frederic@kernel.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260508131647.43868-1-frederic@kernel.org>",
        "References": "<20260508131647.43868-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.6 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  and accounted. Also idle time accounting is ignored.\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. Also idle time\n  accounting is resumed.\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>\nCo-developed-by: Heiko Carstens <hca@linux.ibm.com>\nSigned-off-by: Heiko Carstens <hca@linux.ibm.com>\nTested-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n arch/s390/include/asm/idle.h |  2 +\n arch/s390/kernel/idle.c      |  5 ++-\n arch/s390/kernel/vtime.c     | 75 ++++++++++++++++++++++++++++++++----\n 3 files changed, 73 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h\nindex 32536ee34aa0..e4ad09a22400 100644\n--- a/arch/s390/include/asm/idle.h\n+++ b/arch/s390/include/asm/idle.h\n@@ -8,10 +8,12 @@\n #ifndef _S390_IDLE_H\n #define _S390_IDLE_H\n \n+#include <linux/percpu-defs.h>\n #include <linux/types.h>\n #include <linux/device.h>\n \n struct s390_idle_data {\n+\tbool\t      idle_dyntick;\n \tunsigned long idle_count;\n \tunsigned long idle_time;\n \tunsigned long clock_idle_enter;\ndiff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c\nindex 1f1b06b6b4ef..4685d7c5bc51 100644\n--- a/arch/s390/kernel/idle.c\n+++ b/arch/s390/kernel/idle.c\n@@ -31,7 +31,10 @@ void account_idle_time_irq(void)\n \t/* Account time spent with enabled wait psw loaded as idle time. */\n \t__atomic64_add(idle_time, &idle->idle_time);\n \t__atomic64_add_const(1, &idle->idle_count);\n-\taccount_idle_time(cputime_to_nsecs(idle_time));\n+\n+\t/* Dyntick idle time accounted by nohz/scheduler */\n+\tif (!idle->idle_dyntick)\n+\t\taccount_idle_time(cputime_to_nsecs(idle_time));\n }\n \n void noinstr arch_cpu_idle(void)\ndiff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c\nindex bf48744d0912..d1102a6f80bd 100644\n--- a/arch/s390/kernel/vtime.c\n+++ b/arch/s390/kernel/vtime.c\n@@ -17,6 +17,7 @@\n #include <asm/vtimer.h>\n #include <asm/vtime.h>\n #include <asm/cpu_mf.h>\n+#include <asm/idle.h>\n #include <asm/smp.h>\n \n #include \"entry.h\"\n@@ -110,6 +111,16 @@ static void account_system_index_scaled(struct task_struct *p, u64 cputime,\n \taccount_system_index_time(p, cputime_to_nsecs(cputime), index);\n }\n \n+static inline void vtime_reset_last_update(struct lowcore *lc)\n+{\n+\tasm volatile(\n+\t\t\"\tstpt\t%0\\n\"\t/* Store current cpu timer value */\n+\t\t\"\tstckf\t%1\"\t/* Store current tod clock value */\n+\t\t: \"=Q\" (lc->last_update_timer),\n+\t\t  \"=Q\" (lc->last_update_clock)\n+\t\t: : \"cc\");\n+}\n+\n /*\n  * Update process times based on virtual cpu times stored by entry.S\n  * to the lowcore fields user_timer, system_timer & steal_clock.\n@@ -121,17 +132,16 @@ static int do_account_vtime(struct task_struct *tsk)\n \n \ttimer = lc->last_update_timer;\n \tclock = lc->last_update_clock;\n-\tasm volatile(\n-\t\t\"\tstpt\t%0\\n\"\t/* Store current cpu timer value */\n-\t\t\"\tstckf\t%1\"\t/* Store current tod clock value */\n-\t\t: \"=Q\" (lc->last_update_timer),\n-\t\t  \"=Q\" (lc->last_update_clock)\n-\t\t: : \"cc\");\n+\n+\tvtime_reset_last_update(lc);\n+\n \tclock = lc->last_update_clock - clock;\n \ttimer -= lc->last_update_timer;\n \n \tif (hardirq_count())\n \t\tlc->hardirq_timer += timer;\n+\telse if (in_serving_softirq())\n+\t\tlc->softirq_timer += timer;\n \telse\n \t\tlc->system_timer += timer;\n \n@@ -231,14 +241,63 @@ EXPORT_SYMBOL_GPL(vtime_account_kernel);\n \n void vtime_account_softirq(struct task_struct *tsk)\n {\n-\tget_lowcore()->softirq_timer += vtime_delta();\n+\tif (!__this_cpu_read(s390_idle.idle_dyntick))\n+\t\tget_lowcore()->softirq_timer += vtime_delta();\n+\telse\n+\t\tvtime_flush(tsk);\n }\n \n void vtime_account_hardirq(struct task_struct *tsk)\n {\n-\tget_lowcore()->hardirq_timer += vtime_delta();\n+\tif (!__this_cpu_read(s390_idle.idle_dyntick)) {\n+\t\tget_lowcore()->hardirq_timer += vtime_delta();\n+\t} else {\n+\t\t/*\n+\t\t * In dynticks mode, the idle cputime is accounted by the nohz\n+\t\t * subsystem. Therefore the s390 timer/clocks are reset on IRQ\n+\t\t * entry and steal time must be accounted now.\n+\t\t */\n+\t\tvtime_flush(tsk);\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+\tvtime_reset_last_update(get_lowcore());\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 flushed and the tick subsystem takes over the idle cputime accounting.\n+ */\n+void vtime_dyntick_start(void)\n+{\n+\t__this_cpu_write(s390_idle.idle_dyntick, true);\n+\tvtime_flush(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 and idle accounting resumes.\n+ */\n+void vtime_dyntick_stop(void)\n+{\n+\tvtime_reset_last_update(get_lowcore());\n+\t__this_cpu_write(s390_idle.idle_dyntick, false);\n+}\n+#endif /* CONFIG_NO_HZ_COMMON */\n+\n /*\n  * Sorted add to a list. List is linear searched until first bigger\n  * element is found.\n",
    "prefixes": [
        "06/15"
    ]
}