lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <xhsmhh6mzomo6.mognet@vschneid.remote.csb>
Date:   Mon, 09 Oct 2023 17:11:53 +0200
From:   Valentin Schneider <vschneid@...hat.com>
To:     Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Joel Fernandes <joel@...lfernandes.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 3/3] sched/nohz: Remove weird error handling from
 find_new_ilb()

On 06/10/23 13:01, Ingo Molnar wrote:
> * Peter Zijlstra <peterz@...radead.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)) {

I can't see why we'd want smp_call_function_single*() /
generic_exec_single() to take a signed int as input, shouldn't this just be
unsigned?

The perf thing does look like it wants signed though...

>
> :-/
>
> So I don't think this is a particularly well thought-out interface.
>
> Thanks,
>
> 	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ