Skip to content

Commit a93e88a

Browse files
committed
whitespace clean-ups and other small fixes
1 parent 02300bc commit a93e88a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ bool CgroupSubsystem::memory_limit_in_bytes(physical_memory_size_type upper_boun
676676
CachingCgroupController<CgroupMemoryController>* contrl = memory_controller();
677677
CachedMetric* memory_limit = contrl->metrics_cache();
678678
if (!memory_limit->should_check_metric()) {
679-
value = memory_limit->value();
679+
value = memory_limit->value();
680680
return true;
681681
}
682682
physical_memory_size_type mem_limit = 0;

src/hotspot/os/linux/cgroupUtil_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int CgroupUtil::get_updated_cpu_limit(CgroupCpuController* cpu,
7878
int upper_bound) {
7979
assert(lowest > 0 && lowest <= upper_bound, "invariant");
8080
int cpu_limit_val = -1;
81-
if (CgroupUtil::processor_count(cpu, upper_bound, cpu_limit_val) && cpu_limit_val != -1) {
81+
if (CgroupUtil::processor_count(cpu, upper_bound, cpu_limit_val) && cpu_limit_val != upper_bound) {
8282
assert(cpu_limit_val <= upper_bound, "invariant");
8383
if (lowest > cpu_limit_val) {
8484
return cpu_limit_val;

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ bool CgroupV1MemoryController::memory_max_usage_in_bytes(physical_memory_size_ty
349349

350350
bool CgroupV1MemoryController::rss_usage_in_bytes(physical_memory_size_type& result) {
351351
physical_memory_size_type rss = 0;
352-
352+
353353
if (!reader()->read_numerical_key_value("/memory.stat", "rss", rss)) {
354354
return false;
355355
}
@@ -452,13 +452,13 @@ char* CgroupV1Subsystem::cpu_cpuset_memory_nodes() {
452452
* result reference.
453453
*
454454
* return:
455-
* true if the value was set in the result reference
455+
* true if the value was set in the result reference
456456
* false on failure to read the number from the file
457457
* and the result reference has not been touched.
458458
*/
459459
bool CgroupV1CpuController::cpu_quota(int& result) {
460460
uint64_t quota = 0;
461-
461+
462462
// intentionally not using the macro so as to not log a
463463
// negative value as a large unsiged int
464464
if (!reader()->read_number("/cpu.cfs_quota_us", quota)) {

src/hotspot/os/linux/osContainer_linux.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
// Some cgroup interface files define the value 'max' for unlimited.
3434
// Define this constant value to indicate this value.
3535
const uint64_t value_unlimited = std::numeric_limits<uint64_t>::max();
36-
const uint64_t value_unused = 0;
3736

3837
// 20ms timeout between re-reads of memory limit and _active_processor_count.
3938
#define OSCONTAINER_CACHE_TIMEOUT (NANOSECS_PER_SEC/50)
4039

4140
// Carrier object for print_container_helper()
4241
class MetricResult: public StackObj {
4342
private:
43+
static const uint64_t value_unused = 0;
4444
bool _success = false;
4545
physical_memory_size_type _value = value_unused;
46-
public:
46+
public:
4747
void set_value(physical_memory_size_type val) {
4848
// having a value means success
4949
_success = true;

test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ TEST(cgroupTest, read_number_tests) {
275275
// Some interface files have numbers as well as the string
276276
// 'max', which means unlimited.
277277
uint64_t result = 0;
278-
uint64_t unlimited = SIZE_MAX;
278+
uint64_t unlimited = std::numeric_limits<uint64_t>::max();
279279
fill_file(test_file, "max\n");
280280
ok = controller->read_number_handle_max(base_with_slash, result);
281281
EXPECT_TRUE(ok) << "Number parsing for 'max' string should have been successful";

0 commit comments

Comments
 (0)