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] RE: [Xen-users] cache for partition based VBD?

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] RE: [Xen-users] cache for partition based VBD?
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Wed, 30 Nov 2005 02:06:34 +0000
Cc: "Petersson, Mats" <mats.petersson@xxxxxxx>, Tim Freeman <tfreeman@xxxxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 30 Nov 2005 02:11:10 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <907625E08839C4409CE5768403633E0B0EAAD1@xxxxxxxxxxxxxxxxx>
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>
References: <907625E08839C4409CE5768403633E0B0EAAD1@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.3
> The block device cache would be efficient in the sense that it's useful
> for every type of file-system, and it's not going to have to be clever
> about what sort of accesses are frequent, not so frequent etc. This
> gives benefit to the "cache at the device level".
>
> On the other hand, a file-system level cache would also make sense.
> Caching directory structurs or file-allocation-table [not necessarily in
> the Microsoft sense] would obviously help a whole lot more than caching
> some block from the middle of a file that isn't ever going to be read
> again. This motivates having a targetted caching mechanism in the
> file-system (VFS) layer.

Linux does caching at the level of blocks on a device and of contiguous pages 
within a file by stuffing them both in the page cache.  Disk-based 
filesystems are able to use a cached interface to block storage (when 
appropriate) to access their on disk data structures.  Filesystems use the 
block-level interface to the page cache to read their own metadata but store 
file contents into the page cache in a file-oriented manner.

The VFS manipulates and caches various meta-stuff like inode data generically 
(although it has to get this from the filesystem, which in term retrieves 
that data from the block layer).

The filesystem is also free to build its own data structures that cache useful 
information.  For instance, filesystems may choose to store metadata in 
privately allocated structures or (sometimes) in parts of the page cache.  
There are private pointers in the file and inode structures to facilitate 
this.

> A combination would of course make even more sense - cache important
> data structures in the File-system layer, and cache blocks that have
> frequent/recent accesses in the block-device.

Yup.

> > I think that the Linux architecture puts the buffer cache in
> > front of all block device access, not at the VFS layer.  So
> > does that answer the question?  The dom0 disk backend driver
> > sits "above" the buffer cache?  (sorry for my crude
> > understanding)
>
> I would say that this is correct - the Dom0 disk driver would have a
> cache in itself, and the DomU would also have a caching layer. But I'm
> not SURE about this at all.
>
> If someone can make further comments, it would be great.

I'm pretty sure our blkback driver uses a non-caching interface to storage: it 
requests stuff directly from the block layer, rather than from the 
block-level interface to the page cache.  The only way caching gets to happen 
in dom0 is if you're using loop devices in which case direct block access is 
looped back into the VFS (and therefore the page cache inevitable gets 
involved).

Sounds sane?,
Mark

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