From: Mark Brown <broonie@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
John Stultz <jstultz@google.com>, Marco Elver <elver@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com, Edward Liaw <edliaw@google.com>,
Carlos Llamas <cmllamas@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()
Date: Thu, 11 Apr 2024 13:41:59 +0100 [thread overview]
Message-ID: <a9a4a964-6f0c-43a5-9fa8-10926d74fbf1@sirena.org.uk> (raw)
In-Reply-To: <20240406150950.GA3060@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]
On Sat, Apr 06, 2024 at 05:09:51PM +0200, Oleg Nesterov wrote:
> Thomas says:
>
> The signal distribution test has a tendency to hang for a long
> time as the signal delivery is not really evenly distributed. In
> fact it might never be distributed across all threads ever in
> the way it is written.
>
> To me even the
>
> This primarily tests that the kernel does not favour any one.
>
> comment doesn't look right. The kernel does favour a thread which hits
> the timer interrupt when CLOCK_PROCESS_CPUTIME_ID expires.
>
> The new version simply checks that the group leader sleeping in join()
> never receives SIGALRM, cpu_timer_fire() should always send the signal
> to the thread which burns cpu.
>
> Without the commit bcb7ee79029d ("posix-timers: Prefer delivery of signals
> to the current thread") the test-case fails immediately, the very 1st tick
> wakes the leader up. Otherwise it quickly succeeds after 100 ticks.
This has landed in -next and is causing warning spam throughout
kselftest when built with clang:
/home/broonie/git/bisect/tools/testing/selftests/kselftest.h:435:6: warning: variable 'major' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (uname(&info) || sscanf(info.release, "%u.%u.", &major, &minor) != 2)
^~~~~~~~~~~~
/home/broonie/git/bisect/tools/testing/selftests/kselftest.h:438:9: note: uninitialized use occurs here
return major > min_major || (major == min_major && minor >= min_minor);
^~~~~
/home/broonie/git/bisect/tools/testing/selftests/kselftest.h:435:6: note: remove the '||' if its condition is always false
if (uname(&info) || sscanf(info.release, "%u.%u.", &major, &minor) != 2)
^~~~~~~~~~~~~~~
/home/broonie/git/bisect/tools/testing/selftests/kselftest.h:432:20: note: initialize the variable 'major' to silence this warning
unsigned int major, minor;
^
= 0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-04-11 12:42 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 12:30 [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread Marco Elver
2023-03-16 12:30 ` [PATCH v6 2/2] selftests/timers/posix_timers: Test delivery of signals across threads Marco Elver
2024-04-06 20:53 ` Muhammad Usama Anjum
2024-04-06 21:13 ` Oleg Nesterov
2024-04-06 21:32 ` Muhammad Usama Anjum
2023-03-30 10:19 ` [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread Marco Elver
2023-04-06 14:12 ` Marco Elver
2023-04-06 15:13 ` Frederic Weisbecker
2023-04-06 20:22 ` Peter Zijlstra
2024-04-01 20:17 ` John Stultz
2024-04-02 9:07 ` Dmitry Vyukov
2024-04-02 14:57 ` Thomas Gleixner
2024-04-02 17:23 ` John Stultz
2024-04-03 12:41 ` Thomas Gleixner
2024-04-03 15:03 ` Oleg Nesterov
2024-04-03 15:43 ` Thomas Gleixner
2024-04-03 16:32 ` Thomas Gleixner
2024-04-03 18:16 ` John Stultz
2024-04-03 19:09 ` Thomas Gleixner
2024-04-03 19:35 ` John Stultz
2024-04-03 22:24 ` Thomas Gleixner
2024-04-04 14:54 ` Oleg Nesterov
2024-04-04 18:08 ` Thomas Gleixner
2024-04-06 15:09 ` [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution() Oleg Nesterov
2024-04-06 15:10 ` Oleg Nesterov
2024-04-06 22:00 ` Thomas Gleixner
2024-04-08 8:30 ` Dmitry Vyukov
2024-04-08 10:01 ` Thomas Gleixner
2024-04-08 10:26 ` Oleg Nesterov
2024-04-08 18:49 ` Oleg Nesterov
2024-04-08 22:17 ` Thomas Gleixner
2024-04-09 11:10 ` Oleg Nesterov
2024-04-09 11:45 ` Dmitry Vyukov
2024-04-09 12:02 ` Thomas Gleixner
2024-04-09 13:38 ` [PATCH v2] " Oleg Nesterov
2024-04-10 22:21 ` John Stultz
2024-04-10 22:31 ` Thomas Gleixner
2024-04-10 22:33 ` John Stultz
2024-04-11 12:41 ` Mark Brown [this message]
2024-04-11 15:33 ` [PATCH] " John Stultz
2024-04-11 12:44 ` Mark Brown
2024-04-11 14:17 ` Thomas Gleixner
2024-04-11 15:50 ` Oleg Nesterov
2024-04-11 16:03 ` Mark Brown
2024-04-12 12:35 ` [PATCH] selftests: fix build failure with NOLIBC Oleg Nesterov
2024-04-14 7:42 ` Mark Brown
2024-04-04 8:55 ` [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread Dmitry Vyukov
2024-04-04 13:43 ` Oleg Nesterov
2024-04-04 15:10 ` Thomas Gleixner
2024-04-04 15:23 ` Oleg Nesterov
2024-04-05 4:28 ` Dmitry Vyukov
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=a9a4a964-6f0c-43a5-9fa8-10926d74fbf1@sirena.org.uk \
--to=broonie@kernel.org \
--cc=cmllamas@google.com \
--cc=dvyukov@google.com \
--cc=ebiederm@xmission.com \
--cc=edliaw@google.com \
--cc=elver@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jstultz@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).