Thread (19 messages) 19 messages, 2 authors, 2023-09-15

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

From: David Howells <dhowells@redhat.com>
Date: 2023-09-15 11:23:59
Also in: linux-block, linux-fsdevel, linux-kselftest, linux-mm, lkml

David Laight [off-list ref] wrote:
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help