[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1531557122-12540-1-git-send-email-laoar.shao@gmail.com>
Date: Sat, 14 Jul 2018 16:32:02 +0800
From: Yafang Shao <laoar.shao@...il.com>
To: hannes@...xchg.org, mhocko@...nel.org, vdavydov.dev@...il.com
Cc: cgroups@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Yafang Shao <laoar.shao@...il.com>
Subject: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq
try_charge maybe executed in packet receive path, which is in interrupt
context.
In this situation, the 'current' is the interrupted task, which may has
no relation to the rx softirq, So it is nonsense to use 'current'.
Avoid bothering the interrupted if page_counter_try_charge failes.
Signed-off-by: Yafang Shao <laoar.shao@...il.com>
---
mm/memcontrol.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 68ef266..13f95db 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2123,6 +2123,9 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
goto retry;
}
+ if (in_softirq())
+ goto nomem;
+
/*
* Unlike in global OOM situations, memcg is not in a physical
* memory shortage. Allow dying and OOM-killed tasks to
--
1.8.3.1
Powered by blists - more mailing lists