1570175abd16 2374b6822551 2e3f139e8ece 50f44ee7248a 795ee30648c7 e615a191216e
v5.2 ** Description changed: Description: > 1) Some p2pdma user calls pci_alloc_p2pmem() to get some memory to DMA > to taking a reference to the pgmap. > 2) Another process unbinds the underlying p2pdma driver and the devm > chain starts to unwind. > 3) devm_memremap_pages_release() is called and it kills the reference > and drop's it's last reference. Oh! Yes, nice find. We need to wait for the percpu-ref to be dead and all outstanding references dropped before we can proceed to arch_remove_memory(), and I think this problem has been there since day one because the final exit was always after devm_memremap_pages() release which means arch_remove_memory() was always racing any final put_page(). I'll take a look, it seems the arch_remove_pages() call needs to be moved out-of-line to its own context and wait for the final exit of the percpu-ref. Target Release: 19.10 - Target Kernel: 5.3 + Target Kernel: 5.2 ** Changed in: intel Status: New => Fix Committed -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1835349 Title: Fix devm_memremap_pages shutdown handling Status in intel: Fix Committed Status in linux package in Ubuntu: Incomplete Bug description: Description: > 1) Some p2pdma user calls pci_alloc_p2pmem() to get some memory to DMA > to taking a reference to the pgmap. > 2) Another process unbinds the underlying p2pdma driver and the devm > chain starts to unwind. > 3) devm_memremap_pages_release() is called and it kills the reference > and drop's it's last reference. Oh! Yes, nice find. We need to wait for the percpu-ref to be dead and all outstanding references dropped before we can proceed to arch_remove_memory(), and I think this problem has been there since day one because the final exit was always after devm_memremap_pages() release which means arch_remove_memory() was always racing any final put_page(). I'll take a look, it seems the arch_remove_pages() call needs to be moved out-of-line to its own context and wait for the final exit of the percpu-ref. Target Release: 19.10 Target Kernel: 5.2 To manage notifications about this bug go to: https://bugs.launchpad.net/intel/+bug/1835349/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp