History

mm/memcg: move penalty delay clamping out of calculate_high_delay()

We will want to call calculate_high_delay() twice - once for memory and once for swap, and we should apply the clamp value to sum of the penalties. Clamping has to be applied outside of calculate_high_delay().

Jakub Kicinski committed 6 years ago

Commit ff144e61 parent 8a5dbc61 file · +8 −8Browse files

Unified · Split

mm/memcontrol.c+8−8
@@ -2386,14 +2386,7 @@ static unsigned long calculate_high_delay(struct mem_cgroup *memcg, · 2385 unmodified lines
23862386 * MEMCG_CHARGE_BATCH pages is nominal, so work out how much smaller or
23872387 * larger the current charge patch is than that.
23882388 */
2389− penalty_jiffies = penalty_jiffies * nr_pages / MEMCG_CHARGE_BATCH;
2390−
2391− /*
2392− * Clamp the max delay per usermode return so as to still keep the
2393− * application moving forwards and also permit diagnostics, albeit
2394− * extremely slowly.
2395− */
2396− return min(penalty_jiffies, MEMCG_MAX_HIGH_DELAY_JIFFIES);
2389+ return penalty_jiffies * nr_pages / MEMCG_CHARGE_BATCH;
23972390 }
23982391
23992392 /*
@@ -2421,6 +2414,13 @@ void mem_cgroup_handle_over_high(void) · 21 unmodified lines
24212414 penalty_jiffies = calculate_high_delay(memcg, nr_pages,
24222415 mem_find_max_overage(memcg));
24232416
2417+ /*
2418+ * Clamp the max delay per usermode return so as to still keep the
2419+ * application moving forwards and also permit diagnostics, albeit
2420+ * extremely slowly.
2421+ */
2422+ penalty_jiffies = min(penalty_jiffies, MEMCG_MAX_HIGH_DELAY_JIFFIES);
2423+
24242424 /*
24252425 * Don't sleep if the amount of jiffies this memcg owes us is so low
24262426 * that it's not even worth doing, in an attempt to be nice to those who

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t