Re: [PATCH v1] mm/memory_hotplug: document the signal_pending() check in offline_pages()

From: David Hildenbrand
Date: Wed Jul 12 2023 - 15:10:20 EST


On 11.07.23 22:47, Michal Hocko wrote:
On Tue 11-07-23 19:40:50, David Hildenbrand wrote:
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.

Yes, and it is likely goot to mention here that this is an antipattern
for many other kernel operations like IO (e.g. write) but it is a long
term behavior that somebody might depend on and it is safer to reflect
the documentation to the realitity rather than other way around (which
would be imho better).


You mean adding something like

"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."


Thanks!

--
Cheers,

David / dhildenb