[RHEL8,COMMIT] memcg: fixes accounting for allocations called in "disabled

Submitted by Konstantin Khorenko on Oct. 5, 2020, 10:20 a.m.

Details

Message ID 202010051020.095AKmA9142715@finist-co8.sw.ru
State New
Series "memcg: fixes accounting for allocations called in "disabled BH" context"
Headers show

Commit Message

Konstantin Khorenko Oct. 5, 2020, 10:20 a.m.
The commit is pushed to "branch-rh8-4.18.0-193.6.3.vz8.4.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-193.6.3.vz8.4.11
------>
commit 060218e7064c3f370b0a8f6bbe8017971c15a89d
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Mon Oct 5 13:20:48 2020 +0300

    memcg: fixes accounting for allocations called in "disabled
    
    BH" context #PSBM-120694
    Message-ID: <49f823ed-279d-2bba-ed53-aebf362c84e0@virtuozzo.com>
    Date: Mon, 5 Oct 2020 10:47:46 +0300
    
    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 71e0697ff838..df70c3bdd444 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2630,7 +2630,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;
 }