Show a cover letter.

GET /api/covers/2218133/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2218133,
    "url": "http://patchwork.ozlabs.org/api/covers/2218133/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20260331131622.30505-1-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-1-frederic@kernel.org>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260331131622.30505-1-frederic@kernel.org/",
    "date": "2026-03-31T13:16:08",
    "name": "[00/14,v3] tick/sched: Refactor idle cputime accounting",
    "submitter": {
        "id": 79411,
        "url": "http://patchwork.ozlabs.org/api/people/79411/?format=api",
        "name": "Frederic Weisbecker",
        "email": "frederic@kernel.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20260331131622.30505-1-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/covers/2218133/comments/",
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-19080-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=mlSVk4hs;\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-19080-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c0a:e001:78e: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=mlSVk4hs;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.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 4flTCv4kfgz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 00:16:43 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4flTCn0QGyz2ydQ;\n\tWed, 01 Apr 2026 00:16:37 +1100 (AEDT)",
            "from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e: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 4flTCl3Mt7z2ybQ\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 01 Apr 2026 00:16:35 +1100 (AEDT)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id 3B8C342AAF;\n\tTue, 31 Mar 2026 13:16:33 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 2379FC19423;\n\tTue, 31 Mar 2026 13:16:25 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774962996;\n\tcv=none;\n b=ZTS+7zRRDXT0kjCCnN43F0F+BHLbagqBxE6Z/TEcuSVyh0XfzWAr8to3M75vl9ApNp18m1ciAA1f71bi7QwyqoXSUX3AFNvYQaaPfKI2vN2GF7RNGAbiisz9fL4Suj9FYtp2PNMGc+FAT/9gylKpx2K69fDi6AoUMd1yBc7QKXTfiHMkuUMdfIvsy91cqnF/GmlK+B8a1GebFr/6DtqHphjMuXLIglIL07eBXAyWFyvtI5ffUpb1mVH2YCPOaHDCEcJW7SKwnzAu0e3je1azHgxpHZxPY3IMyNMoz0R+BuvV/3jTbskX6K2g8bAvU4TD+zYF7a2XVG3zxjeLDPSr1g==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774962996; c=relaxed/relaxed;\n\tbh=K9CEPw/0HL22GSY+m5f5KpjUQ8pv9hE8xL5lVCPR+ec=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=Hdzzhzx1a2fVhLyLQJxEGsGYr6PRuHbC8pUIycV3MAi+r5AXvGl88sZj1aVhkEX/tfGJb7W1GGOMYbqYtfEXJCn1+E+j7XQhaQ5OxA1XUj0PSE6QZTHe2RG8fFZq1Qg8dgOs7hXnjOQdrBVIN2eM2vKDFBNpIfQuFgFsuplH5WNgia3AYtXZ5llSr0e8sup4GdIhK3+x3TWjZjTzjFDAurW0uoyBfZ9U9XcHaFjOegCIswBiahrcR9zl5O++kldArnmBhyuJ9qPc6qbM9EWyY9j2B3psnA9lveBO85zXb/Sa0dsZ6Dr5ceEcg1P+YdBtXzEWsqZJWfDJLlkl/xiOWA==",
        "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=mlSVk4hs; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25;\n helo=sea.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=1774962993;\n\tbh=3ZPV2KN8EPNGWI/TpDqG6/w8urtND7i6PC8+hEDCYpU=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=mlSVk4hsKqrfJJ3Fu2vnTKjR9JTi0AJ8OS3+rsEQL54ODPDOHu/uvdqw0bzNsagBW\n\t oB2N8bfamYg+iiq9N7SkkPpw7CnErEmvp54wRpJE308vM1m/uvngBLqao3Bunk61bz\n\t O6abRhDZ4VRd5Sx2m+GqdX3nIOMxbwD96dJVYfwZYdrCN9QeIQG/V7sDXdwItuXQK4\n\t hc3CWuzsMyaWlELQMEieiKGaKj6ze9IUlP24Own3stiQiV7m0U2bXJ7+QmwXGuOnFK\n\t gAzphn3zCOy+BK9s8QBeRLLnuF64ROdT+S1juUzYPJgkjefLltpGVzucYHKdUk0H1R\n\t KR5uvZeCWWllw==",
        "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 00/14 v3] tick/sched: Refactor idle cputime accounting",
        "Date": "Tue, 31 Mar 2026 15:16:08 +0200",
        "Message-ID": "<20260331131622.30505-1-frederic@kernel.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "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": "Hi,\n\nAfter the issue reported here:\n\n        https://lore.kernel.org/all/20251210083135.3993562-1-jackzxcui1989@163.com/\n\nIt occurs that the idle cputime accounting is a big mess that\naccumulates within two concurrent statistics, each having their own\nshortcomings:\n\n* The accounting for online CPUs which is based on the delta between\n  tick_nohz_start_idle() and tick_nohz_stop_idle().\n\n  Pros:\n       - Works when the tick is off\n\n       - Has nsecs granularity\n\n  Cons:\n       - Account idle steal time but doesn't substract it from idle\n         cputime.\n\n       - Assumes CONFIG_IRQ_TIME_ACCOUNTING by not accounting IRQs but\n         the IRQ time is simply ignored when\n         CONFIG_IRQ_TIME_ACCOUNTING=n\n\n       - The windows between 1) idle task scheduling and the first call\n         to tick_nohz_start_idle() and 2) idle task between the last\n         tick_nohz_stop_idle() and the rest of the idle time are\n         blindspots wrt. cputime accounting (though mostly insignificant\n         amount)\n\n       - Relies on private fields outside of kernel stats, with specific\n         accessors.\n\n* The accounting for offline CPUs which is based on ticks and the\n  jiffies delta during which the tick was stopped.\n\n  Pros:\n       - Handles steal time correctly\n\n       - Handle CONFIG_IRQ_TIME_ACCOUNTING=y and\n         CONFIG_IRQ_TIME_ACCOUNTING=n correctly.\n\n       - Handles the whole idle task\n\n       - Accounts directly to kernel stats, without midlayer accumulator.\n\n   Cons:\n       - Doesn't elapse when the tick is off, which doesn't make it\n         suitable for online CPUs.\n\n       - Has TICK_NSEC granularity (jiffies)\n\n       - Needs to track the dyntick-idle ticks that were accounted and\n         substract them from the total jiffies time spent while the tick\n         was stopped. This is an ugly workaround.\n\nHaving two different accounting for a single context is not the only\nproblem: since those accountings are of different natures, it is\npossible to observe the global idle time going backward after a CPU goes\noffline, as reported by Xin Zhao.\n\nClean up the situation with introducing a hybrid approach that stays\ncoherent, fixes the backward jumps and works for both online and offline\nCPUs:\n\n* Tick based or native vtime accounting operate before the tick is\n  stopped and resumes once the tick is restarted.\n\n* When the idle loop starts, switch to dynticks-idle accounting as is\n  done currently, except that the statistics accumulate directly to the\n  relevant kernel stat fields.\n\n* Private dyntick cputime accounting fields are removed.\n\n* Works on both online and offline case.\n\n* Move most of the relevant code to the common sched/cputime subsystem\n\n* Handle CONFIG_IRQ_TIME_ACCOUNTING=n correctly such that the\n  dynticks-idle accounting still elapses while on IRQs.\n\n* Correctly substract idle steal cputime from idle time\n\nChanges since v2:\n\n- Add tags\n\n- Fix frenglish\n\n- Add fixup from Heiko to s390 patch\n\n- Drop \"cpufreq: ondemand: Simplify idle cputime granularity test\" as it's upstream\n\n- Fix cpufreq regression reported by Shrikanth\n\n- Simplfy irqtime handling with relying on kcpustat_idle_dyntick()\n\ngit://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git\n        timers/core-v3\n\nHEAD: e37a063888aac70d4c598ce2ed367f8ce3552a69\n\nThanks!\n\nFrederic Weisbecker (14):\n  sched/idle: Handle offlining first in idle loop\n  sched/cputime: Remove superfluous and error prone kcpustat_field()\n    parameter\n  sched/cputime: Correctly support generic vtime idle time\n  powerpc/time: Prepare to stop elapsing in dynticks-idle\n  s390/time: Prepare to stop elapsing in dynticks-idle\n  tick/sched: Unify idle cputime accounting\n  tick/sched: Remove nohz disabled special case in cputime fetch\n  tick/sched: Move dyntick-idle cputime accounting to cputime code\n  tick/sched: Remove unused fields\n  tick/sched: Account tickless idle cputime only when tick is stopped\n  tick/sched: Consolidate idle time fetching APIs\n  sched/cputime: Provide get_cpu_[idle|iowait]_time_us() off-case\n  sched/cputime: Handle idle irqtime gracefully\n  sched/cputime: Handle dyntick-idle steal time correctly\n\n arch/powerpc/kernel/time.c         |  41 ++++\n arch/s390/include/asm/idle.h       |   2 +\n arch/s390/kernel/idle.c            |   5 +-\n arch/s390/kernel/vtime.c           |  57 +++++-\n drivers/cpufreq/cpufreq.c          |  29 +--\n drivers/cpufreq/cpufreq_governor.c |   6 +-\n drivers/macintosh/rack-meter.c     |   2 +-\n fs/proc/stat.c                     |  40 +---\n fs/proc/uptime.c                   |   8 +-\n include/linux/kernel_stat.h        |  76 ++++++--\n include/linux/tick.h               |   4 -\n include/linux/vtime.h              |  22 ++-\n kernel/rcu/tree.c                  |   9 +-\n kernel/rcu/tree_stall.h            |   7 +-\n kernel/sched/cputime.c             | 289 ++++++++++++++++++++++++-----\n kernel/sched/idle.c                |  13 +-\n kernel/time/tick-sched.c           | 202 ++++----------------\n kernel/time/tick-sched.h           |  12 --\n kernel/time/timer_list.c           |   6 +-\n scripts/gdb/linux/timerlist.py     |   4 -\n 20 files changed, 481 insertions(+), 353 deletions(-)"
}