rcuclassic.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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 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. * Documentation/RCU
  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/cpu.h>
  49. #include <linux/mutex.h>
  50. #ifdef CONFIG_DEBUG_LOCK_ALLOC
  51. static struct lock_class_key rcu_lock_key;
  52. struct lockdep_map rcu_lock_map =
  53. STATIC_LOCKDEP_MAP_INIT("rcu_read_lock", &rcu_lock_key);
  54. EXPORT_SYMBOL_GPL(rcu_lock_map);
  55. #endif
  56. /* Definition for rcupdate control block. */
  57. static struct rcu_ctrlblk rcu_ctrlblk = {
  58. .cur = -300,
  59. .completed = -300,
  60. .lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock),
  61. .cpumask = CPU_MASK_NONE,
  62. };
  63. static struct rcu_ctrlblk rcu_bh_ctrlblk = {
  64. .cur = -300,
  65. .completed = -300,
  66. .lock = __SPIN_LOCK_UNLOCKED(&rcu_bh_ctrlblk.lock),
  67. .cpumask = CPU_MASK_NONE,
  68. };
  69. DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L };
  70. DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L };
  71. static int blimit = 10;
  72. static int qhimark = 10000;
  73. static int qlowmark = 100;
  74. #ifdef CONFIG_SMP
  75. static void force_quiescent_state(struct rcu_data *rdp,
  76. struct rcu_ctrlblk *rcp)
  77. {
  78. int cpu;
  79. cpumask_t cpumask;
  80. set_need_resched();
  81. if (unlikely(!rcp->signaled)) {
  82. rcp->signaled = 1;
  83. /*
  84. * Don't send IPI to itself. With irqs disabled,
  85. * rdp->cpu is the current cpu.
  86. *
  87. * cpu_online_map is updated by the _cpu_down()
  88. * using stop_machine_run(). Since we're in irqs disabled
  89. * section, stop_machine_run() is not exectuting, hence
  90. * the cpu_online_map is stable.
  91. *
  92. * However, a cpu might have been offlined _just_ before
  93. * we disabled irqs while entering here.
  94. * And rcu subsystem might not yet have handled the CPU_DEAD
  95. * notification, leading to the offlined cpu's bit
  96. * being set in the rcp->cpumask.
  97. *
  98. * Hence cpumask = (rcp->cpumask & cpu_online_map) to prevent
  99. * sending smp_reschedule() to an offlined CPU.
  100. */
  101. cpus_and(cpumask, rcp->cpumask, cpu_online_map);
  102. cpu_clear(rdp->cpu, cpumask);
  103. for_each_cpu_mask(cpu, cpumask)
  104. smp_send_reschedule(cpu);
  105. }
  106. }
  107. #else
  108. static inline void force_quiescent_state(struct rcu_data *rdp,
  109. struct rcu_ctrlblk *rcp)
  110. {
  111. set_need_resched();
  112. }
  113. #endif
  114. /**
  115. * call_rcu - Queue an RCU callback for invocation after a grace period.
  116. * @head: structure to be used for queueing the RCU updates.
  117. * @func: actual update function to be invoked after the grace period
  118. *
  119. * The update function will be invoked some time after a full grace
  120. * period elapses, in other words after all currently executing RCU
  121. * read-side critical sections have completed. RCU read-side critical
  122. * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  123. * and may be nested.
  124. */
  125. void call_rcu(struct rcu_head *head,
  126. void (*func)(struct rcu_head *rcu))
  127. {
  128. unsigned long flags;
  129. struct rcu_data *rdp;
  130. head->func = func;
  131. head->next = NULL;
  132. local_irq_save(flags);
  133. rdp = &__get_cpu_var(rcu_data);
  134. *rdp->nxttail = head;
  135. rdp->nxttail = &head->next;
  136. if (unlikely(++rdp->qlen > qhimark)) {
  137. rdp->blimit = INT_MAX;
  138. force_quiescent_state(rdp, &rcu_ctrlblk);
  139. }
  140. local_irq_restore(flags);
  141. }
  142. EXPORT_SYMBOL_GPL(call_rcu);
  143. /**
  144. * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.
  145. * @head: structure to be used for queueing the RCU updates.
  146. * @func: actual update function to be invoked after the grace period
  147. *
  148. * The update function will be invoked some time after a full grace
  149. * period elapses, in other words after all currently executing RCU
  150. * read-side critical sections have completed. call_rcu_bh() assumes
  151. * that the read-side critical sections end on completion of a softirq
  152. * handler. This means that read-side critical sections in process
  153. * context must not be interrupted by softirqs. This interface is to be
  154. * used when most of the read-side critical sections are in softirq context.
  155. * RCU read-side critical sections are delimited by rcu_read_lock() and
  156. * rcu_read_unlock(), * if in interrupt context or rcu_read_lock_bh()
  157. * and rcu_read_unlock_bh(), if in process context. These may be nested.
  158. */
  159. void call_rcu_bh(struct rcu_head *head,
  160. void (*func)(struct rcu_head *rcu))
  161. {
  162. unsigned long flags;
  163. struct rcu_data *rdp;
  164. head->func = func;
  165. head->next = NULL;
  166. local_irq_save(flags);
  167. rdp = &__get_cpu_var(rcu_bh_data);
  168. *rdp->nxttail = head;
  169. rdp->nxttail = &head->next;
  170. if (unlikely(++rdp->qlen > qhimark)) {
  171. rdp->blimit = INT_MAX;
  172. force_quiescent_state(rdp, &rcu_bh_ctrlblk);
  173. }
  174. local_irq_restore(flags);
  175. }
  176. EXPORT_SYMBOL_GPL(call_rcu_bh);
  177. /*
  178. * Return the number of RCU batches processed thus far. Useful
  179. * for debug and statistics.
  180. */
  181. long rcu_batches_completed(void)
  182. {
  183. return rcu_ctrlblk.completed;
  184. }
  185. EXPORT_SYMBOL_GPL(rcu_batches_completed);
  186. /*
  187. * Return the number of RCU batches processed thus far. Useful
  188. * for debug and statistics.
  189. */
  190. long rcu_batches_completed_bh(void)
  191. {
  192. return rcu_bh_ctrlblk.completed;
  193. }
  194. EXPORT_SYMBOL_GPL(rcu_batches_completed_bh);
  195. /* Raises the softirq for processing rcu_callbacks. */
  196. static inline void raise_rcu_softirq(void)
  197. {
  198. raise_softirq(RCU_SOFTIRQ);
  199. /*
  200. * The smp_mb() here is required to ensure that this cpu's
  201. * __rcu_process_callbacks() reads the most recently updated
  202. * value of rcu->cur.
  203. */
  204. smp_mb();
  205. }
  206. /*
  207. * Invoke the completed RCU callbacks. They are expected to be in
  208. * a per-cpu list.
  209. */
  210. static void rcu_do_batch(struct rcu_data *rdp)
  211. {
  212. struct rcu_head *next, *list;
  213. int count = 0;
  214. list = rdp->donelist;
  215. while (list) {
  216. next = list->next;
  217. prefetch(next);
  218. list->func(list);
  219. list = next;
  220. if (++count >= rdp->blimit)
  221. break;
  222. }
  223. rdp->donelist = list;
  224. local_irq_disable();
  225. rdp->qlen -= count;
  226. local_irq_enable();
  227. if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
  228. rdp->blimit = blimit;
  229. if (!rdp->donelist)
  230. rdp->donetail = &rdp->donelist;
  231. else
  232. raise_rcu_softirq();
  233. }
  234. /*
  235. * Grace period handling:
  236. * The grace period handling consists out of two steps:
  237. * - A new grace period is started.
  238. * This is done by rcu_start_batch. The start is not broadcasted to
  239. * all cpus, they must pick this up by comparing rcp->cur with
  240. * rdp->quiescbatch. All cpus are recorded in the
  241. * rcu_ctrlblk.cpumask bitmap.
  242. * - All cpus must go through a quiescent state.
  243. * Since the start of the grace period is not broadcasted, at least two
  244. * calls to rcu_check_quiescent_state are required:
  245. * The first call just notices that a new grace period is running. The
  246. * following calls check if there was a quiescent state since the beginning
  247. * of the grace period. If so, it updates rcu_ctrlblk.cpumask. If
  248. * the bitmap is empty, then the grace period is completed.
  249. * rcu_check_quiescent_state calls rcu_start_batch(0) to start the next grace
  250. * period (if necessary).
  251. */
  252. /*
  253. * Register a new batch of callbacks, and start it up if there is currently no
  254. * active batch and the batch to be registered has not already occurred.
  255. * Caller must hold rcu_ctrlblk.lock.
  256. */
  257. static void rcu_start_batch(struct rcu_ctrlblk *rcp)
  258. {
  259. if (rcp->next_pending &&
  260. rcp->completed == rcp->cur) {
  261. rcp->next_pending = 0;
  262. /*
  263. * next_pending == 0 must be visible in
  264. * __rcu_process_callbacks() before it can see new value of cur.
  265. */
  266. smp_wmb();
  267. rcp->cur++;
  268. /*
  269. * Accessing nohz_cpu_mask before incrementing rcp->cur needs a
  270. * Barrier Otherwise it can cause tickless idle CPUs to be
  271. * included in rcp->cpumask, which will extend graceperiods
  272. * unnecessarily.
  273. */
  274. smp_mb();
  275. cpus_andnot(rcp->cpumask, cpu_online_map, nohz_cpu_mask);
  276. rcp->signaled = 0;
  277. }
  278. }
  279. /*
  280. * cpu went through a quiescent state since the beginning of the grace period.
  281. * Clear it from the cpu mask and complete the grace period if it was the last
  282. * cpu. Start another grace period if someone has further entries pending
  283. */
  284. static void cpu_quiet(int cpu, struct rcu_ctrlblk *rcp)
  285. {
  286. cpu_clear(cpu, rcp->cpumask);
  287. if (cpus_empty(rcp->cpumask)) {
  288. /* batch completed ! */
  289. rcp->completed = rcp->cur;
  290. rcu_start_batch(rcp);
  291. }
  292. }
  293. /*
  294. * Check if the cpu has gone through a quiescent state (say context
  295. * switch). If so and if it already hasn't done so in this RCU
  296. * quiescent cycle, then indicate that it has done so.
  297. */
  298. static void rcu_check_quiescent_state(struct rcu_ctrlblk *rcp,
  299. struct rcu_data *rdp)
  300. {
  301. if (rdp->quiescbatch != rcp->cur) {
  302. /* start new grace period: */
  303. rdp->qs_pending = 1;
  304. rdp->passed_quiesc = 0;
  305. rdp->quiescbatch = rcp->cur;
  306. return;
  307. }
  308. /* Grace period already completed for this cpu?
  309. * qs_pending is checked instead of the actual bitmap to avoid
  310. * cacheline trashing.
  311. */
  312. if (!rdp->qs_pending)
  313. return;
  314. /*
  315. * Was there a quiescent state since the beginning of the grace
  316. * period? If no, then exit and wait for the next call.
  317. */
  318. if (!rdp->passed_quiesc)
  319. return;
  320. rdp->qs_pending = 0;
  321. spin_lock(&rcp->lock);
  322. /*
  323. * rdp->quiescbatch/rcp->cur and the cpu bitmap can come out of sync
  324. * during cpu startup. Ignore the quiescent state.
  325. */
  326. if (likely(rdp->quiescbatch == rcp->cur))
  327. cpu_quiet(rdp->cpu, rcp);
  328. spin_unlock(&rcp->lock);
  329. }
  330. #ifdef CONFIG_HOTPLUG_CPU
  331. /* warning! helper for rcu_offline_cpu. do not use elsewhere without reviewing
  332. * locking requirements, the list it's pulling from has to belong to a cpu
  333. * which is dead and hence not processing interrupts.
  334. */
  335. static void rcu_move_batch(struct rcu_data *this_rdp, struct rcu_head *list,
  336. struct rcu_head **tail)
  337. {
  338. local_irq_disable();
  339. *this_rdp->nxttail = list;
  340. if (list)
  341. this_rdp->nxttail = tail;
  342. local_irq_enable();
  343. }
  344. static void __rcu_offline_cpu(struct rcu_data *this_rdp,
  345. struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
  346. {
  347. /* if the cpu going offline owns the grace period
  348. * we can block indefinitely waiting for it, so flush
  349. * it here
  350. */
  351. spin_lock_bh(&rcp->lock);
  352. if (rcp->cur != rcp->completed)
  353. cpu_quiet(rdp->cpu, rcp);
  354. spin_unlock_bh(&rcp->lock);
  355. rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
  356. rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
  357. rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
  358. local_irq_disable();
  359. this_rdp->qlen += rdp->qlen;
  360. local_irq_enable();
  361. }
  362. static void rcu_offline_cpu(int cpu)
  363. {
  364. struct rcu_data *this_rdp = &get_cpu_var(rcu_data);
  365. struct rcu_data *this_bh_rdp = &get_cpu_var(rcu_bh_data);
  366. __rcu_offline_cpu(this_rdp, &rcu_ctrlblk,
  367. &per_cpu(rcu_data, cpu));
  368. __rcu_offline_cpu(this_bh_rdp, &rcu_bh_ctrlblk,
  369. &per_cpu(rcu_bh_data, cpu));
  370. put_cpu_var(rcu_data);
  371. put_cpu_var(rcu_bh_data);
  372. }
  373. #else
  374. static void rcu_offline_cpu(int cpu)
  375. {
  376. }
  377. #endif
  378. /*
  379. * This does the RCU processing work from softirq context.
  380. */
  381. static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
  382. struct rcu_data *rdp)
  383. {
  384. if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch)) {
  385. *rdp->donetail = rdp->curlist;
  386. rdp->donetail = rdp->curtail;
  387. rdp->curlist = NULL;
  388. rdp->curtail = &rdp->curlist;
  389. }
  390. if (rdp->nxtlist && !rdp->curlist) {
  391. local_irq_disable();
  392. rdp->curlist = rdp->nxtlist;
  393. rdp->curtail = rdp->nxttail;
  394. rdp->nxtlist = NULL;
  395. rdp->nxttail = &rdp->nxtlist;
  396. local_irq_enable();
  397. /*
  398. * start the next batch of callbacks
  399. */
  400. /* determine batch number */
  401. rdp->batch = rcp->cur + 1;
  402. /* see the comment and corresponding wmb() in
  403. * the rcu_start_batch()
  404. */
  405. smp_rmb();
  406. if (!rcp->next_pending) {
  407. /* and start it/schedule start if it's a new batch */
  408. spin_lock(&rcp->lock);
  409. rcp->next_pending = 1;
  410. rcu_start_batch(rcp);
  411. spin_unlock(&rcp->lock);
  412. }
  413. }
  414. rcu_check_quiescent_state(rcp, rdp);
  415. if (rdp->donelist)
  416. rcu_do_batch(rdp);
  417. }
  418. static void rcu_process_callbacks(struct softirq_action *unused)
  419. {
  420. __rcu_process_callbacks(&rcu_ctrlblk, &__get_cpu_var(rcu_data));
  421. __rcu_process_callbacks(&rcu_bh_ctrlblk, &__get_cpu_var(rcu_bh_data));
  422. }
  423. static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
  424. {
  425. /* This cpu has pending rcu entries and the grace period
  426. * for them has completed.
  427. */
  428. if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
  429. return 1;
  430. /* This cpu has no pending entries, but there are new entries */
  431. if (!rdp->curlist && rdp->nxtlist)
  432. return 1;
  433. /* This cpu has finished callbacks to invoke */
  434. if (rdp->donelist)
  435. return 1;
  436. /* The rcu core waits for a quiescent state from the cpu */
  437. if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
  438. return 1;
  439. /* nothing to do */
  440. return 0;
  441. }
  442. /*
  443. * Check to see if there is any immediate RCU-related work to be done
  444. * by the current CPU, returning 1 if so. This function is part of the
  445. * RCU implementation; it is -not- an exported member of the RCU API.
  446. */
  447. int rcu_pending(int cpu)
  448. {
  449. return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) ||
  450. __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
  451. }
  452. /*
  453. * Check to see if any future RCU-related work will need to be done
  454. * by the current CPU, even if none need be done immediately, returning
  455. * 1 if so. This function is part of the RCU implementation; it is -not-
  456. * an exported member of the RCU API.
  457. */
  458. int rcu_needs_cpu(int cpu)
  459. {
  460. struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
  461. struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
  462. return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu));
  463. }
  464. void rcu_check_callbacks(int cpu, int user)
  465. {
  466. if (user ||
  467. (idle_cpu(cpu) && !in_softirq() &&
  468. hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
  469. /*
  470. * Get here if this CPU took its interrupt from user
  471. * mode or from the idle loop, and if this is not a
  472. * nested interrupt. In this case, the CPU is in
  473. * a quiescent state, so count it.
  474. *
  475. * Also do a memory barrier. This is needed to handle
  476. * the case where writes from a preempt-disable section
  477. * of code get reordered into schedule() by this CPU's
  478. * write buffer. The memory barrier makes sure that
  479. * the rcu_qsctr_inc() and rcu_bh_qsctr_inc() are see
  480. * by other CPUs to happen after any such write.
  481. */
  482. smp_mb(); /* See above block comment. */
  483. rcu_qsctr_inc(cpu);
  484. rcu_bh_qsctr_inc(cpu);
  485. } else if (!in_softirq()) {
  486. /*
  487. * Get here if this CPU did not take its interrupt from
  488. * softirq, in other words, if it is not interrupting
  489. * a rcu_bh read-side critical section. This is an _bh
  490. * critical section, so count it. The memory barrier
  491. * is needed for the same reason as is the above one.
  492. */
  493. smp_mb(); /* See above block comment. */
  494. rcu_bh_qsctr_inc(cpu);
  495. }
  496. raise_rcu_softirq();
  497. }
  498. static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
  499. struct rcu_data *rdp)
  500. {
  501. memset(rdp, 0, sizeof(*rdp));
  502. rdp->curtail = &rdp->curlist;
  503. rdp->nxttail = &rdp->nxtlist;
  504. rdp->donetail = &rdp->donelist;
  505. rdp->quiescbatch = rcp->completed;
  506. rdp->qs_pending = 0;
  507. rdp->cpu = cpu;
  508. rdp->blimit = blimit;
  509. }
  510. static void __cpuinit rcu_online_cpu(int cpu)
  511. {
  512. struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
  513. struct rcu_data *bh_rdp = &per_cpu(rcu_bh_data, cpu);
  514. rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp);
  515. rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp);
  516. open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
  517. }
  518. static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
  519. unsigned long action, void *hcpu)
  520. {
  521. long cpu = (long)hcpu;
  522. switch (action) {
  523. case CPU_UP_PREPARE:
  524. case CPU_UP_PREPARE_FROZEN:
  525. rcu_online_cpu(cpu);
  526. break;
  527. case CPU_DEAD:
  528. case CPU_DEAD_FROZEN:
  529. rcu_offline_cpu(cpu);
  530. break;
  531. default:
  532. break;
  533. }
  534. return NOTIFY_OK;
  535. }
  536. static struct notifier_block __cpuinitdata rcu_nb = {
  537. .notifier_call = rcu_cpu_notify,
  538. };
  539. /*
  540. * Initializes rcu mechanism. Assumed to be called early.
  541. * That is before local timer(SMP) or jiffie timer (uniproc) is setup.
  542. * Note that rcu_qsctr and friends are implicitly
  543. * initialized due to the choice of ``0'' for RCU_CTR_INVALID.
  544. */
  545. void __init __rcu_init(void)
  546. {
  547. rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE,
  548. (void *)(long)smp_processor_id());
  549. /* Register notifier for non-boot CPUs */
  550. register_cpu_notifier(&rcu_nb);
  551. }
  552. module_param(blimit, int, 0);
  553. module_param(qhimark, int, 0);
  554. module_param(qlowmark, int, 0);