apm bug

Andrej Presern (andrejp@luz.fe.uni-lj.si)
Mon, 29 Sep 1997 22:00:52 +0200


I'm experiencing some strange behaviour when the system
goes to power saving mode (apm). See this:

[andrejp@soda ~/src/caos/src/test]$ date
Mon Sep 29 17:23:06 CEST 1997
[andrejp@soda ~/src/caos/src/test]$ uptime
5:23pm up 4:34, 2 users, load average: 0.00, 0.02, 0.02
[andrejp@soda ~/src/caos/src/test]$ procinfo
Linux 2.0.31 (andrejp@soda) (gcc 2.7.2.3.f.1) #1 [soda]

Memory: Total Used Free Shared Buffers Cached
Mem: 63508 61728 1780 22840 11300 32596
Swap: 32764 0 32764

Bootup: Mon Sep 29 12:49:05 1997 Load average: 0.00 0.02 0.02 2/51 2547

user : 0:04:23.35 1.6% page in : 38128 disk 1: 8915r 17352w
nice : 0:02:33.65 0.9% page out: 28280 disk 2: 238r 0w
system: 0:05:26.92 2.0% swap in : 1
idle : 4:21:42.77 95.5% swap out: 0
uptime: 4:34:06.68 context : 2266424

irq 0: 1644669 timer irq 8: 0
irq 1: 55176 keyboard irq 9: 0
irq 2: 0 cascade [4] irq 10: 0
irq 3: 67524 irq 11: 0
irq 4: 0 irq 12: 220386 PS/2 Mouse
irq 5: 0 irq 13: 1 math error
irq 6: 0 irq 14: 26515 ide0+
irq 7: 0 irq 15: 0 ide1+

After these commands the system was left totaly idling (I wasn't at home
even, the computer is not hooked to any nets or anything). When I came
back, I ran these same commands. Here's the output:

[andrejp@soda ~]$ date
Mon Sep 29 21:28:19 CEST 1997
[andrejp@soda ~]$ uptime
9:28pm up 4:58, 3 users, load average: 0.50, 0.15, 0.04
[andrejp@soda ~]$ procinfo
Linux 2.0.31 (andrejp@soda) (gcc 2.7.2.3.f.1) #1 [soda]

Memory: Total Used Free Shared Buffers Cached
Mem: 63508 62392 1116 24720 11300 32596
Swap: 32764 0 32764

Bootup: Mon Sep 29 16:30:19 1997 Load average: 0.50 0.15 0.04 2/53 2577

user : 0:04:59.18 1.7% page in : 38128 disk 1: 8915r 17683w
nice : 0:03:10.26 1.1% page out: 28620 disk 2: 238r 0w
system: 0:06:19.19 2.1% swap in : 1
idle : 4:43:33.30 95.2% swap out: 0
uptime: 4:58:01.93 context : 2381467

irq 0: 1788193 timer irq 8: 0
irq 1: 55263 keyboard irq 9: 0
irq 2: 0 cascade [4] irq 10: 0
irq 3: 67524 irq 11: 0
irq 4: 0 irq 12: 220386 PS/2 Mouse
irq 5: 0 irq 13: 1 math error
irq 6: 0 irq 14: 26846 ide0+
irq 7: 0 irq 15: 0 ide1+

Now the observations:
- Time difference is aproximately 4 hours and 5 minutes.
- Uptime difference is aproximately 25 minutes
- Bootup time difference is aproximately 3 hours 40 minutes even though the
system was NOT rebooted in the meantime (and the logs confirm this)
- My bios APM settings are:
* doze 6 minutes
* standby 8 minutes
* suspend 10 minutes
* hdd powerdown disabled
- Kernel was compiled with these APM options:
CONFIG_APM=y
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
# CONFIG_APM_DISPLAY_BLANK is not set
CONFIG_APM_POWER_OFF=y

Notice that 4h5m - 25m = 3h40m which is weird in itself. Also notice that
6 + 8 + 10 = 24 (bios APM times), which is approximately what the uptime
difference is. It appears as if the kernel doesn't count the uptime when
the machine was in the power saving mode.

This is 2.0.31-pre10 with cyrix and qnx scheduler 1.12 patches.

I can reproduce this anytime, so I can perform some tests if anyone wants..

Andrej