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

RE: [Xen-devel] [patch] Add support for barriers to blk{back, front} dri

To: "Gerd Hoffmann" <kraxel@xxxxxxx>
Subject: RE: [Xen-devel] [patch] Add support for barriers to blk{back, front} drivers.
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Mon, 23 Oct 2006 12:42:26 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 23 Oct 2006 04:42:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acb2fBAicsbSdT3CQZ290DoB1OOQ0QAFiL+Q
Thread-topic: [Xen-devel] [patch] Add support for barriers to blk{back, front} drivers.
 
> > Out of interest, have you any benchmarks showing the benefits of 
> > barrier support? I'd be very interested to see them.
> 
> It's about correctness, not about performance.  I've talked 
> with Jens Axboe about it a while ago.  Barriers are 
> *required* for journaling filesystems to work reliable.  

I just don't believe that. If the underlying device doesn't support
barriers Linux should just stop issuing requests until it has the
completion notifcation back for *all* the outstanding IOs to the device,
and then start issuing the new batch of IOs.  
I'd be incredibly surprised if this is not what Linux does today for
devices that don't support barriers. [NB: you still have the issue of
disks that support write caching and lie and send the completion before
data has hit the disk, but there's nothing you can do about that from
the OS]

Barriers should just be an optimization that gives greater scheduling
flexibility. 

I'd certainly be interested to see some benchmarks with and without the
barrier support in blkfront/back.

> > Also, have you thought how this would work with blktap?  
> Does the AIO 
> > interface allow ordering constraints to be communicated to 
> the kernel?
> 
> Have a look at Documentation/block/barrier.txt for some 
> background information.
> 
> It shouldn't be a big problem to implement barriers with 
> blktap too.  I think it can't be simply passed down to the 
> block layer (like blkback does).  But it can be implement 
> with aio_fsync().  If a barrier request comes in: sync, 
> submit the write request, sync again, then go ahead with the 
> next request.  

Linux's notion of a barrier is pretty odd in that it does appear to
require the second fsync, at least according to barrier.txt. That's more
restrictive than the notion of barrier I've seen in other OSes.

> Some extra care might be needed for the disk 
> format metadata (cow images come to mind ...).

There's already care taken to ensure that metadata updates happen with
the correct ordering with respect to data writes. Adding barriers at the
data level should be totally orthogonal. 

Ian



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