Merge tag 'mm-stable-2022-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull MM updates from Andrew Morton: "Most of the MM queue. A few things are still pending. Liam's maple tree rework didn't make it. This has resulted in a few other minor patch series being held over for next time. Multi-gen LRU still isn't merged as we were waiting for mapletree to stabilize. The current plan is to merge MGLRU into -mm soon and to later reintroduce mapletree, with a view to hopefully getting both into 6.1-rc1. Summary: - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe Lin, Yang Shi, Anshuman Khandual and Mike Rapoport - Some kmemleak fixes from Patrick Wang and Waiman Long - DAMON updates from SeongJae Park - memcg debug/visibility work from Roman Gushchin - vmalloc speedup from Uladzislau Rezki - more folio conversion work from Matthew Wilcox - enhancements for coherent device memory mapping from Alex Sierra - addition of shared pages tracking and CoW support for fsdax, from Shiyang Ruan - hugetlb optimizations from Mike Kravetz - Mel Gorman has contributed some pagealloc changes to improve latency and realtime behaviour. - mprotect soft-dirty checking has been improved by Peter Xu - Many other singleton patches all over the place" [ XFS merge from hell as per Darrick Wong in https://lore.kernel.org/all/YshKnxb4VwXycPO8@magnolia/ ] * tag 'mm-stable-2022-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (282 commits) tools/testing/selftests/vm/hmm-tests.c: fix build mm: Kconfig: fix typo mm: memory-failure: convert to pr_fmt() mm: use is_zone_movable_page() helper hugetlbfs: fix inaccurate comment in hugetlbfs_statfs() hugetlbfs: cleanup some comments in inode.c hugetlbfs: remove unneeded header file hugetlbfs: remove unneeded hugetlbfs_ops forward declaration hugetlbfs: use helper macro SZ_1{K,M} mm: cleanup is_highmem() mm/hmm: add a test for cross device private faults selftests: add soft-dirty into run_vmtests.sh selftests: soft-dirty: add test for mprotect mm/mprotect: fix soft-dirty check in can_change_pte_writable() mm: memcontrol: fix potential oom_lock recursion deadlock mm/gup.c: fix formatting in check_and_migrate_movable_page() xfs: fail dax mount if reflink is enabled on a partition mm/memcontrol.c: remove the redundant updating of stats_flush_threshold userfaultfd: don't fail on unrecognized features hugetlb_cgroup: fix wrong hugetlb cgroup numa stat ...
This commit is contained in:
@ -685,13 +685,15 @@ svm_migrate_vma_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
|
||||
migrate.vma = vma;
|
||||
migrate.start = start;
|
||||
migrate.end = end;
|
||||
migrate.flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE;
|
||||
migrate.pgmap_owner = SVM_ADEV_PGMAP_OWNER(adev);
|
||||
if (adev->gmc.xgmi.connected_to_cpu)
|
||||
migrate.flags = MIGRATE_VMA_SELECT_DEVICE_COHERENT;
|
||||
else
|
||||
migrate.flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE;
|
||||
|
||||
buf = kvcalloc(npages,
|
||||
2 * sizeof(*migrate.src) + sizeof(uint64_t) + sizeof(dma_addr_t),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!buf)
|
||||
goto out;
|
||||
|
||||
@ -974,7 +976,7 @@ int svm_migrate_init(struct amdgpu_device *adev)
|
||||
{
|
||||
struct kfd_dev *kfddev = adev->kfd.dev;
|
||||
struct dev_pagemap *pgmap;
|
||||
struct resource *res;
|
||||
struct resource *res = NULL;
|
||||
unsigned long size;
|
||||
void *r;
|
||||
|
||||
@ -989,28 +991,34 @@ int svm_migrate_init(struct amdgpu_device *adev)
|
||||
* should remove reserved size
|
||||
*/
|
||||
size = ALIGN(adev->gmc.real_vram_size, 2ULL << 20);
|
||||
res = devm_request_free_mem_region(adev->dev, &iomem_resource, size);
|
||||
if (IS_ERR(res))
|
||||
return -ENOMEM;
|
||||
if (adev->gmc.xgmi.connected_to_cpu) {
|
||||
pgmap->range.start = adev->gmc.aper_base;
|
||||
pgmap->range.end = adev->gmc.aper_base + adev->gmc.aper_size - 1;
|
||||
pgmap->type = MEMORY_DEVICE_COHERENT;
|
||||
} else {
|
||||
res = devm_request_free_mem_region(adev->dev, &iomem_resource, size);
|
||||
if (IS_ERR(res))
|
||||
return -ENOMEM;
|
||||
pgmap->range.start = res->start;
|
||||
pgmap->range.end = res->end;
|
||||
pgmap->type = MEMORY_DEVICE_PRIVATE;
|
||||
}
|
||||
|
||||
pgmap->type = MEMORY_DEVICE_PRIVATE;
|
||||
pgmap->nr_range = 1;
|
||||
pgmap->range.start = res->start;
|
||||
pgmap->range.end = res->end;
|
||||
pgmap->ops = &svm_migrate_pgmap_ops;
|
||||
pgmap->owner = SVM_ADEV_PGMAP_OWNER(adev);
|
||||
pgmap->flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE;
|
||||
|
||||
pgmap->flags = 0;
|
||||
/* Device manager releases device-specific resources, memory region and
|
||||
* pgmap when driver disconnects from device.
|
||||
*/
|
||||
r = devm_memremap_pages(adev->dev, pgmap);
|
||||
if (IS_ERR(r)) {
|
||||
pr_err("failed to register HMM device memory\n");
|
||||
|
||||
/* Disable SVM support capability */
|
||||
pgmap->type = 0;
|
||||
devm_release_mem_region(adev->dev, res->start, resource_size(res));
|
||||
if (pgmap->type == MEMORY_DEVICE_PRIVATE)
|
||||
devm_release_mem_region(adev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
return PTR_ERR(r);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user