migrate_device.c (6f84981772535e670e4e2df051a672af229b6694) | migrate_device.c (7d4a8be0c4b2b7ffb367929d2b352651f083806b) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Device Memory Migration functionality. 4 * 5 * Originally written by Jérôme Glisse. 6 */ 7#include <linux/export.h> 8#include <linux/memremap.h> --- 292 unchanged lines hidden (view full) --- 301 struct mmu_notifier_range range; 302 303 /* 304 * Note that the pgmap_owner is passed to the mmu notifier callback so 305 * that the registered device driver can skip invalidating device 306 * private page mappings that won't be migrated. 307 */ 308 mmu_notifier_range_init_owner(&range, MMU_NOTIFY_MIGRATE, 0, | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Device Memory Migration functionality. 4 * 5 * Originally written by Jérôme Glisse. 6 */ 7#include <linux/export.h> 8#include <linux/memremap.h> --- 292 unchanged lines hidden (view full) --- 301 struct mmu_notifier_range range; 302 303 /* 304 * Note that the pgmap_owner is passed to the mmu notifier callback so 305 * that the registered device driver can skip invalidating device 306 * private page mappings that won't be migrated. 307 */ 308 mmu_notifier_range_init_owner(&range, MMU_NOTIFY_MIGRATE, 0, |
309 migrate->vma, migrate->vma->vm_mm, migrate->start, migrate->end, | 309 migrate->vma->vm_mm, migrate->start, migrate->end, |
310 migrate->pgmap_owner); 311 mmu_notifier_invalidate_range_start(&range); 312 313 walk_page_range(migrate->vma->vm_mm, migrate->start, migrate->end, 314 &migrate_vma_walk_ops, migrate); 315 316 mmu_notifier_invalidate_range_end(&range); 317 migrate->end = migrate->start + (migrate->npages << PAGE_SHIFT); --- 410 unchanged lines hidden (view full) --- 728 * called if the page could not be unmapped. 729 */ 730 VM_BUG_ON(!migrate); 731 addr = migrate->start + i*PAGE_SIZE; 732 if (!notified) { 733 notified = true; 734 735 mmu_notifier_range_init_owner(&range, | 310 migrate->pgmap_owner); 311 mmu_notifier_invalidate_range_start(&range); 312 313 walk_page_range(migrate->vma->vm_mm, migrate->start, migrate->end, 314 &migrate_vma_walk_ops, migrate); 315 316 mmu_notifier_invalidate_range_end(&range); 317 migrate->end = migrate->start + (migrate->npages << PAGE_SHIFT); --- 410 unchanged lines hidden (view full) --- 728 * called if the page could not be unmapped. 729 */ 730 VM_BUG_ON(!migrate); 731 addr = migrate->start + i*PAGE_SIZE; 732 if (!notified) { 733 notified = true; 734 735 mmu_notifier_range_init_owner(&range, |
736 MMU_NOTIFY_MIGRATE, 0, migrate->vma, | 736 MMU_NOTIFY_MIGRATE, 0, |
737 migrate->vma->vm_mm, addr, migrate->end, 738 migrate->pgmap_owner); 739 mmu_notifier_invalidate_range_start(&range); 740 } 741 migrate_vma_insert_page(migrate, addr, newpage, 742 &src_pfns[i]); 743 continue; 744 } --- 231 unchanged lines hidden --- | 737 migrate->vma->vm_mm, addr, migrate->end, 738 migrate->pgmap_owner); 739 mmu_notifier_invalidate_range_start(&range); 740 } 741 migrate_vma_insert_page(migrate, addr, newpage, 742 &src_pfns[i]); 743 continue; 744 } --- 231 unchanged lines hidden --- |