[Devel] [PATCH rh7 2/3] ve/vzstat.h: move some kstat definitions into new header.

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Feb 14 20:00:25 MSK 2018


Move some definitions into kstat.h, so we could use later
in other headers (sched.h)

https://jira.sw.ru/browse/PSBM-81395
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 include/linux/kstat.h  | 45 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/vzstat.h | 42 +-----------------------------------------
 2 files changed, 46 insertions(+), 41 deletions(-)
 create mode 100644 include/linux/kstat.h

diff --git a/include/linux/kstat.h b/include/linux/kstat.h
new file mode 100644
index 000000000000..22718c7f8b30
--- /dev/null
+++ b/include/linux/kstat.h
@@ -0,0 +1,45 @@
+#ifndef __LINUX_KSTAT_H
+#define __LINUX_KSTAT_H
+enum {
+	KSTAT_ALLOCSTAT_ATOMIC,
+	KSTAT_ALLOCSTAT,
+	KSTAT_ALLOCSTAT_MP,
+	KSTAT_ALLOCSTAT_NR,
+};
+
+struct kstat_perf_snap_struct {
+	u64 wall_tottime, cpu_tottime;
+	u64 wall_maxdur, cpu_maxdur;
+	unsigned long count;
+};
+
+struct kstat_perf_pcpu_snap_struct {
+	u64 wall_tottime, cpu_tottime;
+	u64 wall_maxdur, cpu_maxdur;
+	unsigned long count;
+	seqcount_t lock;
+};
+
+struct kstat_perf_pcpu_struct {
+	struct kstat_perf_pcpu_snap_struct *cur;
+	struct kstat_perf_snap_struct last;
+};
+
+struct kstat_lat_snap_struct {
+	u64 maxlat, totlat;
+	unsigned long count;
+};
+
+struct kstat_lat_pcpu_snap_struct {
+	u64 maxlat, totlat;
+	unsigned long count;
+} ____cacheline_aligned_in_smp;
+
+struct kstat_lat_pcpu_struct {
+	struct kstat_lat_pcpu_snap_struct *cur;
+	u64 max_snap;
+	struct kstat_lat_snap_struct last;
+	u64 avg[3];
+};
+
+#endif
diff --git a/include/linux/vzstat.h b/include/linux/vzstat.h
index f8e806b29cb7..f1475b2b763a 100644
--- a/include/linux/vzstat.h
+++ b/include/linux/vzstat.h
@@ -10,6 +10,7 @@
 #define __VZSTAT_H__
 
 #include <linux/mmzone.h>
+#include <linux/kstat.h>
 
 struct swap_cache_info_struct {
 	unsigned long add_total;
@@ -18,53 +19,12 @@ struct swap_cache_info_struct {
 	unsigned long find_total;
 };
 
-struct kstat_lat_snap_struct {
-	u64 maxlat, totlat;
-	unsigned long count;
-};
-struct kstat_lat_pcpu_snap_struct {
-	u64 maxlat, totlat;
-	unsigned long count;
-} ____cacheline_aligned_in_smp;
-
-struct kstat_lat_pcpu_struct {
-	struct kstat_lat_pcpu_snap_struct *cur;
-	u64 max_snap;
-	struct kstat_lat_snap_struct last;
-	u64 avg[3];
-};
-
-struct kstat_perf_snap_struct {
-	u64 wall_tottime, cpu_tottime;
-	u64 wall_maxdur, cpu_maxdur;
-	unsigned long count;
-};
-
-struct kstat_perf_pcpu_snap_struct {
-	u64 wall_tottime, cpu_tottime;
-	u64 wall_maxdur, cpu_maxdur;
-	unsigned long count;
-	seqcount_t lock;
-};
-
-struct kstat_perf_pcpu_struct {
-	struct kstat_perf_pcpu_snap_struct *cur;
-	struct kstat_perf_snap_struct last;
-};
-
 struct kstat_zone_avg {
 	unsigned long		free_pages_avg[3],
 				nr_active_avg[3],
 				nr_inactive_avg[3];
 };
 
-enum {
-	KSTAT_ALLOCSTAT_ATOMIC,
-	KSTAT_ALLOCSTAT,
-	KSTAT_ALLOCSTAT_MP,
-	KSTAT_ALLOCSTAT_NR,
-};
-
 struct kernel_stat_glob {
 	unsigned long nr_unint_avg[3];
 	seqcount_t nr_unint_avg_seq;
-- 
2.13.6



More information about the Devel mailing list