+ oom-decouple-mems_allowed-from-oom_unkillable_task-v4.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: oom-decouple-mems_allowed-from-oom_unkillable_task-v4
has been added to the -mm tree.  Its filename is
     oom-decouple-mems_allowed-from-oom_unkillable_task-v4.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/oom-decouple-mems_allowed-from-oom_unkillable_task-v4.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/oom-decouple-mems_allowed-from-oom_unkillable_task-v4.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Shakeel Butt <shakeelb@xxxxxxxxxx>
Subject: oom-decouple-mems_allowed-from-oom_unkillable_task-v4

change function name and update comment

Link: http://lkml.kernel.org/r/20190628152421.198994-3-shakeelb@xxxxxxxxxx
Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
Reported-by: syzbot+d0fc9d3c166bc5e4a94b@xxxxxxxxxxxxxxxxxxxxxxxxx
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Acked-by: Roman Gushchin <guro@xxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
Cc: Nick Piggin <npiggin@xxxxxxxxx>
Cc: Paul Jackson <pj@xxxxxxx>
Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/oom_kill.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

--- a/mm/oom_kill.c~oom-decouple-mems_allowed-from-oom_unkillable_task-v4
+++ a/mm/oom_kill.c
@@ -71,7 +71,7 @@ static inline bool is_memcg_oom(struct o
 
 #ifdef CONFIG_NUMA
 /**
- * has_intersects_mems_allowed() - check task eligiblity for kill
+ * oom_cpuset_eligible() - check task eligiblity for kill
  * @start: task struct of which task to consider
  * @mask: nodemask passed to page allocator for mempolicy ooms
  *
@@ -79,17 +79,18 @@ static inline bool is_memcg_oom(struct o
  * shares the same mempolicy nodes as current if it is bound by such a policy
  * and whether or not it has the same set of allowed cpuset nodes.
  *
- * Only call in the global oom context (i.e. not in memcg oom). This function
- * is assuming 'current' has triggered the oom-killer.
+ * This function is assuming oom-killer context and 'current' has triggered
+ * the oom-killer.
  */
-static bool has_intersects_mems_allowed(struct task_struct *start,
-					struct oom_control *oc)
+static bool oom_cpuset_eligible(struct task_struct *start,
+				struct oom_control *oc)
 {
 	struct task_struct *tsk;
 	bool ret = false;
 	const nodemask_t *mask = oc->nodemask;
 
-	VM_BUG_ON(is_memcg_oom(oc));
+	if (is_memcg_oom(oc))
+		return true;
 
 	rcu_read_lock();
 	for_each_thread(start, tsk) {
@@ -116,8 +117,7 @@ static bool has_intersects_mems_allowed(
 	return ret;
 }
 #else
-static bool has_intersects_mems_allowed(struct task_struct *tsk,
-					struct oom_control *oc)
+static bool oom_cpuset_eligible(struct task_struct *tsk, struct oom_control *oc)
 {
 	return true;
 }
@@ -315,7 +315,7 @@ static int oom_evaluate_task(struct task
 		goto next;
 
 	/* p may not have freeable memory in nodemask */
-	if (!is_memcg_oom(oc) && !has_intersects_mems_allowed(task, oc))
+	if (!is_memcg_oom(oc) && !oom_cpuset_eligible(task, oc))
 		goto next;
 
 	/*
@@ -388,7 +388,7 @@ static int dump_task(struct task_struct
 		return 0;
 
 	/* p may not have freeable memory in nodemask */
-	if (!is_memcg_oom(oc) && !has_intersects_mems_allowed(p, oc))
+	if (!is_memcg_oom(oc) && !oom_cpuset_eligible(p, oc))
 		return 0;
 
 	task = find_lock_task_mm(p);
@@ -1087,7 +1087,7 @@ bool out_of_memory(struct oom_control *o
 
 	if (!is_memcg_oom(oc) && sysctl_oom_kill_allocating_task &&
 	    current->mm && !oom_unkillable_task(current) &&
-	    has_intersects_mems_allowed(current, oc) &&
+	    oom_cpuset_eligible(current, oc) &&
 	    current->signal->oom_score_adj != OOM_SCORE_ADJ_MIN) {
 		get_task_struct(current);
 		oc->chosen = current;
_

Patches currently in -mm which might be from shakeelb@xxxxxxxxxx are

mm-vmscan-prevent-useless-kswapd-loops.patch
slub-dont-panic-for-memcg-kmem-cache-creation-failure.patch
memcg-oom-no-oom-kill-for-__gfp_retry_mayfail.patch
memcg-fsnotify-no-oom-kill-for-remote-memcg-charging.patch
mm-memcg-introduce-memoryeventslocal.patch
mm-oom-refactor-dump_tasks-for-memcg-ooms.patch
mm-oom-remove-redundant-task_in_mem_cgroup-check.patch
oom-decouple-mems_allowed-from-oom_unkillable_task.patch
oom-decouple-mems_allowed-from-oom_unkillable_task-v4.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux