get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218151,
    "url": "http://patchwork.ozlabs.org/api/patches/2218151/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331131622.30505-15-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-15-frederic@kernel.org>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260331131622.30505-15-frederic@kernel.org/",
    "date": "2026-03-31T13:16:22",
    "name": "[14/14] sched/cputime: Handle dyntick-idle steal time correctly",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": false,
    "hash": "7f1073f01e7d764e1c69a5c3674857749943b72c",
    "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-15-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/2218151/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218151/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-19094-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=QcjY+/i5;\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-19094-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c04:e001:324:0:1991:8:25\"",
            "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=QcjY+/i5;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c04:e001:324:0:1991:8:25; 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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flTFs18hqz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 00:18:25 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4flTFl5gB5z2ynZ;\n\tWed, 01 Apr 2026 00:18:19 +1100 (AEDT)",
            "from tor.source.kernel.org (tor.source.kernel.org\n [IPv6:2600:3c04:e001:324:0:1991:8:25])\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 4flTFk5vbgz2ybR\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 01 Apr 2026 00:18:18 +1100 (AEDT)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 89DD26024D;\n\tTue, 31 Mar 2026 13:18:16 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 6B76BC2BC9E;\n\tTue, 31 Mar 2026 13:18:09 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774963099;\n\tcv=none;\n b=Lw73r5PLFDlSUJgP0rQCqr/PUOUoEzbOGUUm+e/OFyIc7umMcVRtohe25DGuy9f9yKvjNYG7kBWJuvkHk8eosN7AsVv8adaoZno6Jv/vA2o175/Jae0ZX7+3bpyVoFkVl3gZZa37xC26bFUHHC0dQyaGQDrINgc4GBxhUScb/Ae6HzzEPvH4p6MJrP1PrCSLLaPhsQucrMJMHlmfvbDwZLAF5UJn4iE/TVS3HdSeVy+abmScwNlgG0deKuOHKQtDn3hW2Ighqvg2Vg5Ya2GWV1KjuQ3AE/nfezi5eQjN1anTknJS9AyTOHCJPpwPrFFbwpYXcgbTloNWWfkTHk+LlA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774963099; c=relaxed/relaxed;\n\tbh=/akHv6CooW7edD6FuziWgT1v2QnnFuvY+9BnjAckks8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=dCvwqse0bzKMIyw1ZcrDPsX6Wlkc97yN6tiKjDF3WJEh/udivKbz/O1zMSnxXBZ0Z1ImneWtcrcu+O4BNdQjoYWIVMA5S/Q6CGMK+IqKo/P3f24Ch8wQ4RZL+TwtGwfhcNiwD7Ssm0rql12LWBwE1o036bp/NpLbhRm7kgJ3CJ6WxL1/fVDXANoRtg6dO+P74eYdCgOvlDYAhwUcusCIRz8y7D0dB/9T3u/AYRg/rWW6xM8QUj29aTNJKIdl2bnsSPBm+FuUXRaKEaCVpnjubC1HfSNqej+elNYTPULnPjfzppN9n34cBtZ3f6MKP+XNyHrSZO6oT4uVPWyMoRUlqA==",
        "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=QcjY+/i5; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25;\n helo=tor.source.kernel.org; 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=1774963096;\n\tbh=PFIpn22Lqg8nUvYixerHksrQguG7VQqiCjtgoj0+dII=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=QcjY+/i5y/kMyQ5zzBs/8HbtBsPy4rODD3TLaBkViHed+LXJHBdR3Hl4Ou6uEQL1/\n\t dh5y2JRw47HtffMZP5vvW6JDLevDFG3rthVqd2dVCUquw82FQw9f/WnKemDfCb6ydo\n\t 7zkk1apR5DmFqaq6YaEvuktsM7cxFtBOxTKP33IISuWEowhBJYUNt8qVHw/MRVQyif\n\t FtmCHCuJIBkqo/w31e+CcNNUhEY21vWe5DD+2vEPKRTmCD9TZ2Io/CfwC2NK7r5Mqe\n\t FYokXoKTBVBio+IyccRpfZkPOshlHMzMTAwv6aXrSbzrq6tzoumbKFgRXvqEa3e2Wn\n\t Z0LqDOdVIb2Og==",
        "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 14/14] sched/cputime: Handle dyntick-idle steal time correctly",
        "Date": "Tue, 31 Mar 2026 15:16:22 +0200",
        "Message-ID": "<20260331131622.30505-15-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": "The dyntick-idle steal time is currently accounted when the tick\nrestarts but the stolen idle time is not subtracted from the idle time\nthat was already accounted. This is to avoid observing the idle time\ngoing backward as the dyntick-idle cputime accessors can't reliably know\nin advance the stolen idle time.\n\nIn order to maintain a forward progressing idle cputime while\nsubtracting idle steal time from it, keep track of the previously\naccounted idle stolen time and substract it from _later_ idle cputime\naccounting.\n\nSigned-off-by: Frederic Weisbecker <frederic@kernel.org>\nTested-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n include/linux/kernel_stat.h |  1 +\n kernel/sched/cputime.c      | 21 +++++++++++++++------\n 2 files changed, 16 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h\nindex 512104b0ff49..24a54a6151ba 100644\n--- a/include/linux/kernel_stat.h\n+++ b/include/linux/kernel_stat.h\n@@ -39,6 +39,7 @@ struct kernel_cpustat {\n \tbool\t\tidle_elapse;\n \tseqcount_t\tidle_sleeptime_seq;\n \tu64\t\tidle_entrytime;\n+\tu64\t\tidle_stealtime;\n #endif\n \tu64\t\tcpustat[NR_STATS];\n };\ndiff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c\nindex a77b6f1dbdca..4ae779b161b5 100644\n--- a/kernel/sched/cputime.c\n+++ b/kernel/sched/cputime.c\n@@ -425,19 +425,25 @@ static inline void irqtime_account_process_tick(struct task_struct *p, int user_\n static void kcpustat_idle_stop(struct kernel_cpustat *kc, u64 now)\n {\n \tu64 *cpustat = kc->cpustat;\n-\tu64 delta;\n+\tu64 delta, steal, steal_delta;\n \n \tif (!kc->idle_elapse)\n \t\treturn;\n \n \tdelta = now - kc->idle_entrytime;\n+\tsteal = steal_account_process_time(delta);\n \n \twrite_seqcount_begin(&kc->idle_sleeptime_seq);\n+\tsteal_delta = min_t(u64, kc->idle_stealtime, delta);\n+\tdelta -= steal_delta;\n+\tkc->idle_stealtime -= steal_delta;\n+\n \tif (nr_iowait_cpu(smp_processor_id()) > 0)\n \t\tcpustat[CPUTIME_IOWAIT] += delta;\n \telse\n \t\tcpustat[CPUTIME_IDLE] += delta;\n \n+\tkc->idle_stealtime += steal;\n \tkc->idle_entrytime = now;\n \tkc->idle_elapse = false;\n \twrite_seqcount_end(&kc->idle_sleeptime_seq);\n@@ -460,7 +466,6 @@ void kcpustat_dyntick_stop(u64 now)\n \t\tkcpustat_idle_stop(kc, now);\n \t\tkc->idle_dyntick = false;\n \t\tvtime_dyntick_stop();\n-\t\tsteal_account_process_time(ULONG_MAX);\n \t}\n }\n \n@@ -504,10 +509,14 @@ static u64 kcpustat_field_dyntick(int cpu, enum cpu_usage_stat idx,\n \tdo {\n \t\tseq = read_seqcount_begin(&kc->idle_sleeptime_seq);\n \n-\t\tif (kc->idle_elapse && compute_delta)\n-\t\t\tidle = cpustat[idx] + (now - kc->idle_entrytime);\n-\t\telse\n-\t\t\tidle = cpustat[idx];\n+\t\tidle = cpustat[idx];\n+\n+\t\tif (kc->idle_elapse && compute_delta) {\n+\t\t\tu64 delta = now - kc->idle_entrytime;\n+\n+\t\t\tdelta -= min_t(u64, kc->idle_stealtime, delta);\n+\t\t\tidle += delta;\n+\t\t}\n \t} while (read_seqcount_retry(&kc->idle_sleeptime_seq, seq));\n \n \treturn idle;\n",
    "prefixes": [
        "14/14"
    ]
}