Home
last modified time | relevance | path

Searched refs:pgmap (Results 1 – 25 of 40) sorted by relevance

12

/linux-6.6.21/mm/
Dmemremap.c45 static void devmap_managed_enable_put(struct dev_pagemap *pgmap) in devmap_managed_enable_put() argument
47 if (pgmap->type == MEMORY_DEVICE_FS_DAX) in devmap_managed_enable_put()
51 static void devmap_managed_enable_get(struct dev_pagemap *pgmap) in devmap_managed_enable_get() argument
53 if (pgmap->type == MEMORY_DEVICE_FS_DAX) in devmap_managed_enable_get()
57 static void devmap_managed_enable_get(struct dev_pagemap *pgmap) in devmap_managed_enable_get() argument
60 static void devmap_managed_enable_put(struct dev_pagemap *pgmap) in devmap_managed_enable_put() argument
72 static unsigned long pfn_first(struct dev_pagemap *pgmap, int range_id) in pfn_first() argument
74 struct range *range = &pgmap->ranges[range_id]; in pfn_first()
79 return pfn + vmem_altmap_offset(pgmap_altmap(pgmap)); in pfn_first()
82 bool pgmap_pfn_valid(struct dev_pagemap *pgmap, unsigned long pfn) in pgmap_pfn_valid() argument
[all …]
Dsparse-vmemmap.c373 struct dev_pagemap *pgmap) in reuse_compound_section() argument
375 unsigned long nr_pages = pgmap_vmemmap_nr(pgmap); in reuse_compound_section()
377 PHYS_PFN(pgmap->ranges[pgmap->nr_range].start); in reuse_compound_section()
402 struct dev_pagemap *pgmap) in vmemmap_populate_compound_pages() argument
408 if (reuse_compound_section(start_pfn, pgmap)) { in vmemmap_populate_compound_pages()
421 size = min(end - start, pgmap_vmemmap_nr(pgmap) * sizeof(struct page)); in vmemmap_populate_compound_pages()
454 struct dev_pagemap *pgmap) in __populate_section_memmap() argument
464 if (vmemmap_can_optimize(altmap, pgmap)) in __populate_section_memmap()
465 r = vmemmap_populate_compound_pages(pfn, start, end, nid, pgmap); in __populate_section_memmap()
Dgup.c29 struct dev_pagemap *pgmap; member
581 struct dev_pagemap **pgmap) in follow_page_pte() argument
621 *pgmap = get_dev_pagemap(pte_pfn(pte), *pgmap); in follow_page_pte()
622 if (*pgmap) in follow_page_pte()
709 page = follow_devmap_pmd(vma, address, pmd, flags, &ctx->pgmap); in follow_pmd_mask()
715 return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); in follow_pmd_mask()
727 return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); in follow_pmd_mask()
734 follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); in follow_pmd_mask()
757 page = follow_devmap_pud(vma, address, pud, flags, &ctx->pgmap); in follow_pud_mask()
852 if (ctx.pgmap) in follow_page()
[all …]
Dsparse.c430 struct dev_pagemap *pgmap) in __populate_section_memmap() argument
633 struct dev_pagemap *pgmap) in populate_section_memmap() argument
635 return __populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in populate_section_memmap()
705 struct dev_pagemap *pgmap) in populate_section_memmap() argument
830 struct dev_pagemap *pgmap) in section_activate() argument
862 memmap = populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in section_activate()
892 struct dev_pagemap *pgmap) in sparse_add_section() argument
903 memmap = section_activate(nid, start_pfn, nr_pages, altmap, pgmap); in sparse_add_section()
Dmm_init.c973 struct dev_pagemap *pgmap) in __init_zone_device_page() argument
992 page->pgmap = pgmap; in __init_zone_device_page()
1014 if (pgmap->type == MEMORY_DEVICE_PRIVATE || in __init_zone_device_page()
1015 pgmap->type == MEMORY_DEVICE_COHERENT) in __init_zone_device_page()
1028 struct dev_pagemap *pgmap) in compound_nr_pages() argument
1030 if (!vmemmap_can_optimize(altmap, pgmap)) in compound_nr_pages()
1031 return pgmap_vmemmap_nr(pgmap); in compound_nr_pages()
1039 struct dev_pagemap *pgmap, in memmap_init_compound() argument
1043 unsigned int order = pgmap->vmemmap_shift; in memmap_init_compound()
1049 __init_zone_device_page(page, pfn, zone_idx, nid, pgmap); in memmap_init_compound()
[all …]
Dmemory-failure.c1725 struct dev_pagemap *pgmap) in mf_generic_kill_procs() argument
1748 switch (pgmap->type) { in mf_generic_kill_procs()
2118 struct dev_pagemap *pgmap) in memory_failure_dev_pagemap() argument
2123 if (!pgmap_pfn_valid(pgmap, pfn)) in memory_failure_dev_pagemap()
2130 if (pgmap_has_memory_failure(pgmap)) { in memory_failure_dev_pagemap()
2131 rc = pgmap->ops->memory_failure(pgmap, pfn, 1, flags); in memory_failure_dev_pagemap()
2140 rc = mf_generic_kill_procs(pfn, flags, pgmap); in memory_failure_dev_pagemap()
2143 put_dev_pagemap(pgmap); in memory_failure_dev_pagemap()
2174 struct dev_pagemap *pgmap; in memory_failure() local
2195 pgmap = get_dev_pagemap(pfn, NULL); in memory_failure()
[all …]
Dmemory_hotplug.c329 struct dev_pagemap *pgmap; in pfn_to_online_page() local
358 pgmap = get_dev_pagemap(pfn, NULL); in pfn_to_online_page()
359 put_dev_pagemap(pgmap); in pfn_to_online_page()
362 if (pgmap) in pfn_to_online_page()
404 params->pgmap); in __add_pages()
/linux-6.6.21/include/linux/
Dmemremap.h100 int (*memory_failure)(struct dev_pagemap *pgmap, unsigned long pfn,
142 static inline bool pgmap_has_memory_failure(struct dev_pagemap *pgmap) in pgmap_has_memory_failure() argument
144 return pgmap->ops && pgmap->ops->memory_failure; in pgmap_has_memory_failure()
147 static inline struct vmem_altmap *pgmap_altmap(struct dev_pagemap *pgmap) in pgmap_altmap() argument
149 if (pgmap->flags & PGMAP_ALTMAP_VALID) in pgmap_altmap()
150 return &pgmap->altmap; in pgmap_altmap()
154 static inline unsigned long pgmap_vmemmap_nr(struct dev_pagemap *pgmap) in pgmap_vmemmap_nr() argument
156 return 1 << pgmap->vmemmap_shift; in pgmap_vmemmap_nr()
163 page->pgmap->type == MEMORY_DEVICE_PRIVATE; in is_device_private_page()
175 page->pgmap->type == MEMORY_DEVICE_PCI_P2PDMA; in is_pci_p2pdma_page()
[all …]
Dhuge_mm.h222 pmd_t *pmd, int flags, struct dev_pagemap **pgmap);
224 pud_t *pud, int flags, struct dev_pagemap **pgmap);
375 unsigned long addr, pmd_t *pmd, int flags, struct dev_pagemap **pgmap) in follow_devmap_pmd() argument
381 unsigned long addr, pud_t *pud, int flags, struct dev_pagemap **pgmap) in follow_devmap_pud() argument
Dmemory_hotplug.h119 struct dev_pagemap *pgmap; member
348 struct dev_pagemap *pgmap);
/linux-6.6.21/drivers/pci/
Dp2pdma.c31 struct dev_pagemap pgmap; member
36 static struct pci_p2pdma_pagemap *to_p2p_pgmap(struct dev_pagemap *pgmap) in to_p2p_pgmap() argument
38 return container_of(pgmap, struct pci_p2pdma_pagemap, pgmap); in to_p2p_pgmap()
196 struct pci_p2pdma_pagemap *pgmap = to_p2p_pgmap(page->pgmap); in p2pdma_page_free() local
199 rcu_dereference_protected(pgmap->provider->p2pdma, 1); in p2pdma_page_free()
289 struct dev_pagemap *pgmap; in pci_p2pdma_add_resource() local
316 pgmap = &p2p_pgmap->pgmap; in pci_p2pdma_add_resource()
317 pgmap->range.start = pci_resource_start(pdev, bar) + offset; in pci_p2pdma_add_resource()
318 pgmap->range.end = pgmap->range.start + size - 1; in pci_p2pdma_add_resource()
319 pgmap->nr_range = 1; in pci_p2pdma_add_resource()
[all …]
/linux-6.6.21/drivers/xen/
Dunpopulated-alloc.c36 struct dev_pagemap *pgmap; in fill_list() local
84 pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL); in fill_list()
85 if (!pgmap) { in fill_list()
90 pgmap->type = MEMORY_DEVICE_GENERIC; in fill_list()
91 pgmap->range = (struct range) { in fill_list()
95 pgmap->nr_range = 1; in fill_list()
96 pgmap->owner = res; in fill_list()
121 vaddr = memremap_pages(pgmap, NUMA_NO_NODE); in fill_list()
139 kfree(pgmap); in fill_list()
/linux-6.6.21/drivers/dax/
Ddevice.c85 if (dev_dax->pgmap->vmemmap_shift) in dax_set_mapping()
397 struct dev_pagemap *pgmap; in dev_dax_probe() local
410 pgmap = dev_dax->pgmap; in dev_dax_probe()
412 if (dev_dax->pgmap) { in dev_dax_probe()
418 pgmap = devm_kzalloc(dev, in dev_dax_probe()
419 struct_size(pgmap, ranges, dev_dax->nr_range - 1), in dev_dax_probe()
421 if (!pgmap) in dev_dax_probe()
424 pgmap->nr_range = dev_dax->nr_range; in dev_dax_probe()
425 dev_dax->pgmap = pgmap; in dev_dax_probe()
429 pgmap->ranges[i] = *range; in dev_dax_probe()
[all …]
Dpmem.c19 struct dev_pagemap pgmap = { }; in __dax_pmem_probe() local
33 rc = nvdimm_setup_pfn(nd_pfn, &pgmap); in __dax_pmem_probe()
53 range = pgmap.range; in __dax_pmem_probe()
64 .pgmap = &pgmap, in __dax_pmem_probe()
Dbus.h23 struct dev_pagemap *pgmap; member
Ddax-private.h72 struct dev_pagemap *pgmap; member
Dbus.c409 dev_dax->pgmap = NULL; in kill_dev_dax()
1318 kfree(dev_dax->pgmap); in dev_dax_release()
1370 if (data->pgmap) { in devm_create_dev_dax()
1374 dev_dax->pgmap = kmemdup(data->pgmap, in devm_create_dev_dax()
1376 if (!dev_dax->pgmap) { in devm_create_dev_dax()
1430 kfree(dev_dax->pgmap); in devm_create_dev_dax()
/linux-6.6.21/tools/testing/nvdimm/test/
Diomap.c99 struct dev_pagemap *pgmap = _pgmap; in nfit_test_kill() local
101 WARN_ON(!pgmap); in nfit_test_kill()
103 percpu_ref_kill(&pgmap->ref); in nfit_test_kill()
105 wait_for_completion(&pgmap->done); in nfit_test_kill()
106 percpu_ref_exit(&pgmap->ref); in nfit_test_kill()
111 struct dev_pagemap *pgmap = container_of(ref, struct dev_pagemap, ref); in dev_pagemap_percpu_release() local
113 complete(&pgmap->done); in dev_pagemap_percpu_release()
116 void *__wrap_devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap) in __wrap_devm_memremap_pages() argument
119 resource_size_t offset = pgmap->range.start; in __wrap_devm_memremap_pages()
123 return devm_memremap_pages(dev, pgmap); in __wrap_devm_memremap_pages()
[all …]
/linux-6.6.21/drivers/nvdimm/
Dpmem.c434 static int pmem_pagemap_memory_failure(struct dev_pagemap *pgmap, in pmem_pagemap_memory_failure() argument
438 container_of(pgmap, struct pmem_device, pgmap); in pmem_pagemap_memory_failure()
477 rc = nvdimm_setup_pfn(nd_pfn, &pmem->pgmap); in pmem_attach_disk()
506 pmem->pgmap.owner = pmem; in pmem_attach_disk()
509 pmem->pgmap.type = MEMORY_DEVICE_FS_DAX; in pmem_attach_disk()
510 pmem->pgmap.ops = &fsdax_pagemap_ops; in pmem_attach_disk()
511 addr = devm_memremap_pages(dev, &pmem->pgmap); in pmem_attach_disk()
515 range_len(&pmem->pgmap.range); in pmem_attach_disk()
517 bb_range = pmem->pgmap.range; in pmem_attach_disk()
520 pmem->pgmap.range.start = res->start; in pmem_attach_disk()
[all …]
Dpfn_devs.c682 static int __nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap) in __nvdimm_setup_pfn() argument
684 struct range *range = &pgmap->range; in __nvdimm_setup_pfn()
685 struct vmem_altmap *altmap = &pgmap->altmap; in __nvdimm_setup_pfn()
705 pgmap->nr_range = 1; in __nvdimm_setup_pfn()
720 pgmap->flags |= PGMAP_ALTMAP_VALID; in __nvdimm_setup_pfn()
855 int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap) in nvdimm_setup_pfn() argument
867 return __nvdimm_setup_pfn(nd_pfn, pgmap); in nvdimm_setup_pfn()
Dpmem.h29 struct dev_pagemap pgmap; member
/linux-6.6.21/drivers/gpu/drm/amd/amdkfd/
Dkfd_migrate.c209 return (addr + adev->kfd.pgmap.range.start) >> PAGE_SHIFT; in svm_migrate_addr_to_pfn()
239 return (addr - adev->kfd.pgmap.range.start); in svm_migrate_addr()
998 struct dev_pagemap *pgmap; in kgd2kfd_init_zone_device() local
1010 pgmap = &kfddev->pgmap; in kgd2kfd_init_zone_device()
1011 memset(pgmap, 0, sizeof(*pgmap)); in kgd2kfd_init_zone_device()
1018 pgmap->range.start = adev->gmc.aper_base; in kgd2kfd_init_zone_device()
1019 pgmap->range.end = adev->gmc.aper_base + adev->gmc.aper_size - 1; in kgd2kfd_init_zone_device()
1020 pgmap->type = MEMORY_DEVICE_COHERENT; in kgd2kfd_init_zone_device()
1025 pgmap->range.start = res->start; in kgd2kfd_init_zone_device()
1026 pgmap->range.end = res->end; in kgd2kfd_init_zone_device()
[all …]
Dkfd_svm.h202 #define KFD_IS_SVM_API_SUPPORTED(adev) ((adev)->kfd.pgmap.type != 0 ||\
/linux-6.6.21/arch/powerpc/include/asm/book3s/64/
Dradix.h369 bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap);
376 struct dev_pagemap *pgmap);
/linux-6.6.21/fs/fuse/
Dvirtio_fs.c801 struct dev_pagemap *pgmap; in virtio_fs_setup_dax() local
825 pgmap = devm_kzalloc(&vdev->dev, sizeof(*pgmap), GFP_KERNEL); in virtio_fs_setup_dax()
826 if (!pgmap) in virtio_fs_setup_dax()
829 pgmap->type = MEMORY_DEVICE_FS_DAX; in virtio_fs_setup_dax()
836 pgmap->range = (struct range) { in virtio_fs_setup_dax()
840 pgmap->nr_range = 1; in virtio_fs_setup_dax()
842 fs->window_kaddr = devm_memremap_pages(&vdev->dev, pgmap); in virtio_fs_setup_dax()

12