lkml.org 
[lkml]   [2006]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] RCU: introduce rcu_soon_pending() interface
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 ||
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-04-24 13:15    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site