tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: What is the best layer/device for a write-back cache based in nvram?



On Fri, Sep 09, 2016 at 11:09:49PM +0200, Jose Luis Rodriguez Garcia wrote:
> 
> The proposed layer must support:
> 
> A- It must be able to obtain the raid configuration of the raid device
> backing the writeback cache. If it is a RAID 0/1 it will cache
> portions of the size of the interleave. If it is RAID 5/6 it will
> cache the size of a full slice.

Don't bother with this for now.  Let the user configure the cache segment
manually.  Passing the information you describe around between layers
is hard and is a problem better left for later.

> B- It can use the buffer cache for avoid read/write cycles, and do
> only writes if the data to be read is in memory.

I'd stay more focused on avoiding _copies_.  Any sane implementation
must satisfy reads from the cache layer if the data are cached.  I
would avoid confusing this layer with the page or buffer caches.

> C- Several devices can share the same write back-cache device ->
> optimal and easy to configure. There is not need to hard partitioning
> a NVRAM device in smaller devices with one partition over-used and
> other infra-used.

I think this is again too large a goal.  If you are worried about
wear levelling, don't -- any modern backing device will do that for
you.

> D- In the case of filesystems as LFS, it would be useful to do the
> next optimization: when a slice is complete in the buffer, write it in
> a short time, because this won't be written any more.

This is pretty much the same as "A", is it not?  Let the user tell you
the cache segment size (chunk size, slice size, whatever you want to
call it) and be done, for now.

> E- It can be useful to use elevator algorithms for do the writes from
> buffer cache to raid.

I definitely don't agree.  If you do this, you'll end up with request
sorting at at least three layers!  The only reason to sort requests
would be if you were going to coalesce them, and I would again urge
that you do that later.

-- 
  Thor Lancelot Simon	                                     tls%panix.com@localhost

    "The dirtiest word in art is the C-word.  I can't even say 'craft'
     without feeling dirty."	-Chuck Close


Home | Main Index | Thread Index | Old Index