From patchwork Tue Mar 22 21:48:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7027C433FE for ; Tue, 22 Mar 2022 21:48:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6951C6B01A6; Tue, 22 Mar 2022 17:48:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6440C6B01A7; Tue, 22 Mar 2022 17:48:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 533006B01A8; Tue, 22 Mar 2022 17:48:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 424206B01A6 for ; Tue, 22 Mar 2022 17:48:23 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 075A1121952 for ; Tue, 22 Mar 2022 21:48:23 +0000 (UTC) X-FDA: 79273361286.14.CAADFED Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id 8938940035 for ; Tue, 22 Mar 2022 21:48:22 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7118DB81DC6; Tue, 22 Mar 2022 21:48:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E539C340EE; Tue, 22 Mar 2022 21:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985700; bh=PTY5AQR0Uv4zkrNMjuB72K6AdNno877uzvOUdRK72r8=; h=Date:To:From:In-Reply-To:Subject:From; b=YvRIVBtrFKPNv6lR2NDtOLLO8TpAgI73EEU34kkodSQOtq42UDmcr0KnIxnthq57N We+U4riAf3MBL+amxmwmgFimpq4Og8Sb7/TCed45zaO1AoJxLzjxeSWRzE/yy8OFXD EMUC6D9kZRJh7mzgJtM1wj7WZCCHJKJkcbc709fM= Date: Tue, 22 Mar 2022 14:48:19 -0700 To: wangkefeng.wang@huawei.com,glider@google.com,elver@google.com,dvyukov@google.com,dlatypov@google.com,davidgow@google.com,brendanhiggins@google.com,liupeng256@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 193/227] kunit: make kunit_test_timeout compatible with comment Message-Id: <20220322214820.1E539C340EE@smtp.kernel.org> X-Stat-Signature: 5efskaoxde6zmmt4btefahbxadwpeabx Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=YvRIVBtr; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8938940035 X-HE-Tag: 1647985702-470532 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Peng Liu Subject: kunit: make kunit_test_timeout compatible with comment In function kunit_test_timeout, it is declared "300 * MSEC_PER_SEC" represent 5min. However, it is wrong when dealing with arm64 whose default HZ = 250, or some other situations. Use msecs_to_jiffies to fix this, and kunit_test_timeout will work as desired. Link: https://lkml.kernel.org/r/20220309083753.1561921-3-liupeng256@huawei.com Fixes: 5f3e06208920 ("kunit: test: add support for test abort") Signed-off-by: Peng Liu Reviewed-by: Marco Elver Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Wang Kefeng Cc: David Gow Signed-off-by: Andrew Morton --- lib/kunit/try-catch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/kunit/try-catch.c~kunit-make-kunit_test_timeout-compatible-with-comment +++ a/lib/kunit/try-catch.c @@ -52,7 +52,7 @@ static unsigned long kunit_test_timeout( * If tests timeout due to exceeding sysctl_hung_task_timeout_secs, * the task will be killed and an oops generated. */ - return 300 * MSEC_PER_SEC; /* 5 min */ + return 300 * msecs_to_jiffies(MSEC_PER_SEC); /* 5 min */ } void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context)