From: John Ogness <john.ogness@linutronix.de>
To: David Gow <davidgow@google.com>
Cc: "Petr Mladek" <pmladek@suse.com>,
"Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Brendan Higgins" <brendanhiggins@google.com>,
"Rae Moar" <rmoar@google.com>,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Yoann Congal" <yoann.congal@smile.fr>,
"Alice Ryhl" <aliceryhl@google.com>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Jens Axboe" <axboe@kernel.dk>,
"Mark Rutland" <mark.rutland@arm.com>,
"Jann Horn" <jannh@google.com>
Subject: Re: [PATCH printk v1] printk: ringbuffer: Add KUnit test
Date: Fri, 22 Nov 2024 15:39:03 +0106 [thread overview]
Message-ID: <84v7wf49uo.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <CABVgOSmn6EqcRZ+Rc047OJ5SQ9xdThuaUaPx40UgWgN+AjBfMA@mail.gmail.com>
Hi David,
On 2024-11-22, David Gow <davidgow@google.com> wrote:
> It's a little unusual for a KUnit test -- particularly since it is
> time-based and uses lots of threads. This isn't a problem, but it's
> definitely a good thing that it's marked as slow. Additionally, KUnit
> doesn't track any extra threads spawned, so it requires a bit more
> care.
>
> There are a couple of issues (e.g., it crashes on non-SMP systems, a
> potential race, etc) and some minor suggestions below. In short, it'd
> be a good idea to move some of the initialisation and checks into the
> main test function, rather than the helper threads.
>
> Equally, it looks like there are a bunch of variables shared between
> kthreads — do these need to be checked with READ_ONCE()/WRITE_ONCE(),
> or made volatile, or something?
Agreed.
> In fact, I'm not sure why there's a separate start_test() and
> test_readerwriter() function -- or indeed, a separate kthread? Am I
> missing something, or could everything start_test() does be done from
> the main test function/kthread?
You are not missing anything. It is definitely awkward, mostly because
it was taken from parts of my own personal testing software. I will
implement all your suggestions. Thanks for the detailed review!
John
next prev parent reply other threads:[~2024-11-22 14:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 14:50 [PATCH printk v1] printk: ringbuffer: Add KUnit test John Ogness
2024-11-22 7:05 ` David Gow
2024-11-22 14:33 ` John Ogness [this message]
2024-11-22 21:54 ` kernel test robot
2024-11-26 10:26 ` Petr Mladek
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=84v7wf49uo.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=aliceryhl@google.com \
--cc=axboe@kernel.dk \
--cc=brendanhiggins@google.com \
--cc=davidgow@google.com \
--cc=jannh@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=ojeda@kernel.org \
--cc=pmladek@suse.com \
--cc=rdunlap@infradead.org \
--cc=rmoar@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=yoann.congal@smile.fr \
/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