Skip to contentSkip to conversation

device-mapper mirror module (dm-raid)

DISCUSSION Penguin Lin 2 participants 2 messages Apr 13, 2007 – Apr 19, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

Dear all:

Recently I am keeping tracing the device-mapper codes in kernel-2.6.20.1

There are still some question that confuse me... and I hope to change something in mirror driver...

---------------------------------------------------------------

1. Is recovery here really necessary ?

Every time when a bio is written to a mirrred target, mirror driver will queue
this io to the write bio_list whthin the mirror_set, finally a kcopyd will be
invoke to write this bio to all mirrored device. Is the flow correct?

But... there are nothing doing in the write callback function (write_callback).... right ?
So in the current version, we won't have any regions that is needed to be recovered.

----------------------------------------------------------------

2. Should we put all read action into the read bio_list of the mirror_set ?

In mirror_map.... should we put all read requests into the read bio_list of the
mirror_set after check the return value from log->type->in_sync(), since do_read() method does the same thing and it will be invoke when a do_work is invoke? Or shoulwe d move all read actions including the checking (in mirror_map) to the do_read() function ?

----------------------------------------------------------------

Thanks for all...
and please forgive my Chinese English..... is too poor.... (hopes some one understand what I am talking about in above...)

regard.

#1 lore raw

[email protected] wrote on 13.04.2007 11:49:07:

Quoted 6 lines

1. Is recovery here really necessary ?

Every time when a bio is written to a mirrred target, mirror driver will queue
this io to the write bio_list whthin the mirror_set, finally a kcopyd

will be

Quoted 2 lines

invoke to write this bio to all mirrored device. Is the flow correct?

AFAIK, thats wrong. Write creates and submits one write bio for each mirror target.
Kcopyd won't be used, except for recovery (currently startup only if I remember
correctly).

Quoted 5 lines

But... there are nothing doing in the write callback function (write_callback).... right ?
So in the current version, we won't have any regions that is needed to be recovered.

Starting any I/O within a region will mark this as dirty. If all I/O on a region
completed sucessfully it will be set in-sync again. Haven't looked at that lately
but it was a bit hidden since write_callback didn't do all the work. Parts of it
were done in the common end_io function of the target.

Quoted 3 lines

----------------------------------------------------------------

2. Should we put all read action into the read bio_list of the

mirror_set ?

Quoted 6 lines

In mirror_map.... should we put all read requests into the read bio_list of the
mirror_set after check the return value from log->type->in_sync(), since

do_read() method does the same thing and it will be invoke when a

do_work

Quoted 5 lines

is invoke? Or shoulwe d move all read actions including the checking (in mirror_map) to the do_read() function ?

----------------------------------------------------------------

IMHO better move all to the read bio_list. So the mapping completes sooner and
the balancing and possible retries could be done in one place.

Regards,
Stefan