diff options
Diffstat (limited to 'include/linux/rcupdate.h')
| -rw-r--r-- | include/linux/rcupdate.h | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a471f3bb713e..981f9aa43353 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -65,7 +65,11 @@ struct rcu_ctrlblk { | |||
| 65 | long cur; /* Current batch number. */ | 65 | long cur; /* Current batch number. */ |
| 66 | long completed; /* Number of the last completed batch */ | 66 | long completed; /* Number of the last completed batch */ |
| 67 | int next_pending; /* Is the next batch already waiting? */ | 67 | int next_pending; /* Is the next batch already waiting? */ |
| 68 | } ____cacheline_maxaligned_in_smp; | 68 | |
| 69 | spinlock_t lock ____cacheline_internodealigned_in_smp; | ||
| 70 | cpumask_t cpumask; /* CPUs that need to switch in order */ | ||
| 71 | /* for current batch to proceed. */ | ||
| 72 | } ____cacheline_internodealigned_in_smp; | ||
| 69 | 73 | ||
| 70 | /* Is batch a before batch b ? */ | 74 | /* Is batch a before batch b ? */ |
| 71 | static inline int rcu_batch_before(long a, long b) | 75 | static inline int rcu_batch_before(long a, long b) |
| @@ -125,36 +129,7 @@ static inline void rcu_bh_qsctr_inc(int cpu) | |||
| 125 | rdp->passed_quiesc = 1; | 129 | rdp->passed_quiesc = 1; |
| 126 | } | 130 | } |
| 127 | 131 | ||
| 128 | static inline int __rcu_pending(struct rcu_ctrlblk *rcp, | 132 | extern int rcu_pending(int cpu); |
| 129 | struct rcu_data *rdp) | ||
| 130 | { | ||
| 131 | /* This cpu has pending rcu entries and the grace period | ||
| 132 | * for them has completed. | ||
| 133 | */ | ||
| 134 | if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch)) | ||
| 135 | return 1; | ||
| 136 | |||
| 137 | /* This cpu has no pending entries, but there are new entries */ | ||
| 138 | if (!rdp->curlist && rdp->nxtlist) | ||
| 139 | return 1; | ||
| 140 | |||
| 141 | /* This cpu has finished callbacks to invoke */ | ||
| 142 | if (rdp->donelist) | ||
| 143 | return 1; | ||
| 144 | |||
| 145 | /* The rcu core waits for a quiescent state from the cpu */ | ||
| 146 | if (rdp->quiescbatch != rcp->cur || rdp->qs_pending) | ||
| 147 | return 1; | ||
| 148 | |||
| 149 | /* nothing to do */ | ||
| 150 | return 0; | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline int rcu_pending(int cpu) | ||
| 154 | { | ||
| 155 | return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || | ||
| 156 | __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); | ||
| 157 | } | ||
| 158 | 133 | ||
| 159 | /** | 134 | /** |
| 160 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 135 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
