Commit 8f20a5e8 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Make rcu_tasks_kthread()'s GP-wait loop allow preemption

The grace-period-wait loop in rcu_tasks_kthread() is under (unnecessary)
RCU protection, and therefore has no preemption points in a PREEMPT=n
kernel.  This commit therefore removes the RCU protection and inserts
cond_resched().
Reported-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 176f8f7a
...@@ -467,7 +467,7 @@ static void check_holdout_task(struct task_struct *t, ...@@ -467,7 +467,7 @@ static void check_holdout_task(struct task_struct *t,
(IS_ENABLED(CONFIG_NO_HZ_FULL) && (IS_ENABLED(CONFIG_NO_HZ_FULL) &&
!is_idle_task(t) && t->rcu_tasks_idle_cpu >= 0)) { !is_idle_task(t) && t->rcu_tasks_idle_cpu >= 0)) {
ACCESS_ONCE(t->rcu_tasks_holdout) = false; ACCESS_ONCE(t->rcu_tasks_holdout) = false;
list_del_rcu(&t->rcu_tasks_holdout_list); list_del_init(&t->rcu_tasks_holdout_list);
put_task_struct(t); put_task_struct(t);
return; return;
} }
...@@ -573,6 +573,7 @@ static int __noreturn rcu_tasks_kthread(void *arg) ...@@ -573,6 +573,7 @@ static int __noreturn rcu_tasks_kthread(void *arg)
bool firstreport; bool firstreport;
bool needreport; bool needreport;
int rtst; int rtst;
struct task_struct *t1;
schedule_timeout_interruptible(HZ); schedule_timeout_interruptible(HZ);
rtst = ACCESS_ONCE(rcu_task_stall_timeout); rtst = ACCESS_ONCE(rcu_task_stall_timeout);
...@@ -582,11 +583,11 @@ static int __noreturn rcu_tasks_kthread(void *arg) ...@@ -582,11 +583,11 @@ static int __noreturn rcu_tasks_kthread(void *arg)
lastreport = jiffies; lastreport = jiffies;
firstreport = true; firstreport = true;
WARN_ON(signal_pending(current)); WARN_ON(signal_pending(current));
rcu_read_lock(); list_for_each_entry_safe(t, t1, &rcu_tasks_holdouts,
list_for_each_entry_rcu(t, &rcu_tasks_holdouts, rcu_tasks_holdout_list) {
rcu_tasks_holdout_list)
check_holdout_task(t, needreport, &firstreport); check_holdout_task(t, needreport, &firstreport);
rcu_read_unlock(); cond_resched();
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment