[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tweaking cron for use on laptops

Martin> Unless I intentionally remove the
Martin> cron package form this machine, the hard drive will not
Martin> spin down.

There are a few things that could be modified to facilitate spinning
down the disk. Syslogd is compulsive about writing information to the
disk right away just in case the system crashes. It could be given an
option to buffer. Cron, as you say, is another candidate. Also, (on a
much longer timeline) there are things that can be done in the filesystems.
For example, the last-accessed time of a file doesn't have to be written
immediately, especially if reading a block from the ram cache. Also, when
a disk is spun down it should be put in the "unmounted" state - that is
with all modifications committed to disk before it's spun down, and the
mounted bit cleared in the superblock. The first write should set the
mounted bit when it is spun back up.

Martin> Anyone thought about this?

I doubt it would be much trouble to hack cron. Go for it.

> From: "Karl M. Hegbloom" <karlheg@inetarena.com>
> I've thought about that  too.  A friend of mine  has a  Thinkpad that
> can do  a context dump to  a disk partition, and  start up right where
> you leave  off.

Linux can do that on the Thinkpad, and many other laptops, via APM.
It's really a BIOS feature. My desktop will suspend, but the BIOS
doesn't save RAM to disk so the power stays on.

> I've set my  drives to spin down,  using 'hdparm', but 'update' keeps
> them from  stopping.  There's a patch out,  called 'atime' patch, if I
> recall, that  is  supposed to help alleviate  this.   It says it comes
> with a  script that puts /dev/* in  a ramdisk.  I  haven't explored it
> yet.

That's the last-accessed time. I'd rather defer writing that information
until I know the disk is spinning than put the devices in a RAM disk.

> But what about 'cron'?  It ought  to set an alarm  that would wake up
> the computer just before a job is scheduled,  run the job, and then go
> back  to sleep.

Take that 60-second alarm and make it 60 minutes. See what breaks. Fix it.

> Another thing  I thought  of   is to install  that  screensaver hooks
> patch, and  have the screensaver send a  signal to a modified 'update'
> daemon.

Most of what you need is already in the APM driver.

> I tried to hack in a call to sync(); where the screen gets blanked in
> the kernel, naively.  (Aiieeeeeeeeeeeeeeh!)   Can't schedule during an
> interrupt.

But you can ask kerneld to perform a service for you, and then return from
the interrupt. It will get there in a second or two.

Bruce Perens K6BP   Bruce@Pixar.com
Finger bruce@master.Debian.org for PGP public key.
PGP fingerprint = 88 6A 15 D0 65 D4 A3 A6  1F 89 6A 76 95 24 87 B3 

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com

Reply to: