Changes

Jump to navigation Jump to search
704 bytes added ,  20:48, 10 December 2015
no edit summary
Line 30: Line 30:  
     11 openat(AT_FDCWD, "/proc/$pid/map_files", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
 
     11 openat(AT_FDCWD, "/proc/$pid/map_files", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
   −
=== <code>parasite_fuxup_vdso</code> ===
+
== Restore ==
 +
 
 +
=== Fork vs VMA restore ===
 +
 
 +
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%
   −
The 2nd longest routine. It takes ~ 0.07 seconds on dump.
      +
=== Opening files for mappings ===
   −
== Restore ==
+
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 ===
   −
=== Fork vs VMA 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.
   −
We restore task's mappings before it goes forking to handle COW. This effectively serializes forking.
+
[[Category: Development]]
 +
[[Category: Thinkers]]

Navigation menu