[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3449352.1694776980@warthog.procyon.org.uk>
Date: Fri, 15 Sep 2023 12:23:00 +0100
From: David Howells <dhowells@...hat.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: dhowells@...hat.com, Al Viro <viro@...iv.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>, "Christoph Hellwig" <hch@....de>,
Christian Brauner <christian@...uner.io>,
"Matthew Wilcox" <willy@...radead.org>,
Brendan Higgins <brendanhiggins@...gle.com>,
David Gow <davidgow@...gle.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"kunit-dev@...glegroups.com" <kunit-dev@...glegroups.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Christian Brauner <brauner@...nel.org>,
"David Hildenbrand" <david@...hat.com>,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC
David Laight <David.Laight@...LAB.COM> 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
> > 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.
Ummm.... Not really:
static ssize_t read_null(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
return 0;
}
static ssize_t write_null(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
return count;
}
static ssize_t read_iter_null(struct kiocb *iocb, struct iov_iter *to)
{
return 0;
}
static ssize_t write_iter_null(struct kiocb *iocb, struct iov_iter *from)
{
size_t count = iov_iter_count(from);
iov_iter_advance(from, count);
return count;
}
David
Powered by blists - more mailing lists