[systemd-devel] Swap gets activated twice (through fstab and gpt generators)

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Jan 27 19:19:45 PST 2015


On Tue, Jan 27, 2015 at 05:47:07PM -0700, Chris Murphy wrote:
> On Tue, Jan 27, 2015 at 5:28 PM, "Jóhann B. Guðmundsson"
> <johannbg at gmail.com> wrote:
> >
> > On 01/28/2015 12:24 AM, Lennart Poettering wrote:
> >>
> >> On Tue, 27.01.15 17:17, Chris Murphy (lists at colorremedies.com) wrote:
> >>
> >>>> > >The problem is simply that we cannot know in advance that /dev/sda7
> >>>> > >and /dev/disk/by-uuid/c0e7978b-f82b-4b7f-b72b-6717f6909abc will
> >>>> > >eventually refer to the same device.
> >>>
> >>> >
> >>> >Are these just scary looking warnings?
> >>
> >> It should be unproblematic, but it looks scary right now. The swapon
> >> will only succeed once, and fail the second time, and that doesn't
> >> look pretty, but the kernel should do the right thing and not get
> >> confused by this.
> >
> >
> > I can confirm it does and I simply remove the swap entry in fstab to make it
> > go away when I encountered it.
> >
> > That said are there any real practical benefits of using swap et al in
> > today's age or are people just still creating it out of habit?
> 
> For those who have hibernation working, it's needed. And there's a
> case for it on baremetal servers, it's sometimes better that they slow
> down instead of totally face planting. And it can be useful if you
> don't have enough memory to do a full fsck on a large file system,
> especially if swap is on an SSD it's not as slow as on a HDD. But
> otherwise, maybe not.
You also need swap if you want to use all of your memory. If you have
no swap, allocating close to 100% RAM becomes very dangerous, because
any overflow will result in oom. If you have swap configured, it acts
as a safety valve. For example, I have servers with long-running simulations
where the amount of memory used tailored to the task, and >95% of memory
is used. If I logged into this machine and run the package manager, without
swap, the kernel would start killing off the jobs.

Zbyszek

> Over on that other OS that begins with W, it looks like they aren't
> using swap directly. Instead there's a separate Intel Rapid Start
> specific partition (it has it's own GPT partition type GUID) that puts
> some kind of hibernation like file there on normal shutdown. Cold boot
> times are insanely fast, like 3-4 seconds from pushing the button.


More information about the systemd-devel mailing list