mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | mm/memory_hotplug: check for fatal signals only in offline_pages()mm/ | +1 | 3 replies | |
| 2/5 | virtio-mem: convert most offline_and_remove_memory() errors to -EBUSYdrivers/ | +9 | 0 replies | |
| 3/5 | mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signalsdrivers/ include/ mm/ | +50 | 6 replies | |
| 4/5 | virtio-mem: set the timeout for offline_and_remove_memory() to 10 secondsdrivers/ | +2 | 0 replies | |
| 5/5 | virtio-mem: check if the config changed before (fake) offlining memorydrivers/ | +8 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH v1 0/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals
As raised by John Hubbard [1], offline_and_remove_memory() failing on fatal signals can be sub-optimal for out-of-tree drivers: dying user space might be the last one holding a device node open.
As that device node gets closed, the driver might unplug the device and trigger offline_and_remove_memory() to unplug previously hotplugged device memory. This, however, will fail reliably when fatal signals are pending on the dying process, turning the device unusable until the machine gets rebooted.
That can be optizied easily by ignoring fatal signals. In fact, checking for fatal signals in the case of offline_and_remove_memory() doesn't make too much sense; the check makes sense when offlining is triggered directly via sysfs. However, we actually do want a way to not end up stuck in offline_and_remove_memory() forever.
What offline_and_remove_memory() users actually want is fail after some given timeout and not care about fatal signals.
So let's implement that, optimizing virtio-mem along the way.
[1] https://lkml.kernel.org/r/[email protected]
David Hildenbrand (5):
mm/memory_hotplug: check for fatal signals only in offline_pages()
virtio-mem: convert most offline_and_remove_memory() errors to -EBUSY mm/memory_hotplug: make offline_and_remove_memory() timeout instead of
failing on fatal signals
virtio-mem: set the timeout for offline_and_remove_memory() to 10
seconds
virtio-mem: check if the config changed before (fake) offlining memory
drivers/virtio/virtio_mem.c | 22 +++++++++++++-- include/linux/memory_hotplug.h | 2 +- mm/memory_hotplug.c | 50 ++++++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 6 deletions(-)
base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1
Signature · 1 line
2.40.1