[CRIU] [PATCH 3/7] page-read: Drop get_remote_pages

Pavel Emelyanov xemul at virtuozzo.com
Wed Nov 16 04:50:23 PST 2016


>>> request_remote_pages uses send(..., MSG_DONTWAIT)
>>> Are you sure that for synchronous case we won't get some weird effects here?
>>
>> Well, "weird effects" no :) In the worst case we'll receive the exit
>> code that != sizeof(something) and will abort the operation.
>>
>> But the same would anyway be a problem even for synchronous case, so
>> this particular MSG_DONTWAIT seem to be incorrect by itself.
> 
> I've used MSG_DONTWAIT for async case only. This way we can return to
> epoll without waiting for net stack.

Yes, but in case send decides not to block, it would return less
bytes sent that you've requested, the check for send != sizeof(pi)
would fail and the whole request_remote_pages() will end up with
return -1, which, in turn, will abort the whole uffd workflow.

So even now the MSG_DONTWAIT is ... not correct. We need to epoll
the socket for write too and send the request piece-by-piece to
make it work properly.

-- Pavel

> For the sync case we used to have write(sk, ...). which, AFAIU, waits
> for TCP ACK before returning.
> Am I missing something?
> 
>> -- Pavel
> 
> 
> 



More information about the CRIU mailing list