Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225625

[PATCH 16/19] staging/lustre: remove obd_memory stats counter

From green@linuxhacker.ru
Newsgroups linux.kernel
Subject [PATCH 16/19] staging/lustre: remove obd_memory stats counter
Date 2015-09-16 02:40 +0200
Message-ID <q98Vs-5ap-31@gated-at.bofh.it> (permalink)
References <q98Vr-5ap-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Oleg Drokin <green@linuxhacker.ru>

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>
---
 drivers/staging/lustre/lustre/include/obd_support.h    |  7 -------
 drivers/staging/lustre/lustre/obdclass/class_obd.c     | 18 ------------------
 .../staging/lustre/lustre/obdclass/lprocfs_counters.c  |  9 ---------
 .../staging/lustre/lustre/obdclass/lprocfs_status.c    |  2 +-
 4 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 62d76b5..80ab85d 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -43,13 +43,6 @@
 #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;
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 32daefb..39bf734 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -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/>");
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
index 1f0004c..6acc4a1 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
@@ -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)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 08d1f0e..8d2a523 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -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;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/19] Lustre cleanups green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 05/19] staging/lustre/llite: Get rid of OBD_ALLOC/FREE_PTR green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 02/19] staging/lustre: Remove unused OBD_VMALLOC green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users green@linuxhacker.ru - 2015-09-16 02:40 +0200
    Re: [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-16 07:40 +0200
      Re: [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users Oleg Drokin <green@linuxhacker.ru> - 2015-09-16 17:10 +0200
  [PATCH 16/19] staging/lustre: remove obd_memory stats counter green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 10/19] staging/lustre/ptlrpc: Replace OBD_FREE_PTR with kfree green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 01/19] staging/lustre: Remove OBD_CPT_ALLOC_LARGE green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 07/19] staging/lustre: Remove references to OBD_ALLOC/FREE* in comments green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 11/19] staging/lustre: Replace last users of OBD_ALLOC/FREE_LARGE green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 18/19] staging/lustre: remove IS_MDS|IS_OST|IS_MGS defines and users green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 06/19] staging/lustre/obdclass: replace OBD_ALLOC_GFP with kzalloc green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 09/19] staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree green@linuxhacker.ru - 2015-09-16 02:40 +0200
  [PATCH 14/19] staging/lustre: Remove memory allocation fault injection framework green@linuxhacker.ru - 2015-09-16 02:40 +0200

csiph-web