We restore task's mappings before it goes forking to handle COW. This effectively serializes forking.
+
+
=== Restoring VMAs ===
+
+
There are 4 stages in VMA restore. Relative times of each are below
+
+
* Reading images 1%
+
* Mapping huuge premap area << 1%
+
* (Re-)mapping sub-areas 73%
+
* Filling area with data 26%
+
+
The 3rd stage has two parts. With timings:
+
+
* Opening filemap fd 85%
+
* Maping vma 15%
+
+
+
=== Opening files for mappings ===
−
The 2nd longest routine. It takes ~ 0.07 seconds on dump.
+
The <code>get_filemap_fd()</code> opens new fd every time. If a file is mapped several
+
times (e.g. -- a library) we can share one fd for that.
+
=== Staging ===
−
== Restore ==
+
When restoring a single task CRIU uses [[stages of restoring]] which slows things down. Need either special-care the single task restore, or introduce fine-grained locking for such things.