Skip to content
  • Felix Kuehling's avatar
    drm/amdkfd: HMM migrate vram to ram · 48ff079b
    Felix Kuehling authored
    
    
    If CPU page fault happens, HMM pgmap_ops callback migrate_to_ram start
    migrate memory from vram to ram in steps:
    
    1. migrate_vma_pages get vram pages, and notify HMM to invalidate the
    pages, HMM interval notifier callback evict process queues
    2. Allocate system memory pages
    3. Use svm copy memory to migrate data from vram to ram
    4. migrate_vma_pages copy pages structure from vram pages to ram pages
    5. Return VM_FAULT_SIGBUS if migration failed, to notify application
    6. migrate_vma_finalize put vram pages, page_free callback free vram
    pages and vram nodes
    7. Restore work wait for migration is finished, then update GPU page
    table mapping to system memory, and resume process queues
    
    Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
    Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    48ff079b