“The swap is now a file, not a partition that will scale to what your system needs, making it easier to install Ubuntu on any machine.”
Huh. I vaguely remember something about systems that supported swap files tearing support out. As I recall, it was because it was deadlock prone. The file system may need to allocate in the write path, which triggers swapping, which needs to write, which triggers allocations, which triggers swapping, which needs to write… you get the idea.
“The swap is now a file, not a partition that will scale to what your system needs, making it easier to install Ubuntu on any machine.”
Would there be any issues with doing this as opposed to keeping your swap on a separate partition? Is the only upside ease of installation for those unfamiliar with disk partitioning?
There’s potentially a very slight performance difference, but it would be tiny. It’s far outweighed by the benefits at installation time. Depending on how they’re doing it (I haven’t looked in depth), it would also simplify the handling of encrypted swap (that is, they wouldn’t have to do it anymore; if the root filesystem is on an encrypted partition, encrypted swap comes for free).
The only downside of a swap file for me is that it makes hibernation a bit more complicated because you must specify the offset of the file from the partition start as a kernel parameter. But this is only a minor issue and I haven’t used a dedicated swap partition in years.
I’d be surprised; keeping swap in a file has been supported for well over a decade (could be two or even three, I’m not a historian).
I’m very familiar with disk partitioning, but I’m also very happy not to have to do it! And swap is a pretty safe thing to put on even your root partition, as it’s fixed-size and won’t surprise you by filling your disk.
I actually had an issue with my swap on the last 17.10 beta. There existed a /swapfile, and it was listed in /etc/fstab, but for some reason it was not being used (swapon -s and top didn’t show it). A couple of times when I opened a few Chrome tabs in a row, the machine went south, and as far as I could tell kswapd was going nuts. Both times the machine hung.
I blasted the old /swapfile, made a new one in the usual way, activated it, and now the machine is running fine.
Some interesting changes, from: https://www.ubuntu.com/desktop/1710
“The biggest change is the desktop environment. Ubuntu 17.10 is retiring Unity in favour of GNOME, version 3.26.1.”
“Ubuntu 17.10 features the Linux kernel 4.13.”
“The swap is now a file, not a partition that will scale to what your system needs, making it easier to install Ubuntu on any machine.”
“Ubuntu 17.10 will be supported for 9 months until July 2018. If you need Long Term Support, it is recommended you use Ubuntu 16.04 LTS instead.”
Huh. I vaguely remember something about systems that supported swap files tearing support out. As I recall, it was because it was deadlock prone. The file system may need to allocate in the write path, which triggers swapping, which needs to write, which triggers allocations, which triggers swapping, which needs to write… you get the idea.
Windows swaps to a file on NTFS just fine…
It must’ve been about ZFS. Swapping to a file on ZFS or a zvol WILL deadlock :)
Would there be any issues with doing this as opposed to keeping your swap on a separate partition? Is the only upside ease of installation for those unfamiliar with disk partitioning?
There’s potentially a very slight performance difference, but it would be tiny. It’s far outweighed by the benefits at installation time. Depending on how they’re doing it (I haven’t looked in depth), it would also simplify the handling of encrypted swap (that is, they wouldn’t have to do it anymore; if the root filesystem is on an encrypted partition, encrypted swap comes for free).
The only downside of a swap file for me is that it makes hibernation a bit more complicated because you must specify the offset of the file from the partition start as a kernel parameter. But this is only a minor issue and I haven’t used a dedicated swap partition in years.
I hadn’t thought about hibernation…but then again, I gave up trying to get it working on any OS ten years ago and haven’t thought about it since. :)
I’d be surprised; keeping swap in a file has been supported for well over a decade (could be two or even three, I’m not a historian).
I’m very familiar with disk partitioning, but I’m also very happy not to have to do it! And swap is a pretty safe thing to put on even your root partition, as it’s fixed-size and won’t surprise you by filling your disk.
I actually had an issue with my swap on the last 17.10 beta. There existed a
/swapfile, and it was listed in/etc/fstab, but for some reason it was not being used (swapon -sandtopdidn’t show it). A couple of times when I opened a few Chrome tabs in a row, the machine went south, and as far as I could tellkswapdwas going nuts. Both times the machine hung.I blasted the old
/swapfile, made a new one in the usual way, activated it, and now the machine is running fine.