[Devel] [PATCH RHEL7 COMMIT] ve/vzstat.h: move some kstat definitions into new header

Konstantin Khorenko khorenko at virtuozzo.com
Thu Feb 15 19:02:33 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.43.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.43.6
------>
commit c98a0fae0c9a854d1eb90c56a78c84572837764f
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Feb 15 19:02:33 2018 +0300

    ve/vzstat.h: move some kstat definitions into new header
    
    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  | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/vzstat.h | 44 +-------------------------------------------
 2 files changed, 49 insertions(+), 43 deletions(-)

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;


More information about the Devel mailing list