From: Joe Jin Subject: Re: [patch 0/6] xenblk: Add O_DIRECT and O_SYNC support. Date: Wed, 5 Nov 2008 11:22:41 +0800 Message-ID: <20081105032241.GA17919@joejin-pc.cn.oracle.com> References: <20081104080255.GA26209@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen-devel@lists.xensource.com, kurt.hackel@oracle.com, shinya.narahara@oracle.com, Joe Jin , greg.marsden@oracle.com, wen.gang.wang@oracle.com, jens.axboe@oracle.com List-Id: xen-devel@lists.xenproject.org > > To direct-io answer is yes for request have marked if write request with > > O_DIRECT flag, but to O_SYNC, filesystem implentation it at filesystem, > > layer, I think do not touch filesystem codes to implement O_SYNC support > > is impossible. > > O_DIRECT has no meaning really across the xenblk interface. The intention is > that blkback talks at a raw block device below the buffer cache anyway. > > For O_SYNC it can be implemented by pushing out all I/Os into the ring > buffer and then wait for all required responses. Why do you think that > doesn't work? Indeed it should work already if such logic exists in the > generic Linux block layer, since blkfront notifies that layer as responses > come in from blkback. > Do you think when xenblk backend make_reponse() means the request have commited to disk? We have did a sample testing and found without BI_RW_SYNC flag setted, either O_DIRECT or O_SYNC flag, when vm crashed/power outage, lots of data lost, sometimes more than 1M data lost, that means vm under high data lost risk. With BI_RW_SYNC flag when call submit_bio, open file with O_DIRECT or O_SYNC flag, could sync data very well. Thanks, Joe