[13/12] page-xfer: Don't send zero pages if none found

Submitted by Pavel Emelianov on June 29, 2017, 10:33 a.m.

Details

Message ID 7d244b02-4ee1-89b6-c0d0-b5213c688aae@virtuozzo.com
State Accepted
Series "A set of cleanups for pagemaps/xfers/reads before master merge"
Commit 653211f501fb59ed3d353ad9dbe22c173206d8a3
Headers show

Commit Message

Pavel Emelianov June 29, 2017, 10:33 a.m.
When page-server gets a request from lazy-daemon for a pagemap,
the former cannot read no pages from the image.

Mike says: "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..."

Why not?!

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/page-xfer.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index 24fc565..d949c06 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -678,10 +678,8 @@  static int page_server_get_pages(int sk, struct page_server_iov *pi)
 	 */
 
 	if (pi->nr_pages == 0) {
-		/* no iovs found means we've hit a zero page */
 		pr_debug("no iovs found, zero pages\n");
-		pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, 0);
-		return send_psi(sk, pi);
+		return -1;
 	}
 
 	pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT);

Comments

Mike Rapoport June 29, 2017, 6:02 p.m.
On Thu, Jun 29, 2017 at 01:33:44PM +0300, Pavel Emelyanov wrote:
> When page-server gets a request from lazy-daemon for a pagemap,
> the former cannot read no pages from the image.

Hm? Can you please rephrase a bit? "cannot read no pages" really finished
me :-P
 
> Mike says: "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..."
> 
> Why not?!
> 
> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
> ---
>  criu/page-xfer.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/criu/page-xfer.c b/criu/page-xfer.c
> index 24fc565..d949c06 100644
> --- a/criu/page-xfer.c
> +++ b/criu/page-xfer.c
> @@ -678,10 +678,8 @@ static int page_server_get_pages(int sk, struct page_server_iov *pi)
>  	 */
> 
>  	if (pi->nr_pages == 0) {
> -		/* no iovs found means we've hit a zero page */
>  		pr_debug("no iovs found, zero pages\n");
> -		pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, 0);
> -		return send_psi(sk, pi);
> +		return -1;
>  	}
> 
>  	pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT);
> -- 
> 2.1.4
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
>
Pavel Emelianov June 30, 2017, 6:38 a.m.
On 06/29/2017 09:02 PM, Mike Rapoport wrote:
> On Thu, Jun 29, 2017 at 01:33:44PM +0300, Pavel Emelyanov wrote:
>> When page-server gets a request from lazy-daemon for a pagemap,
>> the former cannot read no pages from the image.
> 
> Hm? Can you please rephrase a bit? "cannot read no pages" really finished
> me :-P

How about:

"When page-server gets a request from lazy-daemon for a pagemap,
the former cannot read zero pages from the image."

?

>> Mike says: "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..."
>>
>> Why not?!
>>
>> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
>> ---
>>  criu/page-xfer.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/criu/page-xfer.c b/criu/page-xfer.c
>> index 24fc565..d949c06 100644
>> --- a/criu/page-xfer.c
>> +++ b/criu/page-xfer.c
>> @@ -678,10 +678,8 @@ static int page_server_get_pages(int sk, struct page_server_iov *pi)
>>  	 */
>>
>>  	if (pi->nr_pages == 0) {
>> -		/* no iovs found means we've hit a zero page */
>>  		pr_debug("no iovs found, zero pages\n");
>> -		pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, 0);
>> -		return send_psi(sk, pi);
>> +		return -1;
>>  	}
>>
>>  	pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT);
>> -- 
>> 2.1.4
>>
>> _______________________________________________
>> CRIU mailing list
>> CRIU@openvz.org
>> https://lists.openvz.org/mailman/listinfo/criu
>>
> 
> .
>
Mike Rapoport June 30, 2017, 9:11 a.m.
On June 30, 2017 9:38:55 AM GMT+03:00, Pavel Emelyanov <xemul@virtuozzo.com> wrote:
>On 06/29/2017 09:02 PM, Mike Rapoport wrote:
>> On Thu, Jun 29, 2017 at 01:33:44PM +0300, Pavel Emelyanov wrote:
>>> When page-server gets a request from lazy-daemon for a pagemap,
>>> the former cannot read no pages from the image.
>> 
>> Hm? Can you please rephrase a bit? "cannot read no pages" really
>finished
>> me :-P
>
>How about:
>
>"When page-server gets a request from lazy-daemon for a pagemap,
>the former cannot read zero pages from the image."
>
>?

'When page-server gets a request for an absent pagemap from lazy-pages daemon, it should not reply with "zero pages"'.

>>> Mike says: "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..."
>>>
>>> Why not?!
>>>
>>> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
>>> ---
>>>  criu/page-xfer.c | 4 +---
>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/criu/page-xfer.c b/criu/page-xfer.c
>>> index 24fc565..d949c06 100644
>>> --- a/criu/page-xfer.c
>>> +++ b/criu/page-xfer.c
>>> @@ -678,10 +678,8 @@ static int page_server_get_pages(int sk, struct
>page_server_iov *pi)
>>>  	 */
>>>
>>>  	if (pi->nr_pages == 0) {
>>> -		/* no iovs found means we've hit a zero page */
>>>  		pr_debug("no iovs found, zero pages\n");

Can we make it
 pr_err("%lx: no pages at %lx\n", pi->dst_id, pi->vaddr);
?

>>> -		pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, 0);
>>> -		return send_psi(sk, pi);
>>> +		return -1;
>>>  	}
>>>
>>>  	pi->cmd = encode_ps_cmd(PS_IOV_ADD_F, PE_PRESENT);
>>> -- 
>>> 2.1.4
>>>
>>> _______________________________________________
>>> CRIU mailing list
>>> CRIU@openvz.org
>>> https://lists.openvz.org/mailman/listinfo/criu
>>>
>> 
>> .
>>