summaryrefslogtreecommitdiff
path: root/src/classlibnative
diff options
context:
space:
mode:
authorGuillaume B <gboucher90@users.noreply.github.com>2017-07-21 14:08:11 +0200
committerJan Vorlicek <janvorli@microsoft.com>2017-07-21 14:08:11 +0200
commitdf214e67d3cbccb42d2733f4cbe8097a378a731a (patch)
treea0cf5dac96b96b590853ea096bebbabe7d62a521 /src/classlibnative
parente6865018d91fd257f05a42fe4fe353beb32c641a (diff)
downloadcoreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.tar.gz
coreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.tar.bz2
coreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.zip
Add CGroup CFS CPU limit support (#12797)
Diffstat (limited to 'src/classlibnative')
-rw-r--r--src/classlibnative/bcltype/system.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/classlibnative/bcltype/system.cpp b/src/classlibnative/bcltype/system.cpp
index f6a19f97d1..4e13bd1876 100644
--- a/src/classlibnative/bcltype/system.cpp
+++ b/src/classlibnative/bcltype/system.cpp
@@ -369,6 +369,13 @@ INT32 QCALLTYPE SystemNative::GetProcessorCount()
processorCount = systemInfo.dwNumberOfProcessors;
}
+#ifdef FEATURE_PAL
+ uint32_t cpuLimit;
+
+ if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < processorCount)
+ processorCount = cpuLimit;
+#endif
+
END_QCALL;
return processorCount;