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

Submitted by Vasily Averin on Oct. 5, 2020, 7:47 a.m.

Details

Message ID 49f823ed-279d-2bba-ed53-aebf362c84e0@virtuozzo.com
State New
Series "memcg: fixes accounting for allocations called in "disabled BH" context"
Headers show

Commit Message

Vasily Averin Oct. 5, 2020, 7:47 a.m.
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@virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;
 }