Whamcloud - gitweb
b=23460 make page state changes tracking optinal
authorVitaly Fertman <vitaly.fertman@sun.com>
Tue, 23 Nov 2010 21:03:09 +0000 (00:03 +0300)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Tue, 23 Nov 2010 21:17:57 +0000 (00:17 +0300)
i=green

The stats are unused by anybody, yet they take away several percents of read
speed. Let's make them optional.

lustre/autoconf/lustre-core.m4
lustre/obdclass/cl_page.c

index bb9bf6e..c632a48 100644 (file)
@@ -2591,6 +2591,17 @@ if test x$enable_lu_ref = xyes ; then
         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
 fi
 
         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
 fi
 
+AC_ARG_ENABLE([pgstate-track],
+              AC_HELP_STRING([--enable-pgstate-track],
+                             [enable page state tracking]),
+              [enable_pgstat_track='yes'],[])
+AC_MSG_CHECKING([whether to enable page state tracking])
+AC_MSG_RESULT([$enable_pgstat_track])
+if test x$enable_pgstat_track = xyes ; then
+        AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
+                  [enable page state tracking code])
+fi
+
          #2.6.29
          LC_WRITE_BEGIN_END
          LC_D_OBTAIN_ALIAS
          #2.6.29
          LC_WRITE_BEGIN_END
          LC_D_OBTAIN_ALIAS
index 79b7b1b..76fa7ca 100644 (file)
@@ -306,7 +306,10 @@ static void cl_page_free(const struct lu_env *env, struct cl_page *page)
                 slice->cpl_ops->cpo_fini(env, slice);
         }
         cfs_atomic_dec(&site->cs_pages.cs_total);
                 slice->cpl_ops->cpo_fini(env, slice);
         }
         cfs_atomic_dec(&site->cs_pages.cs_total);
+
+#ifdef LUSTRE_PAGESTATE_TRACKING
         cfs_atomic_dec(&site->cs_pages_state[page->cp_state]);
         cfs_atomic_dec(&site->cs_pages_state[page->cp_state]);
+#endif
         lu_object_ref_del_at(&obj->co_lu, page->cp_obj_ref, "cl_page", page);
         cl_object_put(env, obj);
         lu_ref_fini(&page->cp_reference);
         lu_object_ref_del_at(&obj->co_lu, page->cp_obj_ref, "cl_page", page);
         cl_object_put(env, obj);
         lu_ref_fini(&page->cp_reference);
@@ -370,7 +373,10 @@ static int cl_page_alloc(const struct lu_env *env, struct cl_object *o,
                 if (err == NULL) {
                         cfs_atomic_inc(&site->cs_pages.cs_busy);
                         cfs_atomic_inc(&site->cs_pages.cs_total);
                 if (err == NULL) {
                         cfs_atomic_inc(&site->cs_pages.cs_busy);
                         cfs_atomic_inc(&site->cs_pages.cs_total);
+
+#ifdef LUSTRE_PAGESTATE_TRACKING
                         cfs_atomic_inc(&site->cs_pages_state[CPS_CACHED]);
                         cfs_atomic_inc(&site->cs_pages_state[CPS_CACHED]);
+#endif
                         cfs_atomic_inc(&site->cs_pages.cs_created);
                         result = 0;
                 }
                         cfs_atomic_inc(&site->cs_pages.cs_created);
                         result = 0;
                 }
@@ -563,7 +569,9 @@ static void cl_page_state_set0(const struct lu_env *env,
                                struct cl_page *page, enum cl_page_state state)
 {
         enum cl_page_state old;
                                struct cl_page *page, enum cl_page_state state)
 {
         enum cl_page_state old;
+#ifdef LUSTRE_PAGESTATE_TRACKING
         struct cl_site *site = cl_object_site(page->cp_obj);
         struct cl_site *site = cl_object_site(page->cp_obj);
+#endif
 
         /*
          * Matrix of allowed state transitions [old][new], for sanity
 
         /*
          * Matrix of allowed state transitions [old][new], for sanity
@@ -616,8 +624,10 @@ static void cl_page_state_set0(const struct lu_env *env,
                 PASSERT(env, page,
                         equi(state == CPS_OWNED, page->cp_owner != NULL));
 
                 PASSERT(env, page,
                         equi(state == CPS_OWNED, page->cp_owner != NULL));
 
+#ifdef LUSTRE_PAGESTATE_TRACKING
                 cfs_atomic_dec(&site->cs_pages_state[page->cp_state]);
                 cfs_atomic_inc(&site->cs_pages_state[state]);
                 cfs_atomic_dec(&site->cs_pages_state[page->cp_state]);
                 cfs_atomic_inc(&site->cs_pages_state[state]);
+#endif
                 cl_page_state_set_trust(page, state);
         }
         EXIT;
                 cl_page_state_set_trust(page, state);
         }
         EXIT;