mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmlockd: reduce adopt delays
This commit is contained in:
parent
039be7d5b9
commit
5e1d64a991
@ -5407,7 +5407,7 @@ static int remove_inactive_lvs(struct list_head *vg_lockd)
|
|||||||
goto next_dmname;
|
goto next_dmname;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug("adopt remove_inactive dm name %s dm uuid %s vgname %s lvname %s",
|
log_debug("adopt found active dm %s %s lv %s/%s",
|
||||||
names->name, dm_uuid, vgname, lvname);
|
names->name, dm_uuid, vgname, lvname);
|
||||||
|
|
||||||
if (!vgname || !lvname) {
|
if (!vgname || !lvname) {
|
||||||
@ -5428,8 +5428,7 @@ static int remove_inactive_lvs(struct list_head *vg_lockd)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Found an active LV in a lockd VG. */
|
/* Found an active LV in a lockd VG. */
|
||||||
log_debug("dm device %s adopt in vg %s lv %s",
|
log_debug("adopting %s", names->name);
|
||||||
names->name, ls->vg_name, r->name);
|
|
||||||
r->adopt = 1;
|
r->adopt = 1;
|
||||||
goto next_dmname;
|
goto next_dmname;
|
||||||
}
|
}
|
||||||
@ -5701,7 +5700,6 @@ static void adopt_locks(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
while (count_start_done < count_start) {
|
while (count_start_done < count_start) {
|
||||||
sleep(1);
|
|
||||||
act = NULL;
|
act = NULL;
|
||||||
|
|
||||||
pthread_mutex_lock(&client_mutex);
|
pthread_mutex_lock(&client_mutex);
|
||||||
@ -5711,8 +5709,10 @@ static void adopt_locks(void)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&client_mutex);
|
pthread_mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
if (!act)
|
if (!act) {
|
||||||
|
usleep(500000);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (act->result < 0) {
|
if (act->result < 0) {
|
||||||
log_error("adopt add lockspace failed vg %s %d", act->vg_name, act->result);
|
log_error("adopt add lockspace failed vg %s %d", act->vg_name, act->result);
|
||||||
@ -5830,7 +5830,6 @@ static void adopt_locks(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
while (count_adopt_done < count_adopt) {
|
while (count_adopt_done < count_adopt) {
|
||||||
sleep(1);
|
|
||||||
act = NULL;
|
act = NULL;
|
||||||
|
|
||||||
pthread_mutex_lock(&client_mutex);
|
pthread_mutex_lock(&client_mutex);
|
||||||
@ -5840,8 +5839,10 @@ static void adopt_locks(void)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&client_mutex);
|
pthread_mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
if (!act)
|
if (!act) {
|
||||||
|
usleep(200000);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lock adopt results
|
* lock adopt results
|
||||||
@ -5976,7 +5977,6 @@ static void adopt_locks(void)
|
|||||||
/* Wait for the unlocks to complete. */
|
/* Wait for the unlocks to complete. */
|
||||||
|
|
||||||
while (count_adopt_done < count_adopt) {
|
while (count_adopt_done < count_adopt) {
|
||||||
sleep(1);
|
|
||||||
act = NULL;
|
act = NULL;
|
||||||
|
|
||||||
pthread_mutex_lock(&client_mutex);
|
pthread_mutex_lock(&client_mutex);
|
||||||
@ -5986,8 +5986,10 @@ static void adopt_locks(void)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&client_mutex);
|
pthread_mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
if (!act)
|
if (!act) {
|
||||||
|
usleep(200000);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (act->result < 0)
|
if (act->result < 0)
|
||||||
log_error("adopt unlock error %d", act->result);
|
log_error("adopt unlock error %d", act->result);
|
||||||
|
Loading…
Reference in New Issue
Block a user