On Thu, 2004-11-04 at 19:27 -0500, Alan Cox wrote: > On Thu, Nov 04, 2004 at 01:59:48PM -0500, David Zeuthen wrote: > > Basically hal does this (every two seconds) > > > > open("/dev/hdc", O_RDONLY|O_NONBLOCK|O_EXCL|O_LARGEFILE) = 0 > > ioctl(0, CDROM_DRIVE_STATUS, 0x7fffffff) = 1 > > close(0) > > > > Can some kernel person comment on why this is killing performance on > > the /dev/hda harddrive when the optical drive at /dev/hdb is polled? > > Because /dev/hdb is powersaved. Every time you poll it the laptop powers up > the drive (costly on power/time), polls the TOC, replies and a second or so > later powers back down. During the power up, poll TOC sequence it locks the > bus so your IDE bus spends 1.5 of every 2 seconds jammed by the drive. > > We have some bug reports for this from magicdev too. > Interesting - I suppose there is no better way to detect media in optical drives than polling? IIRC some IDE optical drives emits a signal on media change (so we don't have to poll; we just listen to that signal) but this is not widely available (since most drives doesn't comply with the MMC specs) just like the notification from eject buttons is not widely available, correct? Who controls the power saving policy; the drive firmware or the kernel? Is the jamming of the IDE bus caused by a deficiency in the kernel or is that just the true way of the IDE spec? How does other operating systems handle this? Cheers, David