I raised a Radar bug (number 3494492) a while ago to bring attention to the fact that it would be very useful if we had a way of querying the Mach layer to find out if a vnode has cached and/or dirty pages. The implementation for 'cached' should be fairly simple, but 'dirty' might be harder, as in the process of checking each page, new ones could become dirty. Our best approximation to 'dirty' at the moment is to look at the v_clen field of the vnode and return true if it's non-zero. This is less than ideal because it only means that the vnode was dirty at some point in the past - it might since have been cleaned. We're hitting a performance issue as a result of this. In Final Cut Pro for example, if you've rendered some video there will be vnodes to large files that were once dirty. Whenever a sync occurs, we decide that these vnodes are dirty and call ubc_pushdirty_range() on them. The box then grinds to a halt for a few seconds as the Mach code iterates all the pages looking for dirty ones to flush. As a result, video playback stops for a few seconds at regular intervals. Is it feasible for us to maintain our own dirty state for our vnodes? How do we know when a flush has finished writing out all the dirty pages? It seems that the transition from clean to dirty would be easy to handle, but the transition back from dirty to clean would be non-trivial. Sam _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Sam Vaughan