rcu-tasks: Update comments in call_rcu_tasks_generic()
Zqiang
reviewerPATCH 1/1 rcu-tasks: Update comments in call_rcu_tasks_generic()
Currently, the comments: "We can't create the thread unless interrupts are enabled." from 'commit 4929c913bda5 ("rcu: Make call_rcu_tasks() tolerate first call with irqs disabled")', now the kthread creation has been move to core_initcall() time from 'commit c63eb17ff06d ("rcu: Create call_rcu_tasks() kthread at boot time")', and use the irq_work does deferred wakeup. this commit therefore update comments in call_rcu_tasks_generic().
--- kernel/rcu/tasks.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/rcu/tasks.h +5 -1
@@ -395,7 +395,11 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,raw_spin_unlock_irqrestore (&rtp->cbs_gbl_lock, flags); }rcu_read_unlock (); -/* We can't create the thread unless interrupts are enabled. */ +// We can't create the kthread with interrupts disabled, +// or a spinlock might be held, the kthread creation has +// been move to core_initcall() time. +// at the same time, use the irq_work does deferred wakeup +// to avoid potential lockdep splat. if (needwake &&READ_ONCE (rtp->kthread_ptr))irq_work_queue (&rtpcp->rtp_irq_work); }
Signature · 1 line
2.17.1
Quoted 9 lines · Zqiang
Currently, the comments: "We can't create the thread unless interrupts are enabled." from 'commit
4929c913bda5("rcu: Makecall_rcu_tasks()tolerate first call with irqs disabled")', now the kthread creation has been move tocore_initcall()time from 'commitc63eb17ff06d("rcu: Createcall_rcu_tasks()kthread at boot time")', and use theirq_workdoes deferred wakeup. this commit therefore update comments incall_rcu_tasks_generic().Signed-off-by Zqiang <[email protected]>
Queued and pushed both, thank you! I adjusted the comment and commit log, so please double-check them in case I messed something up.
Thanx, Paul
Quoted 24 lines
--- kernel/rcu/tasks.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)kernel/rcu/tasks.h +5
-1@@ -395,7 +395,11 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,raw_spin_unlock_irqrestore (&rtp->cbs_gbl_lock, flags); }rcu_read_unlock (); -/* We can't create the thread unless interrupts are enabled. */ +// We can't create the kthread with interrupts disabled, +// or a spinlock might be held, the kthread creation has +// been move to core_initcall() time. +// at the same time, use the irq_work does deferred wakeup +// to avoid potential lockdep splat. if (needwake &&READ_ONCE (rtp->kthread_ptr))irq_work_queue (&rtpcp->rtp_irq_work); }Signature · 1 line
2.17.1
Zqiang
reviewerQuoted 12 lines · Zqiang
Quoted 10 lines
Currently, the comments: "We can't create the thread unless interrupts
are enabled." from 'commit4929c913bda5("rcu: Makecall_rcu_tasks()tolerate first call with irqs disabled")', now the kthread creation has been move tocore_initcall()time from 'commitc63eb17ff06d("rcu: Createcall_rcu_tasks()kthread at boot time")', and use theirq_workdoes deferred wakeup. this commit therefore update comments incall_rcu_tasks_generic().
Quoted 4 lines
Quoted 2 lines
Signed-off-by Zqiang <[email protected]>Queued and pushed both, thank you! I adjusted the comment and commit log, so please double-check them in case I messed something up.
Thank you for adjusted comment! I have been checked(including previous SRCU patches).
Thanks
Zqiang
Quoted 29 lines
Thanx, Paul
Quoted 25 lines
--- kernel/rcu/tasks.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)diff --git
a/kernel/rcu/tasks.hb/kernel/rcu/tasks.h
indexa2ca79d1dd6a..089a0d5a5cc9100644
---a/kernel/rcu/tasks.h
+++b/kernel/rcu/tasks.h
@@ -395,7 +395,11 @@ static void call_rcu_tasks_generic(structrcu_head*rhp,rcu_callback_tfunc,raw_spin_unlock_irqrestore(&rtp->cbs_gbl_lock, flags);
}
rcu_read_unlock();
- /* We can't create the thread unless interrupts are enabled. */
+ // We can't create the kthread with interrupts disabled,
+ // or a spinlock might be held, the kthread creation has
+ // been move tocore_initcall()time.
+ // at the same time, use theirq_workdoes deferred wakeup
+ // to avoid potential lockdep splat.
if (needwake &&READ_ONCE(rtp->kthread_ptr))
irq_work_queue(&rtpcp->rtp_irq_work);
}
--
2.17.1