Jiri Slaby
3e85899637
memcg: make it work on sparse non-0-node systems
...
We have a single node system with node 0 disabled:
Scanning NUMA topology in Northbridge 24
Number of physical nodes 2
Skipping disabled node 0
Node 1 MemBase 0000000000000000 Limit 00000000fbff0000
NODE_DATA(1) allocated [mem 0xfbfda000-0xfbfeffff]
This causes crashes in memcg when system boots:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
#PF error: [normal kernel read fault]
...
RIP: 0010:list_lru_add+0x94/0x170
...
Call Trace:
d_lru_add+0x44/0x50
dput.part.34+0xfc/0x110
__fput+0x108/0x230
task_work_run+0x9f/0xc0
exit_to_usermode_loop+0xf5/0x100
It is reproducible as far as 4.12. I did not try older kernels. You have
to have a new enough systemd, e.g. 241 (the reason is unknown -- was not
investigated). Cannot be reproduced with systemd 234.
The system crashes because the size of lru array is never updated in
memcg_update_all_list_lrus and the reads are past the zero-sized array,
causing dereferences of random memory.
The root cause are list_lru_memcg_aware checks in the list_lru code. The
test in list_lru_memcg_aware is broken: it assumes node 0 is always
present, but it is not true on some systems as can be seen above.
So fix this by avoiding checks on node 0. Remember the memcg-awareness by
a bool flag in struct list_lru.
Link: http://lkml.kernel.org/r/20190522091940.3615-1-jslaby@suse.cz
Fixes: 60d3fd32a7 ("list_lru: introduce per-memcg lists")
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Acked-by: Michal Hocko <mhocko@suse.com >
Suggested-by: Vladimir Davydov <vdavydov.dev@gmail.com >
Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com >
Reviewed-by: Shakeel Butt <shakeelb@google.com >
Cc: Johannes Weiner <hannes@cmpxchg.org >
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com >
Cc: <stable@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-06-01 15:51:31 -07:00
..
2019-05-30 11:26:37 -07:00
2019-05-07 19:43:05 +02:00
2019-05-30 11:29:52 -07:00
2019-05-24 17:27:12 +02:00
2019-05-05 21:52:42 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-11 10:54:43 -04:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-15 18:21:43 -07:00
2019-05-30 11:29:52 -07:00
2019-05-20 08:21:07 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-04-27 17:03:44 -04:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:53 -07:00
2019-05-30 11:29:22 -07:00
2019-05-24 17:27:13 +02:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:40 +02:00
2019-05-14 19:52:52 -07:00
2019-05-30 11:29:53 -07:00
2019-05-02 17:17:52 +02:00
2019-05-30 11:26:41 -07:00
2019-05-15 18:21:43 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:27:12 +02:00
2019-05-06 11:55:39 +02:00
2019-05-24 17:39:02 +02:00
2019-05-30 11:29:55 -07:00
2019-05-30 11:26:35 -07:00
2019-05-09 00:41:00 -05:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-21 11:28:46 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:37:52 +02:00
2019-05-24 17:37:52 +02:00
2019-05-14 09:47:48 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-14 19:52:50 -07:00
2019-05-23 10:25:26 -06:00
2019-05-30 11:26:41 -07:00
2019-05-14 19:52:49 -07:00
2019-05-23 10:25:26 -06:00
2019-04-30 16:12:02 -06:00
2019-05-04 07:24:08 -06:00
2019-05-23 10:25:26 -06:00
2019-05-24 17:36:45 +02:00
2019-04-27 09:07:04 -07:00
2019-05-30 11:29:53 -07:00
2019-05-30 11:29:53 -07:00
2019-04-30 16:11:59 -06:00
2019-05-07 08:39:02 -06:00
2019-06-01 15:51:31 -07:00
2019-05-06 08:39:11 -07:00
2019-05-15 13:21:37 -07:00
2019-05-14 19:52:48 -07:00
2019-05-09 15:25:13 -04:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:26:35 -07:00
2019-05-18 15:52:26 -07:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:39 -07:00
2019-05-14 07:57:29 -07:00
2019-05-10 12:20:36 +02:00
2019-05-10 05:29:27 -07:00
2019-05-14 19:52:50 -07:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:53 -07:00
2019-05-20 15:02:08 -07:00
2019-05-24 17:27:11 +02:00
2019-05-07 21:28:04 -07:00
2019-05-30 11:26:37 -07:00
2019-05-09 14:50:09 -07:00
2019-05-24 17:37:52 +02:00
2019-05-30 11:29:21 -07:00
2019-05-30 11:29:21 -07:00
2019-05-24 17:37:54 +02:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-05-03 15:30:23 +01:00
2019-05-06 15:04:40 +02:00
2019-05-21 11:28:40 +02:00
2019-05-15 17:35:54 +01:00
2019-05-24 17:37:53 +02:00
2019-05-01 12:29:28 -04:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:26:32 -07:00
2019-05-25 16:33:36 -07:00
2019-05-30 11:26:32 -07:00
2019-05-08 21:23:11 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-07 22:03:58 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-07 21:12:44 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-12 18:16:31 -04:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:27:12 +02:00
2019-05-13 15:08:16 -07:00
2019-05-13 15:08:16 -07:00
2019-05-15 16:05:47 -07:00
2019-05-14 09:47:47 -07:00
2019-05-30 11:29:53 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2019-05-21 11:28:39 +02:00
2019-05-14 09:47:44 -07:00
2019-05-14 09:47:48 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:55 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-04-29 10:44:03 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:35 -07:00
2019-05-01 07:47:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-14 19:52:52 -07:00
2019-05-30 11:26:32 -07:00
2019-05-01 10:41:38 +01:00
2019-05-01 10:49:17 +01:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:37:52 +02:00
2019-05-30 11:26:35 -07:00
2019-04-29 08:29:20 +02:00
2019-05-30 11:26:32 -07:00
2019-05-14 19:52:49 -07:00
2019-05-07 18:48:09 -07:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-05-14 19:52:48 -07:00
2019-05-15 23:39:38 +02:00
2019-05-14 19:52:49 -07:00
2019-05-30 11:29:22 -07:00
2019-05-21 11:28:46 +02:00
2019-05-24 17:39:02 +02:00
2019-05-06 10:19:19 -06:00
2019-06-01 15:51:31 -07:00
2019-05-14 19:52:49 -07:00
2019-05-16 15:55:48 -07:00
2019-05-21 11:28:45 +02:00
2019-05-06 13:50:15 -07:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:37:53 +02:00
2019-05-07 20:17:51 -07:00
2019-05-13 09:23:18 -04:00
2019-05-30 11:26:32 -07:00
2019-06-01 15:51:31 -07:00
2019-05-14 09:47:50 -07:00
2019-05-14 09:47:49 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:41 -07:00
2019-05-14 09:47:46 -07:00
2019-05-14 19:52:48 -07:00
2019-05-14 19:52:48 -07:00
2019-05-14 09:47:49 -07:00
2019-05-14 19:52:48 -07:00
2019-05-14 10:55:54 -07:00
2019-05-07 21:50:24 +09:00
2019-05-24 17:27:10 +02:00
2019-05-19 10:58:45 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-06 01:18:58 +02:00
2019-05-30 11:26:41 -07:00
2019-05-14 17:19:47 +02:00
2019-05-19 10:35:20 -07:00
2019-05-01 14:26:36 -05:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-16 10:29:00 -07:00
2019-05-03 10:49:17 -04:00
2019-05-30 11:26:39 -07:00
2019-05-14 09:47:51 -07:00
2019-05-30 11:29:19 -07:00
2019-05-14 10:30:10 -07:00
2019-05-21 10:50:45 +02:00
2019-05-17 10:33:30 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-07 14:31:03 +02:00
2019-05-30 11:29:52 -07:00
2019-05-21 11:28:45 +02:00
2019-05-13 10:51:31 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-14 19:52:48 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:29:54 -07:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-14 19:52:51 -07:00
2019-05-30 11:26:41 -07:00
2019-05-14 19:52:48 -07:00
2019-05-14 19:52:48 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-14 19:52:48 -07:00
2019-05-30 11:26:32 -07:00
2019-05-17 10:08:59 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-14 19:52:51 -07:00
2019-05-30 11:29:21 -07:00
2019-05-16 09:45:20 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-08 22:14:36 +02:00
2019-05-21 11:28:46 +02:00
2019-05-21 11:28:46 +02:00
2019-05-07 12:47:47 -03:00
2019-05-14 19:52:48 -07:00
2019-05-30 11:29:52 -07:00
2019-05-24 17:39:00 +02:00
2019-05-30 11:26:32 -07:00
2019-05-07 20:17:51 -07:00
2019-04-30 16:11:57 -06:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-04-30 12:37:56 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-16 15:51:55 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-04-29 12:37:57 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:22 -07:00
2019-05-21 11:28:46 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-16 16:16:18 -07:00
2019-05-06 19:40:31 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:39:02 +02:00
2019-05-30 11:29:21 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-08 10:03:52 -07:00
2019-05-14 09:47:45 -07:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:27:13 +02:00
2019-05-24 17:27:13 +02:00
2019-05-12 13:11:36 -04:00
2019-05-24 17:39:00 +02:00
2019-05-18 15:52:26 -07:00
2019-05-14 09:47:45 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:37 -07:00
2019-05-15 17:35:54 +01:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:36:47 +02:00