linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Eric Biederman <ebiederm@xmission.com>,
	Kees Cook <kees@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Shuah Khan <shuah@kernel.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	David Gow <davidgow@google.com>, Rae Moar <rmoar@google.com>
Subject: Re: [PATCH 0/7] Make core VMA operations internal and testable
Date: Wed,  3 Jul 2024 15:56:36 -0700	[thread overview]
Message-ID: <20240703225636.90190-1-sj@kernel.org> (raw)
In-Reply-To: <1a41caa5-561e-415f-85f3-01b52b233506@lucifer.local>

On Wed, 3 Jul 2024 21:33:00 +0100 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:

> On Wed, Jul 03, 2024 at 01:26:53PM GMT, Andrew Morton wrote:
> > On Wed,  3 Jul 2024 12:57:31 +0100 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:
> >
> > > Kernel functionality is stubbed and shimmed as needed in tools/testing/vma/
> > > which contains a fully functional userland vma_internal.h file and which
> > > imports mm/vma.c and mm/vma.h to be directly tested from userland.
> >
> > Cool stuff.
> 
> Thanks :)
> 
> >
> > Now we need to make sure that anyone who messes with vma code has run
> > the tests.  And has added more testcases, if appropriate.
> >
> > Does it make sense to execute this test under selftests/ in some
> > fashion?  Quite a few people appear to be running the selftest code
> > regularly and it would be good to make them run this as well.
> 
> I think it will be useful to do that, yes, but as the tests are currently a
> skeleton to both provide the stubbing out and to provide essentially an
> example of how you might test (though enough that it'd now be easy to add a
> _ton_ of tests), it's not quite ready to be run just yet.

If we will eventually move the files under selftests/, why dont' we place the
files there from the beginning?  Is there a strict rule saying files that not
really involved with running tests or not ready cannot be added there?  If so,
could adding the files after the tests are ready to be run be an option?
Cc-ing Shuah since I think she might have a comment.

Also, I haven't had enough time to read the patches in detail but just the
cover letter a little bit.  My humble impression from that is that this might
better to eventually be kunit tests.  I know there was a discussion with Kees
on RFC v1 [1] which you kindly explained why you decide to implement this in
user space.  To my understanding, at least some of the problems are not real
problems.  For two things as examples,

1. I understand that you concern the test speed [2].  I think Kunit could be
slower than the dedicated user space tests, but to my experience, it's not that
bad when using the default UML-based execution.

2. My next humble undrestanding is that you want to test functions that you
don't want to export [2,3] to kernel modules.  To my understanding it's not
limited on Kunit.  I'm testing such DAMON functions using KUnit by including
test code in the c file but protecting it via a config.  For an example, please
refer to DAMON_KUNIT_TEST.

I understand above are only small parts of the reason for your decision, and
some of those would really unsupported by Kunit.  In the case, I think adding
this user space tests as is is good.  Nonetheless, I think it would be good to
hear some comments from Kunit developers.  IMHO, letting them know the
limitations will hopefully help setting their future TODO items.  Cc-ing
Brendan, David and Rae for that.

To recap, I have no strong opinions about this patch, but I think knowing how
Selftests and KUnit developers think could be helpful.


[1] https://lore.kernel.org/202406270957.C0E5E8057@keescook
[2] https://lore.kernel.org/5zuowniex4sxy6l7erbsg5fiirf4d4f5fbpz2upay2igiwa2xk@vuezoh2wbqf4
[3] https://lore.kernel.org/f005a7b0-ca31-4d39-b2d5-00f5546d610a@lucifer.local


Thanks,
SJ

[...]


  parent reply	other threads:[~2024-07-03 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 11:57 Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 1/7] userfaultfd: move core VMA manipulation logic to mm/userfaultfd.c Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 2/7] mm: move vma_modify() and helpers to internal header Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 3/7] mm: move vma_shrink(), vma_expand() " Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 4/7] mm: move internal core VMA manipulation functions to own file Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 5/7] MAINTAINERS: Add entry for new VMA files Lorenzo Stoakes
2024-07-04  7:39   ` Vlastimil Babka
2024-07-04  9:49     ` Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 6/7] tools: separate out shared radix-tree components Lorenzo Stoakes
2024-07-03 11:57 ` [PATCH 7/7] tools: add skeleton code for userland testing of VMA logic Lorenzo Stoakes
2024-07-04  5:59   ` SeongJae Park
2024-07-04 10:51     ` Lorenzo Stoakes
2024-07-04 11:44   ` Lorenzo Stoakes
2024-07-03 20:26 ` [PATCH 0/7] Make core VMA operations internal and testable Andrew Morton
2024-07-03 20:33   ` Lorenzo Stoakes
2024-07-03 21:43     ` Andrew Morton
2024-07-03 22:56     ` SeongJae Park [this message]
2024-07-03 23:24       ` Lorenzo Stoakes
2024-07-04  0:31         ` SeongJae Park
2024-07-04  1:26         ` Andrew Morton
2024-07-04  7:10       ` David Gow
2024-07-04 10:18         ` Lorenzo Stoakes

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=20240703225636.90190-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=ebiederm@xmission.com \
    --cc=jack@suse.cz \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=rmoar@google.com \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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