setterm -blank 1 -powerdown 1
setterm -blank 1 -powerdown 1
Do it in console, since setterm needs to write to standard output a character string that will invoke the specified terminal capabilities. One command is effective to all tty.
T
Newsgroups: gmane.linux.debian.user Date: Mon, 30 Oct 2006 20:56:56 -0500
> >> I'm wondering how I can configure my console screen energy saving time. > >> ie, when my PC is left with tty screens. > >> > > man setterm > > /usr/bin/setterm > > Thanks, I tried > > setterm -powerdown 1 > > but nothing happened, even after 2 minutes. >
the man page for setterm under -powerdown says:
If the console is blanked or the monitor is in suspend mode, then the monitor will go into vsync suspend mode or powerdown mode respectively after this period of time has elapsed.
So: before the -powerdown time comes into effect, the monitor must be in blank. It will then go into vsync suspend. It will then go into powerdown.
You need to also set -blank
Douglas Tutty
AUTHOR: Ken Moffat <ken@kenmoffat.uklinux.net> DATE: 2005-06-15 LICENSE: MIT License
DESCRIPTION: With processors that support it (e.g. recent athlon64, many laptop processors), you can reduce the processor frequency, to reduce wasted energy or conserve battery power.
PREREQUISITES: 2.6.9 or later kernel, the bootscripts target LFS-6.1
Frequency scaling is an important part of increasing the battery life of notebooks, but it also has a place in reducing power consumption, and thus waste heat, on desktops and servers. Most CPUs that support it will have at least two valid frequency/voltage settings, e.g. my athlon64 Winchester 3200 (2.0 GHz) can run at approx 1.0 GHz, 1.8 GHz, and 2.0 GHz. Give the ondemand governor a heavy load and the speed quickly ramps up. After the load has fallen back, the speed will first fall to 1.8 GHz and then some seconds later to 1.0 GHz.
The kernel began by offering 'powersave' (slow) and 'performance' (fast) drivers, with a 'userspace' alternative to allow a daemon to dynamically change the frequency. As of 2.6.9, an 'ondemand' driver was made available. Other demand-based governors, such as 'conservative', have been introduced in later kernels.
Meanwhile, the powernowd daemon was developed, see http://www.deater.net/john/powernowd.html - this will dynamically change the frequency as the load goes up and down.
It would seem that the 'ondemand' driver makes powernowd redundant, but some CPUs (like the ppc 7447) apparently have a very high transition latency which causes the ondemand governor to decline to manage them - on my 7447A the powersave and performance drivers ('governors') work, but trying to install 'ondemand' fails. Equally, on a laptop powernowd will probably be a little quicker at dropping the speed, and can therefore give a little more battery life.
On x86 and x86_64 it appears that your bios has to support frequency scaling (typically labelled Cool'n'Quiet on boards with AMD CPUs) - after upgrading to a new mobo/cpu, I lost the ability to use both the 'ondemand' governor and powernowd until I configured the bios properly.
On the Processor menu, select CPU Frequency scaling
Set the Default CPUFreq governor to userspace (the default is often 'performance')
Select the governors you wish to use, typically 'performance', 'powersave', and try 'ondemand'. Feel free to select any other available governors. I assume most people will want to build these governors in, rather than compiling them as modules.
Select the correct cpu-freq hardware driver (on a mac there is nothing further to select, on x86, choose from POWERNOW_K7, POWERNOW_K8, SPEEDSTEP_CENTRINO, and similar options).
After you've booted the new kernel, you can test which of the kernel governors work. As root, echo the governor name to /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - presumably, people with SMP boxes need to try this for each CPU. Then test the status of the command, e.g. with 'echo $?' - if the governor loaded, the status will be 0 and you can use that governor, otherwise the status will be 1.
You can view the current CPU frequency in /proc/cpuinfo. To test the ondemand or other variable-speed governors, run something "expensive" (e.g. untar the gcc .bz2, or do a big compile) and repeatedly check the spead in the cpuinfo file. You should find that it ramps up shortly after the load starts, and falls back a few seconds after the load drops. [ BUT, if you are in an xterm on a kernel > 2.6.12-rc5, see the ignore_nice line in my bootscript below. ]
If one or more of the demand-based governors works for you, you're almost done, you just need to ensure the appropriate governor is loaded after you boot. For my desktop box (athlon64) I use the following :
cat >>/etc/rc.d/init.d/cpufreq << EOF
#!/bin/sh
. /etc/sysconfig/rc
. ${rc_functions}
case "${1}" in
start|demand)
boot_mesg "Enabling ondemand cpu frequency"
echo ondemand \
>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
boot_mesg "ignoring niceness for ondemand"
echo 1 \
>/sys/boot/devices/system/cpu0/cpufreq/ondemand/ignore_nice
;;
powersave)
boot_mesg "Enabling powersave cpu frequency"
echo powersave \
>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
;;
performance)
boot_mesg "Enabling performance cpu frequency"
echo performance \
>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
;;
*)
echo "Usage: ${0} {start|demand|powersave|performance}"
exit 1
;;
esac
EOF
chmod 754 /etc/rc.d/init.d/cpufreq
ln -s ../init.d/cpufreq /etc/rc.d/rcsysinit.d/S45cpufreq
Note that this allows me to set powersave or performance if I ever wish to, and that I just install this in rcsysinit.d so there is no 'stop' option.
The 'ignore_nice' ensures the old behaviour of ondemand for kernels newer than 2.6.12-rc5 : without this, anything I start in an xterm has a niceness of 10 and the kernel doesn't allow it to influence the cpu frequency.
This is based on 0.96. Untar it, you'll notice the Makefile is described as -very- simple. Unfortunately, it installs into /usr/sbin - on a laptop, you probably want to bring it up as part of the boot process, so I think it belongs in /sbin. The easy way to do that is
make && install -m 755 powernowd /sbin
There is an example powernowd.init in the package, which could be adapted for the bootscript, using variations of "dyn" (dynamic), "low", "high" - I go with something a little simple - dynamic frequency control at all times:
cat >>/etc/rc.d/init.d/powernowd << EOF
#!/bin/sh
. /etc/sysconfig/rc
. ${rc_functions}
case "${1}" in
start)
boot_mesg "Starting powernowd"
loadproc /sbin/powernowd
;;
status)
boot_mesg "Starting powernowd"
statusproc /sbin/powernowd
;;
stop)
boot_mesg "Starting powernowd"
killproc /sbin/powernowd
;;
*)
echo "Usage: ${0} {start|status|stop}"
exit 1
;;
esac
EOF
chmod 754 /etc/rc.d/init.d/powernowd
ln -s ../init.d/powernowd /etc/rc.d/rcsysinit.d/S45powernowd
ln -s ../init.d/powernowd /etc/rc.d/rc0.d/K45powernowd
ln -s ../init.d/powernowd /etc/rc.d/rc6.d/K45powernowd
Barry Shilliday for bringing the scaling_governors to my attention in an article in PC Plus magazine.
Eric Piel for explaining how to restore the old behaviour for the ondemand governor.
2005-07-12 First version.
Updated versions of this hint may be found at http://www.kenmoffat.uklinux.net/hints/
documented on: 2005.09.12
Newsgroups: gmane.linux.debian.user Date: Mon, 2 May 2005 16:55:06 +0800
> I have AMD Sempron 2200 processor on ASRock motherboard. my linux box > is debian-sarge. I have found some utilities to cool down the > processor temperature. some utilities warn having a performance loss > like *noisy sound*, *poor hard-disk response*, etc. etc. may happen > during its operation. > > could any user having such processor and colling utility please tell > me the *best* utility which I can use in my system ?
There is a Linux utility called Powernowd which I'm using on my notebook. It slows down processor speed to 20% of normal when there is little load, but automatically takes it up to 100% when demand requires. I find it very useful, and have not noticed any appreciable slowness in performance. As for how useful this is, I find that my cpu temperature is 60 degrees Celsius without Powernowd, and 45 degrees Celsius with it. So this is a major improvement.
From apt-cache show powernowd:
Description: control cpu speed and voltage using 2.6 kernel interface This simple client controls CPU speed and voltage using the sysfs interface to the CPUFreq driver in v2.6 Linux kernels. It does not depend on APM or ACPI, and it doesn't try to do anything other than control the CPU.
The name is somewhat misleading, as any CPUfreq capable processor will work, not just those from AMD. However, it works better on CPUs that support more than two speed steps, like those with AMD's PowerNow! or Intel's Pentium M series.
This daemon is less complicated than cpufreqd or cpudyn, at the cost of absolutely depending on a 2.6 kernel with the userspace governor and sysfs support enabled.
Robert Storey
> This daemon is less complicated than cpufreqd or cpudyn, at the cost of
Or you can just use the 2.6 kernel ondemand cpufreq governor.
Micha Feigin
Newsgroups: gmane.linux.debian.user Date: Wed, 9 Feb 2005 19:34:49 +0200
> > I have ACPI installed and apparently functioning (it turns my monitor > > off). I have a 2.6.10 kernel and KDE 3.3 > > > > In windows, I have a little set of toolbar buttons that include: > > power off monitor > > sleep (power off disks and monitor) > > hibernate (disks and monitor off, idle processor at 1/8 speed, fan off) > > > > Is there a ready-made equivalent for linux? > > There is a "hibernate" package in debian that supposedly does software > suspend. You apparently need to patch your kernel to use it so I don't > know if that's what you want. It's all still a bit touch-and-go it > seems, but it might work for you. > > Wim
Try this:
andras.lorincz
Newsgroups: linux.debian.user Date: 2002-12-05 11:20:14 PST
I would like to cool my CPU in the same way CPUIdle does it under windows : using the Hlt instruction when the CPU is idle. As far as I know, it's possible to achieve this under linux with apm or acpi, but I have never succeded.
I am running a Debian unstable, kernel 2.4.19-k7 (binary package) with an Athlon XP 1700+ on a MSI K7T266 Pro2. I first tried with apm, loading the module with the following options: apm power_off=1 idle_threshold=90 This seems to work fine for the poweroff function, but that's all. I was expecting to see a process "kapm_idle" running, but it never happened. And looking at the sources of apm, I came across this:
1.16: Fix idle calling. (Andreas Steinmetz <ast@domdv.de> et al.)
Notify listeners of standby or suspend events before notifying
drivers. Return EBUSY to ioctl() if suspend is rejected. …
Daemonize now gets rid of our controlling terminal (sfr).
CONFIG_APM_CPU_IDLE now just affects the default value of
idle_threshold (sfr).
Change name of kernel apm daemon (as it no longer idles) (sfr).
So it seems that apm no longer idles: how can I do it then?
I also tried with acpi. Here, I have no clues of how to make idle calls to the processor. The acpi modules can be found in
/lib/modules/2.4.19-k7/kernel/drivers/acpi/
From what I have read, ospm_processor.o seems to be the one I need, but if I simply load it, nothing happens… I didn't find any documentation about these modules (and I don't know what parameters they can take).
Thank you very much if you can help with this problem!
My CPU is more than 20^C over the motherboard's temperature when I run linux (that is 60^C, sometimes 65^), while it's only 3/4^C under windows and a software cooler (dropping to 35/40^C)! And I can't afford to change my CPU Cooler just now…
This doesn't really answer your question, I'm afraid, but might help you search more precisely.
The linux kernel issues the hlt instruction when the system is idle. You don't need to install anything extra. In the kernel's boot messages, you should see a line like "Checking 'hlt' instruction… OK." (unless you booted the kernel with the "no-hlt" parameter, which I'm sure you didn't).
The APM sys idle support is a little different, and is controlled by the CONFIG APM CPU IDLE kernel compilation option.
Vineet
> I would like to cool my CPU in the same way CPUIdle does it under > windows : using the Hlt instruction when the CPU is idle.
Linux does this by default. Please don't assume that Linux repeats the same broken mistakes Windows does, as this is almost never the case.
> * Daemonize now gets rid of our controlling terminal (sfr). > * CONFIG APM CPU IDLE now just affects the default value of > * idle threshold (sfr). > * Change name of kernel apm daemon (as it no longer idles) (sfr). > > So it seems that apm no longer idles: how can I do it then?
That's laptop specific; while desktop systems can do this, too, the power savings and heat dissapation is epsilon on desktops compared to what linux already does.
Just to clarify: HLT is a CPU feature standard on i386 architecture, not an APM or ACPI feature.
> My CPU is more than 20?C over the motherboard's temperature when I run > linux (that is 60?C, sometimes 65?), while it's only 3/4?C under wi ndows > and a software cooler (dropping to 35/40?C)! And I can't afford to > change my CPU Cooler just now...
This would presumably be due to Linux not using the BIOS unless it can't possibly do something on it's own, wheras Windows depends on the BIOS for every little tiny detail. Hence the need for drivers for large hard drives on older systems under Windows, but not under Linux, among other details.
About the only way you can narrow that gap down a bit under Linux is to start investing in water cooling, though this is serious overkill unless you're overclocking. I used to have 30C differences between the system and CPU temps before I got into overclocking, though both temps were still well inside spec. I got a Koolance case and overclocked the CPU by about 25%. The water cooling is still overkill when overclocking this little, my CPU is only about 4C warmer than the system temp while mostly idle.
For those interested, I pull around 225 frames per second, never lower than 30 and never greater than 325 in UT, depending on system load.
Paul Johnson
> Just to clarify: HLT is a CPU feature standard on i386 architecture, > not an APM or ACPI feature.
The previous package lvcool has a nice readme to it that explains how the ACPI C(123) states can help and work much better than a simple HLT. ACPI is a really cool thing, if completely implemented.
Bad thing: I have an Athlon with the problems mentioned in the readme file and I don't want to risk it :-/ OTH, I do not have a overheat problem, either. If I do, I can still use throttling.
Hendrik Sattler
>Won't help you much with Athlons. Get lvcool from >http://people.debian.org/~blade/testing/.[]
Thank you very much. lvcool seems to work fine with my motherboard. Right now, the temperature of my CPU is only 28^C instead of 45^ (with the case open)! That's great!
Olivier Guyotot
Newsgroups: comp.os.linux.setup Date: 2000/05/13
>As, like many, I've got the computer running all the time, I would like >to activate some power saving modes, have the monitor go on standby, >etc. I found apm, which seemed simple enough from the man page >description, but when I do > > apm -s >or > apm -S > >(in console mode as root, as it's not accessible from a user login) >nothing seems to happen. I would probably have to set it to run from a >configuration file, but I can't find this explained anywhere, nor does >the KDE Desktop properties (or any other utility that I could find) give >access to power management.
APM is primarily for laptops. My laptop has ACPI instead of APM. apm -s does put it into a deep suspend, but apm -S (standby) does not work.
>For the time being, I'm experimenting with BIOS level power management >settings, but there has got to be higher level access, no?
See 'man setterm' for console power saving. I forget exactly how to do this in X, but it would be a setting in XF86Config.
Use hdparm to spin down drives that are idle, although, your primary drive may never spin down due to logging and other things going on.
David Efflandt
Newsgroups: comp.os.linux.hardware Date: 1996/06/08
: I remember once reading that Linux will do/not do a certain instruction that : pretty much shuts down the processor when idle. This was in contrast to : Win95 that continues to cycle tthe processor. : In other words, after three hours of being idle, Linux kept the processor : cold to the touch, while Win95 has it hot to the touch. : Was this a simple instruction? One that might be implemented in a Win95 : screensaver?
When Linux has nothing to do it executes the HALT instruction which stops the CPU cold. It wakes up again on the next interrupt.
When Win95 has nothing to do it sits in a busy loop polling. If you were to put a HALT instruction in a Win95 application it would freeze the machine and you would have to push the reset button to get it back.
>: >When Linux has nothing to do it executes the HALT instruction which stops >: >the CPU cold. It wakes up again on the next interrupt. >: > >: >When Win95 has nothing to do it sits in a busy loop polling. If you were >: >: Any kernel hackers want to comment on just how this is able to work? I >: for one can't figure out how if you halt the CPU, how it can wake >: up again. How is Linux able to get away with this? > >As far as i know the cpu wakes up when it recieves an interupt. On the >PC this happens at least as often as every timmer tick.
That is correct. The HLT stops the processor cold until an enabled interrupt (or NMI) or RESET signal is received.
Garrett P. Nievin
> > When Linux has nothing to do it executes the HALT instruction which stops > > the CPU cold. It wakes up again on the next interrupt.
True. HLT puts newer processors into the auto halt power down state, where they need only 15% of the power. The HLT state is left on any interrupt. Because there are at least timer ticks, the CPU doesn't freeze completely.
If you disable interrupts and even NMIs (via the CMOS port), and then do a HLT, then your machine will not wake up again until an INIT or RESET, asserted to the processor pins.
> > When Win95 has nothing to do it sits in a busy loop polling.
Unfortunately. But there is a program called POWER.EXE coming with MS-DOS, which also has this HLT stuff to save power. Maybe installing APM functions in Windows also installs such a HLT task. I don't know from head.
> Any kernel hackers want to comment on just how this is able to work? I > for one can't figure out how if you halt the CPU, how it can wake > up again. How is Linux able to get away with this?
Because of the timer ticks, which cause interrupts.
> Is the halt sort of like a "soft reboot" where the kernel is set up > to intercept the starting address or something? (The intel procs > are set to jump to ffff:fff0 or some such when the system first > boots, IIRC.)
No. The auto halt power down state is not a seperate operation mode. It just disables all unused parts in the CPU, which anyway is stopped by the HLT. Why waste energy, while the processor anyway waits due to the HLT?
> IMHO this would be something nifty on the kernel hackers' guide page > or what have you :).
There is nothing secret about the HLT. All this behaviour is described in full detail in the iPentium manuals.
Christian Ludloff
> I can set suspend mode in the BIOS to thirty minutes, but then when the > processor goes into standby, the clock stops. Makes sense but is a > terrible side effect. This is in both Win95 and Linux. Would it be a > BIOS function to allow the clock timer to continue?
To be correct, the kernel's internal clock stops. However, the bios clock (aka hardware clock or CMOS clock) does not so all you need is to update the kernel clock from bios after resume. This is done automatically if you enable the apm_bios in linux (available since 1.3.37 or so), assuming that your bios implements apm (if it doesn't you'd still be able to set the clock, see clock(8), but you wouldn't get notified about resume events so you'd have to do some kind of polling). I don't have the faintest idea about Win95 but then I'm not answering to the Win95 newsgroup either ;).
Gabor J.Toth
Newsgroups: comp.os.linux.portable Date: 2002-08-11 07:08:21 PST
> I'd like to ask how suspend/standby/hibernate works on the various > systems people are using.
IBM Thinkpad A22p, suspend-to-RAM works great, never used suspend-to-disk. Suspend-to-RAM worked fine on the previous laptops I've owned, Thinkpad 380D and 600X. I tested suspend-to-disk on both the 600X and A22p, it worked fine, but I never had any use for it.
> It seems to be loosely equivalent to Windows' 'standby' function in > that it needs power - eventually the battery will die if you leave it > that way long enough.
A modern laptop will stay in suspend-to-RAM for between 48 and 72 hours before running out of battery power. That should be long enough for almost any purpose.
> What I would really like is something equivalent to the Windows > 'hibernate' feature Is there any way to do this? (Omnibook 500, RedHat > 7.3)
Suspend-to-disk is typically controlled by the machine's BIOS, not the OS at all. On most laptops, a special "hibernation file" is written to the first FAT32 partition, and the location of that file on disk is written to NVRAM using super-secret BIOS calls. All this requires a laptop-specific DOS utility. Another super-secret BIOS call (typically activated by pressing Fn-F12 on the keyboard) traps the CPU, and a BIOS routine takes over and writes the contents of RAM and the processor state into the hibernation file, then sets a flag so that the next time the power's turned on, the thing restores its state from the file instead of going through normal bootup.
Getting this to work right requires some tweaking in most cases. An alternative is the "swsusp" patch to the kernel, which will work regardless of whether the laptop's native suspend-to-disk capability will.
Matt G
I have a rebranded Clevo laptop (http://cpbotha.net/my_laptop.html) that is almost exclusively ACPI. Suspend to ram does not work yet (I'll explain more later) but I use the swsusp patches (link on my laptop page) to "hibernate" to disc. This works perfectly on my setup.
> Suspend-to-disk is typically controlled by the machine's BIOS, not the > OS at all. On most laptops, a special "hibernation file" is written to > the first FAT32 partition, and the location of that file on disk is > written to NVRAM using super-secret BIOS calls. All this requires a
This is not so true anymore. This used to be the case with most older laptops (and some of the newer Thinkpads and Dells) but the move to ACPI is changing all of this. With ACPI, far more of the responsibility of suspending/resuming is left with the OS. In linux, this support is still fledgeling. When it's complete, however, it will offer far more fine-grained control than ever possible with APM.
I know that ACPI suspend-to-ram S1 works on many laptops already. S3 suspend to RAM works on far fewer and is only available on the 2.5.x kernels. S4 suspend to disc is not implemented at all, but the software suspend patches (swsusp) represent a big step in the right direction.
charl p. botha
> None of those work for me. When I switch the power back on, the > screen comes back, but the machine remains hung up. Quite > annoying. I tried many fixes, but nothing helped. > > Dell Latitude CPi 266 > Red Hat 7.2 > APM
Dell Latitude CPi D330XT, APM suspend to ram works via Fn-suspend, pressing power button to resume, or just closing the lid, reopen to resume. I have to turn off apm calls during cpu idle or the machine will reboot after about 20 minutes of use. Haven't tried suspend to disk yet.
Jerry
> > Dell Latitude CPi D330XT, APM suspend to ram works via Fn-suspend,
> Is that with Red Hat?
Slackware 8.0 with a custom built 2.4.16 kernal using pcmcia-cs, not the kernel pcmcia.
Jerry
IBM Thinkpad A21m
I don't do anything with APM, I only press Function+F4. It goes to standby fine, but the time also stops.
> Function+F4. It goes to standby fine, but the time also stops.
This is not tough to fix. However, we need to know which distro you're using, since the apmd_proxy script lives in different spots depending on distro. In SuSE, it lives in /usr/sbin/apmd_proxy and most of its environment variables are set in /etc/sysconfig/powermanagement (in 8.0, 7.x had the env. variables in /etc/rc.config or directly within the proxy script.) In Redhat, it lives in /etc/sysconfig/apm-scripts/ apmscript , and the env. variables are in /etc/sysconfig/apmd .
In SuSE, set the APMD_SET_CLOCK_ON_RESUME varaible to "yes". In Redhat, set CLOCK_SYNC to "yes". Then when apmd receives a "resume" event, it'll execute "hwclock —hctosys", and the time will be (mostly) correct on resume. HTH,
Matt G
Newsgroups: alt.os.linux.mandrake, comp.os.linux.misc Date: 2000/07/22
I am running Mandrake 7.1 on my machine ( AMD Athalon 650 +128M+30G )
I am also running apmd with what ever standard configuration provided in /etc/sysconfig/apmd I have also enabled my BIOS power management settings
I have noticed that after about 20 mins of idle time my machine goes into standby but it wakes up when I do something like moving the mouse or pressing any key.
But recently I had noticed that if I leave it idle for a longer time even the power LED goes out and I cannot revive it by any of the above methods . ( though the CD drives work fine and I can here the fans inside )
I had to reboot my machine. after it started up I noticed the following line in /var/log/messages
>Jul 21 09:50:10 hobbes apmd[360]: System Suspend
What is happening here ? is there a proper way to revive it from its deep slumber (with our rebooting) and should I be concerned about any hardware or settings fault. ? I don't have windows on my machine so I have no way of checking if I am alright otherwise!
Any comments will be appreciated ..
Anil
> Usually apmd is only recommended for laptops. You don't usually use it > for a regular PC, because it puts everything to sleep including any > network. When a machine goes into suspend, mouse movement will NOT awaken > it, but any keypress should. What does the owner's manual for your > computer say about suspend? > > David Efflandt
My motherboard manual briefly describes my BIOS APM settings, it talks about the Suspend timeout settings and boot up based on the network card access. but nothing about waking from suspend without booting up again.
All I wanted was to have some way the system goes into some sort of low power mode after some specified period of inactivity . Since I am running linux I wanted to keep it up 24x7 and hopefully access it over the network.
yesterday I had tried using kapm a applet interface to apm . I could not wake the system up after intentionally suspending it through that either.
I will still do some exploring and see if I can figure out anything useful.
Thanks again
Anil
Newsgroups: comp.os.linux.misc Date: 1999/04/13
> I'm having a weird clock problem with my laptop running RedHat 5.2 and > the 2.0.36 kernel. > > When ever I leave the maching idle, eight minutes later the clock will > stop. > > The only thing I am using that might be clock related are APM support > and Real Time Clock support in the kernel and an X/AfterStep app called > asclock (not as root.) Only root is able to set the clock. > > Does anyone have any idea what is going on here?
Yep, your CPU is napping (which it should do on a laptop).
There are two (well, more, really) clocks in Linux: one is the obvious hardware clock, the other is a software clock. The software clock gets incremented 100 times a second at each interrupt. Since reading the hardware clock is relatively slow, when you call the various functions to get the time, it uses the software clock.
The problem here is that your laptop is entering 'standby' mode, and in the process, putting the CPU completely asleep. (Normally standby just does some power reductions to conserve power without knocking out the CPU, but some laptops are weird. Actually, they all are.)
Since your CPU is comatose, it's not going to care about the timer any more, and those 100'ths of seconds will merrily roll past it. That's sort of against the point, eh?
So how to fix it?
See http://www.wpi.edu/~jmhill/LinuxPage/apmdoc1.html for what to do (a simple kernel patch that makes standby mode act more like suspend mode in dealing with the clock).
Brian Moore
Newsgroups: comp.os.linux.misc Date: 2001-10-24 09:35:56 PST
> I would like to eventually implement some power-saving scheme in every > night to do my part for the environment. > Please help.
Some machine BIOSes have a Wake Up feature that you can enable. It automatically starts the machine at a given time. You can also enable the power saving mode of the monitor/system unit and add "Wake on Lan" capable NICs. If done correctly, PCs in sleep mode draw very little power.
There's also the possibility of X10 devices. I don't know if the price/savings will be worthwhile, but you can use them to shutdown machines that don't have the power saving features.
kwan
> I have a network of 10 machines and I leave them on all the time, even > during weekends when no one is using them. Is there any way for me to > automatically power them down on Friday night and power them up in the > right sequence on Monday morning in order to save some power? What do > you all suggest I do to save power?
apmsleep - go into suspend or standby mode and wake-up
later
...
crontab - maintain crontab files for individual users (V3)
...
Lee Sau Dan
Newsgroups: comp.os.linux.networking Date: 2001-07-27 13:51:24 PST
I'm using kernel PPPoE with the patched pppd-2.4.1 under kernel 2.4.7. That laptop shares the adsl connection with a w2k laptop using IP masquerading. I would like the internet connection always to be available to the win box, without my having to monitor it, and ideally surviving putting the "server" laptop on suspend and then waking it up. I tried the "persist" option to pppd today, but it didn't quite do it for me, as pppd itself seemed to die, but left the ppp0 interface up, albeit unresponsive (no internet connection). I suppose the next thing to try would be to have init respawn pppd, but I seem to recall seeing someone advising against it. In addition, I might have to have apmd do some acrobatics.
As I'm sure many people here are doing exactly the same thing, I'd appreciate hearing some opinions. Thanks!
David Bragason
You cannot have it survive suspension. The other end will notice no connection and kill the connection. Use something like demand or the program diald which reconnects when there is some traffic to send.
Bill Unruh
I suppose the first thing to determine is why is the connection terminating. Is it the result of the device just becoming idle and hence the network connection is dropped. If it is, then a small cron job which starts up every 10 minutes or so and pings a couple of sites should fix the problem.
If it is a case of the power management aspects like the machine going into standby/sleep mode, then you might want to check the BIOS and see whether APM support is enabled. If it is, you might like to adjust the settings, or if possible, actually turn the support off so that the laptop runs all the time.
Have you been able to work out whether it is the remote end which terminates the connection or is it the local end ?, it seems strange if the ppp0 interface continues to live but there is no connection. Almost sounds like power management might actually be the problem in this case.
Dean Thompson
Thanks for the replies. The reason I mentioned apmd is that I actually want to use suspend, and have the internet connection instantly available when it resumes. That way I can tell the person using the other computer just to make sure my computer is awake, and then there will be a connection.
Just using pppd with "persist" I find it survives a suspend/resume of a few minutes, but not a few hours. What happens is the pppd process is dead, ppp0 up but dead, and another invocation of pppd ifconfigs ppp1, and things gets screwy.
I don't really like the idea of a cronjob either, as that way the connection might stay down for a few minutes. I've instead settled on having pppd persist running from boot time on, but apmd taking it down and starting it again via suspend/resume scripts. I hope that works nicely. These suspends are all user initiated, by the way, as I don't want the system to be permanently connected (crackers…)
David Bragason
> Hmm, I didn't know that it was possible to actually put a machine into > suspend and have the PPP session survive. The only thing that I could > recommend is to check to see whether or not the apmd daemon actually > invokves any scripts when a system is revived from its standby period. If > it does, you might want to actually issue a "service network restart" > command to restart all the network services. I just don't think everything > would be happy with networking being there, going to sleep and then waking > up. Surely, connections in the system or cache memory in a switch/router > might expire during that period. > Dean Thompson
I think I've got it now. It seems best to use pcmcia-cs's own apm support, and I've taken apmd away altogether, as it didn't play in harmony with pcmcia-cs (my SuSE apmd assumed pcmcia had no apm support), but mucked the interfaces up instead. Now the /etc/pcmcia/network script (with arguments "suspend" and "resume") takes care of pppd. Compiling pcmcia-cs with apm support seems to take care of the interfaces themselves (eth0 and eth1).
David Bragason
Newsgroups: comp.os.linux.redhat Date: 2001-11-26 02:16:28 PST
There's a strange problem that I'm facing with my RedHat 7.2 Server. It runs services like ssh, httpd and ftp.
Many times it happens that when the Server is left in disuse for some time, it refuses connections to remote clients on all the services. When I go and do anything on it (like simply logging in and logging out), its starts behaving properly.
I suspect that it may be because of the power-saving mode. Could anyone please point out something that can be done about the situation? Is there any way to bring it out of poersaving mode remotely? (If the cause is indeed power-saving)
Tahir Hashmi
> You might consider turning off APM in the BIOS. > > [snip] > >situation? Is there any way to bring it out of poersaving mode > >remotely? (If the cause is indeed power-saving) [snip]
I don't want to turn off power-saving. It would be good if somehow requests for remote connection would bring the Server out of power-saving. Otherwise, I'll have to turn it off anyway :(
Tahir Hashmi
Newsgroups: comp.os.linux.setup Date: 2002-09-28 10:05:23 PST
> > RH 7.2 installs apmd during a desktop install. Since I often find that > > apmd is the source of problems (such as shutting down my NIC at > > inopportune times), I stop it and prevent it from autostarting. > > But if I were to take the time to get beyond the problems it causes > > without turning it off, is apmd useful on a desktop? Forgive me if the > > answer is obvious.
> If your machine needs to be on 24x7 (firewall, router, web server), then > there's probably not much point in apmd, since you'll have disabled the > BIOS's suspend/standby features, and apmd will never get triggered.
My system is up 24x7 but is inactive for much of that time. However the network must always be up for remote login.
> But if your machine's just your own personal workstation, you might want to > make use of APM's standby/suspend modes for the reduction in power > consumption, potential for lowered noise from drives and fans, and/or the > convenience of resuming from suspend instead of doing a > shutdown/reboot.
It's just a personal workstation and I'd like to reduce power consumption, but the network gets hosed when apmd is running. I have not found any way to get the network back short of rebooting.
After my post, I began to look around the sysconfig directory. I don't know how I missed it the first time, but I now discovered a switch in /etc/sysconfig/apmd that may keep apmd from messing with the network. I'll give apmd another try with that switch turned off.
Precept
Newsgroups: comp.os.linux.networking Date: 2002-09-28 07:24:18 PST
> The indications I get are that when the monitor goes into powersave mode, I > loose ip forwarding functionality. When I hit a keyboard key, my connection > returns.
It's most likely the apmd daemon. Edit /etc/sysconfig/apmd and find the lines
NET_RESTART= NETFS_RESTART=
For a server, you want these to ="no"
Rex
> when i run 'top' i find a process called 'kapm-idled' taking up a lot of > CPU usage .. upto 90+ % ! and i cant kill it.
kapm-idled is merely a daemon that graps all free CPU time and runs instructions to help keep the CPU cool. So if you system is not doung much, kapm-idled is supposed to use a lot of CPU.
This little utility will cool your Athlon/Duron processor on Via KT133 or KX133 (VT8363 or VT8371/VT82C686x) chipsets during idle.
It seems that a simple HLT instruction will halt a Athlon/Duron but it will not put it into a low power mode.
Even setting the Bus disconnect bit in the Northbridge is not sufficient because the Northbridge will only take action if the CPU is in the STPGNT state - a mere HLT just isn't enough.
|
|
the AMD 761 Northbridge has an option for disconnecting the bus on HLT. To put the CPU into the required STPGNT state you'd have to utilize an ACPI register in the Southbridge. |
Date/Time: 07/30/1997 16:29:30
> In your opinion, what would be the way to keep the my cpu cool.
By: David Risley Monday, May 31, 1999 07:26:23 PM EST
http://www.hardwarecentral.com/hardwarecentral/tutorials/24/1/ http://www.hardwarecentral.com/hardwarecentral/print/24/
Back in the 386 days, if you had cooling facilities for your processor people would have thought you were nuts. Today though, cooling is a very important issue. There are several ways to cool the processor, and I will try to discuss each of them here.
With the 386 processor, there wasn't a need for a special cooling system. The chip was slow and did not have many transistors, therefore the air flow from the power supply was enough to cool the chip. With the release of the 486, cooling became an issue. With the slower 486s, it wasn't a really big deal, but with the 486DX-66, cooling was an issue. This clock doubled chip got pretty hot. From then on, chips ran faster and hotter. All chips used today require a special cooling system. How much cooling depends on the processor, the case, and the type of cooling system you are using.
The type of processor is the biggest variable in the amount and type of cooling needed. For example, the Cyrix 6x86 is a nice Pentium alternative, but runs much hotter than the Pentium. Run-of-the-mill fans could not keep it cool enough, so Cyrix had to design a special heat sink and fan to keep the chip cool.
A processor that is not cooled enough will show some strange errors. Every processor has a safe range of temperatures that it can handle. Once the temperature gets above that point, one will usually see random error messages. Many times, one will not suspect that cooling is the problem because the error will seem to be coming from another part. Common errors are system crashes, lockups, and surprise reboots. It can also have program errors and memory errors along with many other things.
Most cooling hardware is designed for the AT case. The AT design is very poor when processor cooling is concerned. An independent cooling system is required. In the AT design, the processor is far away from the power supply. Also the fan blows out of the system instead of in, so there is not much of an air flow inside the case.
With the ATX design, the processor was placed near a power supply that blows air directly over the chip. This, for the most part, eliminates the need for a CPU fan. However, it's a a matter of comfort. If you don't feel like it provides enough air, you may want a CPU fan to help. For most cases, though, a passive heat sink is enough.
There are alarms that can be installed in a system to let you know if anything overheats or if the CPU fan fails. If it anything goes wrong, it beeps, or buzzes. One such solution is the FireAlarm. For info, check out http://www.gsconline.com.
http://www.megagames.com/news/html/tweaks/cpucoolv620.shtml http://www.megagames.com/news/show.cgi?&idtype=tweaks&database=74§ion=downloads&
Under many operating systems like Windows NT and Linux the CPU issues an HALT operation when there is nothing to do. That enables a CPU build in functionality that reduces the power consumption. That keeps the CPU cool and saves money. If you overclock the CPU it is advisable to use such a program as the CPU gets hotter as specified.
Unfortunately there is no HALT operation under Windows 95 / 98. The CPU permanently checks whether there is something to do or not. Many other programs like CPUCooL put in a task at low priority which issues a HALT instruction. But it costs time to make the new program run.You can see these programs work with the Microsoft WinTop Monitor. It shows 100 % activity although there is nothing to be done by the CPU.
CPUCooL has an other technique to solve this problem. Look at WinTop and you see the difference. Wintop shows the normal idle time as before. CPUCooL integrates the HALT operation directly into Windows 95 / 98.
The other advantage is that you can only switch off this cooling function by CPUCooL. There is no other way. Even if CPUCooL is terminated the cooling functionality is still alive!
Features:
NEW ATHLON Cooling
Fine tuning for many PLL's
K6-2/3+ multiplier change
Change the FrontSideBus
With this option you can vary the CPU frequency. Many mainbords support setting the FrontSideBus via SMBus. It is for these motherboards I have added this feature. It is for experienced users only and only at your own risk! Details
Shutdown by simple keystroke
You can shutdown the PC with a single key combination. That makes it easier to end the session. You find this item under Options -> Windows Shudown
MONITORING Temperature, fan speed, voltages for many motherboards. The program displays all units, connected to an I2C Bus. It works with all chipset from Intel, ALI, VIA, AMD, and SIS motherboards. You can see the temperature, voltage and fan values of your motherboard chipset, inclusive dial-up adapter display and processor parameters.
CPU Cooling under Windows 95 / 98 / NT / 2000 (Watch Wintop !) There's No way to switch it off! After registering you can get a small *.VXD (6K Byte) for cooling only. It works so far for all non Athlon processors and for Athlon based system with a VIA8363 and AMD760 chipset.
Benifits: There is No need to turn it on or off, No overhead (CPU Time / Memory) Cooling only, and if you wish to stop using it, you simply remove it from your system! All you have to do to receive it is to register and send the file you could generate by Help -> CPUCooL Info -> Write to file to the author at support@podien.de..
CPU Optimization (AMD, Cyrics and Intel only ;-) )
This is the first and only program that optimizes AMD / Cyrix CPU's complete and correct. All the other tools have bugs which I have detected when implementing my optimizations.
Memory optimization (mostly for Windows 95 / 98)
Reads out the values programmed in the E2PROM of the SDRAM's. Every value is decoded inclusive the SDRAM manufacturer if available.
Newsgroups: comp.os.linux.setup, comp.os.linux.misc Date: 1996/06/16
> I'm running Slackware 3.0 on an AST P-90. My PC has power saving (green) > features built-in to BIOS, such that I can set it power off the monitor and > the hard drive after N minutes of inactivity. This works great under > DOS/Win. However, under Linux the Linux screen blanker activates but my hard > drive and monitor don't ever power down. I don't understand -- since its > part of my BIOS, shouldn't it be independent of the OS I'm running. Perhaps
The monitor is no problem, just add a line to your bootup files:
[user@ravel user]$ more /etc/profile # /etc/profile # System wide environment and startup programs # Functions and aliases go in /etc/bashrc # 4/30/96 Change path to include /usr/sbin; powersave on /usr/bin/setterm -powersave on <---------this one
You can also do powersave under X, a bit more tricky, depends on your video card/chipset.
Hard drive powerdown is effected by hdparm [read the man page]. However, I have not been able to successful configure it yet, because on my system various processes (cron?) write to disk every once in a while and "spoil" the hard disk idle period countdown…
If you or anyone figure out how to do this latter trick, I'd appreciate hearing about it. Cheers, Bob L.
Robert Lynch-Berkeley
Newsgroups: comp.os.linux.misc Date: 2000/05/19
> I'm using a Linux (Redhat) box as a firewall/router. > It sees occasional use as a browser and sits at run > level 3 with a Gnome login for family members. > > Using Gnome I have it set up to put the terminal in > "power save" mode when a user is idle. That is great, > it powers the terminal down such that it takes 10 or 15 > seconds to bring up the terminal on a "wakeup". > > When no user is logged on and the Gnome login screen > is presented the terminal is not really powered down, it > just blanks the screen but a "wake up" is instant. This is > not efficient as the tube is much hotter in the instant wakeup > mode. > > I'm guessing this is a something under Gnome control. > (As the "full powerdown" configuration was done via the > Gnome control panel.) > > How do I get the standard behavior with no user logged > on to be a full power save on the terminal?
One way: if your video chip supports it, add "power_saver" to XF86Config, e.g.:
..
# Video device and screen sections.
#**********************************************************************
...
Section "Device"
Identifier "Intel 810"
VendorName "Intel"
BoardName "810"
# add power saving option
Option "power_saver"
VideoRam 4096
EndSection
...
This single setting gives the defaults, but you can optionally configure the various times to reach full power-saving mode. man 4/5 XF*6Config.
Robert Lynch-Berkeley
View this article only Newsgroups: comp.os.linux.hardware, comp.os.linux.misc Date: 2002-05-25 07:08:37 PST
Leonard Evens wrote: > On two computers running RH7.1, my monitor has been going into power > saving mode after some period of time. I use the gnome desktop for both > with the sawfish window manager. In one I have specified that the > toolbox screensaver section that power saving should be used and I've > chosen no screensaver. It used to go off, but suddenly it stopped doing > so. In the other computer, I have not clicked the power saving button > in my desktop toolbox, but the power saving feature is invoked anyway. > I presume something else is controlling it. > > What controls this feature? > >
man "xset" is what you are looking for and is done like this.
To enable the monitor's Energy Star features.
xset +dpms
To disable the monitor's Energy Star features.
xset -dpms
To have it go into standby mode in 5 minutes and into suspend mode in 10 minutes and does not turn the monitor off.
xset dpms 300 600 0
> What controls this feature? > > An alternative to using xset that David described is to adjust the settings in your X config file. This is usually /etc/X11/XF86Config for version 3 and /etc/X11/XF86Config-4 for version 4.
Find or add the following:
Section "ServerFlags"
Option "blanktime" "10"
Option "standby time" 10"
Option "suspend time" "10"
Option "off time" "10"
EndSection
(If the section exists, you only need to add the option lines. Otherwise, you need to add the entire section, usually near the top of the file.)
Then you adjust the numbers to something suitable for your needs and restart the X server. It works for me using RHL 7.1 and Xfree version 4.
Newsgroups: comp.os.linux.redhat, comp.os.linux.hardware Date: 2002-01-06 12:23:52 PST
> Since upgrading to Redhat 7.2 (Kernel 2.4.9-13), I've apparently > lost the ability to control the power saving modes of my monitor. > Worked just fine with Redhat 7.0 (and earlier). > > Using KDE 2.2-10. > Attempting to set power saving modes from Control Panel. > Also tried to use command-line program called 'dpms'. > > No luck.
Check your /etc/X11/XF86Config-4 file. There should be a line that says
Option "dpms"
in the "Device" section. Why Redhat's X configuration program didn't put that in there, I have no idea, but it needs to be there. Put it in there and restart X, then things should work right.
Also, if you are running X as root (*don't* *do* *that*) then some things like screensavers will not work.
Matt G
Newsgroups: gmane.linux.debian.user Date: 2007-08-23
> My newly installed xorg doesn't support dpms any more: > > $ xset dpms force off > server does not have extension for dpms option > xset: unknown option force > > Which package should I install to get back the functionality?
load/enable the following module,
"extmod" # some commonly used server extensions (e.g. shape extension)
I'm able to use 'xset dpms force off' again.
xpt
> load/enable the following module, > > "extmod" # some commonly used server extensions (e.g. shape extension) > > I'm able to use 'xset dpms force off' again.
But the problem is that none of the dpms setting is working:
xset dpms force standby xset dpms force suspend xset dpms force off
None of the above command has any effect. I'm using the vesa driver.
xpt
Newsgroups: comp.os.linux.x
> > I am trying to figure out how to use energy saving features of the monitor. > > Have you tried the xset options? > xset q gives you the current configuration of your X server. Type xset > or man xset for help. xset +dpms turns on the Energy saving functions. > Use xset dpms [standby [suspend [off]]] to change the settings in secons > for the waiting times till standby, supend or off mode. > > hauke
Besides, you can also set the values directly in the screen section in the /etc/X11/XF86Config file, like this:
Section "Screen"
Driver "Accel"
Device "VVV"
Monitor "MMM"
DefaultColorDepth 16
BlankTime 8
SuspendTime 12
OffTime 20
SubSection "Display"
Depth 8
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
See the above 3 lines of BlankTime, SuspendTime and OffTime?
Note, This is for XFree v3!
tong
Newsgroups: uk.comp.os.linux Date: 2002-09-22 04:28:05 PST
>>Just curious if people in this group leave their systems on >>all the time, or turn them off each day (providing you are not hosting >>a web server etc!) > > The two machines on my desktop are powered up and down, usually > several times a day. And they've lasted since 1995 and 1996, so > if one of them goes now, the saving I've made in power will be > hugely greater than the market price of a comparable replacement.
I doubt it.
Assuming you have an 'average' PC, you've got a 300W switch-mode PSU, rated at ~75% efficiency (most are better, but for the sake of argument, let's say it's not a "good" one). That means the absolute maximum power it will draw is ~400W. Actually this is an over-estimate since PSU's of the day were typically 200W, but for the sake of argument we'll use current figures…
Let's say you use the computer flat-out for 25% of the day, with it idling the rest of the time. I think this is a gross over- estimate - typical tasks are hardly a strain on computers, but again, for the sake of argument…
Let's assume that with the computer running flat-out, it completely maxes out the power suppy (again, an unreasonable over-estimate, but for the sake of argument…) Let's similarly assume that keeping the power flowing takes about 25% of the maximum the PSU can provide… again I think I'm being generous, but …
This means you draw 400W for 3 hours (assuming you sleep at night), and approx 100W that for the rest of the day. You use 100W all night. This is per-machine.
Your daily total of Kilowatt-Hours (kWH) per machine is therefore (3*0.4 + 21*0.1) or 3.3 kwH.
1995 is 8 years ago, so the total kwH since then is 8 * 365 * 3.3, or 9636 kWH. The price of a kWH is currently approx 5p, giving a total figure for the power used per machine of 9636 * 0.05 pounds, if the price of electricity has not risen in 8 years (not true!)
This gives a price for running each of your computers for 8 years of approx. 480 pounds, and this is a gross over-estimate, as pointed out (repeatedly :-)
The figure above doesn't take into account the *difference* between you using the machine, and you leaving it on either - you should really subtract from it how much power you actually used…
Hardly "hugely greater", and if the figures were not over-estimated, I think you'd find it's more like 250 quid.
Pedantically,
Simon. (who leaves his computers on…)
> Hardly "hugely greater", and if the figures were not over-estimated, > I think you'd find it's more like 250 quid.
Well, if the market value of a machine of that age is up to ~50 quid (as it was last time I looked on the uk computer marketplace newsgroup) then by your calculation that's a 400% difference.
> Pedantically,
Quite.
Nick Kew
> I do leave mine all the time, but would like to be able to spin down the > harddrives.
Worth noting that if you are using a journeling filesystem like ext3 or reiserfs then the drives won't be able to spind down using apm and if you spin them down manually with hdparm they will start right back up again.
Stuart Buckland
> >>Hard disk heads can also get dirty, > >>because they don't get accumulated dirt cleaned off on the landing > >>zone when they are powered on/off. > >> > > Heads on a hard disk get dirty?? I don't think so. > > I was curious about that myself. How exactly would the dust get into a > sealed container?
It's present when sealed, I suppose. "Sticktion" occurs when minute amounts of grease that accumulate on the drive heads cause the heads to adhere to the landing zones. When started up, the heads won't fly and the disk gets wrecked. This doesn't occur in drives powered down at least every few months because ridges in the landing zone clean the dirt off the heads.
I have read this in quite a few places, including several times in this group IIRC. Apparently it's a cause of drive failure in long-running servers, but not running one I haven't seen it myself.
Roger Leigh
> When started up, the heads won't fly > and the disk gets
whacked until it works again.
(This is unlikely to damage modern disks, but it should unstick the heads.)
Nix
> I have read this in quite a few places, including several times in
It's true that when turning off a disk that has been running non-stop for years it may not start again, but AFAIK the problem is in the bearings. Over time the lubrication migrates away from the running surfaces and under continual pounding by ball bearings at high temperature the chemical properties of the remainder change to a form of tar.
Dave Pickles