lkml.org 
[lkml]   [2020]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip: core/rcu] rcu-tasks: Convert rcu_tasks_wait_gp() for-loop to while-loop
The following commit has been merged into the core/rcu branch of tip:

Commit-ID: 77dc174103fdb121c47621e9856d73704b7eddd2
Gitweb: https://git.kernel.org/tip/77dc174103fdb121c47621e9856d73704b7eddd2
Author: Paul E. McKenney <paulmck@kernel.org>
AuthorDate: Tue, 15 Sep 2020 15:41:50 -07:00
Committer: Paul E. McKenney <paulmck@kernel.org>
CommitterDate: Mon, 02 Nov 2020 17:12:42 -08:00

rcu-tasks: Convert rcu_tasks_wait_gp() for-loop to while-loop

The infinite for-loop in rcu_tasks_wait_gp() has its only exit at the
top of the loop, so this commit does the straightforward conversion to
a while-loop, thus saving a few lines.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/rcu/tasks.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index d5d9f2d..a93271f 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -338,14 +338,11 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp)
if (fract > HZ)
fract = HZ;

- for (;;) {
+ while (!list_empty(&holdouts)) {
bool firstreport;
bool needreport;
int rtst;

- if (list_empty(&holdouts))
- break;
-
/* Slowly back off waiting for holdouts */
set_tasks_gp_state(rtp, RTGS_WAIT_SCAN_HOLDOUTS);
schedule_timeout_idle(HZ/fract);
\
 
 \ /
  Last update: 2020-12-13 20:24    [W:0.034 / U:1.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site