forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commitd505b8a
sched: Defend cfs and rt bandwidth quota against overflow
When users write some huge number into cpu.cfs_quota_us orcpu.rt_runtime_us, overflow might happen during to_ratio() shifts ofschedulable checks.to_ratio() could be altered to avoid unnecessary internal overflow, butmin_cfs_quota_period is less than 1 << BW_SHIFT, so a cutoff would stillbe needed. Set a cap MAX_BW for cfs_quota_us and rt_runtime_us toprevent overflow.Signed-off-by: Huaixin Chang <changhuaixin@linux.alibaba.com>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Reviewed-by: Ben Segall <bsegall@google.com>Link:https://lkml.kernel.org/r/20200425105248.60093-1-changhuaixin@linux.alibaba.com1 parentdbe9337 commitd505b8a
3 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7379 | 7379 | | |
7380 | 7380 | | |
7381 | 7381 | | |
| 7382 | + | |
| 7383 | + | |
7382 | 7384 | | |
7383 | 7385 | | |
7384 | 7386 | | |
| |||
7406 | 7408 | | |
7407 | 7409 | | |
7408 | 7410 | | |
| 7411 | + | |
| 7412 | + | |
| 7413 | + | |
| 7414 | + | |
| 7415 | + | |
| 7416 | + | |
7409 | 7417 | | |
7410 | 7418 | | |
7411 | 7419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
2585 | 2587 | | |
2586 | 2588 | | |
2587 | 2589 | | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
2588 | 2596 | | |
2589 | 2597 | | |
2590 | 2598 | | |
| |||
2702 | 2710 | | |
2703 | 2711 | | |
2704 | 2712 | | |
2705 | | - | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
2706 | 2716 | | |
2707 | 2717 | | |
2708 | 2718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1915 | 1915 | | |
1916 | 1916 | | |
1917 | 1917 | | |
| 1918 | + | |
| 1919 | + | |
1918 | 1920 | | |
1919 | 1921 | | |
1920 | 1922 | | |
| |||
0 commit comments
Comments
(0)