2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

pipe: save all pipe data in a separate file

A pipe buffer has 16 slots. A slot is page, offset and size.
When we use splice and data is not aligned, splice connects
a page from file cache and set offset. For this reason we loose
a part of buffer.

If a data size is more than 15 pages, data will be aligned in a image.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2012-04-05 20:02:00 +04:00
committed by Pavel Emelyanov
parent 7b10ef0761
commit 96be8be2d1
5 changed files with 75 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
#define CORE_MAGIC 0x55053847 /* Kolomna */
#define VMAS_MAGIC 0x54123737 /* Tula */
#define PIPES_MAGIC 0x56513555 /* Tver */
#define PIPES_DATA_MAGIC 0x56453709 /* Dubna */
#define SIGACT_MAGIC 0x55344201 /* Murom */
#define UNIXSK_MAGIC 0x54373943 /* Ryazan */
#define INETSK_MAGIC 0x56443851 /* Pereslavl */
@@ -75,10 +76,22 @@ struct pipe_entry {
u32 id;
u32 pipe_id;
u32 flags;
} __packed;
struct pipe_data_entry {
u32 pipe_id;
u32 bytes;
u32 off;
u8 data[0];
} __packed;
/*
* splice() connect cache pages to pipe buffer, so
* some part of pages may be loosed if data are not
* aligned in a file.
*/
#define PIPE_NONALIG_DATA (15 * PAGE_SIZE)
#define USK_INFLIGHT 1
struct unix_sk_entry {