rcupdate.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. /*
  2. * Read-Copy Update mechanism for mutual exclusion
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. * Copyright (C) IBM Corporation, 2001
  19. *
  20. * Authors: Dipankar Sarma <dipankar@in.ibm.com>
  21. * Manfred Spraul <manfred@colorfullife.com>
  22. *
  23. * Based on the original work by Paul McKenney <paulmck@us.ibm.com>
  24. * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
  25. * Papers:
  26. * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf
  27. * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001)
  28. *
  29. * For detailed explanation of Read-Copy Update mechanism see -
  30. * http://lse.sourceforge.net/locking/rcupdate.html
  31. *
  32. */
  33. #include <linux/types.h>
  34. #include <linux/kernel.h>
  35. #include <linux/init.h>
  36. #include <linux/spinlock.h>
  37. #include <linux/smp.h>
  38. #include <linux/rcupdate.h>
  39. #include <linux/interrupt.h>
  40. #include <linux/sched.h>
  41. #include <asm/atomic.h>
  42. #include <linux/bitops.h>
  43. #include <linux/module.h>
  44. #include <linux/completion.h>
  45. #include <linux/moduleparam.h>
  46. #include <linux/percpu.h>
  47. #include <linux/notifier.h>
  48. #include <linux/rcupdate.h>
  49. #include <linux/cpu.h>
  50. /* Definition for rcupdate control block. */
  51. struct rcu_ctrlblk rcu_ctrlblk = {
  52. .cur = -300,
  53. .completed = -300,
  54. .lock = SPIN_LOCK_UNLOCKED,
  55. .cpumask = CPU_MASK_NONE,
  56. };
  57. struct rcu_ctrlblk rcu_bh_ctrlblk = {
  58. .cur = -300,
  59. .completed = -300,
  60. .lock = SPIN_LOCK_UNLOCKED,
  61. .cpumask = CPU_MASK_NONE,
  62. };
  63. DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L };
  64. DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L };
  65. /* Fake initialization required by compiler */
  66. static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL};
  67. static int blimit = 10;
  68. static int qhimark = 10000;
  69. static int qlowmark = 100;
  70. #ifdef CONFIG_SMP
  71. static int rsinterval = 1000;
  72. #endif
  73. static atomic_t rcu_barrier_cpu_count;
  74. static struct semaphore rcu_barrier_sema;
  75. static struct completion rcu_barrier_completion;
  76. #ifdef CONFIG_SMP
  77. static void force_quiescent_state(struct rcu_data *rdp,
  78. struct rcu_ctrlblk *rcp)
  79. {
  80. int cpu;
  81. cpumask_t cpumask;
  82. set_need_resched();
  83. if (unlikely(rdp->qlen - rdp->last_rs_qlen > rsinterval)) {
  84. rdp->last_rs_qlen = rdp->qlen;
  85. /*
  86. * Don't send IPI to itself. With irqs disabled,
  87. * rdp->cpu is the current cpu.
  88. */
  89. cpumask = rcp->cpumask;
  90. cpu_clear(rdp->cpu, cpumask);
  91. for_each_cpu_mask(cpu, cpumask)
  92. smp_send_reschedule(cpu);
  93. }
  94. }
  95. #else
  96. static inline void force_quiescent_state(struct rcu_data *rdp,
  97. struct rcu_ctrlblk *rcp)
  98. {
  99. set_need_resched();
  100. }
  101. #endif
  102. /**
  103. * call_rcu - Queue an RCU callback for invocation after a grace period.
  104. * @head: structure to be used for queueing the RCU updates.
  105. * @func: actual update function to be invoked after the grace period
  106. *
  107. * The update function will be invoked some time after a full grace
  108. * period elapses, in other words after all currently executing RCU
  109. * read-side critical sections have completed. RCU read-side critical
  110. * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  111. * and may be nested.
  112. */
  113. void fastcall call_rcu(struct rcu_head *head,
  114. void (*func)(struct rcu_head *rcu))
  115. {
  116. unsigned long flags;
  117. struct rcu_data *rdp;
  118. head->func = func;
  119. head->next = NULL;
  120. local_irq_save(flags);
  121. rdp = &__get_cpu_var(rcu_data);
  122. *rdp->nxttail = head;
  123. rdp->nxttail = &head->next;
  124. if (unlikely(++rdp->qlen > qhimark)) {
  125. rdp->blimit = INT_MAX;
  126. force_quiescent_state(rdp, &rcu_ctrlblk);
  127. }
  128. local_irq_restore(flags);
  129. }
  130. /**
  131. * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.
  132. * @head: structure to be used for queueing the RCU updates.
  133. * @func: actual update function to be invoked after the grace period
  134. *
  135. * The update function will be invoked some time after a full grace
  136. * period elapses, in other words after all currently executing RCU
  137. * read-side critical sections have completed. call_rcu_bh() assumes
  138. * that the read-side critical sections end on completion of a softirq
  139. * handler. This means that read-side critical sections in process
  140. * context must not be interrupted by softirqs. This interface is to be
  141. * used when most of the read-side critical sections are in softirq context.
  142. * RCU read-side critical sections are delimited by rcu_read_lock() and
  143. * rcu_read_unlock(), * if in interrupt context or rcu_read_lock_bh()
  144. * and rcu_read_unlock_bh(), if in process context. These may be nested.
  145. */
  146. void fastcall call_rcu_bh(struct rcu_head *head,
  147. void (*func)(struct rcu_head *rcu))
  148. {
  149. unsigned long flags;
  150. struct rcu_data *rdp;
  151. head->func = func;
  152. head->next = NULL;
  153. local_irq_save(flags);
  154. rdp = &__get_cpu_var(rcu_bh_data);
  155. *rdp->nxttail = head;
  156. rdp->nxttail = &head->next;
  157. if (unlikely(++rdp->qlen > qhimark)) {
  158. rdp->blimit = INT_MAX;
  159. force_quiescent_state(rdp, &rcu_bh_ctrlblk);
  160. }
  161. local_irq_restore(flags);
  162. }
  163. /*
  164. * Return the number of RCU batches processed thus far. Useful
  165. * for debug and statistics.
  166. */
  167. long rcu_batches_completed(void)
  168. {
  169. return rcu_ctrlblk.completed;
  170. }
  171. static void rcu_barrier_callback(struct rcu_head *notused)
  172. {
  173. if (atomic_dec_and_test(&rcu_barrier_cpu_count))
  174. complete(&rcu_barrier_completion);
  175. }
  176. /*
  177. * Called with preemption disabled, and from cross-cpu IRQ context.
  178. */
  179. static void rcu_barrier_func(void *notused)
  180. {
  181. int cpu = smp_processor_id();
  182. struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
  183. struct rcu_head *head;
  184. head = &rdp->barrier;
  185. atomic_inc(&rcu_barrier_cpu_count);
  186. call_rcu(head, rcu_barrier_callback);
  187. }
  188. /**
  189. * rcu_barrier - Wait until all the in-flight RCUs are complete.
  190. */
  191. void rcu_barrier(void)
  192. {
  193. BUG_ON(in_interrupt());
  194. /* Take cpucontrol semaphore to protect against CPU hotplug */
  195. down(&rcu_barrier_sema);
  196. init_completion(&rcu_barrier_completion);
  197. atomic_set(&rcu_barrier_cpu_count, 0);
  198. on_each_cpu(rcu_barrier_func, NULL, 0, 1);
  199. wait_for_completion(&rcu_barrier_completion);
  200. up(&rcu_barrier_sema);
  201. }
  202. EXPORT_SYMBOL_GPL(rcu_barrier);
  203. /*
  204. * Invoke the completed RCU callbacks. They are expected to be in
  205. * a per-cpu list.
  206. */
  207. static void rcu_do_batch(struct rcu_data *rdp)
  208. {
  209. struct rcu_head *next, *list;
  210. int count = 0;
  211. list = rdp->donelist;
  212. while (list) {
  213. next = rdp->donelist = list->next;
  214. list->func(list);
  215. list = next;
  216. rdp->qlen--;
  217. if (++count >= rdp->blimit)
  218. break;
  219. }
  220. if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
  221. rdp->blimit = blimit;
  222. if (!rdp->donelist)
  223. rdp->donetail = &rdp->donelist;
  224. else
  225. tasklet_schedule(&per_cpu(rcu_tasklet, rdp->cpu));
  226. }
  227. /*
  228. * Grace period handling:
  229. * The grace period handling consists out of two steps:
  230. * - A new grace period is started.
  231. * This is done by rcu_start_batch. The start is not broadcasted to
  232. * all cpus, they must pick this up by comparing rcp->cur with
  233. * rdp->quiescbatch. All cpus are recorded in the
  234. * rcu_ctrlblk.cpumask bitmap.
  235. * - All cpus must go through a quiescent state.
  236. * Since the start of the grace period is not broadcasted, at least two
  237. * calls to rcu_check_quiescent_state are required:
  238. * The first call just notices that a new grace period is running. The
  239. * following calls check if there was a quiescent state since the beginning
  240. * of the grace period. If so, it updates rcu_ctrlblk.cpumask. If
  241. * the bitmap is empty, then the grace period is completed.
  242. * rcu_check_quiescent_state calls rcu_start_batch(0) to start the next grace
  243. * period (if necessary).
  244. */
  245. /*
  246. * Register a new batch of callbacks, and start it up if there is currently no
  247. * active batch and the batch to be registered has not already occurred.
  248. * Caller must hold rcu_ctrlblk.lock.
  249. */
  250. static void rcu_start_batch(struct rcu_ctrlblk *rcp)
  251. {
  252. if (rcp->next_pending &&
  253. rcp->completed == rcp->cur) {
  254. rcp->next_pending = 0;
  255. /*
  256. * next_pending == 0 must be visible in
  257. * __rcu_process_callbacks() before it can see new value of cur.
  258. */
  259. smp_wmb();
  260. rcp->cur++;
  261. /*
  262. * Accessing nohz_cpu_mask before incrementing rcp->cur needs a
  263. * Barrier Otherwise it can cause tickless idle CPUs to be
  264. * included in rcp->cpumask, which will extend graceperiods
  265. * unnecessarily.
  266. */
  267. smp_mb();
  268. cpus_andnot(rcp->cpumask, cpu_online_map, nohz_cpu_mask);
  269. }
  270. }
  271. /*
  272. * cpu went through a quiescent state since the beginning of the grace period.
  273. * Clear it from the cpu mask and complete the grace period if it was the last
  274. * cpu. Start another grace period if someone has further entries pending
  275. */
  276. static void cpu_quiet(int cpu, struct rcu_ctrlblk *rcp)
  277. {
  278. cpu_clear(cpu, rcp->cpumask);
  279. if (cpus_empty(rcp->cpumask)) {
  280. /* batch completed ! */
  281. rcp->completed = rcp->cur;
  282. rcu_start_batch(rcp);
  283. }
  284. }
  285. /*
  286. * Check if the cpu has gone through a quiescent state (say context
  287. * switch). If so and if it already hasn't done so in this RCU
  288. * quiescent cycle, then indicate that it has done so.
  289. */
  290. static void rcu_check_quiescent_state(struct rcu_ctrlblk *rcp,
  291. struct rcu_data *rdp)
  292. {
  293. if (rdp->quiescbatch != rcp->cur) {
  294. /* start new grace period: */
  295. rdp->qs_pending = 1;
  296. rdp->passed_quiesc = 0;
  297. rdp->quiescbatch = rcp->cur;
  298. return;
  299. }
  300. /* Grace period already completed for this cpu?
  301. * qs_pending is checked instead of the actual bitmap to avoid
  302. * cacheline trashing.
  303. */
  304. if (!rdp->qs_pending)
  305. return;
  306. /*
  307. * Was there a quiescent state since the beginning of the grace
  308. * period? If no, then exit and wait for the next call.
  309. */
  310. if (!rdp->passed_quiesc)
  311. return;
  312. rdp->qs_pending = 0;
  313. spin_lock(&rcp->lock);
  314. /*
  315. * rdp->quiescbatch/rcp->cur and the cpu bitmap can come out of sync
  316. * during cpu startup. Ignore the quiescent state.
  317. */
  318. if (likely(rdp->quiescbatch == rcp->cur))
  319. cpu_quiet(rdp->cpu, rcp);
  320. spin_unlock(&rcp->lock);
  321. }
  322. #ifdef CONFIG_HOTPLUG_CPU
  323. /* warning! helper for rcu_offline_cpu. do not use elsewhere without reviewing
  324. * locking requirements, the list it's pulling from has to belong to a cpu
  325. * which is dead and hence not processing interrupts.
  326. */
  327. static void rcu_move_batch(struct rcu_data *this_rdp, struct rcu_head *list,
  328. struct rcu_head **tail)
  329. {
  330. local_irq_disable();
  331. *this_rdp->nxttail = list;
  332. if (list)
  333. this_rdp->nxttail = tail;
  334. local_irq_enable();
  335. }
  336. static void __rcu_offline_cpu(struct rcu_data *this_rdp,
  337. struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
  338. {
  339. /* if the cpu going offline owns the grace period
  340. * we can block indefinitely waiting for it, so flush
  341. * it here
  342. */
  343. spin_lock_bh(&rcp->lock);
  344. if (rcp->cur != rcp->completed)
  345. cpu_quiet(rdp->cpu, rcp);
  346. spin_unlock_bh(&rcp->lock);
  347. rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
  348. rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
  349. rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
  350. }
  351. static void rcu_offline_cpu(int cpu)
  352. {
  353. struct rcu_data *this_rdp = &get_cpu_var(rcu_data);
  354. struct rcu_data *this_bh_rdp = &get_cpu_var(rcu_bh_data);
  355. __rcu_offline_cpu(this_rdp, &rcu_ctrlblk,
  356. &per_cpu(rcu_data, cpu));
  357. __rcu_offline_cpu(this_bh_rdp, &rcu_bh_ctrlblk,
  358. &per_cpu(rcu_bh_data, cpu));
  359. put_cpu_var(rcu_data);
  360. put_cpu_var(rcu_bh_data);
  361. tasklet_kill_immediate(&per_cpu(rcu_tasklet, cpu), cpu);
  362. }
  363. #else
  364. static void rcu_offline_cpu(int cpu)
  365. {
  366. }
  367. #endif
  368. /*
  369. * This does the RCU processing work from tasklet context.
  370. */
  371. static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
  372. struct rcu_data *rdp)
  373. {
  374. if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch)) {
  375. *rdp->donetail = rdp->curlist;
  376. rdp->donetail = rdp->curtail;
  377. rdp->curlist = NULL;
  378. rdp->curtail = &rdp->curlist;
  379. }
  380. local_irq_disable();
  381. if (rdp->nxtlist && !rdp->curlist) {
  382. rdp->curlist = rdp->nxtlist;
  383. rdp->curtail = rdp->nxttail;
  384. rdp->nxtlist = NULL;
  385. rdp->nxttail = &rdp->nxtlist;
  386. local_irq_enable();
  387. /*
  388. * start the next batch of callbacks
  389. */
  390. /* determine batch number */
  391. rdp->batch = rcp->cur + 1;
  392. /* see the comment and corresponding wmb() in
  393. * the rcu_start_batch()
  394. */
  395. smp_rmb();
  396. if (!rcp->next_pending) {
  397. /* and start it/schedule start if it's a new batch */
  398. spin_lock(&rcp->lock);
  399. rcp->next_pending = 1;
  400. rcu_start_batch(rcp);
  401. spin_unlock(&rcp->lock);
  402. }
  403. } else {
  404. local_irq_enable();
  405. }
  406. rcu_check_quiescent_state(rcp, rdp);
  407. if (rdp->donelist)
  408. rcu_do_batch(rdp);
  409. }
  410. static void rcu_process_callbacks(unsigned long unused)
  411. {
  412. __rcu_process_callbacks(&rcu_ctrlblk, &__get_cpu_var(rcu_data));
  413. __rcu_process_callbacks(&rcu_bh_ctrlblk, &__get_cpu_var(rcu_bh_data));
  414. }
  415. static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
  416. {
  417. /* This cpu has pending rcu entries and the grace period
  418. * for them has completed.
  419. */
  420. if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
  421. return 1;
  422. /* This cpu has no pending entries, but there are new entries */
  423. if (!rdp->curlist && rdp->nxtlist)
  424. return 1;
  425. /* This cpu has finished callbacks to invoke */
  426. if (rdp->donelist)
  427. return 1;
  428. /* The rcu core waits for a quiescent state from the cpu */
  429. if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
  430. return 1;
  431. /* nothing to do */
  432. return 0;
  433. }
  434. int rcu_pending(int cpu)
  435. {
  436. return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) ||
  437. __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
  438. }
  439. void rcu_check_callbacks(int cpu, int user)
  440. {
  441. if (user ||
  442. (idle_cpu(cpu) && !in_softirq() &&
  443. hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
  444. rcu_qsctr_inc(cpu);
  445. rcu_bh_qsctr_inc(cpu);
  446. } else if (!in_softirq())
  447. rcu_bh_qsctr_inc(cpu);
  448. tasklet_schedule(&per_cpu(rcu_tasklet, cpu));
  449. }
  450. static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
  451. struct rcu_data *rdp)
  452. {
  453. memset(rdp, 0, sizeof(*rdp));
  454. rdp->curtail = &rdp->curlist;
  455. rdp->nxttail = &rdp->nxtlist;
  456. rdp->donetail = &rdp->donelist;
  457. rdp->quiescbatch = rcp->completed;
  458. rdp->qs_pending = 0;
  459. rdp->cpu = cpu;
  460. rdp->blimit = blimit;
  461. }
  462. static void __devinit rcu_online_cpu(int cpu)
  463. {
  464. struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
  465. struct rcu_data *bh_rdp = &per_cpu(rcu_bh_data, cpu);
  466. rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp);
  467. rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp);
  468. tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);
  469. }
  470. static int __devinit rcu_cpu_notify(struct notifier_block *self,
  471. unsigned long action, void *hcpu)
  472. {
  473. long cpu = (long)hcpu;
  474. switch (action) {
  475. case CPU_UP_PREPARE:
  476. rcu_online_cpu(cpu);
  477. break;
  478. case CPU_DEAD:
  479. rcu_offline_cpu(cpu);
  480. break;
  481. default:
  482. break;
  483. }
  484. return NOTIFY_OK;
  485. }
  486. static struct notifier_block __devinitdata rcu_nb = {
  487. .notifier_call = rcu_cpu_notify,
  488. };
  489. /*
  490. * Initializes rcu mechanism. Assumed to be called early.
  491. * That is before local timer(SMP) or jiffie timer (uniproc) is setup.
  492. * Note that rcu_qsctr and friends are implicitly
  493. * initialized due to the choice of ``0'' for RCU_CTR_INVALID.
  494. */
  495. void __init rcu_init(void)
  496. {
  497. sema_init(&rcu_barrier_sema, 1);
  498. rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE,
  499. (void *)(long)smp_processor_id());
  500. /* Register notifier for non-boot CPUs */
  501. register_cpu_notifier(&rcu_nb);
  502. }
  503. struct rcu_synchronize {
  504. struct rcu_head head;
  505. struct completion completion;
  506. };
  507. /* Because of FASTCALL declaration of complete, we use this wrapper */
  508. static void wakeme_after_rcu(struct rcu_head *head)
  509. {
  510. struct rcu_synchronize *rcu;
  511. rcu = container_of(head, struct rcu_synchronize, head);
  512. complete(&rcu->completion);
  513. }
  514. /**
  515. * synchronize_rcu - wait until a grace period has elapsed.
  516. *
  517. * Control will return to the caller some time after a full grace
  518. * period has elapsed, in other words after all currently executing RCU
  519. * read-side critical sections have completed. RCU read-side critical
  520. * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  521. * and may be nested.
  522. *
  523. * If your read-side code is not protected by rcu_read_lock(), do -not-
  524. * use synchronize_rcu().
  525. */
  526. void synchronize_rcu(void)
  527. {
  528. struct rcu_synchronize rcu;
  529. init_completion(&rcu.completion);
  530. /* Will wake me after RCU finished */
  531. call_rcu(&rcu.head, wakeme_after_rcu);
  532. /* Wait for it */
  533. wait_for_completion(&rcu.completion);
  534. }
  535. /*
  536. * Deprecated, use synchronize_rcu() or synchronize_sched() instead.
  537. */
  538. void synchronize_kernel(void)
  539. {
  540. synchronize_rcu();
  541. }
  542. module_param(blimit, int, 0);
  543. module_param(qhimark, int, 0);
  544. module_param(qlowmark, int, 0);
  545. #ifdef CONFIG_SMP
  546. module_param(rsinterval, int, 0);
  547. #endif
  548. EXPORT_SYMBOL_GPL(rcu_batches_completed);
  549. EXPORT_SYMBOL_GPL_FUTURE(call_rcu); /* WARNING: GPL-only in April 2006. */
  550. EXPORT_SYMBOL_GPL_FUTURE(call_rcu_bh); /* WARNING: GPL-only in April 2006. */
  551. EXPORT_SYMBOL_GPL(synchronize_rcu);
  552. EXPORT_SYMBOL_GPL_FUTURE(synchronize_kernel); /* WARNING: GPL-only in April 2006. */