[CRIU] [PATCH 06/12] page-xfer: Tune up send_psi to accept less args
Pavel Emelyanov
xemul at virtuozzo.com
Thu Jun 29 12:49:47 MSK 2017
>> @@ -665,18 +667,23 @@ static int page_server_get_pages(int sk, struct page_server_iov *pi)
>> if (ret)
>> return ret;
>>
>> + /*
>> + * The pi is reused for send_psi here, so .nr_pages, .vaddr and
>> + * .dst_id all remain intact.
>> + */
>> +
>> if (pi->nr_pages == 0) {
>> /* no iovs found means we've hit a zero page */
>> pr_debug("no iovs found, zero pages\n");
>> - return send_psi(sk, encode_ps_cmd(PS_IOV_ADD_F, 0), 0, 0, 0);
>> + pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, 0);
>> + return send_psi(sk, pi);
>
> Actually, when I'm thinking about it, we should never get here. The pagemap
> should be completely in sync between src and dst and dst should never
> request pages that are not present.
>
> Maybe we should return -1 here? At least we'll have a chance that dump will
> unroll everything...
Hm... OK, I'll send the 13/12 patch :)
>> }
>>
>> - len = pi->nr_pages * PAGE_SIZE;
>> -
>> - if (send_psi(sk, encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT),
>> - pi->nr_pages, pi->vaddr, pi->dst_id))
>> + pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT);
>> + if (send_psi(sk, pi))
>> return -1;
>>
>> + len = pi->nr_pages * PAGE_SIZE;
>> ret = splice(pipe_read_dest.p[0], NULL, sk, NULL, len, SPLICE_F_MOVE);
>> if (ret != len)
>> return -1;
>> --
>> 2.1.4
>>
>> _______________________________________________
>> CRIU mailing list
>> CRIU at openvz.org
>> https://lists.openvz.org/mailman/listinfo/criu
>>
>
> .
>
More information about the CRIU
mailing list