ia64/xen-unstable

view patches/linux-2.6.16.29/rcu_needs_cpu.patch @ 12327:eea9247ad5a0

[XENOPROF] Oprofile user level samples for passive domains are being lost.
The number of of lost samples is most significant when dom0 is idle.

From: joserenato.santos@hp.com
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Nov 09 11:47:42 2006 +0000 (2006-11-09)
parents 041be3f6b38e
children
line source
1 diff -pruN ../orig-linux-2.6.16.29/include/linux/rcupdate.h ./include/linux/rcupdate.h
2 --- ../orig-linux-2.6.16.29/include/linux/rcupdate.h 2006-09-12 19:02:10.000000000 +0100
3 +++ ./include/linux/rcupdate.h 2006-09-19 14:05:39.000000000 +0100
4 @@ -134,6 +134,7 @@ static inline void rcu_bh_qsctr_inc(int
5 }
7 extern int rcu_pending(int cpu);
8 +extern int rcu_needs_cpu(int cpu);
10 /**
11 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
12 diff -pruN ../orig-linux-2.6.16.29/kernel/rcupdate.c ./kernel/rcupdate.c
13 --- ../orig-linux-2.6.16.29/kernel/rcupdate.c 2006-09-12 19:02:10.000000000 +0100
14 +++ ./kernel/rcupdate.c 2006-09-19 14:05:39.000000000 +0100
15 @@ -485,6 +485,20 @@ int rcu_pending(int cpu)
16 __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
17 }
19 +/*
20 + * Check to see if any future RCU-related work will need to be done
21 + * by the current CPU, even if none need be done immediately, returning
22 + * 1 if so. This function is part of the RCU implementation; it is -not-
23 + * an exported member of the RCU API.
24 + */
25 +int rcu_needs_cpu(int cpu)
26 +{
27 + struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
28 + struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
29 +
30 + return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu));
31 +}
32 +
33 void rcu_check_callbacks(int cpu, int user)
34 {
35 if (user ||