Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GC] Fix data type in IOPrioritySizePolicy #673

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class IOPolicy : public CHeapObj<mtGC> {
* cpu 417487649 75106 102895030 23107566512 152075 65480092 6013218 0 0 0
*/
size_t user, nice, system, idle, iowait_time, irq, softirq, steal, guest, guest_nice;
int parse_line = sscanf(line, "cpu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu", &user,
&nice, &system, &idle, &iowait_time, &irq, &softirq, &steal, &guest, &guest_nice);
int parse_line = sscanf(line, "cpu " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT, &user,
&nice, &system, &idle, &iowait_time, &irq, &softirq, &steal, &guest, &guest_nice);
if (parse_line != 10) {
fill_value_fail(file);
return;
Expand Down Expand Up @@ -276,8 +276,8 @@ class IOPolicy : public CHeapObj<mtGC> {
return eden_size;
}
size_t reduced_size;
reduced_size = MIN(eden_size, avg_survivor * IOPrioritySizePolicyEdenScale);
reduced_size = MAX(reduced_size, ParallelScavengeHeap::heap()->young_gen()->max_size() / 10);
reduced_size = (size_t)MIN2((float)eden_size, avg_survivor * (float)IOPrioritySizePolicyEdenScale);
reduced_size = MAX2(reduced_size, ParallelScavengeHeap::heap()->young_gen()->max_size() / 10);
if (PrintAdaptiveSizePolicy) {
gclog_or_tty->print_cr(
"decrease eden from " SIZE_FORMAT "M to " SIZE_FORMAT
Expand All @@ -294,8 +294,8 @@ class IOPolicy : public CHeapObj<mtGC> {
}
const static float PromoScale = 5;
size_t reduced_size;
reduced_size = MIN(reduced_size, avg_promo * PromoScale);
reduced_size = MAX(reduced_size,
reduced_size = (size_t)MIN2((float)promo_size, avg_promo * PromoScale);
reduced_size = MAX2(reduced_size,
ParallelScavengeHeap::heap()->old_gen()->max_gen_size() / 10);
if (PrintAdaptiveSizePolicy) {
gclog_or_tty->print_cr(
Expand Down
Loading