Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1927398lqe; Tue, 9 Apr 2024 05:03:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8JE02dmHb9YJWbA32RghavEjbBVLhrONj+GPAGTZvhUaWLKLKG4WpEKHPYRxBm7JBEaA5HAXaM3PU9Z7B8psngUwtqFEzN16EaJM/5w== X-Google-Smtp-Source: AGHT+IH2amo/U1PMyZv7iZsw8XfP7Y9ohvOgcTOLhgJqeW1YKToab0w2e0uLg+gufkiDWPNRI83G X-Received: by 2002:a17:902:d896:b0:1e3:e256:44e0 with SMTP id b22-20020a170902d89600b001e3e25644e0mr7160644plz.31.1712664217955; Tue, 09 Apr 2024 05:03:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712664217; cv=pass; d=google.com; s=arc-20160816; b=pbnEiUtbMjLRX95Q+BHzDv0Bo49Ys65OnYknup5APkqTxUsHpj13XqvNLnr/0EttVP bSlpcMvFCYKJjW3xQbO9UGqujtZXVuJB/KzOsgJgByyPgyaHFN6Hk5u04wJcacRShTjt v0agpKyWdcqRElZfwwKTI723QOfnZKhOsTqagyOLyMai7y8OPEtE/3wwX85dJ8Ih0YP9 nmjkoAEKq1TOBVSbNniAzV0laSpq8lJfmoWwq4er6sntToG/gFKOrc0fetMfoP/wKx6j fpyhWxqvPILzmCqC/JTUBQVrgREaNBfK31VUqc6ZsGE+KU2DH29xnOCniXs+EtV4rnFj CN7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=8NoF74+Dpoxqa48kWnxI0CEBaofoHHeQ96U8jZayGGY=; fh=YMfigdof9h68/hROUTb3YhceEFrPPzqQv5CTEIAfxPI=; b=EPoMsJurKd+QtOQ/71vqpJ3z3JKohue6nTAg182uhlagiCYaDMD9cf80g8pLZLtb1s EEqZxDh3LYI1wj8NwkyrwsWq0R75EKtReoaQ2dIreUqu1RLCMgRHXyL8jdppg6mZVZ6B YGyS4VqnXHzorsNgX5dajhk1kGLM0X/rzAJf4xHfAJ1OvuSmUPTvMWtEr12e0ZvyQSJr ODhh/NWLp15C24iZNupemysLUUi1xijmwwipp3xWFqjdBvjUiy+3C9GWIvlUk1d6TeK9 olgNRvL59Cex2/zAi2lTGL9bG7Q5hJOhbglJE837YNunhtTjl9Pbfv0bBkQFo34q3MyR p/Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UNuLPP5S; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CyTwhFEo; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-136832-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id me13-20020a170902fc4d00b001e028766f04si8472034plb.537.2024.04.09.05.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 05:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136832-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UNuLPP5S; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CyTwhFEo; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-136832-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A19042831CE for ; Tue, 9 Apr 2024 12:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 491EA12D20C; Tue, 9 Apr 2024 12:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UNuLPP5S"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CyTwhFEo" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0F1512D1E7; Tue, 9 Apr 2024 12:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712664167; cv=none; b=MmWC0fVy9J5N2cRPJj/6uIKJ1nkRdLtX0T1IJ9Yi3ifbsX6WfkXhgI+9F2/tW8a2+Hfot+TzGRRhyDM/wHpZBy3coPHGnlR/H6Dy1/iU/VzBBUfZCpHaV7bjc2ETFaQfHkpPGs5Eqc6b9EapzXDMG3CrjCnabVrIhXZq8czOimI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712664167; c=relaxed/simple; bh=OSEZ/IJn1fMBgDMHSVQYwhSOUU5+Mc8UTTRDuJvngM4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dqyOC+uAkIi3h3gS1E9PULA32TutDirJoe4NNMQwKe3zbW4pMYzl6BDUPFCA3YB2pf7xeMHdT3co+Saq55lACmBVA6Noy1qBm3G8PqSFRjEuQ7LRCay2L0/U18x4KKiAmj7Q3sCJxrznvdqsGkBOIc9gDJ4Ju7uxpWhr5fH7hHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UNuLPP5S; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CyTwhFEo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712664161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8NoF74+Dpoxqa48kWnxI0CEBaofoHHeQ96U8jZayGGY=; b=UNuLPP5SrIkQee7qfz1ZyYRNb3d2WR3QPojM6WUZB3XqsvAeRsfziV+c6gfUoWCLTAc6j5 cb8UB5Ju1TSnxx+mDDxo8//mRkDg3Ou+HjilxSksmg4SUyhCkGADdMa4Ia63ZPLhZ0CJ5e 60KCV3dcBKnDFSMb5ltGzZvZp2T6gYlhdGYQpbJikI2fpbCere63+gMUjQ7iYB+nb6gfy/ Zi2cIzneMdqEgV0lV7YuxJ6Dqbn0g+ofkSddir1skWrWdfIDEtN10oDojrqJpJ94hiVzQH I6NGXeZtQzeMMbJC24agR34DgADXUD/yECpAE7ewmxx1ucJPdq13qlKmPAZ0hA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712664161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8NoF74+Dpoxqa48kWnxI0CEBaofoHHeQ96U8jZayGGY=; b=CyTwhFEoeUdjhwP0bMFPIs9b+VK/snwqfq0q92W1RQ3TQBS8Nl3h9TRGLDVxlui91hbbnU TzjvW8K/YGS/vPBQ== To: Oleg Nesterov Cc: Dmitry Vyukov , John Stultz , Marco Elver , Peter Zijlstra , Ingo Molnar , "Eric W. Biederman" , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kasan-dev@googlegroups.com, Edward Liaw , Carlos Llamas , Greg Kroah-Hartman Subject: Re: [PATCH] selftests/timers/posix_timers: reimplement check_timer_distribution() In-Reply-To: <20240409111051.GB29396@redhat.com> References: <87frw2axv0.ffs@tglx> <20240404145408.GD7153@redhat.com> <87le5t9f14.ffs@tglx> <20240406150950.GA3060@redhat.com> <20240406151057.GB3060@redhat.com> <20240408102639.GA25058@redhat.com> <20240408184957.GD25058@redhat.com> <87il0r7b4k.ffs@tglx> <20240409111051.GB29396@redhat.com> Date: Tue, 09 Apr 2024 14:02:40 +0200 Message-ID: <877ch67nhb.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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.