lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181103054342.53449-1-smuchun@gmail.com>
Date:   Sat,  3 Nov 2018 13:43:42 +0800
From:   Muchun Song <smuchun@...il.com>
To:     mingo@...nel.org, peterz@...radead.org
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] sched/rt: Remove unnecessary check for next_task in push_rt_task()

In push_rt_task(), we call pick_next_pushable_task() to pick
next_task before the check. If next_task and rq->curr are equal,
which will trigger BUG_ON() in pick_next_pushable_task(). See
the following code in pick_next_pushable_task().

  static struct task_struct *pick_next_pushable_task(struct rq *rq)
  {
	BUG_ON(task_current(rq, p));
  }

The task_current() will check if task p and rq->curr are equal.
So, we can remove the unnecessary check in push_rt_task().

Signed-off-by: Muchun Song <smuchun@...il.com>
---
 kernel/sched/rt.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 481bb7aa25c5..ec097edea9ca 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1813,11 +1813,6 @@ static int push_rt_task(struct rq *rq)
 		return 0;
 
 retry:
-	if (unlikely(next_task == rq->curr)) {
-		WARN_ON(1);
-		return 0;
-	}
-
 	/*
 	 * It's possible that the next_task slipped in of
 	 * higher priority than current. If that's the case
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ