Skip to contentSkip to conversation

xenblk: Add O_DIRECT and O_SYNC support.

PATCH Keir Fraser 1 participant 1 message Nov 5, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · Jens Axboe
Quoted 4 lines · Keir Fraser

O_DIRECT doesn't
mean writes are synchronous to the platters -- just means the buffer cache is bypassed -- which should generally be the case on the blkback side always anyway.

Quoted 6 lines

Ehm, yes it does. When a write(2) returns for an fd that has been opened with O_DIRECT, that io WILL have gone to the disk. So it's as close to 'sync to platter' as we can be without fiddling with the write cache on the device, there's even talk of making it fully platter sync by switching on FUA (forced unit access) in the write command, which would make it always direct-to-platter regardless of device cache setting.

Okay, I was going by the open() man page description which only talks about interactions with the buffer cache. Even so, when the Xen block-device is backed by a raw partition (Oracle's test scenario), there should be nothing the Xen drivers need to do. They generate their asynchronous response to the frontend only after the backend gets the async callback from the backend domain's block-device layer. Presumably something in the filesystem or generic blkdev layer in the frontend VM will be making the write()ing process block until such responses are gathered.

-- Keir