linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Dark Penguin <darkpenguin@yandex.ru>, linux-raid@vger.kernel.org
Subject: Re: Bitmap in RAM?
Date: Fri, 28 Oct 2016 16:58:35 +1100	[thread overview]
Message-ID: <87twbxrp4k.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <57F8EC82.9010804@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]

On Sat, Oct 08 2016, Dark Penguin wrote:

> After researching write-intent bitmaps for a while, my understanding is 
> that they are used only to speed up "re-adding" drives by avoiding a 
> full resync, and to enable --write-mostly --write-behind. However, it 

This is not correct.  Speeding up re-adding is certainly one benefit.
The other benefit is speeding up resync after a system crash.


> does introduce some pretty heavy load on whatever device it's on, 
> especially if it's an internal bitmap, because the head would have to 
> fly all the way to the superblock twice per each write. If it's an 
> external bitmap, then the device it's on would be too busy just serving 
> it to do anything else.

It doesn't update the bitmap immediately before and after every write.
Writes are batched, and the bitmap is updated once before each batch of
writes.
There does need to be another update to record that the write has
completed, but that is delayed and usually merged with the update at the
start of the next batch of writes.
So the bitmap is usually updated once per batch of writes.


>
> So if I were to place it on a tmpfs, I could eliminate this problem only 
> at the expense of being unable to re-add drives after a reboot, right?.. 
> I've read somewhere that bitmaps only work correctly on ext2 or ext3 
> filesystems, but that probably means that it's not a good idea to put it 
> on a filesystem with delayed allocation like ext4 of zfs, otherwise I 
> don't understand why - and so I don't know if there would be any problem 
> with it running on tmpfs. Is there?..

You could create a ramdisk, create an ext2 filesystem on that, and put
the bitmap file there.

It probably would make sense to support in-memory bitmaps which never
get written to disk.  It would be fairly easy to do, and would allow
expedited re-add.  I just hasn't been done.
(patches welcome :-)

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

      parent reply	other threads:[~2016-10-28  5:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-08 12:54 Bitmap in RAM? Dark Penguin
2016-10-08 16:02 ` Roman Mamedov
2016-10-08 16:23   ` Dark Penguin
2016-10-28  5:58 ` NeilBrown [this message]

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=87twbxrp4k.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=darkpenguin@yandex.ru \
    --cc=linux-raid@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).