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