linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: Brendan Higgins <brendanhiggins@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Jeremy Kerr <jk@codeconstruct.com.au>
Subject: Re: [RFC PATCH] kunit: flatten kunit_suite*** to kunit_suite** in executor
Date: Thu, 14 Oct 2021 10:16:35 +0800	[thread overview]
Message-ID: <CABVgOS=bOLt_cRSQBejtKqBnc+aBOYYDv4Df9h-RtXTiHL-Sow@mail.gmail.com> (raw)
In-Reply-To: <20211013191320.2490913-1-dlatypov@google.com>

On Thu, Oct 14, 2021 at 3:13 AM Daniel Latypov <dlatypov@google.com> wrote:
>
> Per [1], we might not need the array-of-array of kunit_suite's.
>
> This RFC patch previews the changes we'd make to the executor to
> accommodate that by making the executor automatically flatten the
> kunit_suite*** into a kunit_suite**.
>
> The test filtering support [2] added the largest dependency on the
> current kunit_suite*** layout, so this patch is based on that.
>
> It actually drastically simplifies the code, so it might be useful to
> keep the auto-flattening step until we actually make the change.
>
> [1] https://lore.kernel.org/linux-kselftest/101d12fc9250b7a445ff50a9e7a25cd74d0e16eb.camel@codeconstruct.com.au/
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=3b29021ddd10cfb6b2565c623595bd3b02036f33
>
> Cc: Jeremy Kerr <jk@codeconstruct.com.au>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>
> ---

I really like this. My only real concern is that it's a little unclear
exactly what the resulting layout is, particularly as to what the
"make_suite_set" function does. It'd be nice to have some more
documentation, either as a comment on the function or a more detailed
commit message, which explicitly describes the old format (an array
(with start and end pointers) of NULL-terminated arrays of suites),
and the new format (a single, NULL-terminated array with both start
and end pointers).

Re: NULL termination. If we're already using both start and end
pointers, the NULL terminator seems useless. (And if we've got a NULL
terminator, why are we passing the end pointer around.) It's not
super-clear why we'd want both, though the comments in this reply do
clarify things a bit:
https://lore.kernel.org/linux-kselftest/CAGS_qxoziNGNVpsUfvUfOReADY0PdriV2gJJ7+LUzzd+7BU-Ow@mail.gmail.com/

Finally, if we do want a runtime way of adding suites to the
executor's list at runtime (which was suggested as a way of working
around some suites which might need extra, global, initialisation),
this might change how that'd have to be implemented a bit. I'm not too
worried about that, though: it's something that's probably better
served with something like a linked list of suite_sets or the like,
anyway.

In any case, I've tested this in the non-module case, and it seems to work fine.
Tested-by: David Gow <davidgow@google.com>

Cheers,
-- David

      parent reply	other threads:[~2021-10-14  2:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 19:13 [RFC PATCH] kunit: flatten kunit_suite*** to kunit_suite** in executor Daniel Latypov
2021-10-13 20:03 ` Brendan Higgins
2021-10-13 20:15   ` Daniel Latypov
2021-10-14  1:55     ` Jeremy Kerr
2022-01-28 21:19       ` Daniel Latypov
2022-01-28 21:27         ` Brendan Higgins
2021-10-14  2:16 ` David Gow [this message]

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='CABVgOS=bOLt_cRSQBejtKqBnc+aBOYYDv4Df9h-RtXTiHL-Sow@mail.gmail.com' \
    --to=davidgow@google.com \
    --cc=brendanhiggins@google.com \
    --cc=dlatypov@google.com \
    --cc=jk@codeconstruct.com.au \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).