mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
50f44ee724
Logan noticed that devm_memremap_pages_release() kills the percpu_ref
drops all the page references that were acquired at init and then
immediately proceeds to unplug, arch_remove_memory(), the backing pages
for the pagemap. If for some reason device shutdown actually collides
with a busy / elevated-ref-count page then arch_remove_memory() should
be deferred until after that reference is dropped.
As it stands the "wait for last page ref drop" happens *after*
devm_memremap_pages_release() returns, which is obviously too late and
can lead to crashes.
Fix this situation by assigning the responsibility to wait for the
percpu_ref to go idle to devm_memremap_pages() with a new ->cleanup()
callback. Implement the new cleanup callback for all
devm_memremap_pages() users: pmem, devdax, hmm, and p2pdma.
Link: http://lkml.kernel.org/r/155727339156.292046.5432007428235387859.stgit@dwillia2-desk3.amr.corp.intel.com
Fixes:
|
||
---|---|---|
.. | ||
test | ||
acpi_nfit_test.c | ||
config_check.c | ||
dax-dev.c | ||
dax_pmem_compat_test.c | ||
dax_pmem_core_test.c | ||
dax_pmem_test.c | ||
device_dax_test.c | ||
dimm_devs.c | ||
Kbuild | ||
libnvdimm_test.c | ||
Makefile | ||
pmem-dax.c | ||
pmem_test.c | ||
watermark.h |