[dm-devel] lockspace interface

Mikulas Patocka mpatocka at redhat.com
Mon Sep 28 18:53:53 UTC 2009


Hi

What's the purpose of two-level uuid-locking?
I.e. you call
lockspace_handle = dm_cluster_lock_init(char *uuid1)
and then
dm_cluster_lock_by_str(void *lockspace_handle, char *uuid2, ...)

Why not use just one uuid?

Also think that locking will be heavily repeated (at least on a single 
node), so it is needed to make lock as fast as possible --- without any 
string operations, hashing, searching, associated spinlocks.

I'd propose to change the interface to

lockspace_handle = dm_cluster_lock_init(char *uuid)
dm_cluster_lock_by_str(void *lockspace_handle, ...)

--- assume that "uuid" already uniquely identifies the snapshot --- and 
that second uuid is unnecessary. You can then get rid of "find_dcl" 
function and its complexities (spinlock, list walking, strlen, strcmp) --- 
so that they won't be executed on the fast path --- and lockspace_handle 
could be a single pointer to struct dm_cluster_lock.

Mikulas




More information about the dm-devel mailing list