[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240409111051.GB29396@redhat.com>
Date: Tue, 9 Apr 2024 13:10:52 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
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 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 apply to Linus's tree...
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.
Thomas, I am almost shy to continue this discussion and waste your time ;)
But ...
> +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() ?
> +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.
Oleg.
Powered by blists - more mailing lists