linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: Christian Brauner <christian@brauner.io>,
	Jens Axboe <axboe@kernel.dk>,  Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>,
	 David Laight <David.Laight@aculab.com>,
	Matthew Wilcox <willy@infradead.org>,
	 Brendan Higgins <brendanhiggins@google.com>,
	David Gow <davidgow@google.com>,
	 linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	 linux-mm@kvack.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org,  kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org,
	 Andrew Morton <akpm@linux-foundation.org>,
	Christian Brauner <brauner@kernel.org>,
	 David Hildenbrand <david@redhat.com>,
	John Hubbard <jhubbard@nvidia.com>,
	 Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	 Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	 Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	 Sven Schnelle <svens@linux.ibm.com>,
	loongarch@lists.linux.dev, linux-s390@vger.kernel.org
Subject: Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests
Date: Wed, 15 Nov 2023 11:12:17 -0500	[thread overview]
Message-ID: <CAHk-=wgHciqm3iaq6hhtP64+Zsca6Y6z5UfzHzjfhUhA=jP0zA@mail.gmail.com> (raw)
In-Reply-To: <20231115154946.3933808-6-dhowells@redhat.com>

On Wed, 15 Nov 2023 at 10:50, David Howells <dhowells@redhat.com> wrote:
>
> This requires access to otherwise unexported core symbols: mm_alloc(),
> vm_area_alloc(), insert_vm_struct() arch_pick_mmap_layout() and
> anon_inode_getfile_secure(), which I've exported _GPL.
>
> [?] Would it be better if this were done in core and not in a module?

I'm not going to take this, even if it were to be sent to me through Christian.

I think the exports really show that this shouldn't be done. And yes,
doing it in core would avoid the exports, but would be even worse.

Those functions exist for setting up user space. You should be doing
this in user space.

I'm getting really fed up with the problems that ther KUnit tests
cause. We have a long history of self-inflicted pain due to "unit
testing", where it has caused stupid problems like just overflowing
the kernel stack etc.

This needs to stop. And this is where I'm putting my foot down. No
more KUnit tests that make up interfaces - or use interfaces - that
they have absolutely no place using.

From a quick look, what you were doing was checking that the patterns
you set up in user space came through ok. Dammit, what's wrong with
just using read()/write() on a pipe, or splice, or whatever. It will
test exactly the same iov_iter thing.

Kernel code should do things that can *only* be done in the kernel.
This is not it.

              Linus


  reply	other threads:[~2023-11-15 16:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 15:49 [PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests David Howells
2023-11-15 15:49 ` [PATCH v3 01/10] iov_iter: Fix some checkpatch complaints in kunit tests David Howells
2023-11-16  4:00   ` Joe Perches
2023-11-15 15:49 ` [PATCH v3 02/10] iov_iter: Consolidate some of the repeated code into helpers David Howells
2023-11-15 15:49 ` [PATCH v3 03/10] iov_iter: Consolidate the test vector struct in the kunit tests David Howells
2023-11-15 15:49 ` [PATCH v3 04/10] iov_iter: Consolidate bvec pattern checking David Howells
2023-11-15 15:49 ` [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests David Howells
2023-11-15 16:12   ` Linus Torvalds [this message]
2023-11-15 16:39   ` David Howells
2023-11-15 16:58     ` Linus Torvalds
2023-11-15 15:49 ` [PATCH v3 06/10] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC David Howells
2023-11-15 15:49 ` [PATCH v3 07/10] iov_iter: Add extract " David Howells
2023-11-15 15:49 ` [PATCH v3 08/10] iov_iter: Add benchmarking kunit tests David Howells
2023-11-15 16:28   ` Linus Torvalds
2023-11-15 15:49 ` [PATCH v3 09/10] iov_iter: Add kunit to benchmark decanting of xarray to bvec David Howells
2023-11-15 15:49 ` [PATCH v3 10/10] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC David Howells
2023-11-15 16:04 ` [PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2023-09-22 11:30 David Howells
2023-09-22 11:30 ` [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests David Howells

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='CAHk-=wgHciqm3iaq6hhtP64+Zsca6Y6z5UfzHzjfhUhA=jP0zA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=David.Laight@aculab.com \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=borntraeger@linux.ibm.com \
    --cc=brauner@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=chenhuacai@kernel.org \
    --cc=christian@brauner.io \
    --cc=david@redhat.com \
    --cc=davidgow@google.com \
    --cc=dhowells@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=jhubbard@nvidia.com \
    --cc=kernel@xen0n.name \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    --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