Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218147/?format=api
{ "id": 2218147, "url": "http://patchwork.ozlabs.org/api/patches/2218147/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331131622.30505-11-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-11-frederic@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260331131622.30505-11-frederic@kernel.org/", "date": "2026-03-31T13:16:18", "name": "[10/14] tick/sched: Account tickless idle cputime only when tick is stopped", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "2750bb2ef9daeb6129dadf280e671f575e93030b", "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-11-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/2218147/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218147/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19090-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=g247PlHX;\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-19090-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=g247PlHX;\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 4flTFF31CFz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 00:17:53 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4flTFB1hgPz2ykX;\n\tWed, 01 Apr 2026 00:17:50 +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 4flTF92PKrz2ygh\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 01 Apr 2026 00:17:49 +1100 (AEDT)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 33DBF6111B;\n\tTue, 31 Mar 2026 13:17:47 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id ED080C2BC9E;\n\tTue, 31 Mar 2026 13:17:39 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774963070;\n\tcv=none;\n b=capg9J4fzyo7De0cl3gF2f59M62Bod64MqaWJR4hok53pzNf/a5i4gAUeOVbCZ4INDSLF+KD9V+8Sc3yYT5/KNc8sXyqsl647vM3GkLQlJmCYHPVTgHiw6L1E81VBFUcqha/pdrZ5pN2MPGqsXwNCuU+wYAJaCF+4Sxf8XFDR09PLUtkpiIrcZ5gl5q1x3irjvYSoXMZBY03JvRH1QcTqqihbaICjuijQNS26rlafoXmabmdeon5XYyAbeRPS0pNmvfyCITNL2khFtPj/EGLWbnRwigUFQQWNzXrkWxRXd/x/z7XWhVa9JTuJhpLxQd+Kfx4RFP+75ULSVCFxAFuyg==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774963070; c=relaxed/relaxed;\n\tbh=nLij8geQ9nMlcCUwAVLBL04cIapzgs6ir2pbYSvvS3U=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=EfkLru4JX5P8+4BWnzl2AUqufYmi/dPgO53XYyWEXlwnkc1hWZCKdkmSyqOIjKjBfJa0Rcbflr5O7RPhR4WPtX8oHSouauXc0QkJ1GKVuMMRr8B2ISBUVbfFRRUwklZWZwTiYjxqgFIa9lNqUdI7yZMalt4GvZcVksCkYadI+ZD+wibePqFJoYjpB3UnWwVSJyn25k5vngcmEhRyVLPkROR0ghnmAjlp9+eQ8VbYoeQBjBQUjdxbn4jBFpBisVH55jkjI4xJGvQYNMaujxmxXdbXnGlh3utzdj0AD+ck9RzQyz087MDp8BcNFXur+lWJYcnv8IKJYKAtF+72TAFYAg==", "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=g247PlHX; 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=1774963066;\n\tbh=b0ahYWXnH1OlnVL9k+U+tBmKrl/hr/iIMc+t5ZPZsTU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=g247PlHXKumCwTjBUEPH/OaEm97Ov8XRAiN+XxOLgKeikZwSsUuHEOpgz+lL1Fcll\n\t u4tm+fBpVaGBDmc+Hd0er8OJZozmuf1jab1eyiLVQOlghTUrrL9x5mwxzXyM+UX6Qo\n\t /r39+MUozV4AJUk4QEu9Y+cGMWBDwbm1O+8f4RsI70Az/uDlGYf6mBmuIFFiQmCxuT\n\t 8yPpijKwrB5RY8+Mkph0ycgLsCcaLpueAYAd24Jxu3ZIBVf2PGZU4/zHTjxMxe9eYx\n\t OThNyt16b8efCE5VXYwaKeNuCagh3SOO6uMCgpmfLBIEnVFdbN7icAFmqJn/EFfVgw\n\t nR8+ZCc/81b1w==", "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 10/14] tick/sched: Account tickless idle cputime only when\n tick is stopped", "Date": "Tue, 31 Mar 2026 15:16:18 +0200", "Message-ID": "<20260331131622.30505-11-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": "There is no real point in switching to dyntick-idle cputime accounting\nmode if the tick is not actually stopped. This just adds overhead,\nnotably fetching the GTOD, on each idle exit and each idle IRQ entry for\nno reason during short idle trips.\n\nSigned-off-by: Frederic Weisbecker <frederic@kernel.org>\nTested-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n kernel/time/tick-sched.c | 44 ++++++++++++++++++----------------------\n 1 file changed, 20 insertions(+), 24 deletions(-)", "diff": "diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c\nindex 0da83d9b324a..923cae35827a 100644\n--- a/kernel/time/tick-sched.c\n+++ b/kernel/time/tick-sched.c\n@@ -1144,8 +1144,10 @@ void tick_nohz_idle_stop_tick(void)\n \t\tts->idle_sleeps++;\n \t\tts->idle_expires = expires;\n \n-\t\tif (!was_stopped && tick_sched_flag_test(ts, TS_FLAG_STOPPED))\n+\t\tif (!was_stopped && tick_sched_flag_test(ts, TS_FLAG_STOPPED)) {\n+\t\t\tkcpustat_dyntick_start(ts->idle_entrytime);\n \t\t\tnohz_balance_enter_idle(cpu);\n+\t\t}\n \t} else {\n \t\ttick_nohz_retain_tick(ts);\n \t}\n@@ -1187,7 +1189,6 @@ void tick_nohz_idle_enter(void)\n \tWARN_ON_ONCE(ts->timer_expires_base);\n \ttick_sched_flag_set(ts, TS_FLAG_INIDLE);\n \tts->idle_entrytime = ktime_get();\n-\tkcpustat_dyntick_start(ts->idle_entrytime);\n \ttick_nohz_clock_sleep(ts);\n \n \tlocal_irq_enable();\n@@ -1217,9 +1218,10 @@ void tick_nohz_irq_exit(void)\n \tstruct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);\n \n \tif (tick_sched_flag_test(ts, TS_FLAG_INIDLE)) {\n-\t\tts->idle_entrytime = ktime_get();\n-\t\tkcpustat_irq_exit(ts->idle_entrytime);\n \t\ttick_nohz_clock_sleep(ts);\n+\t\tts->idle_entrytime = ktime_get();\n+\t\tif (tick_sched_flag_test(ts, TS_FLAG_STOPPED))\n+\t\t\tkcpustat_irq_exit(ts->idle_entrytime);\n \t} else {\n \t\ttick_nohz_full_update_tick(ts);\n \t}\n@@ -1320,8 +1322,11 @@ void tick_nohz_idle_restart_tick(void)\n {\n \tstruct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);\n \n-\tif (tick_sched_flag_test(ts, TS_FLAG_STOPPED))\n-\t\ttick_nohz_restart_sched_tick(ts, ktime_get());\n+\tif (tick_sched_flag_test(ts, TS_FLAG_STOPPED)) {\n+\t\tktime_t now = ktime_get();\n+\t\tkcpustat_dyntick_stop(now);\n+\t\ttick_nohz_restart_sched_tick(ts, now);\n+\t}\n }\n \n static void tick_nohz_idle_update_tick(struct tick_sched *ts, ktime_t now)\n@@ -1351,7 +1356,6 @@ static void tick_nohz_idle_update_tick(struct tick_sched *ts, ktime_t now)\n void tick_nohz_idle_exit(void)\n {\n \tstruct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);\n-\tbool idle_active, tick_stopped;\n \tktime_t now;\n \n \tlocal_irq_disable();\n@@ -1360,18 +1364,13 @@ void tick_nohz_idle_exit(void)\n \tWARN_ON_ONCE(ts->timer_expires_base);\n \n \ttick_sched_flag_clear(ts, TS_FLAG_INIDLE);\n-\tidle_active = tick_sched_flag_test(ts, TS_FLAG_IDLE_ACTIVE);\n-\ttick_stopped = tick_sched_flag_test(ts, TS_FLAG_STOPPED);\n+\ttick_nohz_clock_wakeup(ts);\n \n-\tif (idle_active || tick_stopped)\n+\tif (tick_sched_flag_test(ts, TS_FLAG_STOPPED)) {\n \t\tnow = ktime_get();\n-\n-\tif (idle_active)\n-\t\ttick_nohz_clock_wakeup(ts);\n-\n-\tif (tick_stopped)\n+\t\tkcpustat_dyntick_stop(now);\n \t\ttick_nohz_idle_update_tick(ts, now);\n-\tkcpustat_dyntick_stop(now);\n+\t}\n \n \tlocal_irq_enable();\n }\n@@ -1425,15 +1424,13 @@ static inline void tick_nohz_irq_enter(void)\n \tstruct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);\n \tktime_t now;\n \n-\tif (!tick_sched_flag_test(ts, TS_FLAG_STOPPED | TS_FLAG_IDLE_ACTIVE))\n+\ttick_nohz_clock_wakeup(ts);\n+\n+\tif (!tick_sched_flag_test(ts, TS_FLAG_STOPPED))\n \t\treturn;\n \n \tnow = ktime_get();\n-\n-\tif (tick_sched_flag_test(ts, TS_FLAG_IDLE_ACTIVE)) {\n-\t\ttick_nohz_clock_wakeup(ts);\n-\t\tkcpustat_irq_enter(now);\n-\t}\n+\tkcpustat_irq_enter(now);\n \n \t/*\n \t * If all CPUs are idle we may need to update a stale jiffies value.\n@@ -1442,8 +1439,7 @@ static inline void tick_nohz_irq_enter(void)\n \t * rare case (typically stop machine). So we must make sure we have a\n \t * last resort.\n \t */\n-\tif (tick_sched_flag_test(ts, TS_FLAG_STOPPED))\n-\t\ttick_nohz_update_jiffies(now);\n+\ttick_nohz_update_jiffies(now);\n }\n \n #else\n", "prefixes": [ "10/14" ] }