[dm-devel] Ideas for generalizing the path selector so mirroring can use it for read balancing

Jonathan Brassow jbrassow at redhat.com
Thu Oct 26 22:02:51 UTC 2006


I've attached three patches.  Descriptions are in the headers, but I'll
put them here for convenience too.

1) generalize_path_selection.patch
###################################
Generalize the path selector functions/interface so that it doesn't
rely on the caller having to use 'struct path's.  The path is now
a 'void *', which can be 'struct path' in the case of multipath, or
'struct mirror' in the case of mirrors.

Path selector modules (like round-robin) can no longer use fields
that were available in 'struct path'.  In some functions, this
requires iterating over the paths to find the corresponding
path_info structure, where the 'path' void pointer acts as the
key.  However, the affected functions are rarely
used (initialization, path failures, path restorations, and status),
and this shouldn't hurt performance.  (But it does make things
much easier for the user of the interface.)

2) auto_path_selection.patch
############################
I've added a 'auto_select_path' which doesn't require the caller
to keep any path selection information (like repeat_count).  It
simply switches paths when it is time to switch paths.

A better interface might be:
'force_select_path'
'select_path'
with the first acting as the current 'select_path' does.  However,
I didn't want to change what people expect.

I think, for various path selection techniques, that the
repeat_count makes no sense - so why force people to track something
that is specific to only certain path selection modules.  I think
it should be internalized - hence the new function.

I just want the path selection routines to give me the right path
based on the algorithm they implement.  Why should I have to do
additional work on my end for path selection?

3) mirror_read_balance.patch
############################
This is an incomplete patch.

Because we do not yet know the layout of the mirror mapping table, I
can not parse it - so I've skipped the setup of the path selector.

However, there should be enough here to envision how mirroring would
use the path selector if it was there.

 brassow


-------------- next part --------------
A non-text attachment was scrubbed...
Name: auto_path_selection.patch
Type: text/x-patch
Size: 3061 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20061026/fce97387/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalize_path_selection.patch
Type: text/x-patch
Size: 7525 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20061026/fce97387/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror_read_balance.patch
Type: text/x-patch
Size: 1896 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20061026/fce97387/attachment-0002.bin>


More information about the dm-devel mailing list