WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [patch] xen-blkback: sync I/O after backend disconnected

To: Joe Jin <joe.jin@xxxxxxxxxx>
Subject: [Xen-devel] Re: [patch] xen-blkback: sync I/O after backend disconnected
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 22 Aug 2011 10:38:29 -0400
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Jens Axboe <jaxboe@xxxxxxxxxxxx>, Greg Marsden <greg.marsden@xxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Kurt C Hackel <KURT.HACKEL@xxxxxxxxxx>
Delivery-date: Mon, 22 Aug 2011 07:39:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E4A149E.5080608@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4E48A6A6.4040706@xxxxxxxxxx> <20110815144610.GA3707@xxxxxxxxxxxxx> <4E4A149E.5080608@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Aug 16, 2011 at 02:56:30PM +0800, Joe Jin wrote:
> On 08/15/11 22:46, Christoph Hellwig wrote:
> > On Mon, Aug 15, 2011 at 12:55:02PM +0800, Joe Jin wrote:
> >> When backend disconnect, sync IO requests to the disk.
> > 
> > Care to explain why?
> 
> When backend disconnect, I think we'd better flush all dirty data 
> to the disk ASAP.

Then please state this in the commit log, and even better the code
also.

> > Also you'll just need a sync_blockdev, fsync_bdev does far to many
> > things that don't make any sense when you don't have a file system
> > mounted on a device.
> > 
> 
> xen-blkback support physical device and loopback file, so I think
> here should be fsync_bdev()? 

No, and in fact sync_blockdev is also wrong when thinking about it.
blkback always submits bios directly to the device, so flushing any
kernel caches won't do you any help.  The only thing that might make
sense to flush would be the disk write cache using a blkdev_issue_flush.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel