ia64/xen-unstable

view patches/linux-2.6.16.13/rcu_needs_cpu.patch @ 10365:c230dbe793d6

[LINUX] Fix interaction between idle loop and RCU subsystem.

There is a problem with the current implementation of stop_hz_timer in
arch/i386/kernel/time-xen.c where the hz timer can be stopped on a CPU
which has RCU callbacks pending.

This patch backports a new RCU API created to fix this problem for the
s390 implementation of stop_hz_timer and also updates the time-xen.c
implementation of stop_hz_timer to call the new API.

Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jun 12 14:17:05 2006 +0100 (2006-06-12)
parents
children
line source
1 --- ../pristine-linux-2.6.16.13/kernel/rcupdate.c 2006-05-02 22:38:44.000000000 +0100
2 +++ ./kernel/rcupdate.c 2006-06-09 20:27:45.000000000 +0100
3 @@ -485,6 +485,20 @@ int rcu_pending(int cpu)
4 __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
5 }
7 +/*
8 + * Check to see if any future RCU-related work will need to be done
9 + * by the current CPU, even if none need be done immediately, returning
10 + * 1 if so. This function is part of the RCU implementation; it is -not-
11 + * an exported member of the RCU API.
12 + */
13 +int rcu_needs_cpu(int cpu)
14 +{
15 + struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
16 + struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
17 +
18 + return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu));
19 +}
20 +
21 void rcu_check_callbacks(int cpu, int user)
22 {
23 if (user ||
24 --- ../pristine-linux-2.6.16.13/include/linux/rcupdate.h 2006-05-02 22:38:44.000000000 +0100
25 +++ ./include/linux/rcupdate.h 2006-06-09 20:28:57.000000000 +0100
26 @@ -134,6 +134,7 @@ static inline void rcu_bh_qsctr_inc(int
27 }
29 extern int rcu_pending(int cpu);
30 +extern int rcu_needs_cpu(int cpu);
32 /**
33 * rcu_read_lock - mark the beginning of an RCU read-side critical section.