RCU Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH tip/core/rcu 0/8] Fixes for v5.5
@ 2019-10-03  1:32 Paul E. McKenney
  2019-10-03  1:32 ` [PATCH tip/core/rcu 1/8] rcu: Remove unused function hlist_bl_del_init_rcu() paulmck
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Paul E. McKenney @ 2019-10-03  1:32 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel

Hello!

This series provides miscellaneous fixes:

1.	Remove unused function hlist_bl_del_init_rcu(), courtesy of
	Ethan Hansen.

2.	Make several rcu_segcblist functions state, courtesy of kbuild
	test robot.

3.	Convert for_each_wq to use built-in list check, courtesy of
	Joel Fernandes.

4.	Ensure that ->rcu_urgent_qs is set before resched IPI, courtesy
	of Joel Fernandes.

5-7.	Update tracepoint descriptions.

8.	Fix uninitialized variable in nocb_gp_wait(), courtesy of
	Dan Carpenter.

							Thanx, Paul

------------------------------------------------------------------------

 include/linux/rculist_bl.h |   28 --------------------------
 include/trace/events/rcu.h |   47 ++++++++++++++++++++++++---------------------
 kernel/rcu/rcu_segcblist.c |    6 ++---
 kernel/rcu/tree.c          |    1 
 kernel/rcu/tree_plugin.h   |    2 -
 kernel/workqueue.c         |   10 +--------
 6 files changed, 33 insertions(+), 61 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 1/8] rcu: Remove unused function hlist_bl_del_init_rcu()
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
@ 2019-10-03  1:32 ` paulmck
  2019-10-03  1:32 ` [PATCH tip/core/rcu 2/8] rcu: Several rcu_segcblist functions can be static paulmck
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:32 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Ethan Hansen, Paul E . McKenney

From: Ethan Hansen <1ethanhansen@gmail.com>

The function hlist_bl_del_init_rcu() is declared in rculist_bl.h,
but never used.  This commit therefore removes it.

Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 include/linux/rculist_bl.h | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h
index 66e73ec..0b952d0 100644
--- a/include/linux/rculist_bl.h
+++ b/include/linux/rculist_bl.h
@@ -25,34 +25,6 @@ static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h)
 }
 
 /**
- * hlist_bl_del_init_rcu - deletes entry from hash list with re-initialization
- * @n: the element to delete from the hash list.
- *
- * Note: hlist_bl_unhashed() on the node returns true after this. It is
- * useful for RCU based read lockfree traversal if the writer side
- * must know if the list entry is still hashed or already unhashed.
- *
- * In particular, it means that we can not poison the forward pointers
- * that may still be used for walking the hash list and we can only
- * zero the pprev pointer so list_unhashed() will return true after
- * this.
- *
- * The caller must take whatever precautions are necessary (such as
- * holding appropriate locks) to avoid racing with another
- * list-mutation primitive, such as hlist_bl_add_head_rcu() or
- * hlist_bl_del_rcu(), running on this same list.  However, it is
- * perfectly legal to run concurrently with the _rcu list-traversal
- * primitives, such as hlist_bl_for_each_entry_rcu().
- */
-static inline void hlist_bl_del_init_rcu(struct hlist_bl_node *n)
-{
-	if (!hlist_bl_unhashed(n)) {
-		__hlist_bl_del(n);
-		n->pprev = NULL;
-	}
-}
-
-/**
  * hlist_bl_del_rcu - deletes entry from hash list without re-initialization
  * @n: the element to delete from the hash list.
  *
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 2/8] rcu: Several rcu_segcblist functions can be static
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
  2019-10-03  1:32 ` [PATCH tip/core/rcu 1/8] rcu: Remove unused function hlist_bl_del_init_rcu() paulmck
@ 2019-10-03  1:32 ` paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 3/8] workqueue: Convert for_each_wq to use built-in list check paulmck
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:32 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, kbuild test robot,
	Paul E . McKenney

From: kbuild test robot <lkp@intel.com>

None of rcu_segcblist_set_len(), rcu_segcblist_add_len(), or
rcu_segcblist_xchg_len() are used outside of kernel/rcu/rcu_segcblist.c.
This commit therefore makes them static.

Fixes: ab2ef5c7b4d1 ("rcu/nocb: Atomic ->len field in rcu_segcblist structure")
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/rcu/rcu_segcblist.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index 495c58c..cbc87b8 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -88,7 +88,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp)
 }
 
 /* Set the length of an rcu_segcblist structure. */
-void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
+static void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
 {
 #ifdef CONFIG_RCU_NOCB_CPU
 	atomic_long_set(&rsclp->len, v);
@@ -104,7 +104,7 @@ void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
  * This increase is fully ordered with respect to the callers accesses
  * both before and after.
  */
-void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
+static void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v)
 {
 #ifdef CONFIG_RCU_NOCB_CPU
 	smp_mb__before_atomic(); /* Up to the caller! */
@@ -134,7 +134,7 @@ void rcu_segcblist_inc_len(struct rcu_segcblist *rsclp)
  * with the actual number of callbacks on the structure.  This exchange is
  * fully ordered with respect to the callers accesses both before and after.
  */
-long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
+static long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v)
 {
 #ifdef CONFIG_RCU_NOCB_CPU
 	return atomic_long_xchg(&rsclp->len, v);
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 3/8] workqueue: Convert for_each_wq to use built-in list check
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
  2019-10-03  1:32 ` [PATCH tip/core/rcu 1/8] rcu: Remove unused function hlist_bl_del_init_rcu() paulmck
  2019-10-03  1:32 ` [PATCH tip/core/rcu 2/8] rcu: Several rcu_segcblist functions can be static paulmck
@ 2019-10-03  1:33 ` paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI paulmck
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Paul E . McKenney

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

Because list_for_each_entry_rcu() can now check for holding a
lock as well as for being in an RCU read-side critical section,
this commit replaces the workqueue_sysfs_unregister() function's
use of assert_rcu_or_wq_mutex() and list_for_each_entry_rcu() with
list_for_each_entry_rcu() augmented with a lockdep_is_held() optional
argument.

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/workqueue.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index bc2e09a..e501c79 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -364,11 +364,6 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
 			 !lockdep_is_held(&wq_pool_mutex),		\
 			 "RCU or wq_pool_mutex should be held")
 
-#define assert_rcu_or_wq_mutex(wq)					\
-	RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&			\
-			 !lockdep_is_held(&wq->mutex),			\
-			 "RCU or wq->mutex should be held")
-
 #define assert_rcu_or_wq_mutex_or_pool_mutex(wq)			\
 	RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&			\
 			 !lockdep_is_held(&wq->mutex) &&		\
@@ -425,9 +420,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
  * ignored.
  */
 #define for_each_pwq(pwq, wq)						\
-	list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node)		\
-		if (({ assert_rcu_or_wq_mutex(wq); false; })) { }	\
-		else
+	list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node,		\
+				 lockdep_is_held(&(wq->mutex)))
 
 #ifdef CONFIG_DEBUG_OBJECTS_WORK
 
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
                   ` (2 preceding siblings ...)
  2019-10-03  1:33 ` [PATCH tip/core/rcu 3/8] workqueue: Convert for_each_wq to use built-in list check paulmck
@ 2019-10-03  1:33 ` paulmck
  2019-10-03 11:43   ` Steven Rostedt
  2019-10-03  1:33 ` [PATCH tip/core/rcu 5/8] rcu: Remove obsolete descriptions for rcu_barrier tracepoint paulmck
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Paul E . McKenney

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

The RCU-specific resched_cpu() function sends a resched IPI to the
specified CPU, which can be used to force the tick on for a given
nohz_full CPU.  This is needed when this nohz_full CPU is looping in the
kernel while blocking the current grace period.  However, for the tick
to actually be forced on in all cases, that CPU's rcu_data structure's
->rcu_urgent_qs flag must be set beforehand.  This commit therefore
causes rcu_implicit_dynticks_qs() to set this flag prior to invoking
resched_cpu() on a holdout nohz_full CPU.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/rcu/tree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 8110514..0d83b19 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1073,6 +1073,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
 	if (tick_nohz_full_cpu(rdp->cpu) &&
 		   time_after(jiffies,
 			      READ_ONCE(rdp->last_fqs_resched) + jtsq * 3)) {
+		WRITE_ONCE(*ruqp, true);
 		resched_cpu(rdp->cpu);
 		WRITE_ONCE(rdp->last_fqs_resched, jiffies);
 	}
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 5/8] rcu: Remove obsolete descriptions for rcu_barrier tracepoint
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
                   ` (3 preceding siblings ...)
  2019-10-03  1:33 ` [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI paulmck
@ 2019-10-03  1:33 ` paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 6/8] rcu: Update descriptions for rcu_nocb_wake tracepoint paulmck
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Paul E. McKenney

From: "Paul E. McKenney" <paulmck@linux.ibm.com>

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 include/trace/events/rcu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 694bd04..afa8985 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -713,8 +713,6 @@ TRACE_EVENT_RCU(rcu_torture_read,
  *	"Begin": rcu_barrier() started.
  *	"EarlyExit": rcu_barrier() piggybacked, thus early exit.
  *	"Inc1": rcu_barrier() piggyback check counter incremented.
- *	"OfflineNoCB": rcu_barrier() found callback on never-online CPU
- *	"OnlineNoCB": rcu_barrier() found online no-CBs CPU.
  *	"OnlineQ": rcu_barrier() found online CPU with callbacks.
  *	"OnlineNQ": rcu_barrier() found online CPU, no callbacks.
  *	"IRQ": An rcu_barrier_callback() callback posted on remote CPU.
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 6/8] rcu: Update descriptions for rcu_nocb_wake tracepoint
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
                   ` (4 preceding siblings ...)
  2019-10-03  1:33 ` [PATCH tip/core/rcu 5/8] rcu: Remove obsolete descriptions for rcu_barrier tracepoint paulmck
@ 2019-10-03  1:33 ` paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 7/8] rcu: Update descriptions for rcu_future_grace_period tracepoint paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 8/8] rcu: Fix uninitialized variable in nocb_gp_wait() paulmck
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Paul E. McKenney

From: "Paul E. McKenney" <paulmck@linux.ibm.com>

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 include/trace/events/rcu.h | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index afa8985..4609f2e 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -258,20 +258,27 @@ TRACE_EVENT_RCU(rcu_exp_funnel_lock,
  * the number of the offloaded CPU are extracted.  The third and final
  * argument is a string as follows:
  *
- *	"WakeEmpty": Wake rcuo kthread, first CB to empty list.
- *	"WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list.
- *	"WakeOvf": Wake rcuo kthread, CB list is huge.
- *	"WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge.
- *	"WakeNot": Don't wake rcuo kthread.
- *	"WakeNotPoll": Don't wake rcuo kthread because it is polling.
- *	"DeferredWake": Carried out the "IsDeferred" wakeup.
- *	"Poll": Start of new polling cycle for rcu_nocb_poll.
- *	"Sleep": Sleep waiting for GP for !rcu_nocb_poll.
- *	"CBSleep": Sleep waiting for CBs for !rcu_nocb_poll.
- *	"WokeEmpty": rcuo kthread woke to find empty list.
- *	"WokeNonEmpty": rcuo kthread woke to find non-empty list.
- *	"WaitQueue": Enqueue partially done, timed wait for it to complete.
- *	"WokeQueue": Partial enqueue now complete.
+ * "AlreadyAwake": The to-be-awakened rcuo kthread is already awake.
+ * "Bypass": rcuo GP kthread sees non-empty ->nocb_bypass.
+ * "CBSleep": rcuo CB kthread sleeping waiting for CBs.
+ * "Check": rcuo GP kthread checking specified CPU for work.
+ * "DeferredWake": Timer expired or polled check, time to wake.
+ * "DoWake": The to-be-awakened rcuo kthread needs to be awakened.
+ * "EndSleep": Done waiting for GP for !rcu_nocb_poll.
+ * "FirstBQ": New CB to empty ->nocb_bypass (->cblist maybe non-empty).
+ * "FirstBQnoWake": FirstBQ plus rcuo kthread need not be awakened.
+ * "FirstBQwake": FirstBQ plus rcuo kthread must be awakened.
+ * "FirstQ": New CB to empty ->cblist (->nocb_bypass maybe non-empty).
+ * "NeedWaitGP": rcuo GP kthread must wait on a grace period.
+ * "Poll": Start of new polling cycle for rcu_nocb_poll.
+ * "Sleep": Sleep waiting for GP for !rcu_nocb_poll.
+ * "Timer": Deferred-wake timer expired.
+ * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list.
+ * "WakeEmpty": Wake rcuo kthread, first CB to empty list.
+ * "WakeNot": Don't wake rcuo kthread.
+ * "WakeNotPoll": Don't wake rcuo kthread because it is polling.
+ * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge.
+ * "WokeEmpty": rcuo CB kthread woke to find empty list.
  */
 TRACE_EVENT_RCU(rcu_nocb_wake,
 
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 7/8] rcu: Update descriptions for rcu_future_grace_period tracepoint
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
                   ` (5 preceding siblings ...)
  2019-10-03  1:33 ` [PATCH tip/core/rcu 6/8] rcu: Update descriptions for rcu_nocb_wake tracepoint paulmck
@ 2019-10-03  1:33 ` paulmck
  2019-10-03  1:33 ` [PATCH tip/core/rcu 8/8] rcu: Fix uninitialized variable in nocb_gp_wait() paulmck
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Paul E. McKenney

From: "Paul E. McKenney" <paulmck@linux.ibm.com>

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 include/trace/events/rcu.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 4609f2e..6612260 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -93,16 +93,16 @@ TRACE_EVENT_RCU(rcu_grace_period,
  * the data from the rcu_node structure, other than rcuname, which comes
  * from the rcu_state structure, and event, which is one of the following:
  *
- * "Startleaf": Request a grace period based on leaf-node data.
+ * "Cleanup": Clean up rcu_node structure after previous GP.
+ * "CleanupMore": Clean up, and another GP is needed.
+ * "EndWait": Complete wait.
+ * "NoGPkthread": The RCU grace-period kthread has not yet started.
  * "Prestarted": Someone beat us to the request
  * "Startedleaf": Leaf node marked for future GP.
  * "Startedleafroot": All nodes from leaf to root marked for future GP.
  * "Startedroot": Requested a nocb grace period based on root-node data.
- * "NoGPkthread": The RCU grace-period kthread has not yet started.
+ * "Startleaf": Request a grace period based on leaf-node data.
  * "StartWait": Start waiting for the requested grace period.
- * "EndWait": Complete wait.
- * "Cleanup": Clean up rcu_node structure after previous GP.
- * "CleanupMore": Clean up, and another GP is needed.
  */
 TRACE_EVENT_RCU(rcu_future_grace_period,
 
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH tip/core/rcu 8/8] rcu: Fix uninitialized variable in nocb_gp_wait()
  2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
                   ` (6 preceding siblings ...)
  2019-10-03  1:33 ` [PATCH tip/core/rcu 7/8] rcu: Update descriptions for rcu_future_grace_period tracepoint paulmck
@ 2019-10-03  1:33 ` paulmck
  7 siblings, 0 replies; 11+ messages in thread
From: paulmck @ 2019-10-03  1:33 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Dan Carpenter, Paul E . McKenney

From: Dan Carpenter <dan.carpenter@oracle.com>

We never set this to false.  This probably doesn't affect most people's
runtime because GCC will automatically initialize it to false at certain
common optimization levels.  But that behavior is related to a bug in
GCC and obviously should not be relied on.

Fixes: 5d6742b37727 ("rcu/nocb: Use rcu_segcblist for no-CBs CPUs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/rcu/tree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 2defc7f..fa08d55 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1946,7 +1946,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)
 	int __maybe_unused cpu = my_rdp->cpu;
 	unsigned long cur_gp_seq;
 	unsigned long flags;
-	bool gotcbs;
+	bool gotcbs = false;
 	unsigned long j = jiffies;
 	bool needwait_gp = false; // This prevents actual uninitialized use.
 	bool needwake;
-- 
2.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI
  2019-10-03  1:33 ` [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI paulmck
@ 2019-10-03 11:43   ` Steven Rostedt
  2019-10-03 13:45     ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2019-10-03 11:43 UTC (permalink / raw)
  To: paulmck
  Cc: rcu, linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, dhowells, edumazet,
	fweisbec, oleg, joel, Paul E . McKenney

On Wed,  2 Oct 2019 18:33:01 -0700
paulmck@kernel.org wrote:

> From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> 
> The RCU-specific resched_cpu() function sends a resched IPI to the
> specified CPU, which can be used to force the tick on for a given
> nohz_full CPU.  This is needed when this nohz_full CPU is looping in the
> kernel while blocking the current grace period.  However, for the tick
> to actually be forced on in all cases, that CPU's rcu_data structure's
> ->rcu_urgent_qs flag must be set beforehand.  This commit therefore  
> causes rcu_implicit_dynticks_qs() to set this flag prior to invoking
> resched_cpu() on a holdout nohz_full CPU.

Should this be marked for stable?

-- Steve

> 
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> ---
>  kernel/rcu/tree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 8110514..0d83b19 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1073,6 +1073,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
>  	if (tick_nohz_full_cpu(rdp->cpu) &&
>  		   time_after(jiffies,
>  			      READ_ONCE(rdp->last_fqs_resched) + jtsq * 3)) {
> +		WRITE_ONCE(*ruqp, true);
>  		resched_cpu(rdp->cpu);
>  		WRITE_ONCE(rdp->last_fqs_resched, jiffies);
>  	}


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI
  2019-10-03 11:43   ` Steven Rostedt
@ 2019-10-03 13:45     ` Paul E. McKenney
  0 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2019-10-03 13:45 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: rcu, linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, dhowells, edumazet,
	fweisbec, oleg, joel

On Thu, Oct 03, 2019 at 07:43:19AM -0400, Steven Rostedt wrote:
> On Wed,  2 Oct 2019 18:33:01 -0700
> paulmck@kernel.org wrote:
> 
> > From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> > 
> > The RCU-specific resched_cpu() function sends a resched IPI to the
> > specified CPU, which can be used to force the tick on for a given
> > nohz_full CPU.  This is needed when this nohz_full CPU is looping in the
> > kernel while blocking the current grace period.  However, for the tick
> > to actually be forced on in all cases, that CPU's rcu_data structure's
> > ->rcu_urgent_qs flag must be set beforehand.  This commit therefore  
> > causes rcu_implicit_dynticks_qs() to set this flag prior to invoking
> > resched_cpu() on a holdout nohz_full CPU.
> 
> Should this be marked for stable?

Not unless and until people are actually running into this.  NO_HZ_FULL
has left the tick off for in-kernel loops on nohz_full CPUs for almost
ten years now, and as far as I know, without complaint.

So from what I am seeing, the risk of backporting far exceeds the benefit.

							Thanx, Paul

> -- Steve
> 
> > 
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> > ---
> >  kernel/rcu/tree.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 8110514..0d83b19 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1073,6 +1073,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
> >  	if (tick_nohz_full_cpu(rdp->cpu) &&
> >  		   time_after(jiffies,
> >  			      READ_ONCE(rdp->last_fqs_resched) + jtsq * 3)) {
> > +		WRITE_ONCE(*ruqp, true);
> >  		resched_cpu(rdp->cpu);
> >  		WRITE_ONCE(rdp->last_fqs_resched, jiffies);
> >  	}
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03  1:32 [PATCH tip/core/rcu 0/8] Fixes for v5.5 Paul E. McKenney
2019-10-03  1:32 ` [PATCH tip/core/rcu 1/8] rcu: Remove unused function hlist_bl_del_init_rcu() paulmck
2019-10-03  1:32 ` [PATCH tip/core/rcu 2/8] rcu: Several rcu_segcblist functions can be static paulmck
2019-10-03  1:33 ` [PATCH tip/core/rcu 3/8] workqueue: Convert for_each_wq to use built-in list check paulmck
2019-10-03  1:33 ` [PATCH tip/core/rcu 4/8] rcu: Ensure that ->rcu_urgent_qs is set before resched IPI paulmck
2019-10-03 11:43   ` Steven Rostedt
2019-10-03 13:45     ` Paul E. McKenney
2019-10-03  1:33 ` [PATCH tip/core/rcu 5/8] rcu: Remove obsolete descriptions for rcu_barrier tracepoint paulmck
2019-10-03  1:33 ` [PATCH tip/core/rcu 6/8] rcu: Update descriptions for rcu_nocb_wake tracepoint paulmck
2019-10-03  1:33 ` [PATCH tip/core/rcu 7/8] rcu: Update descriptions for rcu_future_grace_period tracepoint paulmck
2019-10-03  1:33 ` [PATCH tip/core/rcu 8/8] rcu: Fix uninitialized variable in nocb_gp_wait() paulmck

RCU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/rcu/0 rcu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 rcu rcu/ https://lore.kernel.org/rcu \
		rcu@vger.kernel.org rcu@archiver.kernel.org
	public-inbox-index rcu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.rcu


AGPL code for this site: git clone https://public-inbox.org/ public-inbox