On 4/29/26 2:12 AM, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" <[email protected]> > > khugepaged registers atexit() and signal handlers that ensure that THP > settings are restored regardless of how the test exited. > > Make these handlers available for all users of thp_settings. > > The call to thp_save_settings() installs thp_restore_settings as the > atexit() callback and makes sure that signals that kill a process would > still call exit() and atexit() callback. > > Update child process in tests using thp_settings to use _exit() instead > of exit() to avoid altering THP settings in the middle of a test. > > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> > --- I ran the modified mm selftests after applying this patch and the THP settings are being correctly restored to their original values both on normal exit and when the test is being interrupted with Ctrl + C. Tested-by: Sarthak Sharma <[email protected]>

