staging/lustre: remove obd_memory stats counter
authorOleg Drokin <green@linuxhacker.ru>
Wed, 16 Sep 2015 16:27:07 +0000 (12:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2015 03:32:14 +0000 (20:32 -0700)
Now that we no longer track allocated memory, remove
obd_memory statistics counter and all references to it everywhere

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd_support.h
drivers/staging/lustre/lustre/obdclass/class_obd.c
drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c

index 62d76b5031b603dae33e16f49e00f5c38694ed39..80ab85d7ec3c01f3680361913e70fa0e3e2eaeb8 100644 (file)
 #include "lprocfs_status.h"
 
 /* global variables */
-extern struct lprocfs_stats *obd_memory;
-enum {
-       OBD_MEMORY_STAT = 0,
-       OBD_MEMORY_PAGES_STAT = 1,
-       OBD_STATS_NUM,
-};
-
 extern unsigned int obd_debug_peer_on_timeout;
 extern unsigned int obd_dump_on_timeout;
 extern unsigned int obd_dump_on_eviction;
index 32daefb1c5fa4ef88d731c2933f196e59c26e097..39bf734e929876c36fb0aecc97a0c84d548526e8 100644 (file)
@@ -487,22 +487,6 @@ static int __init init_obdclass(void)
        spin_lock_init(&obd_types_lock);
        obd_zombie_impexp_init();
 
-       obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
-                                        LPROCFS_STATS_FLAG_NONE |
-                                        LPROCFS_STATS_FLAG_IRQ_SAFE);
-
-       if (obd_memory == NULL) {
-               CERROR("kmalloc of 'obd_memory' failed\n");
-               return -ENOMEM;
-       }
-
-       lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
-                            LPROCFS_CNTR_AVGMINMAX,
-                            "memused", "bytes");
-       lprocfs_counter_init(obd_memory, OBD_MEMORY_PAGES_STAT,
-                            LPROCFS_CNTR_AVGMINMAX,
-                            "pagesused", "pages");
-
        err = obd_init_checks();
        if (err == -EOVERFLOW)
                return err;
@@ -592,8 +576,6 @@ static void cleanup_obdclass(void)
        class_handle_cleanup();
        class_exit_uuidlist();
        obd_zombie_impexp_stop();
-
-       lprocfs_free_stats(&obd_memory);
 }
 
 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
index 1f0004c5554b6e1fcaef48b3d5573662818dec69..6acc4a10fde9b046ba7ff1461ef52ba7aca95e61 100644 (file)
@@ -41,9 +41,6 @@
 #include "../include/lprocfs_status.h"
 #include "../include/obd_support.h"
 
-struct lprocfs_stats *obd_memory;
-EXPORT_SYMBOL(obd_memory);
-
 void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
 {
        struct lprocfs_counter          *percpu_cntr;
@@ -74,9 +71,6 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
                 * ldlm_pool_shrink(), which calls lprocfs_counter_add().
                 * LU-1727.
                 *
-                * Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE
-                * flag, because it needs accurate counting lest memory leak
-                * check reports error.
                 */
                if (in_interrupt() &&
                    (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
@@ -124,9 +118,6 @@ void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx, long amount)
                 * softirq context here, use separate counter for that.
                 * bz20650.
                 *
-                * Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE
-                * flag, because it needs accurate counting lest memory leak
-                * check reports error.
                 */
                if (in_interrupt() &&
                    (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
index 08d1f0edf98d1008c26eca3a02ee02d407715ee3..8d2a523ea7cffe2a08d0da9326e7c7d2fc558041 100644 (file)
@@ -1082,7 +1082,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
                        goto fail;
                stats->ls_biggest_alloc_num = 1;
        } else if ((flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0) {
-               /* alloc all percpu data, currently only obd_memory use this */
+               /* alloc all percpu data */
                for (i = 0; i < num_entry; ++i)
                        if (lprocfs_stats_alloc_one(stats, i) < 0)
                                goto fail;
This page took 0.028349 seconds and 5 git commands to generate.