All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, 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>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 3/3] sched/nohz: Remove weird error handling from find_new_ilb()
Date: Fri, 6 Oct 2023 13:01:07 +0200	[thread overview]
Message-ID: <ZR/o8+EJGLMi3uPr@gmail.com> (raw)
In-Reply-To: <20231006103858.GB36277@noisy.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Fri, Oct 06, 2023 at 12:25:18PM +0200, Ingo Molnar wrote:
> > find_new_ilb() returns nr_cpu_ids on failure - which is a weird
> > choice in itself: not only is it a global variable, it is
> > a +1 out of bounds CPU index...
> 
> FWIW this is what all the cpumask bitops return when they've exhausted
> the mask. Eg. no bits left set etc..

yeah, which then results in type-forcing uglies like:

   kernel/events/core.c:	if ((unsigned)cpu >= nr_cpu_ids) {
   kernel/events/core.c:   if ((unsigned)cpu >= nr_cpu_ids) {
   kernel/smp.c:	   if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) {

:-/

So I don't think this is a particularly well thought-out interface.

Thanks,

	Ingo

  reply	other threads:[~2023-10-06 11:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 10:25 [PATCH 0/3] sched/nohz: Misc minor cleanups to the NOHZ idle balancing code Ingo Molnar
2023-10-06 10:25 ` [PATCH 1/3] sched/nohz: Update idle load-balancing (ILB) comments Ingo Molnar
2023-10-09 10:26   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2023-10-09 15:12   ` [PATCH 1/3] " Valentin Schneider
2023-10-06 10:25 ` [PATCH 2/3] sched/nohz: Use consistent variable names in find_new_ilb() and kick_ilb() Ingo Molnar
2023-10-09 10:26   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2023-10-09 15:12   ` [PATCH 2/3] " Valentin Schneider
2023-10-06 10:25 ` [PATCH 3/3] sched/nohz: Remove weird error handling from find_new_ilb() Ingo Molnar
2023-10-06 10:38   ` Peter Zijlstra
2023-10-06 11:01     ` Ingo Molnar [this message]
2023-10-09 15:11       ` Valentin Schneider
2023-10-09 10:26   ` [tip: sched/core] sched/nohz: Remove unnecessarily complex error handling pattern " tip-bot2 for Ingo Molnar
2023-10-08 16:56 ` [PATCH 0/3] sched/nohz: Misc minor cleanups to the NOHZ idle balancing code Joel Fernandes

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=ZR/o8+EJGLMi3uPr@gmail.com \
    --to=mingo@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.