On Sun, Dec 16, 2007 at 11:19:44PM +0100, Michael Biebl wrote:
brian m. carlson schrieb:On Sun, Dec 16, 2007 at 09:38:48PM +0100, Sjoerd Simons wrote:strace -tt would be more usefull as that outputs timing information. The open,ioctl,close triple will cause various wakeups every two seconds.. But only in a short time, so that shouldn't have a big impact on the time your processor can actually spent in a lower power state.
Waking up the CD drive to poll its status isn't particularly good for power savings, either, regardless of what the main processor is doing.
Only never SATA drives support hardware notifications (via libata). For others, the only options is to poll, unfortunately. Why polling every 2 secs causes 20 wakeups per seconds is unclear to me. Maybe a driver issue, maybe not.
You'll pardon me if I don't believe you. HAL itself has a comment that says:
/* Check if a disc is in the drive * * @todo Use MMC-2 API if applicable */Most CD-ROM drives support MMC-2, because MMC-2 is pretty old. Run "wodim -checkdrive" to see. My drive implements MMC-2, and because HAL doesn't implement the MMC-2 API, I have no clue whether it might use a more efficient method.
You also ignored the rest of my comment, where I was pointing out that hal is wastefully checking the tray status when that's really rather irrelevant to whether the media has changed. In other words, hal is not doing everything it can to be efficient. Whether that will have an effect on the number of wakeups is so far unknown, but it is unlikely to hurt.
Finally, even if polling is the only way to do something (which I am not conceding), that doesn't mean it's not broken, and it certainly doesn't mean I have to like it.
The ultimate problem is that hal is the third-leading cause of wakeups on my computer. For me, this is unacceptable. I'm pointing out that there are alternatives to the current method that are very likely more efficient, and hal isn't implementing them. I think it should be. If you don't, then please tag this bug wontfix, and I'll argue it out with the upstream maintainers. But please don't try to tell me that I don't know what I'm talking about when the code contradicts you.
I am now going to hack on the code, and see if I can fix this bug. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only a typesetting engine: http://crustytoothpaste.ath.cx/~bmc/code/thwack OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
signature.asc
Description: Digital signature