From: Joe Jin Subject: Re: [patch 0/6] xenblk: Add O_DIRECT and O_SYNC support. Date: Thu, 6 Nov 2008 16:13:33 +0800 Message-ID: <20081106081333.GA15891@joejin-pc.cn.oracle.com> References: <20081105133342.GM21867@kernel.dk> <20081105201649.GQ21867@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20081105201649.GQ21867@kernel.dk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jens Axboe 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, Keir Fraser List-Id: xen-devel@lists.xenproject.org > > You don't need a bio_set if you are not queuing beneath someone else. > But you do need to take care not to call bio_alloc() again without > having submitted the previous allocation, that is a violation of the bio > mempool and can lead to deadlocks. I think the batching you do looks > pointless (again, only looking at the patch), you should submit each bio > as soon as it is built instead of stashing it in an array for later > submission. That also gets rid of your bio mempool violation. > > > > Does blkback propagate unplug events downwards? > > > > Not sure what that means. blkback does its own limited queue plugging to try > > to develop usefully schedulable batches of I/O. There's no concept of > > plugging across the blkfront/blkback interface. > > So once you leave your queuing loop, you unplug the below device? Or > just point me at the source... > >From source code when got all requests from ring buffer, it have have unpluged request_queue, when unplug_fn() called, maybe some requests in request_queue waiting for commit to device. I have suspected the data lost for device's cache, but when set the bio rw to WRITE_SYNC, data could almost sync to disk at once. Thanks, Joe