This is a backport of Sebastian's MEMCG changes to v5.15. With these patches applied, it is possible to use memory cgroups together with PREEMPT_RT on v5.15, just like on v5.17. The patch set was tested on my end by building an x86_64 kernel with PREEMPT_RT, cgroup debug and lockdep enabled. The kernel was run in Qemu, where a small number of child cgroups were created, with memory controller enabled for each and an instance of a small test program running. Changes in v2: - Use the exact patch set merged upstream David Oberhollenzer (1): Allow MEMCG on PREEMPT_RT Johannes Weiner (1): mm/memcg: Opencode the inner part of obj_cgroup_uncharge_pages() in drain_obj_stock() Michal Hocko (1): mm/memcg: Revert ("mm/memcg: optimize user context object stock access") Sebastian Andrzej Siewior (7): mm/memcg: Disable threshold event handlers on PREEMPT_RT mm/memcg: Protect per-CPU counter by disabling preemption on PREEMPT_RT where needed. mm/memcg: Protect memcg_stock with a local_lock_t mm/memcg: Disable migration instead of preemption in drain_all_stock(). mm/memcg: Add missing counter index which are not update in interrupt. mm/memcg: Add a comment regarding the release `obj'. mm/memcg: Only perform the debug checks on !PREEMPT_RT .../admin-guide/cgroup-v1/memory.rst | 2 + init/Kconfig | 1 - mm/memcontrol.c | 232 +++++++++++------- 3 files changed, 146 insertions(+), 89 deletions(-) -- 2.37.1