From: Alan Maguire <alan.maguire@oracle.com> 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 <alan.maguire@oracle.com>, Knut Omang <knut.omang@oracle.com> 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> (raw) In-Reply-To: <1575374868-32601-1-git-send-email-alan.maguire@oracle.com> 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 <knut.omang@oracle.com> Signed-off-by: Knut Omang <knut.omang@oracle.com> Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Reviewed-by: Stephen Boyd <sboyd@kernel.org> --- 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 <linux/completion.h> #include <linux/kernel.h> #include <linux/kthread.h> -#include <linux/sched/sysctl.h> #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
next prev parent reply index Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-03 12:07 [PATCH v5 linux-kselftest-test 0/6] kunit: support building core/tests as modules Alan Maguire 2019-12-03 12:07 ` [PATCH v5 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire 2019-12-03 12:07 ` [PATCH v5 linux-kselftest-test 2/6] kunit: hide unexported try-catch interface in try-catch-impl.h Alan Maguire 2019-12-03 12:07 ` [PATCH v5 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module Alan Maguire 2019-12-03 17:54 ` Brendan Higgins 2019-12-04 0:38 ` Theodore Y. Ts'o 2019-12-04 0:42 ` Brendan Higgins 2019-12-04 0:51 ` Brendan Higgins 2019-12-04 15:41 ` Alan Maguire 2019-12-05 0:00 ` Iurii Zaikin 2019-12-06 13:53 ` Alan Maguire 2019-12-04 0:17 ` Iurii Zaikin 2019-12-04 15:30 ` Alan Maguire 2019-12-04 0:55 ` David Gow 2019-12-03 12:07 ` Alan Maguire [this message] 2019-12-03 22:45 ` [PATCH v5 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Brendan Higgins 2019-12-03 12:07 ` [PATCH v5 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module Alan Maguire 2019-12-03 22:47 ` Brendan Higgins 2019-12-03 12:07 ` [PATCH v5 linux-kselftest-test 6/6] kunit: update documentation to describe module-based build Alan Maguire 2019-12-03 22:50 ` Brendan Higgins 2019-12-03 23:06 ` [PATCH v5 linux-kselftest-test 0/6] kunit: support building core/tests as modules Brendan Higgins
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1575374868-32601-5-git-send-email-alan.maguire@oracle.com \ --to=alan.maguire@oracle.com \ --cc=adilger.kernel@dilger.ca \ --cc=akpm@linux-foundation.org \ --cc=andriy.shevchenko@linux.intel.com \ --cc=brendanhiggins@google.com \ --cc=catalin.marinas@arm.com \ --cc=corbet@lwn.net \ --cc=davidgow@google.com \ --cc=joe.lawrence@redhat.com \ --cc=keescook@chromium.org \ --cc=knut.omang@oracle.com \ --cc=kunit-dev@googlegroups.com \ --cc=linux-doc@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-kselftest@vger.kernel.org \ --cc=mcgrof@kernel.org \ --cc=penguin-kernel@i-love.sakura.ne.jp \ --cc=tytso@mit.edu \ --cc=urezki@gmail.com \ --cc=yamada.masahiro@socionext.com \ --cc=yzaikin@google.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-kselftest Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \ linux-kselftest@vger.kernel.org public-inbox-index linux-kselftest Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest AGPL code for this site: git clone https://public-inbox.org/public-inbox.git