[2/4] kstat: Drop global kstat_lat_struct

Submitted by Kirill Tkhai on Dec. 11, 2017, 3:11 p.m.

Details

Message ID 151300507154.27731.10475246589457480315.stgit@localhost.localdomain
State New
Series "Make kstat_glob::swap_in percpu and cleanup"
Headers show

Commit Message

Kirill Tkhai Dec. 11, 2017, 3:11 p.m.
Nobody uses it since swap_in is converted to percpu interface.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 include/linux/vzstat.h  |    8 --------
 kernel/ve/vzstat_core.c |   25 -------------------------
 2 files changed, 33 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/vzstat.h b/include/linux/vzstat.h
index 5050bc194505..879b93b5aad2 100644
--- a/include/linux/vzstat.h
+++ b/include/linux/vzstat.h
@@ -28,10 +28,6 @@  struct kstat_lat_pcpu_snap_struct {
 	seqcount_t lock;
 } ____cacheline_aligned_in_smp;
 
-struct kstat_lat_struct {
-	struct kstat_lat_snap_struct cur, last;
-	u64 avg[3];
-};
 struct kstat_lat_pcpu_struct {
 	struct kstat_lat_pcpu_snap_struct *cur;
 	u64 max_snap;
@@ -109,18 +105,14 @@  extern void KSTAT_PERF_ADD(struct kstat_perf_pcpu_struct *ptr, u64 real_time,
 	sleep_time = current->se.statistics->sum_sleep_runtime - sleep_time; \
 	KSTAT_PERF_ADD(&kstat_glob.name, start, start - sleep_time);
 
-extern void KSTAT_LAT_ADD(struct kstat_lat_struct *p, u64 dur);
 extern void KSTAT_LAT_PCPU_ADD(struct kstat_lat_pcpu_struct *p, int cpu, u64 dur);
-extern void KSTAT_LAT_UPDATE(struct kstat_lat_struct *p);
 extern void KSTAT_LAT_PCPU_UPDATE(struct kstat_lat_pcpu_struct *p);
 
 #else
 #define KSTAT_PERF_ADD(ptr, real_time, cpu_time)
 #define KSTAT_PERF_ENTER(name)
 #define KSTAT_PERF_LEAVE(name)
-#define KSTAT_LAT_ADD(p, dur)
 #define KSTAT_LAT_PCPU_ADD(p, cpu, dur)
-#define KSTAT_LAT_UPDATE(p)
 #define KSTAT_LAT_PCPU_UPDATE(p)
 #define KSTAT_LAT_PCPU_UPDATE(p)
 #endif
diff --git a/kernel/ve/vzstat_core.c b/kernel/ve/vzstat_core.c
index c179c9fb851b..24a0e1e56101 100644
--- a/kernel/ve/vzstat_core.c
+++ b/kernel/ve/vzstat_core.c
@@ -24,19 +24,6 @@  void KSTAT_PERF_ADD(struct kstat_perf_pcpu_struct *ptr, u64 real_time, u64 cpu_t
 	put_cpu_ptr(cur);
 }
 
-/*
- * Add another statistics reading.
- * Serialization is the caller's due.
- */
-void KSTAT_LAT_ADD(struct kstat_lat_struct *p,
-		u64 dur)
-{
-	p->cur.count++;
-	if (p->cur.maxlat < dur)
-		p->cur.maxlat = dur;
-	p->cur.totlat += dur;
-}
-
 /*
  * Must be called with disabled interrupts to remove any possible
  * locks and seqcounts under write-lock and avoid this 3-way deadlock:
@@ -74,18 +61,6 @@  void KSTAT_LAT_PCPU_ADD(struct kstat_lat_pcpu_struct *p, int cpu,
  * Move current statistics to last, clear last.
  * Serialization is the caller's due.
  */
-void KSTAT_LAT_UPDATE(struct kstat_lat_struct *p)
-{
-	u64 m;
-	memcpy(&p->last, &p->cur, sizeof(p->last));
-	p->cur.maxlat = 0;
-	m = p->last.maxlat;
-	CALC_LOAD(p->avg[0], EXP_1, m)
-	CALC_LOAD(p->avg[1], EXP_5, m)
-	CALC_LOAD(p->avg[2], EXP_15, m)
-}
-EXPORT_SYMBOL(KSTAT_LAT_UPDATE);
-
 void KSTAT_LAT_PCPU_UPDATE(struct kstat_lat_pcpu_struct *p)
 {
 	unsigned i, cpu;