Linus really does write beautifully. Love his style, concise, easily readable, frank, honest with nice human touches.
Much kinder than past Linus writings. I loved it too. "Double ungood" works at least as good as the swearing.
51–60 of 115 posts
Linus really does write beautifully. Love his style, concise, easily readable, frank, honest with nice human touches.
Much kinder than past Linus writings. I loved it too. "Double ungood" works at least as good as the swearing.
Earlier quoted context omitted.
Swapfiles are quite common when you use FDE (say, LUKS) and you don't want your swap to be in plaintext on disk. (Although, you could just have an entire LUKS-encrypted swap volume instead of a swapfile...)
While maybe not the most performant my favorite is LVM2 on top of a single large LUKS-encrypted partition (+no boot partition and a single (custom platform key) signed EFI bootable kernel blob containing the initram fs in the EFI partition). This: - Allows a encrypted swap partition (on in lvm2 on top of luks, sure not perfect but I don't really use swap) - Allows hibernation (which I don't really use tbh.) - Fully e…
Most of the time, I don't need any swap at all, and any swap file/partition is wasted space.
While hibernated, I need ~the amount of system ram as swap.
While running some horrendous matlab script, I need about 1TB of swap.
Yet linux won't dynamically allocate it like other files. I'm forced to constantly resize it manually to save space or be able to do more things.
I guess because I use a swapfile I am not normal according to Linus? Haha, I just find it easier to use a swap file when dual-booting Windows and my Linux install is encrypted. Otherwise, it'd me more work to ensure my swap partition is encrypted.
Dual boot is probably not typical for people who install rc kernels right away? I remember trying to do kernel dev on a dual-boot laptop in college, and I spent a lot of time trying to repair the bootloader while running off of a live-USB environment. Besides, most Linux installs by the numbers are probably web servers/data centers, or large enterprises (think movie studios, large tech companies). I realize this come…
This way you only need one computer, but can have multiple completely separated OS'es. Of course, this doesn't work for laptops.
this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…
If you are using budget vps, it is likely you will want to enable it. Because vps tend to not setup a swap partition at all. And you are unlikly to reformat a vps to add a swap partition.
Why are swap files/partitions constant size? Most of the time, I don't need any swap at all, and any swap file/partition is wasted space. While hibernated, I need ~the amount of system ram as swap. While running some horrendous matlab script, I need about 1TB of swap. Yet linux won't dynamically allocate it like other files. I'm forced to constantly resize it manually to save space or be able to do more things.
> And, as far as I know, all the normal distributions set things up with swap partitions, not files I guess Ubuntu is not a "normal" distribution then? Because it uses a swap file by default.
While it's the default setup of the auto installer it common (and IMHO best) practice to change it to install with a swap partition. It's just that it's much easier for anyone who just gets started with Linux to have a swap file. For example for hibernation you swap partition needs to have the right size. But people do upgrade their desktop RAM and as such would need to resize the partition, which isn't easy (because…
At one point in the past I used the default (or recommended) /boot size and got stuck a couple of years later juggling at updates to fit the boot files into the partition. I just use a monolithic partition per OS per disk now and swap files within that. Is that not good practice (for home systems)?
Earlier quoted context omitted.
Why do you believe that’s the commit that caused the bug?
The second commit self-disambiguates with "swap: fix swapfile read/write offset" and the commit message notes "fixes: 48d1543", which is the first linked commit.
this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…
If you are using budget vps, it is likely you will want to enable it. Because vps tend to not setup a swap partition at all. And you are unlikly to reformat a vps to add a swap partition.
In fact that just happened - no service died but something used a lot of RAM at midnight - investigating now.
Why are swap files/partitions constant size? Most of the time, I don't need any swap at all, and any swap file/partition is wasted space. While hibernated, I need ~the amount of system ram as swap. While running some horrendous matlab script, I need about 1TB of swap. Yet linux won't dynamically allocate it like other files. I'm forced to constantly resize it manually to save space or be able to do more things.
> I need about 1TB of swap.
I don't think most people[†] would ever want that much to be dynamically allocated. If something has needed that much memory unexpectedly then it is likely to be something like a massive leak or accidental fork bomb. It could quickly get to the point where a performance drop due to swap thrashing means you can't interact with the system to kill the offending process so your system is effectively locked until either hit the BRB or it runs out of the massive maximum storage allocated to swap. Of course that adds more complexity: how do you decide how much too much is? If it is a user decision and you sometimes want it to be able to balloon that much but still want the OOM killer to deal with accidentally leaky processes at other times, then you are back to manually managing swap allocation before/after processes that are expected to heavily use it.
[†] not that it is wrong to have a use case that warrants it, but if there is a safe workaround for such unusual cases that complicates life just a little, then IMO that is preferable to the risk of adding complexity that will likely go relative untested because it isn't commonly used.
> linux
Of course other OSs have made different decisions on the matter, so maybe there is room for further discussion.