[Devel] [PATCH rh7 v3 5/8] oom: drop OOM_SCAN_ABORT

Vladimir Davydov vdavydov at parallels.com
Sun Sep 13 06:42:07 PDT 2015


It is not used anymore, neither should it be used with the new locking
design.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/linux/oom.h | 1 -
 mm/memcontrol.c     | 6 ------
 mm/oom_kill.c       | 7 +------
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/include/linux/oom.h b/include/linux/oom.h
index f804551c0a5d..6d4a94f15f2a 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -27,7 +27,6 @@ enum oom_constraint {
 enum oom_scan_t {
 	OOM_SCAN_OK,		/* scan thread and find its badness */
 	OOM_SCAN_CONTINUE,	/* do not consider thread for oom kill */
-	OOM_SCAN_ABORT,		/* abort the iteration and return */
 	OOM_SCAN_SELECT,	/* always select this thread first */
 };
 
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d8f47e124fe4..cb3aaaf72c98 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2001,12 +2001,6 @@ retry:
 				/* fall through */
 			case OOM_SCAN_CONTINUE:
 				continue;
-			case OOM_SCAN_ABORT:
-				cgroup_iter_end(cgroup, &it);
-				mem_cgroup_iter_break(memcg, iter);
-				if (chosen)
-					put_task_struct(chosen);
-				return;
 			case OOM_SCAN_OK:
 				break;
 			};
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2fab831187d2..914f9f4e7676 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -358,9 +358,6 @@ retry:
 			/* fall through */
 		case OOM_SCAN_CONTINUE:
 			continue;
-		case OOM_SCAN_ABORT:
-			rcu_read_unlock();
-			return ERR_PTR(-1UL);
 		case OOM_SCAN_OK:
 			break;
 		};
@@ -887,11 +884,9 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
 	if (!p) {
 		dump_header(NULL, gfp_mask, order, NULL, mpol_mask);
 		panic("Out of memory and no killable processes...\n");
-	}
-	if (PTR_ERR(p) != -1UL) {
+	} else
 		oom_kill_process(p, gfp_mask, order, points, totalpages, NULL,
 				 nodemask, "Out of memory");
-	}
 }
 
 /*
-- 
2.1.4




More information about the Devel mailing list