Skip to content

Commit 538e005

Browse files
author
Kim Barrett
committedApr 28, 2020
8242459: ForceNUMA and only one available NUMA node hits a guarantee
Fix some asserts to handle the single-NUMA node + ForceNUMA case. Reviewed-by: sjohanss, tschatzl
1 parent 1041efe commit 538e005

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/hotspot/share/gc/g1/g1NUMAStats.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,8 @@ double G1NUMAStats::Stat::rate() const {
3131
}
3232

3333
G1NUMAStats::NodeDataArray::NodeDataArray(uint num_nodes) {
34-
guarantee(num_nodes > 1, "Number of nodes (%u) should be set", num_nodes);
34+
// Not using > 1, for -XX:+ForceNUMA support.
35+
guarantee(num_nodes > 0, "Number of nodes (%u) should be set", num_nodes);
3536

3637
// The row represents the number of nodes.
3738
_num_column = num_nodes;
@@ -124,7 +125,8 @@ void G1NUMAStats::NodeDataArray::copy(uint req_index, size_t* stat) {
124125
G1NUMAStats::G1NUMAStats(const int* node_ids, uint num_node_ids) :
125126
_node_ids(node_ids), _num_node_ids(num_node_ids), _node_data() {
126127

127-
assert(_num_node_ids > 1, "Should have more than one active memory nodes %u", _num_node_ids);
128+
// Not using > 1, for -XX:+ForceNUMA support.
129+
assert(_num_node_ids > 0, "Should have at least one node id: %u", _num_node_ids);
128130

129131
for (int i = 0; i < NodeDataItemsSentinel; i++) {
130132
_node_data[i] = new NodeDataArray(_num_node_ids);

0 commit comments

Comments
 (0)
Please sign in to comment.