Removed the code of setting SCHED_IDLE policy for revocable containers. Review: https://reviews.apache.org/r/36413
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c2c9bddd Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c2c9bddd Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c2c9bddd Branch: refs/heads/master Commit: c2c9bddd91bc522192054c403037f21922451144 Parents: 644bd30 Author: Jie Yu <[email protected]> Authored: Fri Jul 10 17:07:06 2015 -0700 Committer: Jie Yu <[email protected]> Committed: Thu Jul 16 17:03:52 2015 -0700 ---------------------------------------------------------------------- .../isolators/cgroups/cpushare.cpp | 20 -------------------- src/tests/isolator_tests.cpp | 4 ---- 2 files changed, 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c2c9bddd/src/slave/containerizer/isolators/cgroups/cpushare.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/isolators/cgroups/cpushare.cpp b/src/slave/containerizer/isolators/cgroups/cpushare.cpp index 45ee2fc..750bef9 100644 --- a/src/slave/containerizer/isolators/cgroups/cpushare.cpp +++ b/src/slave/containerizer/isolators/cgroups/cpushare.cpp @@ -41,7 +41,6 @@ #include <stout/try.hpp> #include "linux/cgroups.hpp" -#include "linux/sched.hpp" #include "slave/flags.hpp" @@ -335,25 +334,6 @@ Future<Nothing> CgroupsCpushareIsolatorProcess::isolate( } } - // NOTE: This only sets the executor and descendants to IDLE policy - // if the initial CPU resource is revocable and not if initial CPU - // is non-revocable but subsequent updates include revocable CPU. - if (info->resources.isSome() && - info->resources.get().revocable().cpus().isSome() && - flags.revocable_cpu_low_priority) { - Try<Nothing> set = sched::policy::set(sched::Policy::IDLE, pid); - if (set.isError()) { - return Failure("Failed to set SCHED_IDLE for pid " + stringify(pid) + - " in container '" + stringify(containerId) + "'" + - " with revocable CPU: " + set.error()); - } - - LOG(INFO) << "Set scheduling policy to SCHED_IDLE for pid " << pid - << " in container '" << containerId << "' because it includes '" - << info->resources.get().revocable().cpus().get() - << "' revocable CPU"; - } - return Nothing(); } http://git-wip-us.apache.org/repos/asf/mesos/blob/c2c9bddd/src/tests/isolator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/isolator_tests.cpp b/src/tests/isolator_tests.cpp index 9fc02c4..b3832b4 100644 --- a/src/tests/isolator_tests.cpp +++ b/src/tests/isolator_tests.cpp @@ -41,7 +41,6 @@ #ifdef __linux__ #include "linux/ns.hpp" -#include "linux/sched.hpp" #endif // __linux__ #include "master/master.hpp" @@ -414,9 +413,6 @@ TEST_F(RevocableCpuIsolatorTest, ROOT_CGROUPS_RevocableCpu) AWAIT_READY(isolator.get()->isolate(containerId, pid.get())); - // Check the executor has its scheduling policy set to IDLE. - EXPECT_SOME_EQ(sched::Policy::IDLE, sched::policy::get(pid.get())); - // Executor should have proper cpu.shares for revocable containers. Result<string> cpuHierarchy = cgroups::hierarchy("cpu"); ASSERT_SOME(cpuHierarchy);
