User: Password:
|
|
Subscribe / Log in / New account

Kernel Summit: kexec and fast booting

Kernel Summit: kexec and fast booting

Posted Jul 22, 2004 3:02 UTC (Thu) by stock (guest, #5849)
Parent article: Kernel Summit: kexec and fast booting

http://wiki.linuxquestions.org/wiki/Scripting

SLEEP COMMANDS

sleep command
usleep command

Today's typical developer main PC at home is a P4 or AMD screaming fast
iron. These new programmers actually miss the resource limiting
constraints of a Atari St, Amiga 3000, Commodore 64 or even a 8088 Intel
PC with only 640 kbyte RAM. For sake! Even Bill Gates once said the 640
kb RAM limit would never be exceeded.

Nowadays, besides RAM abuse, CPU cycles are really abused in god
forbidden ways and methods. For e.g. pcmcia and hotplug to work, its
common practice that inside a startup script the kudzu program is called
several times in a row. Next if one counts inside /etc/rc.d/init.d
directory the number of "sleep 1" calls, one finally understands why that
P4 3.0 GHz hotrod iron is still slower at booting up as my old pentium
P75 with RedHat 4.2 :

[root@tinker init.d]# grep sleep * | wc -l
31
[root@tinker init.d]#

So booting might at least take 30 seconds extra due to sleep commands.
One might check /etc/init.d/functions where the sleep command is used
inside a loop! Why not use the usleep command? This command uses a
microsecond as its time unit instead of a whole second. My solution would
be to replace all sleep shell scripting commands with usleep and put 2 or
3 zeros behind the number of seconds . so one would replace :

sleep 1 ==> usleep 1000

1 second ===> 1 msec

Your Linux machine and its scripts might boot/run a 1000 times faster
after this.

Robert


(Log in to post comments)

Kernel Summit: kexec and fast booting

Posted Jul 22, 2004 12:34 UTC (Thu) by Rakshasa (guest, #14732) [Link]

I wonder... how many of those "slow" sleep commands are in the restart sections?

Kernel Summit: kexec and fast booting

Posted Jul 22, 2004 23:58 UTC (Thu) by melauer (guest, #2438) [Link]

> I wonder... how many of those "slow" sleep commands are in the restart
> sections?

Or, for that matter, in services which you don't use.

[me@localhost init.d]$ grep sleep * | wc -l
22
[me@localhost init.d]$ grep sleep *
alsa: sleep 1
dm: sleep 5
functions: usleep 100000
functions: if checkpid $pid && sleep 1 &&
functions: checkpid $pid && sleep 3 &&
functions: usleep 100000
halt:sleep 5
halt: sleep 5
halt: sleep 2
halt: sleep 5
halt: sleep 120
lm_sensors: sensors -s && sleep 2
firewall: sleep 1
mtink: sleep 2
netfs: sleep 5
netfs: sleep 2
netfs: sleep 5
netfs: sleep 2
netfs: sleep 5
pcmcia: sleep 2
single:sleep 5
sshd: sleep 3


I'm pretty sure that sleep commands in "halt" don't matter in booting, and
I don't use "netfs" (the other top offender) or many of these other
services.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds