Commit c58d6cd
mm, vmscan: Update all zone LRU sizes before updating memcg
Minchan Kim reported setting the following warning on a 32-bit system
although it can affect 64-bit systems.
WARNING: CPU: 4 PID: 1322 at mm/memcontrol.c:998 mem_cgroup_update_lru_size+0x103/0x110
mem_cgroup_update_lru_size(f44b4000, 1, -7): zid 1 lru_size 1 but empty
Modules linked in:
CPU: 4 PID: 1322 Comm: cp Not tainted 4.7.0-rc4-mm1+ torvalds#143
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
00000086 00000086 c2bc5a10 db3e4a97 c2bc5a54 db9d4025 c2bc5a40 db07b82a
db9d0594 c2bc5a70 0000052a db9d4025 000003e6 db208463 000003e6 00000001
f44b4000 00000001 c2bc5a5c db07b88b 00000009 00000000 c2bc5a54 db9d0594
Call Trace:
[<db3e4a97>] dump_stack+0x76/0xaf
[<db07b82a>] __warn+0xea/0x110
[<db208463>] ? mem_cgroup_update_lru_size+0x103/0x110
[<db07b88b>] warn_slowpath_fmt+0x3b/0x40
[<db208463>] mem_cgroup_update_lru_size+0x103/0x110
[<db1b52a2>] isolate_lru_pages.isra.61+0x2e2/0x360
[<db1b6ffc>] shrink_active_list+0xac/0x2a0
[<db3f136e>] ? __delay+0xe/0x10
[<db1b772c>] shrink_node_memcg+0x53c/0x7a0
[<db1b7a3b>] shrink_node+0xab/0x2a0
[<db1b7cf6>] do_try_to_free_pages+0xc6/0x390
[<db1b8205>] try_to_free_pages+0x245/0x590
LRU list contents and counts are updated separately. Counts are updated
before pages are added to the LRU and updated after pages are removed.
The warning above is from a check in mem_cgroup_update_lru_size that
ensures that list sizes of zero are empty.
The problem is that node-lru needs to account for highmem pages if
CONFIG_HIGHMEM is set. One impact of the implementation is that the
sizes are updated in multiple passes when pages from multiple zones were
isolated. This happens whether HIGHMEM is set or not. When multiple zones
are isolated, it's possible for a debugging check in memcg to be tripped.
This patch forces all the zone counts to be updated before the memcg
function is called.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mel Gorman <[email protected]>
Tested-by: Minchan Kim <[email protected]>
Reported-by: Minchan Kim <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 0ddad0a commit c58d6cd
File tree
4 files changed
+37
-15
lines changed- include/linux
- mm
4 files changed
+37
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 55 | | |
| 56 | + | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
965 | 965 | | |
966 | 966 | | |
967 | 967 | | |
968 | | - | |
969 | 968 | | |
970 | 969 | | |
971 | 970 | | |
972 | 971 | | |
973 | 972 | | |
974 | 973 | | |
975 | 974 | | |
976 | | - | |
| 975 | + | |
977 | 976 | | |
978 | 977 | | |
979 | 978 | | |
980 | 979 | | |
981 | 980 | | |
982 | 981 | | |
983 | | - | |
984 | | - | |
985 | 982 | | |
986 | 983 | | |
987 | 984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1350 | 1350 | | |
1351 | 1351 | | |
1352 | 1352 | | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1353 | 1385 | | |
1354 | 1386 | | |
1355 | 1387 | | |
| |||
1436 | 1468 | | |
1437 | 1469 | | |
1438 | 1470 | | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
| 1471 | + | |
1446 | 1472 | | |
1447 | 1473 | | |
1448 | 1474 | | |
| |||
0 commit comments