[CRIU] [RFC] Migration of pipes with O_DIRECT flag.

Stanislav Kinsburskiy skinsbursky at odin.com
Fri Dec 11 04:12:03 PST 2015


Good day,

MIgration of pipes with O_DIRECT is not supported yet.
However, AutoFS control pipe is marked with O_DIRECT flag. Migration of 
the content of control pipe is not supported, because it requires 
migration of some kernel state.
What is even more important, is that original pipe, created my process 
and provided to kernel, can doesn't have this flag: it's set by kernel 
on AutoFS mount unconditionally.
Thus, it's enough just to remove check for O_DIRECT to allow AutoFS 
migration.

However, it's not a generic solution and such a pipe should me migrated 
properly.
Major difference between ordinary pipe and O_DIRECT-one (within criu 
scope), is that splice can't be used to dumping pipe data, because in 
case of O_DIRECT flag pipe becomes a kind of queue, where individual 
writes are not merged and have to be delivered to reader with it's 
original size one per each read request.
Thus, migration of data from pipe with O_DIRECT have to be done differently.
Possible solutions are:
1) Modify existent pipe entry image to contain a header with data size 
after it. This will allow to fill image with array of header-data 
objects. Not backward compatible.
2) Add one more field to pipe entry (some kind of sequence number) and 
create a bunch of pipe entry files with equal id and other attributes, 
but different sequence numbers. Since it's a new field in protobuf, is 
should be backward compatible.
3) Create another protobuf object for pipes with O_DIRECT.

Maybe, there are more and better, than these.

Would be great to hear any ideas.

Sincerely,
Stanislav Kinsburskiy


More information about the CRIU mailing list