mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
mm/memory_hotplug: document the signal_pending() check in offline_pages()
Let's update the documentation that any signal is sufficient, and add a comment that not only checking for fatal signals is historical baggage: changing it now could break existing user space. although unlikely. For example, when an app provides a custom SIGALRM handler and triggers memory offlining, the timeout cmd would no longer stop memory offlining, because SIGALRM would no longer be considered a fatal signal. Note that using signal_pending() instead of fatal_signal_pending() is an anti-pattern, but slowly deprecating that behavior to eventually change it in the far future is probably not worth the effort. If this ever becomes relevant for user-space, we might want to rethink. Link: https://lkml.kernel.org/r/20230711174050.603820-1-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
d03668803b
commit
de7cb03db0
@ -669,7 +669,7 @@ when still encountering permanently unmovable pages within ZONE_MOVABLE
|
|||||||
(-> BUG), memory offlining will keep retrying until it eventually succeeds.
|
(-> BUG), memory offlining will keep retrying until it eventually succeeds.
|
||||||
|
|
||||||
When offlining is triggered from user space, the offlining context can be
|
When offlining is triggered from user space, the offlining context can be
|
||||||
terminated by sending a fatal signal. A timeout based offlining can easily be
|
terminated by sending a signal. A timeout based offlining can easily be
|
||||||
implemented via::
|
implemented via::
|
||||||
|
|
||||||
% timeout $TIMEOUT offline_block | failure_handling
|
% timeout $TIMEOUT offline_block | failure_handling
|
||||||
|
@ -1843,6 +1843,11 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
|
|||||||
do {
|
do {
|
||||||
pfn = start_pfn;
|
pfn = start_pfn;
|
||||||
do {
|
do {
|
||||||
|
/*
|
||||||
|
* Historically we always checked for any signal and
|
||||||
|
* can't limit it to fatal signals without eventually
|
||||||
|
* breaking user space.
|
||||||
|
*/
|
||||||
if (signal_pending(current)) {
|
if (signal_pending(current)) {
|
||||||
ret = -EINTR;
|
ret = -EINTR;
|
||||||
reason = "signal backoff";
|
reason = "signal backoff";
|
||||||
|
Loading…
Reference in New Issue
Block a user