• J
    mm: add pin memory method for checkpoint add restore · 7dc4c73d
    Jingxian He 提交于
    hulk inclusion
    category: feature
    bugzilla: 48159
    CVE: N/A
    
    ------------------------------
    
    We can use the checkpoint and restore in userspace(criu) method to dump
    and restore tasks when updating the kernel.
    Currently, criu needs dump all memory data of tasks to files.
    When the memory size is very large(larger than 1G),
    the cost time of the dumping data will be very long(more than 1 min).
    
    By pin the memory data of tasks and collect the corresponding physical pages
    mapping info in checkpoint process, we can remap the physical pages to
    restore tasks after upgrading the kernel. This pin memory method can
    restore the task data within one second.
    
    The pin memory area info is saved in the reserved memblock,
    which can keep usable in the kernel update process.
    
    The pin memory driver provides the following ioctl command for criu:
    1) SET_PIN_MEM_AREA:
    Set pin memory area, which can be remap to the restore task.
    2) CLEAR_PIN_MEM_AREA:
    Clear the pin memory area info,
    which enable user reset the pin data.
    3) REMAP_PIN_MEM_AREA:
    Remap the pages of the pin memory to the restore task.
    Signed-off-by: NJingxian He <hejingxian@huawei.com>
    Reviewed-by: NChen Wandun <chenwandun@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    7dc4c73d
memory.c 145.7 KB