On Thu 22 Aug 2024 at 21:34:45 (+0200), to...@tuxteam.de wrote: > On Thu, Aug 22, 2024 at 01:45:06PM -0500, David Wright wrote: > > On Thu 22 Aug 2024 at 17:21:04 (+0000), Thorsten Glaser wrote: > > > Mike Castle dixit: > > [...] > > > > >I suspect that the race is that, when the the swapoff() syscall > > > >returns, the kernel has indeed moved all of the content off, so that > > > >part is fine... but it has not yet released whatever kind of resources > > > >is has on the backing store (akin to an open file handle). > > > > > > My guess as well. > > > > I'm not convinced. Finding out what needs copying back and locating > > somewhere to put it is AIUI a slow process. > > Actually, thinking about it: if the system hasn't enough discardable > RAM, the process might take arbitrarily long, no?
Irrespective of the time taken, that could trigger the OOM killer, couldn't it. Very risky, unless you're using two swaps as mentioned. To be fair, I assume that people are using swapoff/swapon like this when they have servers that are running for "ever". In which case, swap may be there for speed rather than extending RAM. Cheers, David.