Re: [PATCH 02/11] mm: call import_iovec() instead of rw_copy_check_uvector() in process_vm_rw()

From
Al Viro <viro@zeniv.linux.org.uk>
Date
2020-09-21 15:29:46
Also in
io-uring, keyrings, linux-arch, linux-arm-kernel, linux-block, linux-fsdevel, linux-mips, linux-mm, linux-s390, linux-scsi, linux-security-module, linuxppc-dev, lkml, sparclinux
Reply to
David Laight, 2020-09-21
On Mon, Sep 21, 2020 at 03:21:35PM +0000, David Laight wrote:
You really don't want to be looping through the array twice.
Profiles, please.
I think the 'length' check can be optimised to do something like:
	for (...) {
		ssize_t len = (ssize_t)iov[seg].iov_len;
		ret += len;
		len_hi += (unsigned long)len >> 20;
	}
	if (len_hi) {
		/* Something potentially odd in the lengths.
		 * Might just be a very long fragment.
		 * Check the individial values. */
		Add the exiting loop here.
	}
Far too ugly to live.
Thread (26 messages) 26 messages, 4 authors, last reply 2021-01-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help