Commit Graph

3 Commits

Author SHA1 Message Date
Kairui Song 51254ba2b2 emm: fix cgroup initilization check
Should check for cgroup switch instead of root cgroup status.

Signed-off-by: Kairui Song <kasong@tencent.com>
2024-09-13 17:55:43 +08:00
Kairui Song 1789bec3a9 emm: fix panic in kdump
Upstream: no
Tested: Tested on Devcloud

Kdump environment disables memory cgroup so related helpers will all
return NULL. Abort early in such case.

Signed-off-by: Kairui Song <kasong@tencent.com>
2024-09-03 03:06:14 +00:00
Kairui Song a209d05a79 emm: memcg: add support for core memcg handling
Upstream: no

Make the memcg extention structs get allocated dynamically. This have
another benifit, lruvec is per-cpu data but our EMM aggregators and
workers are single threaded, by moving these data out of per-cpu data it
avoids the possibility of causing false-share.

css_free is lazy and not protected by cgroup_mutex, css_released is
proteprotected by cgroup_mutex which we use to protect emm_memcg_ops as
well. Doing a few of kfree in css_released should be OK.

Signed-off-by: Kairui Song <kasong@tencent.com>
2024-04-03 16:58:59 +08:00