linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'David Howells' <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jens Axboe <axboe@kernel.dk>, "Christoph Hellwig" <hch@lst.de>,
	Christian Brauner <christian@brauner.io>,
	"Matthew Wilcox" <willy@infradead.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	David Gow <davidgow@google.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"kunit-dev@googlegroups.com" <kunit-dev@googlegroups.com>,
	"linux-kernel@vger.kernel.org" <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>
Subject: RE: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC
Date: Fri, 15 Sep 2023 10:51:36 +0000	[thread overview]
Message-ID: <5017b9fa177f4deaa5d481a5d8914ab4@AcuMS.aculab.com> (raw)
In-Reply-To: <3370515.1694772627@warthog.procyon.org.uk>

From: David Howells
> Sent: 15 September 2023 11:10
> 
> David Laight <David.Laight@ACULAB.COM> 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...  but it should be consistent in the amount of time that consumes since
> no device drivers are involved.  I can try adding the same folio to the
> anon_file multiple times - it might work especially if I don't put the pages
> on the LRU (if that's even possible) - but I wanted separate pages for the
> extraction test.

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 data cache behaviour is very different for the
two cases.

...
> > 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
> rather than using iterate_and_advance(), presumably because it checks for
> signals and resched.

Using /dev/null does exercise the 'copy iov from user' code.
Last time I looked at that the 32bit compat code was faster than
the 64bit code on x86!

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)



  reply	other threads:[~2023-09-15 10:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 22:15 [RFC PATCH 0/9] iov_iter: kunit: Cleanup, abstraction and more tests David Howells
2023-09-14 22:15 ` [RFC PATCH 1/9] iov_iter: Fix some checkpatch complaints in kunit tests David Howells
2023-09-14 22:15 ` [RFC PATCH 2/9] iov_iter: Consolidate some of the repeated code into helpers David Howells
2023-09-14 22:15 ` [RFC PATCH 3/9] iov_iter: Consolidate the test vector struct in the kunit tests David Howells
2023-09-14 22:15 ` [RFC PATCH 4/9] iov_iter: Consolidate bvec pattern checking David Howells
2023-09-14 22:15 ` [RFC PATCH 5/9] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests David Howells
2023-09-14 22:15 ` [RFC PATCH 6/9] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC David Howells
2023-09-14 22:15 ` [RFC PATCH 7/9] iov_iter: Add extract " David Howells
2023-09-14 22:15 ` [RFC PATCH 8/9] iov_iter: Add benchmarking kunit tests David Howells
2023-09-14 22:15 ` [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC David Howells
2023-09-15  7:09   ` David Laight
2023-09-15 10:10   ` David Howells
2023-09-15 10:51     ` David Laight [this message]
2023-09-15 11:23     ` David Howells
2023-09-15 12:10       ` David Laight
2023-09-15 12:36       ` David Howells
2023-09-15 13:08         ` David Laight
2023-09-15 13:24     ` David Howells
2023-09-15 12:19   ` 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=5017b9fa177f4deaa5d481a5d8914ab4@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=christian@brauner.io \
    --cc=david@redhat.com \
    --cc=davidgow@google.com \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jhubbard@nvidia.com \
    --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=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --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