DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-01-23 01:07:00

puterboy
Member
Registered: 2008-09-18
Posts: 306

Fonz - what is benefit of 'swapoff -a' in reload-script.sh?

If anything, I would think that keeping swap on as long as possible would give the kernel more flexibility to allocate precious *physical* memory to store the loaded kernel and initrd.

And when it reboots does it matter if stuff dies in physical memory or in swap?

So, I am wondering whether it would be better to leave that line out altogether?
Thanks

Offline

 

#2 2011-01-23 10:54:43

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Fonz - what is benefit of 'swapoff -a' in reload-script.sh?

If you kill all user processes first, then there shouldn't be much to swap in.

Offline

 

#3 2011-01-24 15:16:46

puterboy
Member
Registered: 2008-09-18
Posts: 306

Re: Fonz - what is benefit of 'swapoff -a' in reload-script.sh?

True - I was just thinking that on the margins if you have a large kernel and a big ramdisk, then  you may want to save as much physical memory as possible.

I was asking more is there any benefit to doing a swapoff -- i.e. do you lose anything or take any risks of the reloading failing if you don't?

Offline

 

#4 2011-01-24 15:28:47

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Fonz - what is benefit of 'swapoff -a' in reload-script.sh?

Not sure what exactly happens during swapoff. But if there's changed data in swap but not flushed to disk, swapoff may simply be required.

Offline

 

#5 2011-01-25 06:03:44

puterboy
Member
Registered: 2008-09-18
Posts: 306

Re: Fonz - what is benefit of 'swapoff -a' in reload-script.sh?

Isn't that what sync is supposed to do? I assumed (maybe wrongly) that swap is just a *slow* memory extension. The stuff there effectively dies just as does the stuff in RAM when you cut the power or reboot (well unless you are doing things like hibernating or forensics tongue)
I assume in swapoff, if there is room in memory it goes there, if not well the kernel does its best but something must give...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB