[PATCH 1/2] mm: oom: remove unnecessary goto in oom_evaluate_task()

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

 



From: ZhangPeng <zhangpeng362@xxxxxxxxxx>

Remove redundant goto statement in oom_evaluate_task() to simplify the
code a bit. No functional modification involved.

Signed-off-by: ZhangPeng <zhangpeng362@xxxxxxxxxx>
---
 mm/oom_kill.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 44bde56ecd02..10f7826c4035 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -335,14 +335,12 @@ static int oom_evaluate_task(struct task_struct *task, void *arg)
 	 */
 	if (oom_task_origin(task)) {
 		points = LONG_MAX;
-		goto select;
+	} else {
+		points = oom_badness(task, oc->totalpages);
+		if (points == LONG_MIN || points < oc->chosen_points)
+			goto next;
 	}
 
-	points = oom_badness(task, oc->totalpages);
-	if (points == LONG_MIN || points < oc->chosen_points)
-		goto next;
-
-select:
 	if (oc->chosen)
 		put_task_struct(oc->chosen);
 	get_task_struct(task);
-- 
2.25.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux