Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-31 Thread Hans-Werner Hilse
Hi,

On Sun, 27 May 2007 16:21:03 +0200 Michal 'vorner' Vaner
[EMAIL PROTECTED] wrote:

 First: You need to load the kernel from the swap, in the time it
 loads, you have no running kernel (well, there is a little part, but
 that one has no clue about network).

No, that's not entirely true. Userspace suspend and resume is in the
kernel since 2.6.17. See my other post in this thread for a pointer (I
think it was http://suspend.sf.net/). So for this way it really happens
all in userspace, with a fully working kernel available. When the image
is loaded into RAM, the resume utility makes a syscall to have the
kernel automatically copy  switch over.

See /usr/src/linux/Documentation/power/*suspend* for all the details.

 Second: You do not want swap on nfs, since it is terribly slow, buggy,
 nfs can allocate memory to transfer data and you get a circular
 problem
 - to get a memory, you need to get a memory. And, what if your cat
 steps on the ethernet cable?

Resume aborts, checksum error. But that's it. But true, I wouldn't
trust NFS too much, either. But then, there are nbd's (network block
devices) which would probably work a treat. But userspace resume from a
file on NFS should work reliably, too.

You're right, however, regarding the slowlyness. Suspending a 4Gig-RAM
machine via NFS is probably a bad idea.

 Third: the suspend does not use swap as a swap, but as a part of a
 disc.

Doesn't matter at all for userspace resume.

 You might try suspend to ram, thought. It should work on diskless
 machine as well as on any other.

...cough, cough... yeah, /as/ well as on any other. So this probably
means: It won't work until you switch off ACPI and resort to APM... But
of course, that will depend.

-hwh
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-31 Thread Michal 'vorner' Vaner
Hello

On Thu, May 31, 2007 at 01:28:20PM +0200, Hans-Werner Hilse wrote:
 On Sun, 27 May 2007 16:21:03 +0200 Michal 'vorner' Vaner
 [EMAIL PROTECTED] wrote:
 
  First: You need to load the kernel from the swap, in the time it
  loads, you have no running kernel (well, there is a little part, but
  that one has no clue about network).
 
 No, that's not entirely true. Userspace suspend and resume is in the
 kernel since 2.6.17. See my other post in this thread for a pointer (I
 think it was http://suspend.sf.net/). So for this way it really happens
 all in userspace, with a fully working kernel available. When the image
 is loaded into RAM, the resume utility makes a syscall to have the
 kernel automatically copy  switch over.
 
 See /usr/src/linux/Documentation/power/*suspend* for all the details.

OK, I use suspend 1, which seems the least buggy to me, I did not know
some of the suspends were in userspace. If so, then yes, it can work.

  Second: You do not want swap on nfs, since it is terribly slow, buggy,
  nfs can allocate memory to transfer data and you get a circular
  problem
  - to get a memory, you need to get a memory. And, what if your cat
  steps on the ethernet cable?
 
 Resume aborts, checksum error. But that's it. But true, I wouldn't
 trust NFS too much, either. But then, there are nbd's (network block
 devices) which would probably work a treat. But userspace resume from a
 file on NFS should work reliably, too.

No, that was not for resume, but for use of swap on NFS. You need fast
response from swap and reliability.

  You might try suspend to ram, thought. It should work on diskless
  machine as well as on any other.
 
 ...cough, cough... yeah, /as/ well as on any other. So this probably
 means: It won't work until you switch off ACPI and resort to APM... But
 of course, that will depend.

Why? It works fine for me. It just suspends and goes on the other day on
my laptop, all working by ACPI - with kernel suspend 1.

-- 
This message has optimized support for formating.
Please choose green font and black background so it looks like it should.

Michal 'vorner' Vaner


pgpsVFHEphh7N.pgp
Description: PGP signature


Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-30 Thread Dan Farrell
On Sun, 27 May 2007 16:21:03 +0200
Michal 'vorner' Vaner [EMAIL PROTECTED] wrote:

 Hello
 
 AFAIK, I think you do not want to do that.
Not on important boxes, that's for sure!
 First: You need to load the kernel from the swap, in the time it
 loads, you have no running kernel (well, there is a little part, but
 that one has no clue about network).
My observations lead me to believe that, after going into hibernation
with swap suspend, the kernel boots up normally, and it's only at the
point of init running that it really comes 'out' of hibernation.  As
far as running kernel before networking, it's a diskless host so the
kernel does do dhcp configuration at boot time.  
 Second: You do not want swap on nfs, since it is terribly slow, buggy,
 nfs can allocate memory to transfer data and you get a circular
 problem
 - to get a memory, you need to get a memory. And, what if your cat
 steps on the ethernet cable?
Better risk that then constantly be running out of memory.  I haven't
had a single problem with this.  To be fair, it has 1/2 gig of RAM and
only 64M of swap, and although it only uses about a meg, it does use
that up pretty much right away.  
 Third: the suspend does not use swap as a swap, but as a part of a
 disc.
As a block device you might say.  A loop device is a block device like
any other, is it not?  
 You might try suspend to ram, thought. It should work on diskless
 machine as well as on any other.
That is my preferred solution.  Perhaps someday I will get it to work...

Anyhow, Hans-Werner-Hilse already provided a solution, which by the way
I haven't actually implemented, and probably never will, because it's
clearly a convoluted scheme in the first place.  He suggested using an
initrd suspension, since you can get an initrd from a tftp server just
like a kernel image.  

Thanks for the feedback,
Dan
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-27 Thread Michal 'vorner' Vaner
Hello

AFAIK, I think you do not want to do that.

First: You need to load the kernel from the swap, in the time it loads,
you have no running kernel (well, there is a little part, but that one
has no clue about network).

Second: You do not want swap on nfs, since it is terribly slow, buggy,
nfs can allocate memory to transfer data and you get a circular problem
- to get a memory, you need to get a memory. And, what if your cat steps
on the ethernet cable?

Third: the suspend does not use swap as a swap, but as a part of a disc.

You might try suspend to ram, thought. It should work on diskless
machine as well as on any other.

-- 
When all else fails, EAT!!!

Michal 'vorner' Vaner


pgpReAHrDjOnz.pgp
Description: PGP signature


Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-24 Thread Alan McKinnon
On Wednesday 23 May 2007, Dan Farrell wrote:
 I know this is a long shot, and not many people run diskless hosts. 
 I have one with kind of a loud fan that uses a lot of energy - it's a
 pentium 4 in a slimline case and it runs pretty hot, so I can't
 adjust the fan speed based on temperature, because it seems like
 turning the fan off at 70+ degrees C is a bad idea.

 Instead, I'd like to be able to suspend to ram or swap so that the
 fans can stop spinning and the cpu can cool down -- all in one fell
 swoop!  -- but I've had troubles doing so.  While working on that, I
 was thinking I might have better luck if the kernel was allowed to
 restart itself.  I would like to set up swsuspend on the machine, but
 I'm a little unclear as to how I would do so.

 I know swapon doesn't work on regular files, so to add my swap I need
 to first use losetup to set up /dev/loop0 as my swap device.  Then
 swapon /dev/loop0 works.  but how can I enable swap on loop0 before
 the initscripts boot (right now I have it done in local.start). 
 Don't I need to be able to mount the swap as swap right away to
 resume from it?  Or will it be enought to specify the location?  If
 not, is there some way to specify loop settings at boot time, on the
 kernel command line?

Your entire post seems half-assed, and I think you need to think it 
through carefully:

1. What are you *actually* trying to do? Seems like the fan is loud, so 
a) replace the fan with a different one that has propellers/bearing  
that don't make a friggin' noise, or b) clean the thing

2. It's *diskless* machine. The whole point of swap is to entend virtual 
memory to include space on disk. If you don't have a physical spinning 
disk platter, what are you going to swap to? tmpfs?

3. Who told you you can't swapon to a regular file? 'man swapon' says 
otherwise

4. It's a p4 cpu you have. Cpu throttling is what reduces cpu 
temperatures in that case, and cpufreqd accomplishes that nicely

5. How *exactly* are you going to resume from a loop device? AFAIK the 
kernel will unmount such mounts before suspending (but this topic is in 
a state of flux as per many recent conversations on lkml)

I think you really need

emerge cpufreqd

and configure your kernel with the necessary governors etc

alan

-- 
Optimists say the glass is half full,
Pessimists say the glass is half empty,
Developers say wtf is the glass twice as big as it needs to be?

Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-24 Thread Dan Farrell
On Wed, 23 May 2007 22:05:14 +0200
Hans-Werner Hilse [EMAIL PROTECTED] wrote:

 Hi,
 
 On Wed, 23 May 2007 11:59:23 -0500
 Dan Farrell [EMAIL PROTECTED] wrote:
 
  I know swapon doesn't work on regular files, so to add my swap I
  need to first use losetup to set up /dev/loop0 as my swap device.
  Then swapon /dev/loop0 works.  but how can I enable swap on loop0
  before the initscripts boot (right now I have it done in
  local.start).  Don't I need to be able to mount the swap as swap
  right away to resume from it?  Or will it be enought to specify the
  location?  If not, is there some way to specify loop settings at
  boot time, on the kernel command line?  
 
 Check out userspace suspend (http://suspend.sf.net/). It's not in
 portage, but will do what you want since you can resume from an
 initrd. In the initrd, you can open a network connection, mount all
 that stuff (you never told where that looped file is located, so I
 guess it's on r/w NFS) and then resume. It's not implemented at the
 moment, I think, but should be easy to add (remote suspending is
 mentioned as an easy possibility).
 
 -hwh
Interesting and helpful, thanks.  
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-24 Thread Dan Farrell
On Wed, 23 May 2007 20:56:30 +0200
Alan McKinnon [EMAIL PROTECTED] wrote:

Well, for what it's worth, 
 Your entire post seems half-assed, and I think you need to think it 
 through carefully:
 
 1. What are you *actually* trying to do? Seems like the fan is loud,
 so a) replace the fan with a different one that has
 propellers/bearing that don't make a friggin' noise, or b) clean the
 thing
Yeah, I could buy a nicer fan.  I don't want to bother with it though.
The fan is clean and well lubricated.  The heatsink is low-profile and
it requires a lot of airflow -- the fan has to spin fast and it's not
going to be silent when it's running, the case is too small and it's
a hot-running processor.
 2. It's *diskless* machine. The whole point of swap is to entend
 virtual memory to include space on disk. If you don't have a physical
 spinning disk platter, what are you going to swap to? tmpfs?
NFS.  The whole point of swap for me is for efficient use of existing
memory.  a few megs of swap go a long way keeping the system responsive
when the ram gets well loaded.  
 3. Who told you you can't swapon to a regular file? 'man swapon' says 
 otherwise
I can do so on the nfs server.  The fact that it's on NFS interferes, I
guess. The diskless says:
| swapon: swapfile has holes

 4. It's a p4 cpu you have. Cpu throttling is what reduces cpu 
 temperatures in that case, and cpufreqd accomplishes that nicely

 5. How *exactly* are you going to resume from a loop device? AFAIK
 the kernel will unmount such mounts before suspending (but this topic
 is in a state of flux as per many recent conversations on lkml)
I recently was given a laptop with a work battery, and it doesn't
unmount anything when I suspend it to swap.   Hans-Werner Hilse explains
in his response how one might resume from a remote disk.  
 I think you really need
 emerge cpufreqd
 and configure your kernel with the necessary governors etc
I have, but unless cpufreqd disagrees with cpufreq-info as far as
hardware limits:
| slim / # cpufreq-info | grep limits
|  hardware limits: 2.10 GHz - 2.40 GHz
i don't think it's going to do any good.  between 2.1 and 2.4 ghz,
there's virtually no noticable difference (in performance _or_ temp).
I just want to suspend it when it isn't doing anything so it doesn't
make any sound but only takes a few seconds to start up.  

So that's kind of what I was thinking.  
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Suspend to swap on a diskless host

2007-05-23 Thread Hans-Werner Hilse
Hi,

On Wed, 23 May 2007 11:59:23 -0500
Dan Farrell [EMAIL PROTECTED] wrote:

 I know swapon doesn't work on regular files, so to add my swap I need
 to first use losetup to set up /dev/loop0 as my swap device.  Then
 swapon /dev/loop0 works.  but how can I enable swap on loop0 before the
 initscripts boot (right now I have it done in local.start).  Don't I
 need to be able to mount the swap as swap right away to resume from
 it?  Or will it be enought to specify the location?  If not, is there
 some way to specify loop settings at boot time, on the kernel command
 line?  

Check out userspace suspend (http://suspend.sf.net/). It's not in
portage, but will do what you want since you can resume from an initrd.
In the initrd, you can open a network connection, mount all that stuff
(you never told where that looped file is located, so I guess it's on
r/w NFS) and then resume. It's not implemented at the moment, I think,
but should be easy to add (remote suspending is mentioned as an
easy possibility).

-hwh
-- 
[EMAIL PROTECTED] mailing list