Re: [RFC PATCH net-next v6 07/15] page_pool: convert to use netmem

2024-03-04 Thread David Howells
Hi Mina, I recommend you cc linux-mm and Matthew Wilcox on these two patches also. David

Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread David Howells
Linus Torvalds wrote: > 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. I was trying to make

[PATCH v3 10/10] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-11-15 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC iterator. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro

[PATCH v3 09/10] iov_iter: Add kunit to benchmark decanting of xarray to bvec

2023-11-15 Thread David Howells
Add a kunit test to benchmark an xarray containing 256MiB of data getting decanted into 256-page BVEC iterators that get copied from - modelling bufferage being drawn from the pagecache and batched up for I/O. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[PATCH v3 07/10] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-11-15 Thread David Howells
with mmap - basically it has to emulated part of execve(). Doing so requires access to additional core symbols: mm_alloc(), vm_area_alloc(), insert_vm_struct() and arch_pick_mmap_layout(). See the iov_kunit_create_user_buf() function added in the patch. Signed-off-by: David Howells cc: Andrew

[PATCH v3 08/10] iov_iter: Add benchmarking kunit tests

2023-11-15 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs and fills them in (similar to a maximal bio struct being set up). Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[PATCH v3 06/10] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-11-15 Thread David Howells
Add copy kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox

[PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread David Howells
and not in a module? Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: Huacai Chen cc: WANG Xuerui cc: Heiko Carstens cc: Vasi

[PATCH v3 04/10] iov_iter: Consolidate bvec pattern checking

2023-11-15 Thread David Howells
Make the BVEC-testing functions use the consolidated pattern checking functions to reduce the amount of duplicated code. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David

[PATCH v3 03/10] iov_iter: Consolidate the test vector struct in the kunit tests

2023-11-15 Thread David Howells
Consolidate the test vector struct in the kunit tests so that the bvec pattern check helpers can share with the kvec check helpers. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins

[PATCH v3 02/10] iov_iter: Consolidate some of the repeated code into helpers

2023-11-15 Thread David Howells
Consolidate some of the repeated code snippets into helper functions to reduce the line count. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest

[PATCH v3 01/10] iov_iter: Fix some checkpatch complaints in kunit tests

2023-11-15 Thread David Howells
shirn Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@vger.kernel.org cc: kunit-...@googlegroups.com cc: linux...@kvack.org cc: linux

[PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests

2023-11-15 Thread David Howells
30400.203330-1-dhowe...@redhat.com/ # v2 Link: https://lore.kernel.org/r/20230922113038.1135236-1-dhowe...@redhat.com/ # v3 David Howells (10): iov_iter: Fix some checkpatch complaints in kunit tests iov_iter: Consolidate some of the repeated code into helpers iov_iter: Consolidate the test vector

[PATCH v3 08/10] iov_iter: Add benchmarking kunit tests

2023-09-22 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs and fills them in (similar to a maximal bio struct being set up). Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[PATCH v3 09/10] iov_iter: Add kunit to benchmark decanting of xarray to bvec

2023-09-22 Thread David Howells
Add a kunit test to benchmark an xarray containing 256MiB of data getting decanted into 256-page BVEC iterators that get copied from - modelling bufferage being drawn from the pagecache and batched up for I/O. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[PATCH v3 10/10] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-22 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC iterator. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro

[PATCH v3 02/10] iov_iter: Consolidate some of the repeated code into helpers

2023-09-22 Thread David Howells
Consolidate some of the repeated code snippets into helper functions to reduce the line count. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest

[PATCH v3 07/10] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-22 Thread David Howells
with mmap - basically it has to emulated part of execve(). Doing so requires access to additional core symbols: mm_alloc(), vm_area_alloc(), insert_vm_struct() and arch_pick_mmap_layout(). See the iov_kunit_create_user_buf() function added in the patch. Signed-off-by: David Howells cc: Andrew

[PATCH v3 03/10] iov_iter: Consolidate the test vector struct in the kunit tests

2023-09-22 Thread David Howells
Consolidate the test vector struct in the kunit tests so that the bvec pattern check helpers can share with the kvec check helpers. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins

[PATCH v3 06/10] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-22 Thread David Howells
Add copy kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox

[PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-09-22 Thread David Howells
and not in a module? Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: Huacai Chen cc: WANG Xuerui cc: Heiko Carstens cc: Vasi

[PATCH v3 01/10] iov_iter: Fix some checkpatch complaints in kunit tests

2023-09-22 Thread David Howells
shirn Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@vger.kernel.org cc: kunit-...@googlegroups.com cc: linux...@kvack.org cc: linux

[PATCH v3 04/10] iov_iter: Consolidate bvec pattern checking

2023-09-22 Thread David Howells
Make the BVEC-testing functions use the consolidated pattern checking functions to reduce the amount of duplicated code. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David

[PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests

2023-09-22 Thread David Howells
30400.203330-1-dhowe...@redhat.com/ # v2 David Howells (10): iov_iter: Fix some checkpatch complaints in kunit tests iov_iter: Consolidate some of the repeated code into helpers iov_iter: Consolidate the test vector struct in the kunit tests iov_iter: Consolidate bvec pattern checking iov_iter:

Re: [RFC PATCH v2 0/9] iov_iter: kunit: Cleanup, abstraction and more tests

2023-09-20 Thread David Howells
David Howells wrote: > Hi Jens, > > Can you consider taking this through the block tree? Sorry, I forgot to remove the 'RFC' tag in the subject. David

Re: [RFC PATCH v2 5/9] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-09-20 Thread David Howells
David Howells wrote: > diff --git a/arch/loongarch/include/asm/page.h > b/arch/loongarch/include/asm/page.h > index 63f137ce82a4..c7c5f5b4c0d3 100644 > --- a/arch/loongarch/include/asm/page.h > +++ b/arch/loongarch/include/asm/page.h > @@ -32,6 +32,7 @@ > > #include

[RFC PATCH v2 3/9] iov_iter: Consolidate the test vector struct in the kunit tests

2023-09-20 Thread David Howells
Consolidate the test vector struct in the kunit tests so that the bvec pattern check helpers can share with the kvec check helpers. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins

[RFC PATCH v2 7/9] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-20 Thread David Howells
with mmap - basically it has to emulated part of execve(). Doing so requires access to additional core symbols: mm_alloc(), vm_area_alloc(), insert_vm_struct() and arch_pick_mmap_layout(). See the iov_kunit_create_user_buf() function added in the patch. Signed-off-by: David Howells cc: Andrew

[RFC PATCH v2 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-20 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC iterator. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro

[RFC PATCH v2 5/9] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-09-20 Thread David Howells
and not in a module? Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: Huacai Chen cc: WANG Xuerui cc: Heiko Carstens cc: Vasi

[RFC PATCH v2 2/9] iov_iter: Consolidate some of the repeated code into helpers

2023-09-20 Thread David Howells
Consolidate some of the repeated code snippets into helper functions to reduce the line count. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest

[RFC PATCH v2 6/9] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-20 Thread David Howells
Add copy kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox

[RFC PATCH v2 4/9] iov_iter: Consolidate bvec pattern checking

2023-09-20 Thread David Howells
Make the BVEC-testing functions use the consolidated pattern checking functions to reduce the amount of duplicated code. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David

[RFC PATCH v2 8/9] iov_iter: Add benchmarking kunit tests

2023-09-20 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs and fills them in (similar to a maximal bio struct being set up). Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[RFC PATCH v2 0/9] iov_iter: kunit: Cleanup, abstraction and more tests

2023-09-20 Thread David Howells
he iteration is not not negligible. - Switch the benchmarking to use copy_from_iter() so that only a single page is needed in the userspace buffer (as it can be shared R/O), not 256MiB's worth. Link: https://lore.kernel.org/r/20230914221526.3153402-1-dhowe...@redhat.com/ # v1 David How

[RFC PATCH v2 1/9] iov_iter: Fix some checkpatch complaints in kunit tests

2023-09-20 Thread David Howells
shirn Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@vger.kernel.org cc: kunit-...@googlegroups.com cc: linux...@kvack.org cc: linux

Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-15 Thread David Howells
David Laight wrote: > You could also just not do the copy! > Although you need (say) asm volatile("\n",:::"memory") to > stop it all being completely optimised away. > That might show up a difference in the 'out_of_line' test > where 15% on top on the data copies is massive - it may be > that the

Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-15 Thread David Howells
David Laight wrote: > I was thinking of import_iovec() - or whatever its current > name is. That doesn't actually access the buffer described by the iovec[]. > That really needs a single structure that contains the iov_iter > and the cache[] (which the caller pretty much always allocates > in t

Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-15 Thread David Howells
David Laight wrote: > Isn't that going to be completely dominated by the cache fills > from memory? > > I'd have thought you'd need to use something with a lot of > small fragments so that the iteration code dominates the copy. Okay, if I switch it to using MAP_ANON for the big 256MiB buffer, s

Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-15 Thread David Howells
David Laight wrote: > > > Some measurements can be made using readv() and writev() > > > on /dev/zero and /dev/null. > > > > Forget /dev/null; that doesn't actually engage any iteration code. The same > > for writing to /dev/zero. Reading from /dev/zero does its own iteration > > thing > > ra

Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-15 Thread David Howells
David Laight wrote: > > Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC > > iterator. This attaches a userspace VM with a mapped file in it > > temporarily to the test thread. > > Isn't that going to be completely dominated by the cache fills > from memory? Yes... b

[RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-14 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC iterator. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro

[RFC PATCH 7/9] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-14 Thread David Howells
with mmap - basically it has to emulated part of execve(). Doing so requires access to additional core symbols: mm_alloc(), vm_area_alloc(), insert_vm_struct() and arch_pick_mmap_layout(). See the iov_kunit_create_user_buf() function added in the patch. Signed-off-by: David Howells cc: Andrew

[RFC PATCH 5/9] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-09-14 Thread David Howells
and not in a module? Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux...@kvack.org cc: linux-fsde...@vger.kernel.org cc

[RFC PATCH 4/9] iov_iter: Consolidate bvec pattern checking

2023-09-14 Thread David Howells
Make the BVEC-testing functions use the consolidated pattern checking functions to reduce the amount of duplicated code. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David

[RFC PATCH 6/9] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-14 Thread David Howells
Add copy kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox

[RFC PATCH 8/9] iov_iter: Add benchmarking kunit tests

2023-09-14 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs and fills them in (similar to a maximal bio struct being set up). Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens

[RFC PATCH 2/9] iov_iter: Consolidate some of the repeated code into helpers

2023-09-14 Thread David Howells
Consolidate some of the repeated code snippets into helper functions to reduce the line count. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest

[RFC PATCH 3/9] iov_iter: Consolidate the test vector struct in the kunit tests

2023-09-14 Thread David Howells
Consolidate the test vector struct in the kunit tests so that the bvec pattern check helpers can share with the kvec check helpers. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins

[RFC PATCH 1/9] iov_iter: Fix some checkpatch complaints in kunit tests

2023-09-14 Thread David Howells
shirn Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@vger.kernel.org cc: kunit-...@googlegroups.com cc: linux...@kvack.org cc: linux

[RFC PATCH 0/9] iov_iter: kunit: Cleanup, abstraction and more tests

2023-09-14 Thread David Howells
ddev 15 uS iov_kunit_benchmark_xarray: avg 3582 uS, stddev 13 uS I've pushed the patches here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-kunit David David Howells (9): iov_iter: Fix some checkpatch complaints in kunit tests iov_iter: Consolid