From: Sasha Levin <levinsasha928@gmail.com>
To: Konstantin Khlebnikov <khlebnikov@parallels.com>
Cc: Avi Kivity <avi@redhat.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"asias.hejun@gmail.com" <asias.hejun@gmail.com>,
"gorcunov@gmail.com" <gorcunov@gmail.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/2 V2] kvm tools: Add scatter-gather variants of IO functions
Date: Sun, 17 Apr 2011 14:11:57 +0300 [thread overview]
Message-ID: <1303038717.3017.18.camel@stimpy> (raw)
In-Reply-To: <4DAAC252.8050703@parallels.com>
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.
next prev parent reply other threads:[~2011-04-17 11:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-16 15:05 [PATCH 1/2 V2] kvm tools: Add scatter-gather variants of IO functions Sasha Levin
2011-04-16 15:05 ` [PATCH 2/2 V2] kvm tools: Add scatter-gather support for disk images Sasha Levin
2011-04-16 18:40 ` [PATCH 1/2 V2] kvm tools: Add scatter-gather variants of IO functions Konstantin Khlebnikov
2011-04-16 20:33 ` Sasha Levin
2011-04-17 9:19 ` Avi Kivity
2011-04-17 10:03 ` Konstantin Khlebnikov
2011-04-17 10:22 ` Sasha Levin
2011-04-17 10:34 ` Konstantin Khlebnikov
2011-04-17 11:11 ` Sasha Levin [this message]
2011-04-17 12:49 ` Avi Kivity
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=1303038717.3017.18.camel@stimpy \
--to=levinsasha928@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=avi@redhat.com \
--cc=gorcunov@gmail.com \
--cc=khlebnikov@parallels.com \
--cc=kvm@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@kernel.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