[Devel] [PATCH RH8] memcg: fixes accounting for allocations called in "disabled BH" context

Vasily Averin vvs at virtuozzo.com
Mon Oct 5 10:47:46 MSK 2020


in_interrupt() check includes "have BH disabled" case,
as result allocations called with disabled BH are not accounted to
proper memory cgroup.

https://jira.sw.ru/browse/PSBM-120694
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 68242a72be4d..09351bb08883 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2632,7 +2632,7 @@ static void memcg_schedule_kmem_cache_create(struct mem_cgroup *memcg,
 
 static inline bool memcg_kmem_bypass(void)
 {
-	if (in_interrupt() || !current->mm || (current->flags & PF_KTHREAD))
+	if (!in_task() || !current->mm || (current->flags & PF_KTHREAD))
 		return true;
 	return false;
 }
-- 
2.17.1



More information about the Devel mailing list