From 2ae079c6be9fea7d829aad9ac539bbc1f654ec0a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 11 Oct 2020 17:26:10 -0700 Subject: [PATCH] cpu: Remove automatic overriding of numThreads in SE on O3. On the O3 CPU, when the number of threads on the CPU (SMT) is too low to hold all the old style CPU workload items, then it would increase the number of threads to match. There are three problems with this. 1. This behavior was only implemented on O3. 2. It could silently hide a bug in the config where the number of workload items was accidentally too big. 3. It makes the DerivO3CPUParams struct tamper with itself in the create() method, which means not even config.ini will accurately reflect the actual config of the system. Change-Id: I0aab70d4b98093f7f14156ca437e763f031049ab Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35937 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/cpu/o3/cpu.cc | 4 ++++ src/cpu/o3/deriv.cc | 14 -------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 20274e010..c5043a7e5 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -132,6 +132,10 @@ FullO3CPU::FullO3CPU(DerivO3CPUParams *params) fatal_if(FullSystem && params->numThreads > 1, "SMT is not supported in O3 in full system mode currently."); + fatal_if(!FullSystem && params->numThreads < params->workload.size(), + "More workload items (%d) than threads (%d) on CPU %s.", + params->workload.size(), params->numThreads, name()); + if (!params->switched_out) { _status = Running; } else { diff --git a/src/cpu/o3/deriv.cc b/src/cpu/o3/deriv.cc index 68baae421..5da710fac 100644 --- a/src/cpu/o3/deriv.cc +++ b/src/cpu/o3/deriv.cc @@ -35,19 +35,5 @@ DerivO3CPU * DerivO3CPUParams::create() { - if (!FullSystem) { - if (workload.size() > numThreads) { - fatal("Workload Size (%i) > Max Supported Threads (%i) on This CPU", - workload.size(), numThreads); - } else if (workload.size() == 0) { - fatal("Must specify at least one workload!"); - } - - // In non-full-system mode, we infer the number of threads from - // the workload if it's not explicitly specified. - numThreads = - (numThreads >= workload.size()) ? numThreads : workload.size(); - } - return new DerivO3CPU(this); } -- 2.30.2