YARN-600. Hook up cgroups CPU settings to the number of virtual cores allocated. (sandyr via tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1492365 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2013-06-12 18:57:31 +00:00
parent b090bc1c21
commit 80eb92aff0
2 changed files with 5 additions and 5 deletions

View File

@ -315,6 +315,9 @@ Release 2.1.0-beta - UNRELEASED
YARN-731. RPCUtil.unwrapAndThrowException should unwrap remote
RuntimeExceptions. (Zhijie Shen via sseth)
YARN-600. Hook up cgroups CPU settings to the number of virtual cores
allocated. (sandyr via tucu)
OPTIMIZATIONS
YARN-512. Log aggregation root directory check is more expensive than it

View File

@ -172,18 +172,15 @@ public class CgroupsLCEResourcesHandler implements LCEResourcesHandler {
* Next three functions operate on all the resources we are enforcing.
*/
/*
* TODO: After YARN-2 is committed, we should call containerResource.getCpus()
* (or equivalent) to multiply the weight by the number of requested cpus.
*/
private void setupLimits(ContainerId containerId,
Resource containerResource) throws IOException {
String containerName = containerId.toString();
if (isCpuWeightEnabled()) {
createCgroup(CONTROLLER_CPU, containerName);
int cpuShares = CPU_DEFAULT_WEIGHT * containerResource.getVirtualCores();
updateCgroup(CONTROLLER_CPU, containerName, "shares",
String.valueOf(CPU_DEFAULT_WEIGHT));
String.valueOf(cpuShares));
}
}