linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] memcg: accounting for allocations called with disabled BH
@ 2021-03-09  8:03 Vasily Averin
  2021-03-09 14:57 ` Michal Hocko
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Vasily Averin @ 2021-03-09  8:03 UTC (permalink / raw)
  To: cgroups, linux-mm; +Cc: Johannes Weiner, Michal Hocko, Vladimir Davydov

in_interrupt() check in memcg_kmem_bypass() is incorrect because
it does not allow to account memory allocation called from task context
with disabled BH, i.e. inside spin_lock_bh()/spin_unlock_bh() sections

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 845eec0..568f2cb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1076,7 +1076,7 @@ static __always_inline bool memcg_kmem_bypass(void)
 		return false;
 
 	/* Memcg to charge can't be determined. */
-	if (in_interrupt() || !current->mm || (current->flags & PF_KTHREAD))
+	if (!in_task() || !current->mm || (current->flags & PF_KTHREAD))
 		return true;
 
 	return false;
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-03-10 19:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09  8:03 [PATCH 1/9] memcg: accounting for allocations called with disabled BH Vasily Averin
2021-03-09 14:57 ` Michal Hocko
2021-03-10  9:11   ` Vasily Averin
2021-03-10  9:40     ` Michal Hocko
2021-03-09 19:39 ` Shakeel Butt
2021-03-09 20:18   ` Roman Gushchin
2021-03-10  9:21     ` Vasily Averin
2021-03-10  9:42     ` Michal Hocko
2021-03-10 19:09       ` Roman Gushchin
2021-03-10  9:17   ` Vasily Averin
2021-03-09 20:39 ` Roman Gushchin
2021-03-10  9:26   ` Vasily Averin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox