From: shadow Date: Fri, 23 May 2008 06:03:26 +0000 (+0000) Subject: don't create too many objects after del orphan. X-Git-Tag: v1_8_0_110~512 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=67e498044303c3737130c34018fbe74684038d61;p=fs%2Flustre-release.git don't create too many objects after del orphan. b=14835 i=tappro i=deen --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 7cf8c4d..b6ff5b8 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -25,6 +25,14 @@ tbd Sun Microsystems, Inc. For more information, please refer to bugzilla 13904. Severity : normal +Bugzilla : 14835 +Frequency : after recovery +Description: precreate to many object's after del orphan. +Details : del orphan st in oscc last_id == next_id and this triger growing + count of precreated objects. Set flag LOW to skip increase count + of precreated objects. + +Severity : normal Bugzilla : 15139 Frequency : rare, on clear nid stats Description: ASSERTION(client_stat->nid_exp_ref_count == 0) diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index c26d2e3..7273722 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -132,8 +132,14 @@ static int oscc_internal_create(struct osc_creator *oscc) LASSERT_SPIN_LOCKED(&oscc->oscc_lock); + if (oscc->oscc_flags & OSCC_FLAG_CREATING || + oscc->oscc_flags & OSCC_FLAG_RECOVERING) { + spin_unlock(&oscc->oscc_lock); + RETURN(0); + } + if (oscc->oscc_grow_count < OST_MAX_PRECREATE && - !(oscc->oscc_flags & (OSCC_FLAG_LOW | OSCC_FLAG_RECOVERING)) && + ((oscc->oscc_flags & OSCC_FLAG_LOW) == 0) && (__s64)(oscc->oscc_last_id - oscc->oscc_next_id) <= (oscc->oscc_grow_count / 4 + 1)) { oscc->oscc_flags |= OSCC_FLAG_LOW; @@ -143,11 +149,6 @@ static int oscc_internal_create(struct osc_creator *oscc) if (oscc->oscc_grow_count > OST_MAX_PRECREATE / 2) oscc->oscc_grow_count = OST_MAX_PRECREATE / 2; - if (oscc->oscc_flags & OSCC_FLAG_CREATING || - oscc->oscc_flags & OSCC_FLAG_RECOVERING) { - spin_unlock(&oscc->oscc_lock); - RETURN(0); - } oscc->oscc_flags |= OSCC_FLAG_CREATING; spin_unlock(&oscc->oscc_lock); @@ -322,6 +323,9 @@ int osc_create(struct obd_export *exp, struct obdo *oa, RETURN(0); } oscc->oscc_flags |= OSCC_FLAG_SYNC_IN_PROGRESS; + /* seting flag LOW we prevent extra grow precreate size + * and enforce use last assigned size */ + oscc->oscc_flags |= OSCC_FLAG_LOW; spin_unlock(&oscc->oscc_lock); CDEBUG(D_HA, "%s: oscc recovery started - delete to "LPU64"\n", oscc->oscc_obd->obd_name, oscc->oscc_next_id - 1);