Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread Oleg Nesterov
On 04/11, Thomas Gleixner wrote: > > On Thu, Apr 11 2024 at 13:44, Mark Brown wrote: > > > > Further to my previous mail it's also broken the arm64 selftest builds, > > they use kselftest.h with nolibc in order to test low level > > functionality mainly used by libc implementations and nolibc

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread Mark Brown
On Thu, Apr 11, 2024 at 05:50:53PM +0200, Oleg Nesterov wrote: > On 04/11, Thomas Gleixner wrote: > > Grrr. Let me stare at this. > Damn ;) > Can't we just turn ksft_min_kernel_version() into > static inline int ksft_min_kernel_version(unsigned int min_major, >

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread John Stultz
On Thu, Apr 11, 2024 at 5:42 AM Mark Brown wrote: > On Sat, Apr 06, 2024 at 05:09:51PM +0200, Oleg Nesterov wrote: > > 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.

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread Thomas Gleixner
On Thu, Apr 11 2024 at 13:44, Mark Brown wrote: > 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

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread Mark Brown
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 >

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-11 Thread Mark Brown
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 >

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-09 Thread Thomas Gleixner
On Tue, Apr 09 2024 at 13:10, Oleg Nesterov wrote: > On 04/09, Thomas Gleixner wrote: > It seems that this is because in your tree check_timer_distribution() does > > if (timer_delete(id)) { > ksft_perror("Can't delete timer"); > return 0; > } > > while in

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-09 Thread Dmitry Vyukov
On Tue, 9 Apr 2024 at 13:12, Oleg Nesterov wrote: > > On 04/09, Thomas Gleixner wrote: > > > > The discussion started about running new tests on older kernels. As this > > is a feature and not a bug fix that obviously fails on older kernels. > > OK, I see... please see below. > > > So something

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-09 Thread Oleg Nesterov
On 04/09, Thomas Gleixner wrote: > > The discussion started about running new tests on older kernels. As this > is a feature and not a bug fix that obviously fails on older kernels. OK, I see... please see below. > So something like the uncompiled below should work. Hmm... this patch doesn't

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-08 Thread Thomas Gleixner
On Mon, Apr 08 2024 at 20:49, Oleg Nesterov wrote: > To me this test should simply do > > ksft_test_result(!ctd_failed, "check signal distribution\n"); > return 0; Right. > but I am not familiar with tools/testing/selftests/ and I am not sure > I understand the last email from

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-08 Thread Oleg Nesterov
On 04/08, Oleg Nesterov wrote: > > On 04/08, Dmitry Vyukov wrote: > > > > > > > > if (ctd_failed) > > > ksft_test_result_skip("No signal distribution. Assuming > > > old kernel\n"); > > > > Shouldn't the test fail here? The goal of a test is to fail when > > things don't

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-08 Thread Oleg Nesterov
On 04/08, Dmitry Vyukov wrote: > > > > > if (ctd_failed) > > ksft_test_result_skip("No signal distribution. Assuming old > > kernel\n"); > > Shouldn't the test fail here? The goal of a test is to fail when > things don't work. I've copied this from the previous patch from

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-08 Thread Thomas Gleixner
On Mon, Apr 08 2024 at 10:30, Dmitry Vyukov wrote: > On Sat, 6 Apr 2024 at 17:12, Oleg Nesterov wrote: >> if (ctd_failed) >> ksft_test_result_skip("No signal distribution. Assuming old >> kernel\n"); > > Shouldn't the test fail here? The goal of a test is to fail when >

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-08 Thread Dmitry Vyukov
On Sat, 6 Apr 2024 at 17:12, Oleg Nesterov wrote: > > Dmitry, Thomas, > > To simplify the review I've attached the code with this patch applied below. > > Yes, this changes the "semantics" of check_timer_distribution(), perhaps it > should be renamed. > > But I do not see a better approach, and

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-06 Thread Thomas Gleixner
On Sat, Apr 06 2024 at 17:10, Oleg Nesterov wrote: > Yes, this changes the "semantics" of check_timer_distribution(), perhaps it > should be renamed. Definitely. > But I do not see a better approach, and in fact I think that > > Test that all running threads _eventually_ receive >

Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-06 Thread Oleg Nesterov
Dmitry, Thomas, To simplify the review I've attached the code with this patch applied below. Yes, this changes the "semantics" of check_timer_distribution(), perhaps it should be renamed. But I do not see a better approach, and in fact I think that Test that all running threads

[PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution()

2024-04-06 Thread Oleg Nesterov
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