The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [patch] RCU: introduce rcu_soon_pending() interface
@ 2006-04-24 11:11 Heiko Carstens
  2006-04-24 23:09 ` Andrew Morton
  0 siblings, 1 reply; 14+ messages in thread
From: Heiko Carstens @ 2006-04-24 11:11 UTC (permalink / raw)
  To: Andrew Morton, Dipankar Sarma, Manfred Spraul, linux-kernel
  Cc: davem, Martin Schwidefsky

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Introduce rcu_soon_pending() interface. This can be used to tell if there
will be a new rcu batch on a cpu soon by looking at the curlist pointer.
This can be used to avoid to enter a tickless idle state where the cpu
would miss that a new batch is ready when rcu_start_batch would be called
on a different cpu.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

See also here: http://www.ussg.iu.edu/hypermail/linux/kernel/0604.3/0057.html
Better solutions welcome :)

 include/linux/rcupdate.h |    1 +
 kernel/rcupdate.c        |    8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 5673008..80bcbce 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -132,6 +132,7 @@ static inline void rcu_bh_qsctr_inc(int 
 }
 
 extern int rcu_pending(int cpu);
+extern int rcu_soon_pending(int cpu);
 
 /**
  * rcu_read_lock - mark the beginning of an RCU read-side critical section.
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 13458bb..e8cf09f 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -485,6 +485,14 @@ int rcu_pending(int cpu)
 		__rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
 }
 
+int rcu_soon_pending(int cpu)
+{
+	struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+	struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
+
+	return (!!rdp->curlist || !!rdp_bh->curlist);
+}
+
 void rcu_check_callbacks(int cpu, int user)
 {
 	if (user || 

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

end of thread, other threads:[~2006-05-02  6:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-24 11:11 [patch] RCU: introduce rcu_soon_pending() interface Heiko Carstens
2006-04-24 23:09 ` Andrew Morton
2006-04-25  5:27   ` Heiko Carstens
2006-04-25 11:46     ` Paul E. McKenney
2006-04-25 11:52       ` Heiko Carstens
2006-04-25 12:08         ` Paul E. McKenney
2006-04-25 12:27           ` [patch] RCU: introduce rcu_needs_cpu() interface Heiko Carstens
     [not found]             ` <20060426141205.58675763.akpm@osdl.org>
2006-04-27  8:11               ` [patch] RCU: add comments to rcu_pending/rcu_needs_cpu Heiko Carstens
2006-05-01 21:57                 ` Paul E. McKenney
2006-05-02  6:35                   ` Heiko Carstens
2006-04-25 12:28           ` [patch] s390: exploit rcu_needs_cpu() interface Heiko Carstens
2006-04-25 11:23   ` [patch] RCU: introduce rcu_soon_pending() interface Paul E. McKenney
2006-04-25 11:33     ` Martin Schwidefsky
2006-04-25 11:48       ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox