4 ms·
I'll continue listening to my OS vendor rather than this random github user with some broken links, thanks. (I’m not interested in being educated on this, I ha
by ghostly_s 7d ago
I'll continue listening to my OS vendor rather than this random github user with some broken links, thanks.
(I’m not interested in being educated on this, I have better things to do. Bring it up with Debian.)
- jenders 7d agoAh the old HN hug. I’ll fix it
- copperx 7d agoWhat bug?
- zahlman 7d ago"Hug", not bug. Referring to a site (presumably under OP's control) crashing due to increased traffic from HN.
- wccrawford 7d agoThe hug of death.
- embedding-shape 7d agoAlso, this seems to be based on a email from 2005, about kernel version 2.4 and 2.6, and their differences. Things might have changed since then, and also depends on a lot of factors, not the least what filesystem you use. I'm not sure people should seriously follow advice that basically boils down to "do this always it's best". Better instead to make yourself informed about the tradeoffs, then make your own choice, for your setup.
- rddbs 7d agoJust because there might exist tradeoffs doesn’t make them matter to someone. If you’re using a Linux distro then you’re already living off thousands of decisions made with tradeoffs and it’s hardly feasible to be informed or care about all of them.
- jenders 7d agoThis recommendation is based off the current implementation. See: https://github.com/torvalds/linux/blob/827751b699b79a6e569983359c02dce67f81b94c/mm/swapfile.c#L2934 https://github.com/torvalds/linux/blob/827751b699b79a6e56998... https://github.com/torvalds/linux/blob/827751b699b79a6e569983359c02dce67f81b94c/include/linux/swap.h#L183 https://github.com/torvalds/linux/blob/827751b699b79a6e56998... The thread is quoted to show that they have been functionally equivalent for several decades and yet distros continue to push outdated recommendations.
- embedding-shape 7d ago> yet distros continue to push outdated recommendations Is it possible perhaps that this advice doesn't apply equally to all situations? Is it the best for people on ZFS? Is it the best for distributions that have their own kernels builds? I'm not saying it's a bad default, or that people should avoid it, just that it's likely not "the absolute best no questions asked" regardless of the situation, that was what I was trying to point out with my previous comment.
- throw10920 7d agoThis is one of the most anti-intellectual and unsuitable for HN comments I've ever seen. You're proudly proclaiming your lack of desire to learn or discuss on a forum meant for those things. Go to Reddit. That's the right place for you.
- angry_octet 7d agoIt's actually incredibly sensible not to just make changes to core OS settings unless you know what you're doing. There are good reasons not to use swap files, which become evident in OOM situations.
- LtWorf 7d agoHow does a swap file vs swap partition change things in OOM situations?
- mitxela 7d agoOne traditional reason to prefer a swap partition was that the filesystem driver might have to allocate memory. I think swap files bypass the filesystem driver, though - getting the block extents and then accessing the block device at those locations, instead of accessing the file.
- angry_octet 7d agoAs @mitxela says, if you need to fault in a page which is needed for some critical OS function, which requires going through the VFS layer, and that requires paging in another page, which has been swapped out due to memory pressure ... There are many edge cases. Swap on primary partitions also complicates dump and restore, although hardly anyone seems to know what backups are now.
- ButlerianJihad 7d agoSee, the thing is that swapping or paging to a file does not use the VFS layer, except when activating or deactivating it. So swapfiles may not be materially different from swap partitions during operations. https://utcc.utoronto.ca/~cks/space/blog/linux/HowSwapFindsBlocks https://utcc.utoronto.ca/~cks/space/blog/linux/HowSwapFindsB... And there are many things that complicate dump and restore. Dump and restore often need to account for what partitions were created, anyway, so don't swap partitions also complicate it? https://utcc.utoronto.ca/~cks/space/blog/sysadmin/SwapfileAndBackupsIssue https://utcc.utoronto.ca/~cks/space/blog/sysadmin/SwapfileAn...
- vor_ 7d agoRespectfully, what a stubborn position to take. You don't want to listen to anyone else, and you don't want to be taught any new information about it that might change your mind. Debian supports swap files and has information about setting them up in the Debian wiki, so I don't know why you're implying they've taken a stand on the issue.