(Reply comes after ChangeLog and Signed-off-by.) This patch creates a new LED trigger that triggers whenever the CPU is active. It can be configured with module parameters to trigger on any combination of user, nice, system, or iowait time, and defaults to including user and system time but not nice or iowait time. I've tested it a bit, and it seems to work, but no guarantees. It's diffed against 2.6.17-git25. Signed-off-by: Thomas Tuttle On July 06 at 19:52 EDT, Pavel Machek hastily scribbled: > Please don't include changelogs in sources. Okay. I've attached an updated patch. > > +#define UPDATE_INTERVAL (5) /* delay between updates, in ms */ > Polling every 5 msec is going to cost _lot_ of juice. Is there a > better way? This is a sticky issue. My first idea was to wire something into schedule() so that when the idle process was selected, it would switch the LED off, and when another process was selected, it would switch it on, but that would have been really hairy. In addition, it wouldn't allow the trigger to differentiate between user, system, nice, and iowait time, which it can now. I don't think it's that much of a performance hit (the calculations are fairly short, and a trigger event isn't sent unless the LED state changed), but if you disagree, I can do a couple of things: * Lower the frequency to every 10ms (100Hz) or 40ms (25Hz). This will reduce the performance hit, but also reduce the accuracy of the LED. Right now, it flickers nicely when the CPU is somewhat busy, but if I lower the frequency, it will more often stay on rather than flickering. I guess it's a matter of taste. * Make the frequency configurable by a module parameter. This way, users who don't mind the performance hit can increase the speed, and those who do mind can lower it. * Try to hook it in to the scheduler, so it actually knows the moment the CPU idles or starts doing something. This will make it impossible to differentiate user/system time, and hard to differentiate user/nice time. I personally think it's okay as it is, but I'm willing to make changes if you prefer. --Thomas Tuttle