From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org,
"Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
igt-dev@lists.freedesktop.org,
"Isabella Basso" <isabbasso@riseup.net>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
intel-xe@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t v2 08/17] lib/kunit: Cancel KTP parser on module load failure
Date: Mon, 11 Sep 2023 11:02:41 +0200 [thread overview]
Message-ID: <20230911110241.156b3259@maurocar-mobl2> (raw)
In-Reply-To: <20230908123233.137134-27-janusz.krzysztofik@linux.intel.com>
On Fri, 8 Sep 2023 14:32:42 +0200
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> wrote:
> For our KTAP parser to be running in parallel with kunit test module
> loading, we now start it in a separate thread before we load the module.
> If the module loading fails then we join the KTAP parser thread right
> after that failure. If the KTAP thread sleeps for some reason then we
> can fail to break the test immediately.
>
> Cancel the KTAP parser thread right after module load error and before
> joining it.
LGTM.
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
> lib/igt_kmod.c | 1 +
> lib/igt_ktap.c | 6 ++++++
> lib/igt_ktap.h | 1 +
> 3 files changed, 8 insertions(+)
>
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 78b8eb8f53..fb0bd21ee5 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -773,6 +773,7 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
> results = ktap_parser_start(tst->kmsg, is_builtin);
>
> if (igt_debug_on(igt_kmod_load(tst->module_name, opts) < 0)) {
> + ktap_parser_cancel();
> igt_ignore_warn(ktap_parser_stop());
> igt_skip("Unable to load %s module\n", tst->module_name);
> }
> diff --git a/lib/igt_ktap.c b/lib/igt_ktap.c
> index 3cfb55ec97..1e75b2ec23 100644
> --- a/lib/igt_ktap.c
> +++ b/lib/igt_ktap.c
> @@ -602,6 +602,12 @@ struct ktap_test_results *ktap_parser_start(int fd, bool is_builtin)
> return &results;
> }
>
> +void ktap_parser_cancel(void)
> +{
> + ktap_args.is_running = false;
> + pthread_cancel(ktap_parser_thread);
> +}
> +
> int ktap_parser_stop(void)
> {
> ktap_args.is_running = false;
> diff --git a/lib/igt_ktap.h b/lib/igt_ktap.h
> index ea57c2bb9b..991800e912 100644
> --- a/lib/igt_ktap.h
> +++ b/lib/igt_ktap.h
> @@ -45,6 +45,7 @@ struct ktap_test_results {
>
>
> struct ktap_test_results *ktap_parser_start(int fd, bool is_builtin);
> +void ktap_parser_cancel(void);
> int ktap_parser_stop(void);
>
> #endif /* IGT_KTAP_H */
next prev parent reply other threads:[~2023-09-11 9:02 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 12:32 [Intel-gfx] [PATCH i-g-t v2 00/17] Fix IGT Kunit implementation issues Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 01/17] lib/kunit: Drop unused file stream Janusz Krzysztofik
2023-09-15 10:36 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 02/17] lib/kunit: Stop loading kunit module explicitly Janusz Krzysztofik
2023-09-15 10:36 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 03/17] lib/kunit: Fix struct kmod_module kunit_kmod not freed Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 04/17] lib/kunit: Optimize calls to igt_success/skip/fail() Janusz Krzysztofik
2023-09-11 8:49 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 05/17] lib/kunit: Fix illegal igt_fail() calls inside subtest body Janusz Krzysztofik
2023-09-11 8:52 ` Mauro Carvalho Chehab
2023-09-11 9:28 ` Janusz Krzysztofik
2023-09-11 11:57 ` Mauro Carvalho Chehab
2023-09-13 13:03 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 06/17] lib/ktap: Make sure we fail on premature cancel Janusz Krzysztofik
2023-09-11 8:55 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 07/17] lib/ktap: Don't ignore interrupt signals Janusz Krzysztofik
2023-09-11 9:01 ` Mauro Carvalho Chehab
2023-09-13 14:04 ` Janusz Krzysztofik
2023-09-15 12:25 ` Mauro Carvalho Chehab
2023-09-15 13:06 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 08/17] lib/kunit: Cancel KTP parser on module load failure Janusz Krzysztofik
2023-09-11 9:02 ` Mauro Carvalho Chehab [this message]
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 09/17] lib/ktap: Drop is_running flag Janusz Krzysztofik
2023-09-11 9:03 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 10/17] lib/ktap: Read /dev/kmsg in blocking mode Janusz Krzysztofik
2023-09-15 10:42 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 11/17] lib/kunit: Fail / skip on kernel taint Janusz Krzysztofik
2023-09-15 10:43 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 12/17] lib/ktap: Use IGT linked lists for storing KTAP results Janusz Krzysztofik
2023-09-15 10:44 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 13/17] lib/ktap: Reimplement KTAP parser Janusz Krzysztofik
2023-09-15 11:45 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-15 12:28 ` [Intel-gfx] " Mauro Carvalho Chehab
2023-09-15 13:09 ` Janusz Krzysztofik
2023-09-15 13:35 ` Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 14/17] lib/kunit: Load test modules in background Janusz Krzysztofik
2023-09-15 12:11 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 15/17] lib/kunit: Parse KTAP report from the main process thread Janusz Krzysztofik
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 16/17] lib/kunit: Strip "_test" or "_kunit" suffix from subtest names Janusz Krzysztofik
2023-09-15 11:42 ` [Intel-gfx] [igt-dev] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [Intel-gfx] [PATCH i-g-t v2 17/17] lib/kunit: Omit suite name prefix if the same as subtest name Janusz Krzysztofik
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=20230911110241.156b3259@maurocar-mobl2 \
--to=mauro.chehab@linux.intel.com \
--cc=dominik.karol.piatkowski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=isabbasso@riseup.net \
--cc=janusz.krzysztofik@linux.intel.com \
--cc=mchehab@kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox