From: Liang Zhen Date: Sat, 18 Jun 2011 10:03:12 +0000 (+0800) Subject: LU-431 o2iblnd: reduce failed alloc retry interval X-Git-Tag: 2.1.53~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9c600731cb3f149580015791b1cb4acfb4740984 LU-431 o2iblnd: reduce failed alloc retry interval o2iblnd can dynamically grow TX descriptor pool at run time, it will take 10 seconds as retry interval if there is a failed allocating, this interval is too long and some RPC might timeout. So we decreased it to one second. Change-Id: I0693e9d2cbf321e473713db6dd668afaf64e1bae Signed-off-by: Liang Zhen Reviewed-on: http://review.whamcloud.com/966 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 5eed508..190d90e 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1629,7 +1629,7 @@ kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages, int npages, fps->fps_version ++; cfs_list_add_tail(&fpo->fpo_list, &fps->fps_pool_list); } else { - fps->fps_next_retry = cfs_time_shift(10); + fps->fps_next_retry = cfs_time_shift(IBLND_POOL_RETRY); } cfs_spin_unlock(&fps->fps_lock); @@ -1824,8 +1824,7 @@ kiblnd_pool_alloc_node(kib_poolset_t *ps) if (rc == 0) { cfs_list_add_tail(&pool->po_list, &ps->ps_pool_list); } else { - /* retry 10 seconds later */ - ps->ps_next_retry = cfs_time_shift(10); + ps->ps_next_retry = cfs_time_shift(IBLND_POOL_RETRY); CERROR("Can't allocate new %s pool because out of memory\n", ps->ps_name); } diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index 9c0409b..aa16854 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -227,7 +227,10 @@ typedef struct kib_hca_dev cfs_atomic_t ibh_ref; /* refcount */ } kib_hca_dev_t; -#define IBLND_POOL_DEADLINE 300 /* # of seconds to keep pool alive */ +/** # of seconds to keep pool alive */ +#define IBLND_POOL_DEADLINE 300 +/** # of seconds to retry if allocation failed */ +#define IBLND_POOL_RETRY 1 typedef struct {