All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Brassow Jonathan <jbrassow@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>, ejt@redhat.com
Subject: Re: [PATCH for-3.14] dm cache: add total cache blocks to status output
Date: Thu, 9 Jan 2014 17:13:23 -0500	[thread overview]
Message-ID: <20140109221323.GA5555@redhat.com> (raw)
In-Reply-To: <684DDE51-1D4E-44AB-8E85-CDD6F38B5D07@redhat.com>

On Thu, Jan 09 2014 at  4:28pm -0500,
Brassow Jonathan <jbrassow@redhat.com> wrote:

> Yes, that'd be nice if we could have this.
> 
> It would be great if chunk_size (i.e. cache block size) was also
> included somehow.  If I had that, I could calculate the size of the
> cache using the status output alone.  I won't complain much if it
> isn't there though, because I can get that from the mapping table.
> 
> The reason I like adding the total number of cache blocks is because I
> /can't/ get that information from either type of status (_INFO or
> _TABLE) for the cache target.  Instead, I would have to get the cache
> device from the mapping table and query that device for its size -
> possible, but the level of indirection is a pain.  As it sits in the
> kernel today, it seems strange to provide some information, but not
> enough to fill in the whole picture.

So ideally you want both the cache blocksize and the metadata blocksize.
We can easily add them, wouldn't be the end of the world.  What format
seems best?

<#used metadata blocks>/<#total metadata blocks> <metadata block size>
<#used cache blocks>/<#total cache blocks> <cache block size>
...

or:

<metadata block size> <#used metadata blocks>/<#total metadata blocks>
<cache block size> <#used cache blocks>/<#total cache blocks>
...

or something else?

(fyi, these status blocksizes would be expressed in 512b sectors)

> Speaking of values I can't compute with the _INFO and _TABLE status...
> "block size" does not mean the same thing for the metadata and data
> numbers - one is in chunk_size and the other is in something else
> (neither seem to be in sectors, as is DM custom).

The cache's block_size is in terms of 512b sectors during table load and
it is then stored in cache->sectors_per_block so I'm not sure what you
mean.

As for cache metadata block size, it is fixed at 4K (just like
dm-thin-metadata).  And yes, DM_CACHE_METADATA_BLOCK_SIZE is in bytes,
not sectors... not a big deal as we convert it to sectors when storing
it in the metadata's superblock. *shrug*

> Honestly, I'm not
> very sure why the ratios are provided for the metadata area... who
> cares?  Is it info we don't need?  No-one has ever asked if the RAID
> or mirror log areas are mostly full.  I don't need to worry about
> overfilling, do I?

If the metadata device isn't sized appropriately you can run out of
metadata space.  But in general, yes the metadata use is fixed based on
the size of the particular cache device and chosen policy (due to policy
hint size).

So we _could_ add a negative check that warns/errors to the user if the
provided metadata device isn't adequate for addressing the entire cache
device.

  reply	other threads:[~2014-01-09 22:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 21:04 [PATCH for-3.14] dm cache: add total cache blocks to status output Mike Snitzer
2014-01-09 21:28 ` Brassow Jonathan
2014-01-09 22:13   ` Mike Snitzer [this message]
2014-01-09 23:55     ` [PATCH v2 for-3.14] dm cache: add block sizes and " Mike Snitzer
2014-01-10  0:09       ` [PATCH] dmts: update CacheStatus to parse new " Mike Snitzer
2014-01-16  1:16       ` [PATCH v2 for-3.14] dm cache: add block sizes and total cache blocks to " Brassow Jonathan
2014-01-16  4:34         ` Mike Snitzer
2014-01-16 17:18           ` Brassow Jonathan
2014-01-16 19:35             ` Mike Snitzer
2014-01-10  1:16     ` [PATCH for-3.14] dm cache: add " Brassow Jonathan
2014-01-10 10:32   ` Joe Thornber
2014-01-10 10:42     ` Joe Thornber
2014-01-10 14:17       ` Mike Snitzer
2014-01-10 10:11 ` Joe Thornber
2014-01-10 14:10   ` [PATCH v3 for-3.14] dm cache: add block sizes and " Mike Snitzer
2014-01-10 15:13     ` Joe Thornber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140109221323.GA5555@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@redhat.com \
    --cc=jbrassow@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.