A proposed change has been put forward for the Linux kernel to improve the efficiency of the new swap allocator during hibernate-related operations. During development, a developer identified a lack of support for fast allocation of large regions in the swap partition when a system enters sleep mode. This issue particularly affected systems with slow SSD drives and using 4K blocks, resulting in a noticeable slowdown during the transition to sleep mode.
After conducting tests on a system equipped with a Samsung SSD 830 drive (SATA II, 3.0 Gbps), the suggested patch, consisting of only a few dozen lines of code, significantly decreased the time needed to enter sleep mode. The reduction was substantial, decreasing the time from 324 seconds to just 35 seconds.
The potential integration of this patch into the upcoming 7.0 kernel branch is being considered, along with the option of backporting it to stable branches such as 6.18, 6.19, and potentially others. More information on this proposal can be found here.