[LU-2798] error: variable ‘site’ set but not used Created: 12/Feb/13 Updated: 15/Feb/13 Resolved: 15/Feb/13 |
|
| Status: | Closed |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Dmitry Eremin (Inactive) | Assignee: | WC Triage |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 6774 | ||||||||
| Description |
|
$ /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc -v cl_lock.c: In function ‘cl_lock_put’: lmv_obd.c: In function ‘lmv_connect_mdc’: |
| Comments |
| Comment by Dmitry Eremin (Inactive) [ 13/Feb/13 ] |
|
The first variable was not not removed after following commit: variable ‘site’ set but not used commit 5cae09a2409dcd396a1ee7be1eca7d3bbf77365e It turns out that atomic doesn't scale well for highly contented Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> diff --git a/lustre/obdclass/cl_lock.c b/lustre/obdclass/cl_lock.c +#ifdef CONFIG_DEBUG_PAGESTATE_TRACKING
+#define CS_LOCK_INC(o, item) \
+ cfs_atomic_inc(&cl_object_site(o)->cs_locks.cs_stats[CS_##item])
+#define CS_LOCK_DEC(o, item) \
+ cfs_atomic_dec(&cl_object_site(o)->cs_locks.cs_stats[CS_##item])
+#define CS_LOCKSTATE_INC(o, state) \
+ cfs_atomic_inc(&cl_object_site(o)->cs_locks_state[state])
+#define CS_LOCKSTATE_DEC(o, state) \
+ cfs_atomic_dec(&cl_object_site(o)->cs_locks_state[state])
+#else
+#define CS_LOCK_INC(o, item)
+#define CS_LOCK_DEC(o, item)
+#define CS_LOCKSTATE_INC(o, state)
+#define CS_LOCKSTATE_DEC(o, state)
+#endif
[...]
@@ -269,8 +285,8 @@ static void cl_lock_free(const struct lu_env *env, struct cl
cfs_list_del_init(lock->cll_layers.next);
slice->cls_ops->clo_fini(env, slice);
}
- cfs_atomic_dec(&cl_object_site(obj)->cs_locks.cs_total);
- cfs_atomic_dec(&cl_object_site(obj)->cs_locks_state[lock->cll_state]);
+ CS_LOCK_DEC(obj, total);
+ CS_LOCKSTATE_DEC(obj, lock->cll_state);
lu_object_ref_del_at(&obj->co_lu, lock->cll_obj_ref, "cl_lock", lock);
cl_object_put(env, obj);
lu_ref_fini(&lock->cll_reference);
@@ -308,7 +324,7 @@ void cl_lock_put(const struct lu_env *env, struct cl_lock *l
LASSERT(cfs_list_empty(&lock->cll_linkage));
cl_lock_free(env, lock);
}
- cfs_atomic_dec(&site->cs_locks.cs_busy);
+ CS_LOCK_DEC(obj, busy);
}
EXIT;
}
The second variable was not not removed after following commit: variable ‘mdc_data’ set but not used commit b3a53261ee18bf0c00e509208a5729890347d582 Allocate lmv tgts array by MDT index, which is similar as lov Signed-off-by: wang di <di.wang@intel.com> - /* - * Copy connect data, it may be used later. - */ - lmv->datas[tgt->ltd_idx] = *mdc_data; - |
| Comment by Jodi Levi (Inactive) [ 15/Feb/13 ] |
|
duplicate of |