Linux RAID subsystem development
 help / color / mirror / Atom feed
* Is there any lazy initialization mechanism in linux-raid?
@ 2017-12-15 11:50 guomingyang
  2017-12-15 12:34 ` Phil Turmel
  2017-12-16  4:22 ` NeilBrown
  0 siblings, 2 replies; 3+ messages in thread
From: guomingyang @ 2017-12-15 11:50 UTC (permalink / raw)
  To: linux-raid

Hi all:

       Today's disk is becoming larger and larger, and the recovery time 
is becoming longer. I'm thinking about a lazy initialization mechanism 
in linux raid5 to speed up recovery, which contains an un-initializing 
bitmap and a backend thread for initializing stripes lazily only after a 
stripe is write. The major difference is as follows:

       (1)When a raid4 or raid5 device is created, we don't recovery a 
disk as usual, instead we just set all the bit in un-initialize bitmap.

       (2)When a write happens and the corresponding un-initializing bit 
is set, we must first clean the bit, then wake up the backend thread to 
resync the stripe, and only do RCW in corresponding stripe before the 
resync is done.

      The major advantage of this mechanism is that when a disk is 
replaced, we can only recovery the stripes which have been initialized, 
so as to speed up recovery.

      Does linux-raid have similar mechanism today? Or is there anyone 
who has already working on similar mechanism?


-- 
Mingyang Guo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is there any lazy initialization mechanism in linux-raid?
  2017-12-15 11:50 Is there any lazy initialization mechanism in linux-raid? guomingyang
@ 2017-12-15 12:34 ` Phil Turmel
  2017-12-16  4:22 ` NeilBrown
  1 sibling, 0 replies; 3+ messages in thread
From: Phil Turmel @ 2017-12-15 12:34 UTC (permalink / raw)
  To: guomingyang, linux-raid

Good morning,

On 12/15/2017 06:50 AM, guomingyang wrote:
> Hi all:
> 
>       Today's disk is becoming larger and larger, and the recovery time
> is becoming longer. I'm thinking about a lazy initialization mechanism
> in linux raid5 to speed up recovery, which contains an un-initializing
> bitmap and a backend thread for initializing stripes lazily only after a
> stripe is write. The major difference is as follows:
> 
>       (1)When a raid4 or raid5 device is created, we don't recovery a
> disk as usual, instead we just set all the bit in un-initialize bitmap.
> 
>       (2)When a write happens and the corresponding un-initializing bit
> is set, we must first clean the bit, then wake up the backend thread to
> resync the stripe, and only do RCW in corresponding stripe before the
> resync is done.

It is interesting, and opens further possibilities.  I'm not sure a
bitmap is the best data structure, but that's be an implementation detail.

>      The major advantage of this mechanism is that when a disk is
> replaced, we can only recovery the stripes which have been initialized,
> so as to speed up recovery.

There's a time penalty added on any operation on the disk to determine
whether the location is initialized or not.  What should reads do when
accessing uninitialized areas?

>      Does linux-raid have similar mechanism today? Or is there anyone
> who has already working on similar mechanism?

By itself I don't think its worth the effort.  However, the accounting
logic could also be used to support trim at the md layer, and the
reduction in actual I/O (supply zeroes when reading uninitialized) might
justify the performance impact of the logic.

I haven't seen any action on anything like this, so I would assume you'd
have to start with some patches.

Regards,

Phil

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is there any lazy initialization mechanism in linux-raid?
  2017-12-15 11:50 Is there any lazy initialization mechanism in linux-raid? guomingyang
  2017-12-15 12:34 ` Phil Turmel
@ 2017-12-16  4:22 ` NeilBrown
  1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2017-12-16  4:22 UTC (permalink / raw)
  To: guomingyang, linux-raid

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

On Fri, Dec 15 2017, guomingyang wrote:

> Hi all:
>
>        Today's disk is becoming larger and larger, and the recovery time 
> is becoming longer. I'm thinking about a lazy initialization mechanism 
> in linux raid5 to speed up recovery, which contains an un-initializing 
> bitmap and a backend thread for initializing stripes lazily only after a 
> stripe is write. The major difference is as follows:
>
>        (1)When a raid4 or raid5 device is created, we don't recovery a 
> disk as usual, instead we just set all the bit in un-initialize bitmap.
>
>        (2)When a write happens and the corresponding un-initializing bit 
> is set, we must first clean the bit, then wake up the backend thread to 
> resync the stripe, and only do RCW in corresponding stripe before the 
> resync is done.
>
>       The major advantage of this mechanism is that when a disk is 
> replaced, we can only recovery the stripes which have been initialized, 
> so as to speed up recovery.
>
>       Does linux-raid have similar mechanism today? Or is there anyone 
> who has already working on similar mechanism?
>

No, linux-raid doesn't support this.
I don't know of anyone working on this.
I wrote about the idea nearly 7 years ago

   http://neil.brown.name/blog/20110216044002#5

but never got around to doing anything.  It probably wouldn't be too
hard if someone wanted it enough to put in some effort.

NeilBrown


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-16  4:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-15 11:50 Is there any lazy initialization mechanism in linux-raid? guomingyang
2017-12-15 12:34 ` Phil Turmel
2017-12-16  4:22 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox