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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201026174152.GA10163@rlk>
Date:   Tue, 27 Oct 2020 01:41:52 +0800
From:   Hui Su <sh_def@....com>
To:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH] sched/rt.c: use list_is_singular() instead of '->prev !=
 ->next'

Use the list_is_singular(&rt_se->run_list) api instead of
'rt_se->run_list.prev != rt_se->run_list.next'.
Fix a comment by the way, and make the comment more clearly.

Signed-off-by: Hui Su <sh_def@....com>
---
 kernel/sched/rt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 49ec096a8aa1..1479d00656b4 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2381,7 +2381,7 @@ static inline void watchdog(struct rq *rq, struct task_struct *p) { }
  *
  * NOTE: This function can be called remotely by the tick offload that
  * goes along full dynticks. Therefore no local assumption can be made
- * and everything must be accessed through the @rq and @curr passed in
+ * and everything must be accessed through the @rq and @p passed in
  * parameters.
  */
 static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued)
@@ -2406,11 +2406,11 @@ static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued)
 	p->rt.time_slice = sched_rr_timeslice;
 
 	/*
-	 * Requeue to the end of queue if we (and all of our ancestors) are not
-	 * the only element on the queue
+	 * Requeue to the end of rt_prio_array queue if we (and all of our
+	 * ancestors) are not the only element on the rt_prio_array queue.
 	 */
 	for_each_sched_rt_entity(rt_se) {
-		if (rt_se->run_list.prev != rt_se->run_list.next) {
+		if (!list_is_singular(&rt_se->run_list)) {
 			requeue_task_rt(rq, p, 0);
 			resched_curr(rq);
 			return;
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ