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 <aryabi...@virtuozzo.com>
---
 include/linux/kstat.h  | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/vzstat.h | 44 +-------------------------------------------
 2 files changed, 49 insertions(+), 43 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..4fff25bcb93f
--- /dev/null
+++ b/include/linux/kstat.h
@@ -0,0 +1,48 @@
+#ifndef __LINUX_KSTAT_H
+#define __LINUX_KSTAT_H
+
+enum {
+       KSTAT_ALLOCSTAT_ATOMIC,
+       KSTAT_ALLOCSTAT_LOW,
+       KSTAT_ALLOCSTAT_HIGH,
+       KSTAT_ALLOCSTAT_LOW_MP,
+       KSTAT_ALLOCSTAT_HIGH_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 fec88011b1d7..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,55 +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_LOW,
-       KSTAT_ALLOCSTAT_HIGH,
-       KSTAT_ALLOCSTAT_LOW_MP,
-       KSTAT_ALLOCSTAT_HIGH_MP,
-       KSTAT_ALLOCSTAT_NR,
-};
-
 struct kernel_stat_glob {
        unsigned long nr_unint_avg[3];
        seqcount_t nr_unint_avg_seq;
-- 
2.16.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to