On Sun, 2011-04-17 at 14:34 +0400, Konstantin Khlebnikov wrote: > Sasha Levin wrote: > > On Sun, 2011-04-17 at 14:03 +0400, Konstantin Khlebnikov wrote: > >> Avi Kivity wrote: > >>> What if nr is nonzero when the loop terminates? You need to update the > >>> first iovec entry so you don't redo that segment. > >> > >> Oh yes, it is simple (hunk above), so "const" from prototype must be removed, > >> while original syscalls declare iov argument as const. > > > > The problem here is that if we start changing the internals of the iovec > > struct it forces us to copy it before calling the I/O functions since if > > we change it within the functions it's unusable to the caller anymore. > > > > Currently it's passed as a const because we only move pointers outside > > the struct. > > > > Basically the trade-off here is copying iovec before every read/write vs > > having to sometimes read data again (< 1 block), so I've went with the > > latter. > > > > Do you think it's better to go with the first alternative? > > > > > > Or we can call one non-vectored operation for the rest of last io-verctor. I don't think it's worth delaying the next readv() to run through read_in_full, and whats more, the part we're going to read again is probably sitting in the file cache anyway. -- Sasha. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html