[CRIU] [PATCH] pagemap: fix reading pages from socket for --remote case
Pavel Emelyanov
xemul at virtuozzo.com
Tue Apr 25 03:57:39 PDT 2017
On 04/25/2017 10:54 AM, Rodrigo Bruno wrote:
> Hi,
>
> 2017-04-24 12:55 GMT+01:00 Pavel Emelyanov <xemul at virtuozzo.com <mailto:xemul at virtuozzo.com>>:
>
> On 04/23/2017 04:29 AM, Rodrigo Bruno wrote:
> > Hi,
> >
> > the patch looks good. It avoids using 'pread' which is not supported for remote images.
> >
> > However, the patch that I sent for the mailing list introducing remote images used 'read' instead of 'pread'.
>
> Yes, sorry about that, it was me wrongly merging async reads with remotes :(
>
> I have a question regarding this place, while we're at it. Here's the code from
> maybe_read_page_local():
>
> if ((flags & (PR_ASYNC|PR_ASAP)) == PR_ASYNC && !opts.remote)
> ret = enqueue_async_page(pr, vaddr, len, buf);
> else {
> ret = read_local_page(pr, vaddr, len, buf);
>
> Why don't we enqueue the read request for opts.remote case?
>
>
> To be honest, I don't remember why I avoided async pages... I looked through the code and I don't see any
> particular reason for it not to work with remote images.
>
> Anyway, just to clarify, what is the motivation behind async pages? Are we avoiding any page read that might be unnecessary
> in the future?
No, for on-disk files doing many small read()-s is still slow even if the data
is in cache. With async pages we merge all the reads together and then call
single preadv() doing all IO with one call.
-- Pavel
More information about the CRIU
mailing list