linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: linux-mm@kvack.org
Cc: akpm@linux-foundation.org, oleg@redhat.com, rientjes@google.com,
	vdavydov@parallels.com, mst@redhat.com, mhocko@suse.com,
	mhocko@kernel.org
Subject: [PATCH 4/8] mm,oom: Remove OOM_SCAN_ABORT case.
Date: Sun, 3 Jul 2016 11:39:16 +0900	[thread overview]
Message-ID: <201607031139.DFD39537.QLVOHJMSFtOOFF@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <201607031135.AAH95347.MVOHQtFJFLOOFS@I-love.SAKURA.ne.jp>

>From e2d850ccbc7abc2643f5aac4dd09787f09270fd4 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Sat, 2 Jul 2016 23:01:17 +0900
Subject: [PATCH 4/8] mm,oom: Remove OOM_SCAN_ABORT case.

Since oom_has_pending_mm() controls whether to select next OOM victim,
we no longer need to abort OOM victim selection loop using OOM_SCAN_ABORT
case. Remove it.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 include/linux/oom.h |  1 -
 mm/memcontrol.c     |  8 --------
 mm/oom_kill.c       | 24 +-----------------------
 3 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/include/linux/oom.h b/include/linux/oom.h
index 1e538c5..5991d41 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -49,7 +49,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 835c95c..c17160d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1263,14 +1263,6 @@ static bool mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
 				/* fall through */
 			case OOM_SCAN_CONTINUE:
 				continue;
-			case OOM_SCAN_ABORT:
-				css_task_iter_end(&it);
-				mem_cgroup_iter_break(memcg, iter);
-				if (chosen)
-					put_task_struct(chosen);
-				/* Set a dummy value to return "true". */
-				chosen = (void *) 1;
-				goto unlock;
 			case OOM_SCAN_OK:
 				break;
 			};
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 39c5034..734378a 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -324,25 +324,6 @@ enum oom_scan_t oom_scan_process_thread(struct oom_control *oc,
 		return OOM_SCAN_CONTINUE;
 
 	/*
-	 * This task already has access to memory reserves and is being killed.
-	 * Don't allow any other task to have access to the reserves unless
-	 * the task has MMF_OOM_REAPED because chances that it would release
-	 * any memory is quite low.
-	 */
-	if (!is_sysrq_oom(oc) && atomic_read(&task->signal->oom_victims)) {
-		struct task_struct *p = find_lock_task_mm(task);
-		enum oom_scan_t ret = OOM_SCAN_ABORT;
-
-		if (p) {
-			if (test_bit(MMF_OOM_REAPED, &p->mm->flags))
-				ret = OOM_SCAN_CONTINUE;
-			task_unlock(p);
-		}
-
-		return ret;
-	}
-
-	/*
 	 * If task is allocating a lot of memory and has been marked to be
 	 * killed first if it triggers an oom, then select it.
 	 */
@@ -374,9 +355,6 @@ static struct task_struct *select_bad_process(struct oom_control *oc,
 			/* fall through */
 		case OOM_SCAN_CONTINUE:
 			continue;
-		case OOM_SCAN_ABORT:
-			rcu_read_unlock();
-			return (struct task_struct *)(-1UL);
 		case OOM_SCAN_OK:
 			break;
 		};
@@ -1075,7 +1053,7 @@ bool out_of_memory(struct oom_control *oc)
 		dump_header(oc, NULL);
 		panic("Out of memory and no killable processes...\n");
 	}
-	if (p && p != (void *)-1UL) {
+	if (p) {
 		oom_kill_process(oc, p, points, totalpages, "Out of memory");
 		/*
 		 * Give the killed process a good chance to exit before trying
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2016-07-03  2:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03  2:35 [PATCH 0/8] Change OOM killer to use list of mm_struct Tetsuo Handa
2016-07-03  2:36 ` [PATCH 1/8] mm,oom_reaper: Remove pointless kthread_run() failure check Tetsuo Handa
2016-07-03 12:42   ` Oleg Nesterov
2016-07-03 16:03     ` Tetsuo Handa
2016-07-03 17:10       ` Oleg Nesterov
2016-07-03 21:53         ` Tetsuo Handa
2016-07-04 11:13           ` Oleg Nesterov
2016-07-07 11:14           ` Michal Hocko
2016-07-03  2:37 ` [PATCH 2/8] mm,oom_reaper: Reduce find_lock_task_mm() usage Tetsuo Handa
2016-07-07 11:19   ` Michal Hocko
2016-07-03  2:38 ` [PATCH 3/8] mm,oom: Use list of mm_struct used by OOM victims Tetsuo Handa
2016-07-04 10:39   ` Oleg Nesterov
2016-07-04 12:50     ` Tetsuo Handa
2016-07-04 18:25       ` Oleg Nesterov
2016-07-05 10:43         ` Tetsuo Handa
2016-07-05 20:52           ` Oleg Nesterov
2016-07-06  8:53             ` Oleg Nesterov
2016-07-06 11:43               ` Tetsuo Handa
2016-07-07 11:31   ` Michal Hocko
2016-07-03  2:39 ` Tetsuo Handa [this message]
2016-07-03  2:40 ` [PATCH 5/8] mm,oom: Remove unused signal_struct->oom_victims Tetsuo Handa
2016-07-07 14:03   ` Michal Hocko
2016-07-03  2:40 ` [PATCH 6/8] mm,oom_reaper: Stop clearing TIF_MEMDIE on remote thread Tetsuo Handa
2016-07-07 14:06   ` Michal Hocko
2016-07-07 16:10     ` Tetsuo Handa
2016-07-07 16:54       ` Michal Hocko
2016-07-03  2:41 ` [PATCH 7/8] mm,oom_reaper: Pass OOM victim's comm and pid values via mm_struct Tetsuo Handa
2016-07-03  2:41 ` [PATCH 8/8] mm,oom_reaper: Make OOM reaper use list of mm_struct Tetsuo Handa
2016-07-04 10:40   ` Oleg Nesterov
2016-07-07 14:15   ` Michal Hocko
2016-07-07 11:04 ` [PATCH 0/8] Change OOM killer to " Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201607031139.DFD39537.QLVOHJMSFtOOFF@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mst@redhat.com \
    --cc=oleg@redhat.com \
    --cc=rientjes@google.com \
    --cc=vdavydov@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox