From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14240C2BA83 for ; Fri, 14 Feb 2020 18:04:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E07F920848 for ; Fri, 14 Feb 2020 18:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581703478; bh=vKHcwCVRb23yZv/rdCpLWOTPd8K+2jbWZg/bXfSw6CY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XaC7O73CBhYrvqtg2gwOQPd50wditOChC0oZXBQ6dLBUMm9T66AuIjMxEBI2QE2Ah LvzartmUkJ7RN1Dic/wIwzhAZQXez0jWwVdj2IXlMF/nckqoHeQlHafABGa7ePhQkf JsK7pjQ3em0mbkatNVWxvKWHZgsCMlVogARCFBCI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391373AbgBNSEi (ORCPT ); Fri, 14 Feb 2020 13:04:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:36836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731452AbgBNPzh (ORCPT ); Fri, 14 Feb 2020 10:55:37 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8FBB24681; Fri, 14 Feb 2020 15:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581695737; bh=vKHcwCVRb23yZv/rdCpLWOTPd8K+2jbWZg/bXfSw6CY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A+zfFwINBo9jBCXjF4DBZoV9TmJZzQqjNCETknmZnkFjpAH2tk37ZJ5if6JEuFsKO ZbSmqvQmNvNN6FYOb3IczMmnUIVPR7zKVsjIHWSFxZrMhnHUq3g7Durl1MciVDRL6b +oAbEWcfmruYhsrEOW1kWtv9unZohxCqJ0Ut+3P4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alan Maguire , Knut Omang , Stephen Boyd , Brendan Higgins , Shuah Khan , Sasha Levin , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH AUTOSEL 5.5 310/542] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Date: Fri, 14 Feb 2020 10:45:02 -0500 Message-Id: <20200214154854.6746-310-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214154854.6746-1-sashal@kernel.org> References: <20200214154854.6746-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Maguire [ Upstream commit 1c024d45151b51c8f8d4749e65958b0bcf3e7c52 ] In discussion of how to handle timeouts, it was noted that if sysctl_hung_task_timeout_seconds is exceeded for a kunit test, the test task will be killed and an oops generated. This should suffice as a means of debugging such timeout issues for now. Hence remove use of sysctl_hung_task_timeout_secs, which has the added benefit of avoiding the need to export that symbol from the core kernel. Co-developed-by: Knut Omang Signed-off-by: Knut Omang Signed-off-by: Alan Maguire Reviewed-by: Stephen Boyd Acked-by: Brendan Higgins Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/kunit/try-catch.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index 55686839eb619..6b9c5242017f6 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -12,7 +12,6 @@ #include #include #include -#include void __noreturn kunit_try_catch_throw(struct kunit_try_catch *try_catch) { @@ -31,8 +30,6 @@ static int kunit_generic_run_threadfn_adapter(void *data) static unsigned long kunit_test_timeout(void) { - unsigned long timeout_msecs; - /* * TODO(brendanhiggins@google.com): We should probably have some type of * variable timeout here. The only question is what that timeout value @@ -49,22 +46,11 @@ static unsigned long kunit_test_timeout(void) * * For more background on this topic, see: * https://mike-bland.com/2011/11/01/small-medium-large.html + * + * If tests timeout due to exceeding sysctl_hung_task_timeout_secs, + * the task will be killed and an oops generated. */ - if (sysctl_hung_task_timeout_secs) { - /* - * If sysctl_hung_task is active, just set the timeout to some - * value less than that. - * - * In regards to the above TODO, if we decide on variable - * timeouts, this logic will likely need to change. - */ - timeout_msecs = (sysctl_hung_task_timeout_secs - 1) * - MSEC_PER_SEC; - } else { - timeout_msecs = 300 * MSEC_PER_SEC; /* 5 min */ - } - - return timeout_msecs; + return 300 * MSEC_PER_SEC; /* 5 min */ } void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) -- 2.20.1