Commit b41f544
committed
mm: scrape LRU pages for offlined memcgs
jira KERNEL-173
feature Add ability to scrape LRU pages from offlined memcgs
commit-author: Yu Zhao <[email protected]>
commit-source v1-0001-mm-scrape-LRU-pages-for-offlined-memcgs.patch
commit-source-path Provided by Google Engineering
upstream-diff A few tweaks to the original patch were necessary:
* Format changes because Documentation/sysctl/vm.txt has
been changed to Documentation/admin-guide/sysctl/vm.rst
* Removed unused nid variable from scrape_offlined_memcgs
* Switched drop_caches_sysctl_handler to use SYSCTL_EIGHT
(otherwise 'echo 8 > /proc/sys/vm/drop_caches' would be
rejected)
* Renamed nr_pages_to_scrape to offlined_memcg_nr_pages in the
!CONFIG_MEMCG case to match the CONFIG_MEMCG case
* Added 'return 0' to scrape_offlined_memcgs in the
!CONFIG_MEMCG case
For offlined memcgs, kmem (slab) is reparented so that it does not hold
refcnts which would in turn prevent those memcgs from being released.
However, reparenting does not apply to LRU pages (pagecache), and
therefore they need to be scraped as well for offlined memcgs.
"echo 8 > /proc/sys/vm/drop_caches" was introduced for this reason. And
unlike "echo 1", it does not have performance impact on online memcgs in
terms of zapping pagecache.
Signed-off-by: Yu Zhao <[email protected]>
Signed-off-by: Brett Mastbergen <[email protected]>1 parent 6d8936c commit b41f544
File tree
8 files changed
+102
-7
lines changed- Documentation/admin-guide/sysctl
- fs
- proc
- include/linux
- kernel
- mm
8 files changed
+102
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
| |||
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
269 | 281 | | |
270 | 282 | | |
271 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
69 | 89 | | |
70 | 90 | | |
71 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
1137 | 1139 | | |
1138 | 1140 | | |
1139 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1140 | 1151 | | |
1141 | 1152 | | |
1142 | 1153 | | |
| |||
1545 | 1556 | | |
1546 | 1557 | | |
1547 | 1558 | | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
1548 | 1570 | | |
1549 | 1571 | | |
1550 | 1572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2627 | 2627 | | |
2628 | 2628 | | |
2629 | 2629 | | |
2630 | | - | |
| 2630 | + | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | 2633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5350 | 5350 | | |
5351 | 5351 | | |
5352 | 5352 | | |
| 5353 | + | |
| 5354 | + | |
5353 | 5355 | | |
5354 | 5356 | | |
5355 | 5357 | | |
| |||
5377 | 5379 | | |
5378 | 5380 | | |
5379 | 5381 | | |
| 5382 | + | |
| 5383 | + | |
5380 | 5384 | | |
5381 | 5385 | | |
5382 | 5386 | | |
5383 | 5387 | | |
5384 | 5388 | | |
5385 | 5389 | | |
5386 | 5390 | | |
| 5391 | + | |
| 5392 | + | |
5387 | 5393 | | |
5388 | 5394 | | |
5389 | 5395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
3092 | 3095 | | |
3093 | 3096 | | |
3094 | 3097 | | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
3095 | 3101 | | |
3096 | 3102 | | |
3097 | 3103 | | |
| |||
4816 | 4822 | | |
4817 | 4823 | | |
4818 | 4824 | | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
0 commit comments