From a9b4698c526690f40de3332f0c4836d4f5883b98 Mon Sep 17 00:00:00 2001 From: dogsheng <960055655@qq.com> Date: Wed, 25 Dec 2019 15:57:46 +0800 Subject: [PATCH] Package init --- ...tats_read-func-obtain-data-from-blki.patch | 39 +++++++++++++++++++ lxcfs.spec | 1 + 2 files changed, 40 insertions(+) create mode 100644 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch diff --git a/0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch b/0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch new file mode 100644 index 0000000..22f90b4 --- /dev/null +++ b/0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch @@ -0,0 +1,39 @@ +From 9eb93c62629d7d0eb42c941d6368455749171258 Mon Sep 17 00:00:00 2001 +From: zhangsong +Date: Wed, 9 Oct 2019 07:24:50 +0800 +Subject: [PATCH] lxcfs: proc_diskstats_read func obtain data from + 'blkio.throttle.*' + +reason:There are many scheduler in linux kernel, such as cfq, bfq, deadline, +etc. However, 'blkio.[a-z_]+' is for cfq, there is nothing provided when OS uses +other scheduler. Cgroup block controller throttle works at generic block layer +which could collect serviced and serviced_bytes information for every scheduler. + +Signed-off-by: zhangsong +--- + bindings.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/bindings.c b/bindings.c +index e7138f8..a76483c 100644 +--- a/bindings.c ++++ b/bindings.c +@@ -4222,11 +4222,13 @@ static int proc_diskstats_read(char *buf, size_t size, off_t offset, + return read_file("/proc/diskstats", buf, size, d); + prune_init_slice(cg); + +- if (!(io_serviced_str = cgfs_get_value("blkio", cg, "blkio.io_serviced_recursive"))) ++ if (!(io_serviced_str = cgfs_get_value("blkio", cg, "blkio.throttle.io_serviced_recursive")) ++ && !(io_serviced_str = cgfs_get_value("blkio", cg, "blkio.throttle.io_serviced"))) + goto err; + if (!(io_merged_str = cgfs_get_value("blkio", cg, "blkio.io_merged_recursive"))) + goto err; +- if (!(io_service_bytes_str = cgfs_get_value("blkio", cg, "blkio.io_service_bytes_recursive"))) ++ if (!(io_service_bytes_str = cgfs_get_value("blkio", cg, "blkio.throttle.io_service_bytes_recursive")) ++ && !(io_service_bytes_str = cgfs_get_value("blkio", cg, "blkio.throttle.io_service_bytes"))) + goto err; + if (!(io_wait_time_str = cgfs_get_value("blkio", cg, "blkio.io_wait_time_recursive"))) + goto err; +-- +2.21.0 + diff --git a/lxcfs.spec b/lxcfs.spec index 1ed5ba3..d1709b8 100644 --- a/lxcfs.spec +++ b/lxcfs.spec @@ -29,6 +29,7 @@ Patch9016: 0016-lxcfs-fix-concurrency-problem.patch Patch9017: 0017-diskstats-support-devicemapper-device.patch Patch9018: 0018-lxcfs-add-proc-partitions.patch Patch9019: 0019-use-bitwise-operators-only-on-unsigned.patch +Patch9020: 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch #Dependency BuildRequires: autoconf automake libtool help2man