[Uml-user] O_DIRECT for ubd access possible?

Marcus Blomenkamp mblomenk at gmx.de
Wed Aug 27 02:03:03 UTC 2003


Hi all,

we are using UML successfully for different purposes for some time now, 
however there is one issue which cannot be solved either by Standalone- or 
UM-Linux. It's also popping up more or less regularly on linux-kernel. It is 
the problem of cache pollution on reading large files, even though we know 
that we will not reuse this data in reasonable time. Application examples: 
streaming media servers, fileservers for media content etc. This one bites 
all users no matter how much physical ram the machines have.

The solutions proposed on kernel mailing list, such as O_DIRECT, fadvise(), 
O_STREAMING, are IMHO less than half the way if used as proclaimed. For them 
it is up to the system administrator to patch every single program involved 
(nfsd, smbd) to use the feature/flag correctly. 

I would like to solve the problem in the data source instead of the data 
serving application. Just forcing the O_DIRECT flag for all open()'s on a 
particular filesystem does not work because of the special access patterns 
imposed by using O_DIRECT. 

My idea was to not expose file content directly from the machine but utilize 
UML virtual hosts for file serving purposes. This adds a additional layer of 
indirection between the data to serve and the data serving program. One 
common way to import data into UML is through file- or partition-mapped 
uniform block devices. I'd like to solve the problem exactly here. Therefore 
using O_DIRECT on access to specific ubd's should suffice. I'm thinking of 
mimicing the infrastructure of the 'sync' command line flag. Is this doable? 
Do the access patterns of the udb driver in its current incarnation meet the 
O_DIRECT constrains?

Best regards, Marcus





More information about the umbrello mailing list