get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2235050,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235050/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260508131647.43868-15-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-15-frederic@kernel.org>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260508131647.43868-15-frederic@kernel.org/",
    "date": "2026-05-08T13:16:46",
    "name": "[14/15] sched/cputime: Handle idle irqtime gracefully",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0b83d2aa26b2579d694a371cda33259673f012c0",
    "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-15-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/2235050/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2235050/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-20624-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=qHbbX6uN;\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-20624-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=qHbbX6uN;\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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBqT66gvBz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 23:19:06 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4gBqT65dvMz30Lv;\n\tFri, 08 May 2026 23:19:06 +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 4gBqT56gz1z30HQ\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 08 May 2026 23:19:05 +1000 (AEST)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 1A8E8600AE;\n\tFri,  8 May 2026 13:19:04 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id CA590C2BCB0;\n\tFri,  8 May 2026 13:18:55 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1778246346;\n\tcv=none;\n b=ZkzB/9Gd/3NjWOV6ij6qmjnJJukcEGt9P2QCh3RXyYzAFB55Ett8bR5EMXoDQ8vKCCCBaBfnFdpNdYSzE+BEuz7ehyCri0SDuH8lFt1hj473Wpi/ibkZX8fvWIfaJiHNUJOv/Aab4q3pFIkfXjiEEFLuh4UUwTVzojGXnw9CkO5P88D352AncDOFZ0qygSbITk+8Ka80g5L/dPT3uWwxOdqLRvjK9kip/KuYBFdCWLdr3QSjXeNEIUaTsUQ9rBwoWZkcMpCVRWKkwi1tSOeuoLYVQiMpxieD4X2ZfNxn9jyAdjrGsKPXkSgc/q4s5uFBlA2+CKKuzCHXC3x3crN6dQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1778246346; c=relaxed/relaxed;\n\tbh=Y8cES+HffG1g9+CSYFZk8HpBKt6h8qnilgLSq7bYgGM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=apG8JP7bOnuq6cAMDWkC4sW+6iuskqcOq7vjt+GVP/v2w5no+2ui5+nZR9OQhJLv+/qGQLH+JJKNIAbJFrlKGspLRI98REj5BrdeF4z11V7P2bLye0gM500vMF5gKLwnLy2ftv9yRQShNke1Kf94S5V4HB0TayArYB8T/6ZG1V4NHgnXr7i1k+AUlMhluR5Rn2ctPvmRtxFgknSmZjar6AK5x1tkSjupRuOZESx9zIjpa/8vFyCDWDQjhHdYjCm1mnX2/Bc0DvKFinilGYFOrJyan14N8YKbq+AncvghV0vZUD8LtnPHIAWlCpEE8FUCl1r1QW8eulMfhtcB/q+bFw==",
        "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=qHbbX6uN; 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=1778246343;\n\tbh=XFJ8pRWP/axY4OUs3PqKazFlUE7J3E8NIjuAoFfvd54=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qHbbX6uNw5iE1JmyAD29DJUX17xmu/WOfINYTTf/zyArVxcRB4G37uk5Iqv+RXV4z\n\t HwbuiTsKWfCITC/thuYQbwa8cqqTJz197QCzqql6enFpRG4PfQNhOsF79owoGXVOBx\n\t 4H1TxhtNXAs9MLtt3xeLeey3Zb+6MWrLKkhk6p9XhCkfkuMc5zaTtUunLSfQLHCkY4\n\t +2O5gu6PuMSb1ZwrTNn/vDjdtgQZ99zW5XSQm4QFemx60/kKG40Yu7RwqmYGzBjcto\n\t 8GvefEz008RHKOKpJxxd5alxoFAsfoZHUJfFVtUZv7IwJxhv5Qu09GIq3FqEIZkRu1\n\t Ll6SZU2I+T4BQ==",
        "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 14/15] sched/cputime: Handle idle irqtime gracefully",
        "Date": "Fri,  8 May 2026 15:16:46 +0200",
        "Message-ID": "<20260508131647.43868-15-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": "The dyntick-idle cputime accounting always assumes that IRQ time\naccounting is enabled and consequently stops elapsing the idle time\nduring dyntick-idle IRQs.\n\nThis doesn't mix up well with disabled IRQ time accounting because then\nidle IRQs become a cputime blind-spot. Also this feature is disabled\non most configurations and the overhead of pausing dyntick-idle\naccounting while in idle IRQs could then be avoided.\n\nFix the situation with conditionally pausing dyntick-idle accounting\nduring idle IRQs only iff either native vtime (which does IRQ time\naccounting) or generic IRQ time accounting are enabled.\n\nAlso make sure that the accumulated IRQ time is not accidentally\nsubstracted from later accounting.\n\nSigned-off-by: Frederic Weisbecker <frederic@kernel.org>\nTested-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n kernel/sched/cputime.c | 20 +++++++++++++++++---\n 1 file changed, 17 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c\nindex 335d2c127763..94be22aa5cb6 100644\n--- a/kernel/sched/cputime.c\n+++ b/kernel/sched/cputime.c\n@@ -47,7 +47,8 @@ static void irqtime_account_delta(struct irqtime *irqtime, u64 delta,\n \tu64_stats_update_begin(&irqtime->sync);\n \tcpustat[idx] += delta;\n \tirqtime->total += delta;\n-\tirqtime->tick_delta += delta;\n+\tif (!kcpustat_idle_dyntick())\n+\t\tirqtime->tick_delta += delta;\n \tu64_stats_update_end(&irqtime->sync);\n }\n \n@@ -444,6 +445,10 @@ static void kcpustat_idle_stop(struct kernel_cpustat *kc, u64 now)\n \n static void kcpustat_idle_start(struct kernel_cpustat *kc, u64 now)\n {\n+\t/* Irqtime accounting might have been enabled in the middle of the IRQ */\n+\tif (kc->idle_elapse)\n+\t\treturn;\n+\n \twrite_seqcount_begin(&kc->idle_sleeptime_seq);\n \tkc->idle_entrytime = now;\n \tkc->idle_elapse = true;\n@@ -478,7 +483,8 @@ void kcpustat_irq_enter(u64 now)\n {\n \tstruct kernel_cpustat *kc = kcpustat_this_cpu;\n \n-\tif (!vtime_generic_enabled_this_cpu())\n+\tif (!vtime_generic_enabled_this_cpu() &&\n+\t    (irqtime_enabled() || vtime_accounting_enabled_this_cpu()))\n \t\tkcpustat_idle_stop(kc, now);\n }\n \n@@ -486,7 +492,15 @@ void kcpustat_irq_exit(u64 now)\n {\n \tstruct kernel_cpustat *kc = kcpustat_this_cpu;\n \n-\tif (!vtime_generic_enabled_this_cpu())\n+\t/*\n+\t * Generic vtime already does its own idle accounting.\n+\t * But irqtime accounting or arch vtime which also accounts IRQs\n+\t * need to pause nohz accounting. Resume nohz accounting as long\n+\t * as the irqtime config is enabled to handle case where irqtime\n+\t * accounting got runtime disabled in the middle of an IRQ.\n+\t */\n+\tif (!vtime_generic_enabled_this_cpu() &&\n+\t    (IS_ENABLED(CONFIG_IRQ_TIME_ACCOUNTING) || vtime_accounting_enabled_this_cpu()))\n \t\tkcpustat_idle_start(kc, now);\n }\n \n",
    "prefixes": [
        "14/15"
    ]
}