Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1242516ybl; Tue, 3 Dec 2019 04:09:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzO8JLXu9i0zRAV8Q5gIgAQV1ZySPti1+NqeHDeYyno8EPOX+8poQwu+Ohmu7UZjkbTMi2W X-Received: by 2002:aca:5d57:: with SMTP id r84mr295853oib.42.1575374988104; Tue, 03 Dec 2019 04:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575374988; cv=none; d=google.com; s=arc-20160816; b=szWB8ttpxkGvOP9nHCDuHahNp/DpHNSemGdfCYc6uuIRdzgivhbiXRgFYcjid4kHsl j/yiA7YWSGO/fzPnES3eJEuvPMlQKdBUELacJY7/H8kcRLOPZdomfrjxhm1gB9Mogt2q M7rKSYcBwGz3/8XIVhmal0GioTkkc+i7fFbtcPw2jgvzKAqtV/7trfF9VyUxU5Uo6KwG oyQtK3PVnHQBjsfhg+ZARjIwJZZd2O9DI3FsJSisFD8ah8Cd+ZWoprD4Rdbaskrep5HI niUlTtsJZBi2JexxFPRGmMFEOEcbZjoeFQJdnqpSqhnak0b9XQhJ6Y9ZtnWxi7q4PKtg Frdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=xvYpKbh6ED9uRiphqSzC1Fk53OVKY/xaKrjX10pWFMY=; b=H8jZHpOLm+ne2mW4q+kk1XxtiS1nWfLQDix1tKc3xydPEdGWqJ7tRAb37rdLD20gC0 eakG/toBFSLBrTW4roHPlP4a8t0ba8jW0Yvm4io5FALzFQKu5te+l180wOHdF5nLbGPZ +rigMkdfoEkozgCsUavWCmOYhFfy4klZyYS1T0B5gQiEFP2ytH0bALpPMdnfKEQWmIAo FbhcZEf0AAviUcVSogLQ/FNuOwu6PvHTmWzcDTkLgnTA5oPPMSt9LZcmrZA5royuWL49 BG6yU6H80hnT99oU8oiqh/IYo4n6ZUPcgL5JIO0y/UPoFu1ruF5qGC5HEwE4zJGvCngt 39Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=aSLxv5sZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x207si1208143oif.30.2019.12.03.04.09.35; Tue, 03 Dec 2019 04:09:48 -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=@oracle.com header.s=corp-2019-08-05 header.b=aSLxv5sZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbfLCMJB (ORCPT + 99 others); Tue, 3 Dec 2019 07:09:01 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:46054 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbfLCMI7 (ORCPT ); Tue, 3 Dec 2019 07:08:59 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xB3Bs0L4147741; Tue, 3 Dec 2019 12:08:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=xvYpKbh6ED9uRiphqSzC1Fk53OVKY/xaKrjX10pWFMY=; b=aSLxv5sZCA6+ZX4remrnvLA+BDKGgNt94D1ms2Jq05KsLZrqReMobtU9MeYoVYeAUuxC dFUjRfWxZfjMdf9zCzESyfWYC6Y2DtqHM7GllKPNJ0t+PqOBsy4pQUFxotJ4g1sVV/Xn 6RrffF47v6egAgI+aVo5fZt8NMif4t6/eKjMjmQsfMTBSt3aFzxYkrRTxKyk9xqJ/5d9 psZ5DU2b4ZUIABRWKShmNR0Al6hgBHLlea94fvkiVMW8Y4f5v7CW8c22Ui0XFTNO3dZb pj2tHR+QCJY0zUeBTIziw7wN9HQ3AVIgUMOylYZP0vogVHfh0VtM1N5gSzzb0EgC3INj dA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2wkgcq75vh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Dec 2019 12:08:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xB3BsX9R161922; Tue, 3 Dec 2019 12:08:38 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2wn4qpup69-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Dec 2019 12:08:38 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xB3C8a6E025166; Tue, 3 Dec 2019 12:08:36 GMT Received: from dhcp-10-175-211-120.vpn.oracle.com (/10.175.211.120) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Dec 2019 04:08:35 -0800 From: Alan Maguire To: brendanhiggins@google.com, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, keescook@chromium.org, yzaikin@google.com, akpm@linux-foundation.org, yamada.masahiro@socionext.com, catalin.marinas@arm.com, joe.lawrence@redhat.com, penguin-kernel@i-love.sakura.ne.jp, urezki@gmail.com, andriy.shevchenko@linux.intel.com, corbet@lwn.net, davidgow@google.com, adilger.kernel@dilger.ca, tytso@mit.edu, mcgrof@kernel.org, linux-doc@vger.kernel.org, Alan Maguire , Knut Omang Subject: [PATCH v5 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Date: Tue, 3 Dec 2019 12:07:46 +0000 Message-Id: <1575374868-32601-5-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1575374868-32601-1-git-send-email-alan.maguire@oracle.com> References: <1575374868-32601-1-git-send-email-alan.maguire@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9459 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912030096 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9459 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912030096 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 0247a28..0dd434e 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -11,7 +11,6 @@ #include #include #include -#include #include "try-catch-impl.h" @@ -33,8 +32,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 @@ -51,22 +48,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) -- 1.8.3.1