Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'pci/p2pdma'

- Release per-CPU pgmap ref when vm_insert_page() fails so we don't hang
when removing the PCI device (Hou Tao)

- Remove incorrect p2pmem_alloc_mmap() warning about page refcount (Hou
Tao)

- Reset page reference count when page mapping fails (Alistair Popple)

* pci/p2pdma:
PCI/P2PDMA: Reset page reference count when page mapping fails
PCI/P2PDMA: Fix p2pmem_alloc_mmap() warning condition
PCI/P2PDMA: Release per-CPU pgmap ref when vm_insert_page() fails

+9 -1
+9 -1
drivers/pci/p2pdma.c
··· 147 147 * we have just allocated the page no one else should be 148 148 * using it. 149 149 */ 150 - VM_WARN_ON_ONCE_PAGE(!page_ref_count(page), page); 150 + VM_WARN_ON_ONCE_PAGE(page_ref_count(page), page); 151 151 set_page_count(page, 1); 152 152 ret = vm_insert_page(vma, vaddr, page); 153 153 if (ret) { 154 154 gen_pool_free(p2pdma->pool, (uintptr_t)kaddr, len); 155 + 156 + /* 157 + * Reset the page count. We don't use put_page() 158 + * because we don't want to trigger the 159 + * p2pdma_folio_free() path. 160 + */ 161 + set_page_count(page, 0); 162 + percpu_ref_put(ref); 155 163 return ret; 156 164 } 157 165 percpu_ref_get(ref);