Messages in this thread Patch in this message | | | Date | Mon, 11 Oct 1999 21:59:49 +0200 | From | Pavel Machek <> | Subject | Re: kapmd taking large amounts of cpu |
| |
Hi!
> just an idle question out of the blue, over the last few releases, i've > noticed kapmd is taking anywhere between 10 and 40% of the cpu. it > isn't having a huge impact most of the time but does contribute.
It happens here, too.
I'm just taking a look. The code is perverted.
If system is idle (that is measured once a second *), it starts spinning within the loop telling bios that we are idle. That "idle call" in a loop is maybe done with disabled interrupts (damaging killing interrupt response?)
What is more funny is that in case of cpu being idle, apm_do_idle() is probably going to be called only half of a time. See:
schedule_timeout(HZ)
apm_do_idle() while (1) if (jiffies-start > HZ) break and repeat. That gives calls being done only half of a time. Patch appended.
* -- what happens if there's _another_ program that wakes up once a second? I think that with 0.01 probability apm_do_idle() will be never called on such system. I think that this is ugly and that it can hurt in real life.
--- clean/arch/i386/kernel/apm.c Sat Sep 11 20:55:53 1999 +++ linux/arch/i386/kernel/apm.c Mon Oct 11 21:56:50 1999 @@ -1073,8 +1078,10 @@ unsigned long start = jiffies; do { apm_do_idle(); - if (jiffies - start > APM_CHECK_TIMEOUT) - break; + if (jiffies - start > APM_CHECK_TIMEOUT) { + apm_event_handler(); + start = jiffies; + } } while (system_idle()); apm_do_busy(); apm_event_handler(); -- I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel. Pavel Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |