[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877ch67nhb.ffs@tglx>
Date: Tue, 09 Apr 2024 14:02:40 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>, John Stultz <jstultz@...gle.com>,
Marco Elver <elver@...gle.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, "Eric W. Biederman"
<ebiederm@...ssion.com>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, kasan-dev@...glegroups.com, Edward Liaw
<edliaw@...gle.com>, Carlos Llamas <cmllamas@...gle.com>, Greg
Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] selftests/timers/posix_timers: reimplement
check_timer_distribution()
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 Linus's tree it returns -1 if timer_delete()
> fails. Nevermind.
Ooops.
>> +static bool check_kernel_version(unsigned int min_major, unsigned int min_minor)
>> +{
>> + unsigned int major, minor;
>> + struct utsname info;
>> +
>> + uname(&info);
>> + if (sscanf(info.release, "%u.%u.", &major, &minor) != 2)
>> + ksft_exit_fail();
>> + return major > min_major || (major == min_major && minor >= min_minor);
>> +}
>
> this looks useful regardless. Perhaps it should be moved into
> tools/testing/selftests/kselftest.h as ksft_ck_kernel_version() ?
Makes sense.
>> +static int check_timer_distribution(void)
>> +{
>> + const char *errmsg;
>> +
>> + if (!check_kernel_version(6, 3)) {
>> + ksft_test_result_skip("check signal distribution (old kernel)\n");
>> return 0;
>
> ..
>
>> + ksft_test_result(!ctd_failed, "check signal distribution\n");
>
> Perhaps
>
> if (!ctd_failed)
> ksft_test_result_pass("check signal distribution\n");
> else if (check_kernel_version(6, 3))
> ksft_test_result_fail("check signal distribution\n");
> else
> ksft_test_result_skip("check signal distribution (old kernel)\n");
>
> makes more sense?
>
> This way it can be used on the older kernels with bcb7ee79029d backported.
Indeed.
Powered by blists - more mailing lists