Hi Pavel! On 2024-05-24 04:45, Pavel Machek wrote: > Hi! > >> While trying to use a swapfile for hibernation, I noticed that the suspend >> process was failing when it tried to search for the swap to use for snapshot. >> I had created the swapfile on ext4 and got the starting physical block offset >> using the filefrag command. > > How is swapfile for hibernation supposed to work? I'm afraid that > can't work, and we should just not allow hibernation if there's > anything else than just one swap partition. I am not sure what you mean. We can pass the starting physical block offset of a swapfile into /sys/power/resume_offset, and hibernate can directly read/write into it using the swap extents information created by iomap during swapon. On resume, the kernel would read this offset value from the commandline parameters, and then access the swapfile. I find having a swapfile option for hibernate useful, in the scenarios where it is hard to modify the partitioning scheme, or to have a dedicated swap partition. Are there any plans to remove swapfile support from hibernation? -- Sukrit