lkml.org 
[lkml]   [2023]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] sched/nohz: Remove weird error handling from find_new_ilb()

* 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

\
 
 \ /
  Last update: 2023-10-06 13:02    [W:0.050 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site