lkml.org 
[lkml]   [2006]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectEfficient media-not-present detection
The block layer detects missing media during open() via a two-step
process. First it invokes the media_changed() method, and if that returns
a positive result it invokes the revalidate_disk() method, which will
realize that no media is present.

This ends up doing twice as much work as needed. Often the
media_changed() method is capable of detecting whether media is present;
if it isn't there's no reason to call revalidate_disk(). Applications
like hald that poll drives to see when media is present therefore end up
generating twice the necessary overhead.

To remedy this would require altering the meaning of the return value from
media_changed(). Something like: 0 for no change, -ENOMEDIUM for media
definitely not present, anything else for media changed or possibly not
present.

This would be a fairly big change since there a lot of block device
drivers. Is there any reason to think it shouldn't be done?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-20 21:53    [W:0.021 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site