Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Christian Loehle <christian.loehle@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	cocci@inria.fr
Subject: Re: [PATCH] sched: Replace nr_iowait_cpu() with a bool accessor
Date: Thu, 15 Oct 2026 09:37:50 +0200	[thread overview]
Message-ID: <20261015073750.GI4121339@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261014134745.3032405-1-christian.loehle@arm.com>

On Wed, Oct 14, 2026 at 02:47:45PM +0100, Christian Loehle wrote:
> The menu governor was the last consumer of the per-CPU I/O-wait count
> that needed its magnitude, apart from nr_iowait() summing it globally.
> Commit 38f83090f515 ("cpuidle: menu: Remove iowait influence") removed
> that use. All remaining per-CPU consumers only test for zero/nonzero.
> 
> Replace nr_iowait_cpu() with bool cpu_has_iowait() and update the generic
> and s390 idle accounting callers. Have nr_iowait() read the counters
> directly so that the global total and existing accounting are preserved.
> Replace the stale menu comment with a description of the predicate.
> 
> Include the Coccinelle recipe for the code conversion, verified against
> the original files. The helper's comment is updated manually. Reproduce
> the conversion with:
> 
>   make coccicheck COCCI=scripts/coccinelle/api/cpu_has_iowait.cocci MODE=patch
> 
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
>  arch/s390/kernel/idle.c                     |  4 +-
>  include/linux/sched/stat.h                  |  2 +-
>  kernel/sched/core.c                         | 13 ++---
>  kernel/sched/cputime.c                      | 10 ++--
>  scripts/coccinelle/api/cpu_has_iowait.cocci | 56 +++++++++++++++++++++
>  5 files changed, 69 insertions(+), 16 deletions(-)
>  create mode 100644 scripts/coccinelle/api/cpu_has_iowait.cocci

So I like this; but I'm confused about including the cocci script. Why
is this?

      parent reply	other threads:[~2026-10-15  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 13:47 [PATCH] sched: Replace nr_iowait_cpu() with a bool accessor Christian Loehle
2026-10-14 13:53 ` sashiko-bot
2026-10-15  7:37 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261015073750.GI4121339@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=bsegall@google.com \
    --cc=christian.loehle@arm.com \
    --cc=cocci@inria.fr \
    --cc=dietmar.eggemann@arm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=nicolas.palix@imag.fr \
    --cc=rostedt@goodmis.org \
    --cc=svens@linux.ibm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox