Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1591193ybv; Thu, 20 Feb 2020 23:53:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxZgM2d3iIfrOG+BwZpalK8A1ib5CPX1tHRhE+KXHaSq/XGr54CzA22/cBlmZE7eyk1WCuz X-Received: by 2002:aca:1b11:: with SMTP id b17mr947788oib.45.1582271608759; Thu, 20 Feb 2020 23:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271608; cv=none; d=google.com; s=arc-20160816; b=EiCBwSnzRfvvBSMksV9KbxtBnoP0e4e2D5oA/UqZKQUWRbHIO5jdpSxBlFaDrqdoej pTwFjujBM2vlSnAbCvY/SHhHitc63OJ+yzqeTgpdwSrfpiSBgR3aYl/yB0vEOlUeQCY9 rLxd8U8fJD7/e8EES7VJEqW3Wr42N3dyzm5GYk+gpP2WMwdyNyj89MWd9lo7FaIDD2aE jyYx0SneJhXeDnh8TBC+QVJ4yjmNkZ06bSm1y+055xfzenf6xUn6Mg471etO51YgFtpl o102xzQro1Cs9byU5QPo3cfMFY1gFLi2mGE92n2AXzh7Sbez3/2BW9dSLhhnFYgQKVZV 1Gfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xE7saENaJF7/7fwDzMcmiFms19+HsEnCUdcoGUJHTOQ=; b=WENPfg6gQVlPoJzD2qrfsHeVjxwUnSE6qNhW5ojfyPmrxDidjN8yjwpkBDZjPyZ9wp fQF+kDEHpHRYn4jSnUb73RKJQ7NXS//E9EifTpib3e1X2NxxJzXm8ewaeZTeWdL/wfuy +6d6jm2gY5+1lYWz5aLzT5LUaLMioxKahZ3O1fMJRU5a0M5oCNt5e05dwoofD32z8hCW n18Qi+LggThWjoRqZ0J4m+PMA7vDMOgvgqCA56Q25X6J5NzMyYj9nvpDjenrDuU5nwlN gxgw+nsbgXDJxmGVyfdpe4ikX4XGfInfppTdoTZx2opIYektih5AwruKjDKz73s6ezIu 89cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fQIkuYOn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p186si406453oih.172.2020.02.20.23.53.16; Thu, 20 Feb 2020 23:53:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fQIkuYOn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729908AbgBUHxN (ORCPT + 99 others); Fri, 21 Feb 2020 02:53:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:51314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730003AbgBUHxM (ORCPT ); Fri, 21 Feb 2020 02:53:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E54124650; Fri, 21 Feb 2020 07:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271591; bh=vKHcwCVRb23yZv/rdCpLWOTPd8K+2jbWZg/bXfSw6CY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQIkuYOnTbzkqsP30KznFbtYiWe4Zx1ALxDzQozXzBL+hTuC1SG7/vUBbFrJ+NXW/ mygUvdWoBLGkxJsLzpkWu3eRI6g8dKhOBBZM/55DGNulqMf0WKo3qDA7OBhushkOU1 bhDR5HIaeAbnkMhuiExoyD6TelzyOkNjR+a1Tnn8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Knut Omang , Alan Maguire , Stephen Boyd , Brendan Higgins , Shuah Khan , Sasha Levin Subject: [PATCH 5.5 223/399] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Date: Fri, 21 Feb 2020 08:39:08 +0100 Message-Id: <20200221072424.639367517@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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