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 Laight
From: David Howells > Sent: 15 September 2023 13:36 > > 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

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 Laight
From: David Howells > Sent: 15 September 2023 12:23 > > 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

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 Laight
From: David Howells > Sent: 15 September 2023 11:10 > > 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

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

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

2023-09-15 Thread David Laight
From: David Howells > Sent: 14 September 2023 23:15 > > 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 fr