* [PATCH tip/core/rcu 0/2] config-param reduction and blocked-task warning
@ 2011-01-13 19:04 Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 1/2] rcu: demote SRCU_SYNCHRONIZE_DELAY from kernel-parameter status Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings Paul E. McKenney
0 siblings, 2 replies; 5+ messages in thread
From: Paul E. McKenney @ 2011-01-13 19:04 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet,
darren
Hello!
A couple of fixes:
1. Revert the ill-considered addition of a configuration parameter.
2. Avoid a pointless blocked-task warning.
After a bit more testing and review, I believe that these should go into
2.6.38, as they both represent regressions.
Thanx, Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH RFC tip/core/rcu 1/2] rcu: demote SRCU_SYNCHRONIZE_DELAY from kernel-parameter status
2011-01-13 19:04 [PATCH tip/core/rcu 0/2] config-param reduction and blocked-task warning Paul E. McKenney
@ 2011-01-13 19:04 ` Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings Paul E. McKenney
1 sibling, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2011-01-13 19:04 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet,
darren, Paul E. McKenney
Because the adaptive synchronize_srcu_expedited() approach has
worked very well in testing, remove the kernel parameter and
replace it by a C-preprocessor macro. If someone finds problems
with this approach, a more complex and aggressively adaptive
approach might be required.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
init/Kconfig | 15 ---------------
kernel/srcu.c | 15 +++++++++++++--
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/init/Kconfig b/init/Kconfig
index 526ec1c..e11bc79 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -497,21 +497,6 @@ config RCU_BOOST_DELAY
Accept the default if unsure.
-config SRCU_SYNCHRONIZE_DELAY
- int "Microseconds to delay before waiting for readers"
- range 0 20
- default 10
- help
- This option controls how long SRCU delays before entering its
- loop waiting on SRCU readers. The purpose of this loop is
- to avoid the unconditional context-switch penalty that would
- otherwise be incurred if there was an active SRCU reader,
- in a manner similar to adaptive locking schemes. This should
- be set to be a bit longer than the common-case SRCU read-side
- critical-section overhead.
-
- Accept the default if unsure.
-
endmenu # "RCU Subsystem"
config IKCONFIG
diff --git a/kernel/srcu.c b/kernel/srcu.c
index 98d8c1e..73ce23f 100644
--- a/kernel/srcu.c
+++ b/kernel/srcu.c
@@ -156,6 +156,16 @@ void __srcu_read_unlock(struct srcu_struct *sp, int idx)
EXPORT_SYMBOL_GPL(__srcu_read_unlock);
/*
+ * We use an adaptive strategy for synchronize_srcu() and especially for
+ * synchronize_srcu_expedited(). We spin for a fixed time period
+ * (defined below) to allow SRCU readers to exit their read-side critical
+ * sections. If there are still some readers after 10 microseconds,
+ * we repeatedly block for 1-millisecond time periods. This approach
+ * has done well in testing, so there is no need for a config parameter.
+ */
+#define SYNCHRONIZE_SRCU_READER_DELAY 10
+
+/*
* Helper function for synchronize_srcu() and synchronize_srcu_expedited().
*/
static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))
@@ -207,11 +217,12 @@ static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))
* will have finished executing. We initially give readers
* an arbitrarily chosen 10 microseconds to get out of their
* SRCU read-side critical sections, then loop waiting 1/HZ
- * seconds per iteration.
+ * seconds per iteration. The 10-microsecond value has done
+ * very well in testing.
*/
if (srcu_readers_active_idx(sp, idx))
- udelay(CONFIG_SRCU_SYNCHRONIZE_DELAY);
+ udelay(SYNCHRONIZE_SRCU_READER_DELAY);
while (srcu_readers_active_idx(sp, idx))
schedule_timeout_interruptible(1);
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings
2011-01-13 19:04 [PATCH tip/core/rcu 0/2] config-param reduction and blocked-task warning Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 1/2] rcu: demote SRCU_SYNCHRONIZE_DELAY from kernel-parameter status Paul E. McKenney
@ 2011-01-13 19:04 ` Paul E. McKenney
2011-01-13 19:29 ` Thomas Gleixner
1 sibling, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2011-01-13 19:04 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet,
darren, Paul E. McKenney, Paul E. McKenney
From: Paul E. McKenney <paul.mckenney@linaro.org>
If the RCU callback-processing kthread has nothing to do, it parks in
a wait_event(). If RCU remains idle for more than two minutes, the
kernel complains about this. This commit changes from wait_event()
to wait_event_interruptible() to prevent the kernel from complaining
just because RCU is idle.
Reported-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Thomas Weber <weber@corscience.de>
---
kernel/rcutiny.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 0344937..0c343b9 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -189,7 +189,8 @@ static int rcu_kthread(void *arg)
unsigned long flags;
for (;;) {
- wait_event(rcu_kthread_wq, have_rcu_kthread_work != 0);
+ wait_event_interruptible(rcu_kthread_wq,
+ have_rcu_kthread_work != 0);
morework = rcu_boost();
local_irq_save(flags);
work = have_rcu_kthread_work;
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings Paul E. McKenney
@ 2011-01-13 19:29 ` Thomas Gleixner
2011-01-13 20:44 ` Paul E. McKenney
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2011-01-13 19:29 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
josh, niv, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, Paul E. McKenney
On Thu, 13 Jan 2011, Paul E. McKenney wrote:
> Reported-by: Russell King <rmk@arm.linux.org.uk>
> Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
So finally someone managed to clone you ?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings
2011-01-13 19:29 ` Thomas Gleixner
@ 2011-01-13 20:44 ` Paul E. McKenney
0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2011-01-13 20:44 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
josh, niv, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, Paul E. McKenney
On Thu, Jan 13, 2011 at 08:29:49PM +0100, Thomas Gleixner wrote:
> On Thu, 13 Jan 2011, Paul E. McKenney wrote:
> > Reported-by: Russell King <rmk@arm.linux.org.uk>
> > Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> So finally someone managed to clone you ?
Thankfully, they only managed to multiplex me. ;-)
Thanx, Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-13 20:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-13 19:04 [PATCH tip/core/rcu 0/2] config-param reduction and blocked-task warning Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 1/2] rcu: demote SRCU_SYNCHRONIZE_DELAY from kernel-parameter status Paul E. McKenney
2011-01-13 19:04 ` [PATCH RFC tip/core/rcu 2/2] rcu: avoid pointless blocked-task warnings Paul E. McKenney
2011-01-13 19:29 ` Thomas Gleixner
2011-01-13 20:44 ` Paul E. McKenney
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.