This is an automated email from the ASF dual-hosted git repository. jpeach pushed a commit to branch 1.7.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 9ca78518163cf6d8fd6acc50ad16ac68d8ad77ed Author: James Peach <jpe...@apache.org> AuthorDate: Tue Nov 27 09:08:40 2018 -0800 Added the `DISCARD` blkio cgroup operation. The Linux 4.19 kernel added a new `Discard` operation to the blkio cgroup statistics. Added this new operation so that the containerizer won't fail to parse blkio statistics on the latest kernels. Review: https://reviews.apache.org/r/69449/ (cherry picked from commit 68cf4372721ca71741b6d836072f432d65d102f9) --- include/mesos/mesos.proto | 1 + include/mesos/v1/mesos.proto | 1 + src/linux/cgroups.cpp | 5 ++++- src/linux/cgroups.hpp | 3 +++ src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp | 3 +++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto index 5a985fc..bf46cc9 100644 --- a/include/mesos/mesos.proto +++ b/include/mesos/mesos.proto @@ -3274,6 +3274,7 @@ message CgroupInfo { WRITE = 3; SYNC = 4; ASYNC = 5; + DISCARD = 6; } // Describes a stat value without the device descriptor part. diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto index a5ebb78..8b84879 100644 --- a/include/mesos/v1/mesos.proto +++ b/include/mesos/v1/mesos.proto @@ -3267,6 +3267,7 @@ message CgroupInfo { WRITE = 3; SYNC = 4; ASYNC = 5; + DISCARD = 6; } // Describes a stat value without the device descriptor part. diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp index 45dd5cf..73646c9 100644 --- a/src/linux/cgroups.cpp +++ b/src/linux/cgroups.cpp @@ -1804,7 +1804,8 @@ static bool isOperation(const string& s) s == "Read" || s == "Write" || s == "Sync" || - s == "Async"); + s == "Async" || + s == "Discard"); } @@ -1820,6 +1821,8 @@ static Try<Operation> parseOperation(const string& s) return Operation::SYNC; } else if (s == "Async") { return Operation::ASYNC; + } else if (s == "Discard") { + return Operation::DISCARD; } return Error("Invalid Operation value: '" + s + "'"); diff --git a/src/linux/cgroups.hpp b/src/linux/cgroups.hpp index f4cc2d8..19c0092 100644 --- a/src/linux/cgroups.hpp +++ b/src/linux/cgroups.hpp @@ -461,6 +461,7 @@ enum class Operation { WRITE, SYNC, ASYNC, + DISCARD, }; @@ -646,6 +647,8 @@ inline std::ostream& operator<<(std::ostream& stream, const Operation op) return stream << "Sync"; case Operation::ASYNC: return stream << "Async"; + case Operation::DISCARD: + return stream << "Discard"; } UNREACHABLE(); diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp index fbf1fed..19afed9 100644 --- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp +++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp @@ -85,6 +85,9 @@ static void setValue( case cgroups::blkio::Operation::ASYNC: value->set_op(CgroupInfo::Blkio::ASYNC); break; + case cgroups::blkio::Operation::DISCARD: + value->set_op(CgroupInfo::Blkio::DISCARD); + break; } }