8255047: Add HotSpot UseDebuggerErgo flags

Reviewed-by: dcubed, dholmes
This commit is contained in:
Stefan Karlsson 2020-10-22 08:24:51 +00:00
parent 211bb62a90
commit ae72b5283b
4 changed files with 51 additions and 3 deletions

View file

@ -3217,7 +3217,17 @@ void os::Linux::rebuild_cpu_to_node_map() {
if (cpu_map[j] != 0) {
for (size_t k = 0; k < BitsPerCLong; k++) {
if (cpu_map[j] & (1UL << k)) {
cpu_to_node()->at_put(j * BitsPerCLong + k, closest_node);
int cpu_index = j * BitsPerCLong + k;
#ifndef PRODUCT
if (UseDebuggerErgo1 && cpu_index >= (int)cpu_num) {
// Some debuggers limit the processor count without
// intercepting the NUMA APIs. Just fake the values.
cpu_index = 0;
}
#endif
cpu_to_node()->at_put(cpu_index, closest_node);
}
}
}
@ -4762,7 +4772,16 @@ int os::active_processor_count() {
uint os::processor_id() {
const int id = Linux::sched_getcpu();
assert(id >= 0 && id < _processor_count, "Invalid processor id");
#ifndef PRODUCT
if (UseDebuggerErgo1 && id >= _processor_count) {
// Some debuggers limit the processor count without limiting
// the returned processor ids. Fake the processor id.
return 0;
}
#endif
assert(id >= 0 && id < _processor_count, "Invalid processor id [%d]", id);
return (uint)id;
}