Changeset 50059 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jan 13, 2014 9:10:18 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp
r48935 r50059 185 185 RTCPUID cMax = rtMpLinuxMaxCpus(); 186 186 uint32_t *paidCores = (uint32_t *)alloca(sizeof(paidCores[0]) * (cMax + 1)); 187 uint32_t *paidPckgs = (uint32_t *)alloca(sizeof(paidPckgs[0]) * (cMax + 1)); 187 188 uint32_t cCores = 0; 188 189 for (RTCPUID idCpu = 0; idCpu < cMax; idCpu++) … … 191 192 { 192 193 uint32_t idCore = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/core_id", (int)idCpu); 194 uint32_t idPckg = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/physical_package_id", (int)idCpu); 193 195 uint32_t i; 194 196 for (i = 0; i < cCores; i++) 195 if (paidCores[i] == idCore) 197 if ( paidCores[i] == idCore 198 && paidPckgs[i] == idPckg) 196 199 break; 197 200 if (i >= cCores) 198 paidCores[cCores++] = idCore; 201 { 202 paidCores[cCores] = idCore; 203 paidPckgs[cCores] = idPckg; 204 cCores++; 205 } 199 206 } 200 207 } … … 227 234 RTCPUID cMax = rtMpLinuxMaxCpus(); 228 235 uint32_t *paidCores = (uint32_t *)alloca(sizeof(paidCores[0]) * (cMax + 1)); 236 uint32_t *paidPckgs = (uint32_t *)alloca(sizeof(paidPckgs[0]) * (cMax + 1)); 229 237 uint32_t cCores = 0; 230 238 for (RTCPUID idCpu = 0; idCpu < cMax; idCpu++) … … 233 241 { 234 242 uint32_t idCore = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/core_id", (int)idCpu); 243 uint32_t idPckg = (uint32_t)RTLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/topology/physical_package_id", (int)idCpu); 235 244 uint32_t i; 236 245 for (i = 0; i < cCores; i++) 237 if (paidCores[i] == idCore) 246 if ( paidCores[i] == idCore 247 && paidPckgs[i] == idPckg) 238 248 break; 239 249 if (i >= cCores) 240 paidCores[cCores++] = idCore; 250 { 251 paidCores[cCores] = idCore; 252 paidPckgs[cCores] = idPckg; 253 cCores++; 254 } 241 255 } 242 256 }
Note:
See TracChangeset
for help on using the changeset viewer.