Linux Device Mapper development
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <heinzm@redhat.com>
To: dm-devel@redhat.com
Subject: Re: How big should raid metadata device be?
Date: Tue, 3 Nov 2015 02:01:19 +0100	[thread overview]
Message-ID: <5638075F.90602@redhat.com> (raw)
In-Reply-To: <5637BFBF.3010603@redhat.com>



On 11/02/2015 08:55 PM, Andy Grover wrote:
> Hi all,
>
> In looking at md-raid one question I had was exactly how large does 
> the metadata device need to be in comparison to the data device? It 
> contains a padded-to-4Kbyte sized raid metadata struct, and then also 
> a write intent bitmap that is sized based upon the number of stripes, 
> with 16 bits per stripe.

There is no direct relationship between stripes and bitmap size, because the
bitmap holds a bit per region.

I'm restricting this to metadata kept by dm-raid (neither md/md raid1 
clustered or md with external metadata),
because you seem to utilize that:

the metadata contains a 4KiB padded struct to describe the array (the 
raid superblock) at offset 0
followed by 4KiB for the bitmap header. After those 2, a bit per region 
(i.e. blocks / region_size) is allocated.

Say, for 64KiB region size and 1TiB raid1 set size (1TiB*Bit / 64 KiB = 
16777216 Bit; 16777216 Bit / (8 Bit/Byte) / (1024 Byte/KiB) = 2048 KiB:

4KiB superblock
4KiB bitmap header
2048 KiB bitmap
-------------------------
2056KiB total

>
> Is it correct to say the minimum size of the metadata device should be:
>
> 4096 + (2 * stripe_count)
>
> bytes?
>
> Thanks -- Andy
>
> p.s. LVM2 allocates 1 extent (default 4MiB) for the raid meta device. 
> But it's not clear if given a large enough raid dev, and configured 
> with a much smaller extent size than the default, if one extent might 
> not be enough.

It is actually very clear that in case of small lvm2 extent and raid 
region size,
one extent is easily not big enough.
That's why I am developing dynamic raid metadata allocation for lvm2.

Heinz

>
> -- 
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2015-11-03  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 19:55 How big should raid metadata device be? Andy Grover
2015-11-03  1:01 ` Heinz Mauelshagen [this message]
2015-11-03 17:29   ` Andy Grover

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=5638075F.90602@redhat.com \
    --to=heinzm@redhat.com \
    --cc=dm-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox