rcupdate.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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, you can access it online at
  16. * http://www.gnu.org/licenses/gpl-2.0.html.
  17. *
  18. * Copyright IBM Corporation, 2001
  19. *
  20. * Author: Dipankar Sarma <dipankar@in.ibm.com>
  21. *
  22. * Based on the original work by Paul McKenney <paulmck@us.ibm.com>
  23. * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
  24. * Papers:
  25. * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf
  26. * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001)
  27. *
  28. * For detailed explanation of Read-Copy Update mechanism see -
  29. * http://lse.sourceforge.net/locking/rcupdate.html
  30. *
  31. */
  32. #ifndef __LINUX_RCUPDATE_H
  33. #define __LINUX_RCUPDATE_H
  34. #include <linux/types.h>
  35. #include <linux/cache.h>
  36. #include <linux/spinlock.h>
  37. #include <linux/threads.h>
  38. #include <linux/cpumask.h>
  39. #include <linux/seqlock.h>
  40. #include <linux/lockdep.h>
  41. #include <linux/completion.h>
  42. #include <linux/debugobjects.h>
  43. #include <linux/bug.h>
  44. #include <linux/compiler.h>
  45. #include <asm/barrier.h>
  46. extern int rcu_expedited; /* for sysctl */
  47. #ifdef CONFIG_RCU_TORTURE_TEST
  48. extern int rcutorture_runnable; /* for sysctl */
  49. #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
  50. enum rcutorture_type {
  51. RCU_FLAVOR,
  52. RCU_BH_FLAVOR,
  53. RCU_SCHED_FLAVOR,
  54. SRCU_FLAVOR,
  55. INVALID_RCU_FLAVOR
  56. };
  57. #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
  58. void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
  59. unsigned long *gpnum, unsigned long *completed);
  60. void rcutorture_record_test_transition(void);
  61. void rcutorture_record_progress(unsigned long vernum);
  62. void do_trace_rcu_torture_read(const char *rcutorturename,
  63. struct rcu_head *rhp,
  64. unsigned long secs,
  65. unsigned long c_old,
  66. unsigned long c);
  67. #else
  68. static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
  69. int *flags,
  70. unsigned long *gpnum,
  71. unsigned long *completed)
  72. {
  73. *flags = 0;
  74. *gpnum = 0;
  75. *completed = 0;
  76. }
  77. static inline void rcutorture_record_test_transition(void)
  78. {
  79. }
  80. static inline void rcutorture_record_progress(unsigned long vernum)
  81. {
  82. }
  83. #ifdef CONFIG_RCU_TRACE
  84. void do_trace_rcu_torture_read(const char *rcutorturename,
  85. struct rcu_head *rhp,
  86. unsigned long secs,
  87. unsigned long c_old,
  88. unsigned long c);
  89. #else
  90. #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
  91. do { } while (0)
  92. #endif
  93. #endif
  94. #define UINT_CMP_GE(a, b) (UINT_MAX / 2 >= (a) - (b))
  95. #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b))
  96. #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b))
  97. #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b))
  98. #define ulong2long(a) (*(long *)(&(a)))
  99. /* Exported common interfaces */
  100. #ifdef CONFIG_PREEMPT_RCU
  101. /**
  102. * call_rcu() - Queue an RCU callback for invocation after a grace period.
  103. * @head: structure to be used for queueing the RCU updates.
  104. * @func: actual callback function to be invoked after the grace period
  105. *
  106. * The callback function will be invoked some time after a full grace
  107. * period elapses, in other words after all pre-existing RCU read-side
  108. * critical sections have completed. However, the callback function
  109. * might well execute concurrently with RCU read-side critical sections
  110. * that started after call_rcu() was invoked. RCU read-side critical
  111. * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  112. * and may be nested.
  113. *
  114. * Note that all CPUs must agree that the grace period extended beyond
  115. * all pre-existing RCU read-side critical section. On systems with more
  116. * than one CPU, this means that when "func()" is invoked, each CPU is
  117. * guaranteed to have executed a full memory barrier since the end of its
  118. * last RCU read-side critical section whose beginning preceded the call
  119. * to call_rcu(). It also means that each CPU executing an RCU read-side
  120. * critical section that continues beyond the start of "func()" must have
  121. * executed a memory barrier after the call_rcu() but before the beginning
  122. * of that RCU read-side critical section. Note that these guarantees
  123. * include CPUs that are offline, idle, or executing in user mode, as
  124. * well as CPUs that are executing in the kernel.
  125. *
  126. * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the
  127. * resulting RCU callback function "func()", then both CPU A and CPU B are
  128. * guaranteed to execute a full memory barrier during the time interval
  129. * between the call to call_rcu() and the invocation of "func()" -- even
  130. * if CPU A and CPU B are the same CPU (but again only if the system has
  131. * more than one CPU).
  132. */
  133. void call_rcu(struct rcu_head *head,
  134. void (*func)(struct rcu_head *head));
  135. #else /* #ifdef CONFIG_PREEMPT_RCU */
  136. /* In classic RCU, call_rcu() is just call_rcu_sched(). */
  137. #define call_rcu call_rcu_sched
  138. #endif /* #else #ifdef CONFIG_PREEMPT_RCU */
  139. /**
  140. * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
  141. * @head: structure to be used for queueing the RCU updates.
  142. * @func: actual callback function to be invoked after the grace period
  143. *
  144. * The callback function will be invoked some time after a full grace
  145. * period elapses, in other words after all currently executing RCU
  146. * read-side critical sections have completed. call_rcu_bh() assumes
  147. * that the read-side critical sections end on completion of a softirq
  148. * handler. This means that read-side critical sections in process
  149. * context must not be interrupted by softirqs. This interface is to be
  150. * used when most of the read-side critical sections are in softirq context.
  151. * RCU read-side critical sections are delimited by :
  152. * - rcu_read_lock() and rcu_read_unlock(), if in interrupt context.
  153. * OR
  154. * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
  155. * These may be nested.
  156. *
  157. * See the description of call_rcu() for more detailed information on
  158. * memory ordering guarantees.
  159. */
  160. void call_rcu_bh(struct rcu_head *head,
  161. void (*func)(struct rcu_head *head));
  162. /**
  163. * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
  164. * @head: structure to be used for queueing the RCU updates.
  165. * @func: actual callback function to be invoked after the grace period
  166. *
  167. * The callback function will be invoked some time after a full grace
  168. * period elapses, in other words after all currently executing RCU
  169. * read-side critical sections have completed. call_rcu_sched() assumes
  170. * that the read-side critical sections end on enabling of preemption
  171. * or on voluntary preemption.
  172. * RCU read-side critical sections are delimited by :
  173. * - rcu_read_lock_sched() and rcu_read_unlock_sched(),
  174. * OR
  175. * anything that disables preemption.
  176. * These may be nested.
  177. *
  178. * See the description of call_rcu() for more detailed information on
  179. * memory ordering guarantees.
  180. */
  181. void call_rcu_sched(struct rcu_head *head,
  182. void (*func)(struct rcu_head *rcu));
  183. void synchronize_sched(void);
  184. #ifdef CONFIG_PREEMPT_RCU
  185. void __rcu_read_lock(void);
  186. void __rcu_read_unlock(void);
  187. void rcu_read_unlock_special(struct task_struct *t);
  188. void synchronize_rcu(void);
  189. /*
  190. * Defined as a macro as it is a very low level header included from
  191. * areas that don't even know about current. This gives the rcu_read_lock()
  192. * nesting depth, but makes sense only if CONFIG_PREEMPT_RCU -- in other
  193. * types of kernel builds, the rcu_read_lock() nesting depth is unknowable.
  194. */
  195. #define rcu_preempt_depth() (current->rcu_read_lock_nesting)
  196. #else /* #ifdef CONFIG_PREEMPT_RCU */
  197. static inline void __rcu_read_lock(void)
  198. {
  199. preempt_disable();
  200. }
  201. static inline void __rcu_read_unlock(void)
  202. {
  203. preempt_enable();
  204. }
  205. static inline void synchronize_rcu(void)
  206. {
  207. synchronize_sched();
  208. }
  209. static inline int rcu_preempt_depth(void)
  210. {
  211. return 0;
  212. }
  213. #endif /* #else #ifdef CONFIG_PREEMPT_RCU */
  214. /* Internal to kernel */
  215. void rcu_init(void);
  216. void rcu_sched_qs(int cpu);
  217. void rcu_bh_qs(int cpu);
  218. void rcu_check_callbacks(int cpu, int user);
  219. struct notifier_block;
  220. void rcu_idle_enter(void);
  221. void rcu_idle_exit(void);
  222. void rcu_irq_enter(void);
  223. void rcu_irq_exit(void);
  224. #ifdef CONFIG_RCU_USER_QS
  225. void rcu_user_enter(void);
  226. void rcu_user_exit(void);
  227. #else
  228. static inline void rcu_user_enter(void) { }
  229. static inline void rcu_user_exit(void) { }
  230. static inline void rcu_user_hooks_switch(struct task_struct *prev,
  231. struct task_struct *next) { }
  232. #endif /* CONFIG_RCU_USER_QS */
  233. /**
  234. * RCU_NONIDLE - Indicate idle-loop code that needs RCU readers
  235. * @a: Code that RCU needs to pay attention to.
  236. *
  237. * RCU, RCU-bh, and RCU-sched read-side critical sections are forbidden
  238. * in the inner idle loop, that is, between the rcu_idle_enter() and
  239. * the rcu_idle_exit() -- RCU will happily ignore any such read-side
  240. * critical sections. However, things like powertop need tracepoints
  241. * in the inner idle loop.
  242. *
  243. * This macro provides the way out: RCU_NONIDLE(do_something_with_RCU())
  244. * will tell RCU that it needs to pay attending, invoke its argument
  245. * (in this example, a call to the do_something_with_RCU() function),
  246. * and then tell RCU to go back to ignoring this CPU. It is permissible
  247. * to nest RCU_NONIDLE() wrappers, but the nesting level is currently
  248. * quite limited. If deeper nesting is required, it will be necessary
  249. * to adjust DYNTICK_TASK_NESTING_VALUE accordingly.
  250. */
  251. #define RCU_NONIDLE(a) \
  252. do { \
  253. rcu_irq_enter(); \
  254. do { a; } while (0); \
  255. rcu_irq_exit(); \
  256. } while (0)
  257. #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
  258. bool __rcu_is_watching(void);
  259. #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */
  260. /*
  261. * Infrastructure to implement the synchronize_() primitives in
  262. * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
  263. */
  264. typedef void call_rcu_func_t(struct rcu_head *head,
  265. void (*func)(struct rcu_head *head));
  266. void wait_rcu_gp(call_rcu_func_t crf);
  267. #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
  268. #include <linux/rcutree.h>
  269. #elif defined(CONFIG_TINY_RCU)
  270. #include <linux/rcutiny.h>
  271. #else
  272. #error "Unknown RCU implementation specified to kernel configuration"
  273. #endif
  274. /*
  275. * init_rcu_head_on_stack()/destroy_rcu_head_on_stack() are needed for dynamic
  276. * initialization and destruction of rcu_head on the stack. rcu_head structures
  277. * allocated dynamically in the heap or defined statically don't need any
  278. * initialization.
  279. */
  280. #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
  281. void init_rcu_head_on_stack(struct rcu_head *head);
  282. void destroy_rcu_head_on_stack(struct rcu_head *head);
  283. #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
  284. static inline void init_rcu_head_on_stack(struct rcu_head *head)
  285. {
  286. }
  287. static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
  288. {
  289. }
  290. #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
  291. #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU)
  292. bool rcu_lockdep_current_cpu_online(void);
  293. #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */
  294. static inline bool rcu_lockdep_current_cpu_online(void)
  295. {
  296. return 1;
  297. }
  298. #endif /* #else #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */
  299. #ifdef CONFIG_DEBUG_LOCK_ALLOC
  300. static inline void rcu_lock_acquire(struct lockdep_map *map)
  301. {
  302. lock_acquire(map, 0, 0, 2, 0, NULL, _THIS_IP_);
  303. }
  304. static inline void rcu_lock_release(struct lockdep_map *map)
  305. {
  306. lock_release(map, 1, _THIS_IP_);
  307. }
  308. extern struct lockdep_map rcu_lock_map;
  309. extern struct lockdep_map rcu_bh_lock_map;
  310. extern struct lockdep_map rcu_sched_lock_map;
  311. extern struct lockdep_map rcu_callback_map;
  312. extern int debug_lockdep_rcu_enabled(void);
  313. /**
  314. * rcu_read_lock_held() - might we be in RCU read-side critical section?
  315. *
  316. * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU
  317. * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC,
  318. * this assumes we are in an RCU read-side critical section unless it can
  319. * prove otherwise. This is useful for debug checks in functions that
  320. * require that they be called within an RCU read-side critical section.
  321. *
  322. * Checks debug_lockdep_rcu_enabled() to prevent false positives during boot
  323. * and while lockdep is disabled.
  324. *
  325. * Note that rcu_read_lock() and the matching rcu_read_unlock() must
  326. * occur in the same context, for example, it is illegal to invoke
  327. * rcu_read_unlock() in process context if the matching rcu_read_lock()
  328. * was invoked from within an irq handler.
  329. *
  330. * Note that rcu_read_lock() is disallowed if the CPU is either idle or
  331. * offline from an RCU perspective, so check for those as well.
  332. */
  333. static inline int rcu_read_lock_held(void)
  334. {
  335. if (!debug_lockdep_rcu_enabled())
  336. return 1;
  337. if (!rcu_is_watching())
  338. return 0;
  339. if (!rcu_lockdep_current_cpu_online())
  340. return 0;
  341. return lock_is_held(&rcu_lock_map);
  342. }
  343. /*
  344. * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
  345. * hell.
  346. */
  347. int rcu_read_lock_bh_held(void);
  348. /**
  349. * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section?
  350. *
  351. * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an
  352. * RCU-sched read-side critical section. In absence of
  353. * CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU-sched read-side
  354. * critical section unless it can prove otherwise. Note that disabling
  355. * of preemption (including disabling irqs) counts as an RCU-sched
  356. * read-side critical section. This is useful for debug checks in functions
  357. * that required that they be called within an RCU-sched read-side
  358. * critical section.
  359. *
  360. * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
  361. * and while lockdep is disabled.
  362. *
  363. * Note that if the CPU is in the idle loop from an RCU point of
  364. * view (ie: that we are in the section between rcu_idle_enter() and
  365. * rcu_idle_exit()) then rcu_read_lock_held() returns false even if the CPU
  366. * did an rcu_read_lock(). The reason for this is that RCU ignores CPUs
  367. * that are in such a section, considering these as in extended quiescent
  368. * state, so such a CPU is effectively never in an RCU read-side critical
  369. * section regardless of what RCU primitives it invokes. This state of
  370. * affairs is required --- we need to keep an RCU-free window in idle
  371. * where the CPU may possibly enter into low power mode. This way we can
  372. * notice an extended quiescent state to other CPUs that started a grace
  373. * period. Otherwise we would delay any grace period as long as we run in
  374. * the idle task.
  375. *
  376. * Similarly, we avoid claiming an SRCU read lock held if the current
  377. * CPU is offline.
  378. */
  379. #ifdef CONFIG_PREEMPT_COUNT
  380. static inline int rcu_read_lock_sched_held(void)
  381. {
  382. int lockdep_opinion = 0;
  383. if (!debug_lockdep_rcu_enabled())
  384. return 1;
  385. if (!rcu_is_watching())
  386. return 0;
  387. if (!rcu_lockdep_current_cpu_online())
  388. return 0;
  389. if (debug_locks)
  390. lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
  391. return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
  392. }
  393. #else /* #ifdef CONFIG_PREEMPT_COUNT */
  394. static inline int rcu_read_lock_sched_held(void)
  395. {
  396. return 1;
  397. }
  398. #endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
  399. #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
  400. # define rcu_lock_acquire(a) do { } while (0)
  401. # define rcu_lock_release(a) do { } while (0)
  402. static inline int rcu_read_lock_held(void)
  403. {
  404. return 1;
  405. }
  406. static inline int rcu_read_lock_bh_held(void)
  407. {
  408. return 1;
  409. }
  410. #ifdef CONFIG_PREEMPT_COUNT
  411. static inline int rcu_read_lock_sched_held(void)
  412. {
  413. return preempt_count() != 0 || irqs_disabled();
  414. }
  415. #else /* #ifdef CONFIG_PREEMPT_COUNT */
  416. static inline int rcu_read_lock_sched_held(void)
  417. {
  418. return 1;
  419. }
  420. #endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
  421. #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
  422. #ifdef CONFIG_PROVE_RCU
  423. /**
  424. * rcu_lockdep_assert - emit lockdep splat if specified condition not met
  425. * @c: condition to check
  426. * @s: informative message
  427. */
  428. #define rcu_lockdep_assert(c, s) \
  429. do { \
  430. static bool __section(.data.unlikely) __warned; \
  431. if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
  432. __warned = true; \
  433. lockdep_rcu_suspicious(__FILE__, __LINE__, s); \
  434. } \
  435. } while (0)
  436. #if defined(CONFIG_PROVE_RCU) && !defined(CONFIG_PREEMPT_RCU)
  437. static inline void rcu_preempt_sleep_check(void)
  438. {
  439. rcu_lockdep_assert(!lock_is_held(&rcu_lock_map),
  440. "Illegal context switch in RCU read-side critical section");
  441. }
  442. #else /* #ifdef CONFIG_PROVE_RCU */
  443. static inline void rcu_preempt_sleep_check(void)
  444. {
  445. }
  446. #endif /* #else #ifdef CONFIG_PROVE_RCU */
  447. #define rcu_sleep_check() \
  448. do { \
  449. rcu_preempt_sleep_check(); \
  450. rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \
  451. "Illegal context switch in RCU-bh read-side critical section"); \
  452. rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \
  453. "Illegal context switch in RCU-sched read-side critical section"); \
  454. } while (0)
  455. #else /* #ifdef CONFIG_PROVE_RCU */
  456. #define rcu_lockdep_assert(c, s) do { } while (0)
  457. #define rcu_sleep_check() do { } while (0)
  458. #endif /* #else #ifdef CONFIG_PROVE_RCU */
  459. /*
  460. * Helper functions for rcu_dereference_check(), rcu_dereference_protected()
  461. * and rcu_assign_pointer(). Some of these could be folded into their
  462. * callers, but they are left separate in order to ease introduction of
  463. * multiple flavors of pointers to match the multiple flavors of RCU
  464. * (e.g., __rcu_bh, * __rcu_sched, and __srcu), should this make sense in
  465. * the future.
  466. */
  467. #ifdef __CHECKER__
  468. #define rcu_dereference_sparse(p, space) \
  469. ((void)(((typeof(*p) space *)p) == p))
  470. #else /* #ifdef __CHECKER__ */
  471. #define rcu_dereference_sparse(p, space)
  472. #endif /* #else #ifdef __CHECKER__ */
  473. #define __rcu_access_pointer(p, space) \
  474. ({ \
  475. typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \
  476. rcu_dereference_sparse(p, space); \
  477. ((typeof(*p) __force __kernel *)(_________p1)); \
  478. })
  479. #define __rcu_dereference_check(p, c, space) \
  480. ({ \
  481. typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \
  482. rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \
  483. rcu_dereference_sparse(p, space); \
  484. smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
  485. ((typeof(*p) __force __kernel *)(_________p1)); \
  486. })
  487. #define __rcu_dereference_protected(p, c, space) \
  488. ({ \
  489. rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \
  490. rcu_dereference_sparse(p, space); \
  491. ((typeof(*p) __force __kernel *)(p)); \
  492. })
  493. #define __rcu_access_index(p, space) \
  494. ({ \
  495. typeof(p) _________p1 = ACCESS_ONCE(p); \
  496. rcu_dereference_sparse(p, space); \
  497. (_________p1); \
  498. })
  499. #define __rcu_dereference_index_check(p, c) \
  500. ({ \
  501. typeof(p) _________p1 = ACCESS_ONCE(p); \
  502. rcu_lockdep_assert(c, \
  503. "suspicious rcu_dereference_index_check() usage"); \
  504. smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
  505. (_________p1); \
  506. })
  507. /**
  508. * RCU_INITIALIZER() - statically initialize an RCU-protected global variable
  509. * @v: The value to statically initialize with.
  510. */
  511. #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
  512. /**
  513. * rcu_assign_pointer() - assign to RCU-protected pointer
  514. * @p: pointer to assign to
  515. * @v: value to assign (publish)
  516. *
  517. * Assigns the specified value to the specified RCU-protected
  518. * pointer, ensuring that any concurrent RCU readers will see
  519. * any prior initialization.
  520. *
  521. * Inserts memory barriers on architectures that require them
  522. * (which is most of them), and also prevents the compiler from
  523. * reordering the code that initializes the structure after the pointer
  524. * assignment. More importantly, this call documents which pointers
  525. * will be dereferenced by RCU read-side code.
  526. *
  527. * In some special cases, you may use RCU_INIT_POINTER() instead
  528. * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
  529. * to the fact that it does not constrain either the CPU or the compiler.
  530. * That said, using RCU_INIT_POINTER() when you should have used
  531. * rcu_assign_pointer() is a very bad thing that results in
  532. * impossible-to-diagnose memory corruption. So please be careful.
  533. * See the RCU_INIT_POINTER() comment header for details.
  534. *
  535. * Note that rcu_assign_pointer() evaluates each of its arguments only
  536. * once, appearances notwithstanding. One of the "extra" evaluations
  537. * is in typeof() and the other visible only to sparse (__CHECKER__),
  538. * neither of which actually execute the argument. As with most cpp
  539. * macros, this execute-arguments-only-once property is important, so
  540. * please be careful when making changes to rcu_assign_pointer() and the
  541. * other macros that it invokes.
  542. */
  543. #define rcu_assign_pointer(p, v) smp_store_release(&p, RCU_INITIALIZER(v))
  544. /**
  545. * rcu_access_pointer() - fetch RCU pointer with no dereferencing
  546. * @p: The pointer to read
  547. *
  548. * Return the value of the specified RCU-protected pointer, but omit the
  549. * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful
  550. * when the value of this pointer is accessed, but the pointer is not
  551. * dereferenced, for example, when testing an RCU-protected pointer against
  552. * NULL. Although rcu_access_pointer() may also be used in cases where
  553. * update-side locks prevent the value of the pointer from changing, you
  554. * should instead use rcu_dereference_protected() for this use case.
  555. *
  556. * It is also permissible to use rcu_access_pointer() when read-side
  557. * access to the pointer was removed at least one grace period ago, as
  558. * is the case in the context of the RCU callback that is freeing up
  559. * the data, or after a synchronize_rcu() returns. This can be useful
  560. * when tearing down multi-linked structures after a grace period
  561. * has elapsed.
  562. */
  563. #define rcu_access_pointer(p) __rcu_access_pointer((p), __rcu)
  564. /**
  565. * rcu_dereference_check() - rcu_dereference with debug checking
  566. * @p: The pointer to read, prior to dereferencing
  567. * @c: The conditions under which the dereference will take place
  568. *
  569. * Do an rcu_dereference(), but check that the conditions under which the
  570. * dereference will take place are correct. Typically the conditions
  571. * indicate the various locking conditions that should be held at that
  572. * point. The check should return true if the conditions are satisfied.
  573. * An implicit check for being in an RCU read-side critical section
  574. * (rcu_read_lock()) is included.
  575. *
  576. * For example:
  577. *
  578. * bar = rcu_dereference_check(foo->bar, lockdep_is_held(&foo->lock));
  579. *
  580. * could be used to indicate to lockdep that foo->bar may only be dereferenced
  581. * if either rcu_read_lock() is held, or that the lock required to replace
  582. * the bar struct at foo->bar is held.
  583. *
  584. * Note that the list of conditions may also include indications of when a lock
  585. * need not be held, for example during initialisation or destruction of the
  586. * target struct:
  587. *
  588. * bar = rcu_dereference_check(foo->bar, lockdep_is_held(&foo->lock) ||
  589. * atomic_read(&foo->usage) == 0);
  590. *
  591. * Inserts memory barriers on architectures that require them
  592. * (currently only the Alpha), prevents the compiler from refetching
  593. * (and from merging fetches), and, more importantly, documents exactly
  594. * which pointers are protected by RCU and checks that the pointer is
  595. * annotated as __rcu.
  596. */
  597. #define rcu_dereference_check(p, c) \
  598. __rcu_dereference_check((p), rcu_read_lock_held() || (c), __rcu)
  599. /**
  600. * rcu_dereference_bh_check() - rcu_dereference_bh with debug checking
  601. * @p: The pointer to read, prior to dereferencing
  602. * @c: The conditions under which the dereference will take place
  603. *
  604. * This is the RCU-bh counterpart to rcu_dereference_check().
  605. */
  606. #define rcu_dereference_bh_check(p, c) \
  607. __rcu_dereference_check((p), rcu_read_lock_bh_held() || (c), __rcu)
  608. /**
  609. * rcu_dereference_sched_check() - rcu_dereference_sched with debug checking
  610. * @p: The pointer to read, prior to dereferencing
  611. * @c: The conditions under which the dereference will take place
  612. *
  613. * This is the RCU-sched counterpart to rcu_dereference_check().
  614. */
  615. #define rcu_dereference_sched_check(p, c) \
  616. __rcu_dereference_check((p), rcu_read_lock_sched_held() || (c), \
  617. __rcu)
  618. #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) /*@@@ needed? @@@*/
  619. /*
  620. * The tracing infrastructure traces RCU (we want that), but unfortunately
  621. * some of the RCU checks causes tracing to lock up the system.
  622. *
  623. * The tracing version of rcu_dereference_raw() must not call
  624. * rcu_read_lock_held().
  625. */
  626. #define rcu_dereference_raw_notrace(p) __rcu_dereference_check((p), 1, __rcu)
  627. /**
  628. * rcu_access_index() - fetch RCU index with no dereferencing
  629. * @p: The index to read
  630. *
  631. * Return the value of the specified RCU-protected index, but omit the
  632. * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful
  633. * when the value of this index is accessed, but the index is not
  634. * dereferenced, for example, when testing an RCU-protected index against
  635. * -1. Although rcu_access_index() may also be used in cases where
  636. * update-side locks prevent the value of the index from changing, you
  637. * should instead use rcu_dereference_index_protected() for this use case.
  638. */
  639. #define rcu_access_index(p) __rcu_access_index((p), __rcu)
  640. /**
  641. * rcu_dereference_index_check() - rcu_dereference for indices with debug checking
  642. * @p: The pointer to read, prior to dereferencing
  643. * @c: The conditions under which the dereference will take place
  644. *
  645. * Similar to rcu_dereference_check(), but omits the sparse checking.
  646. * This allows rcu_dereference_index_check() to be used on integers,
  647. * which can then be used as array indices. Attempting to use
  648. * rcu_dereference_check() on an integer will give compiler warnings
  649. * because the sparse address-space mechanism relies on dereferencing
  650. * the RCU-protected pointer. Dereferencing integers is not something
  651. * that even gcc will put up with.
  652. *
  653. * Note that this function does not implicitly check for RCU read-side
  654. * critical sections. If this function gains lots of uses, it might
  655. * make sense to provide versions for each flavor of RCU, but it does
  656. * not make sense as of early 2010.
  657. */
  658. #define rcu_dereference_index_check(p, c) \
  659. __rcu_dereference_index_check((p), (c))
  660. /**
  661. * rcu_dereference_protected() - fetch RCU pointer when updates prevented
  662. * @p: The pointer to read, prior to dereferencing
  663. * @c: The conditions under which the dereference will take place
  664. *
  665. * Return the value of the specified RCU-protected pointer, but omit
  666. * both the smp_read_barrier_depends() and the ACCESS_ONCE(). This
  667. * is useful in cases where update-side locks prevent the value of the
  668. * pointer from changing. Please note that this primitive does -not-
  669. * prevent the compiler from repeating this reference or combining it
  670. * with other references, so it should not be used without protection
  671. * of appropriate locks.
  672. *
  673. * This function is only for update-side use. Using this function
  674. * when protected only by rcu_read_lock() will result in infrequent
  675. * but very ugly failures.
  676. */
  677. #define rcu_dereference_protected(p, c) \
  678. __rcu_dereference_protected((p), (c), __rcu)
  679. /**
  680. * rcu_dereference() - fetch RCU-protected pointer for dereferencing
  681. * @p: The pointer to read, prior to dereferencing
  682. *
  683. * This is a simple wrapper around rcu_dereference_check().
  684. */
  685. #define rcu_dereference(p) rcu_dereference_check(p, 0)
  686. /**
  687. * rcu_dereference_bh() - fetch an RCU-bh-protected pointer for dereferencing
  688. * @p: The pointer to read, prior to dereferencing
  689. *
  690. * Makes rcu_dereference_check() do the dirty work.
  691. */
  692. #define rcu_dereference_bh(p) rcu_dereference_bh_check(p, 0)
  693. /**
  694. * rcu_dereference_sched() - fetch RCU-sched-protected pointer for dereferencing
  695. * @p: The pointer to read, prior to dereferencing
  696. *
  697. * Makes rcu_dereference_check() do the dirty work.
  698. */
  699. #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, 0)
  700. /**
  701. * rcu_read_lock() - mark the beginning of an RCU read-side critical section
  702. *
  703. * When synchronize_rcu() is invoked on one CPU while other CPUs
  704. * are within RCU read-side critical sections, then the
  705. * synchronize_rcu() is guaranteed to block until after all the other
  706. * CPUs exit their critical sections. Similarly, if call_rcu() is invoked
  707. * on one CPU while other CPUs are within RCU read-side critical
  708. * sections, invocation of the corresponding RCU callback is deferred
  709. * until after the all the other CPUs exit their critical sections.
  710. *
  711. * Note, however, that RCU callbacks are permitted to run concurrently
  712. * with new RCU read-side critical sections. One way that this can happen
  713. * is via the following sequence of events: (1) CPU 0 enters an RCU
  714. * read-side critical section, (2) CPU 1 invokes call_rcu() to register
  715. * an RCU callback, (3) CPU 0 exits the RCU read-side critical section,
  716. * (4) CPU 2 enters a RCU read-side critical section, (5) the RCU
  717. * callback is invoked. This is legal, because the RCU read-side critical
  718. * section that was running concurrently with the call_rcu() (and which
  719. * therefore might be referencing something that the corresponding RCU
  720. * callback would free up) has completed before the corresponding
  721. * RCU callback is invoked.
  722. *
  723. * RCU read-side critical sections may be nested. Any deferred actions
  724. * will be deferred until the outermost RCU read-side critical section
  725. * completes.
  726. *
  727. * You can avoid reading and understanding the next paragraph by
  728. * following this rule: don't put anything in an rcu_read_lock() RCU
  729. * read-side critical section that would block in a !PREEMPT kernel.
  730. * But if you want the full story, read on!
  731. *
  732. * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), it
  733. * is illegal to block while in an RCU read-side critical section. In
  734. * preemptible RCU implementations (TREE_PREEMPT_RCU and TINY_PREEMPT_RCU)
  735. * in CONFIG_PREEMPT kernel builds, RCU read-side critical sections may
  736. * be preempted, but explicit blocking is illegal. Finally, in preemptible
  737. * RCU implementations in real-time (with -rt patchset) kernel builds,
  738. * RCU read-side critical sections may be preempted and they may also
  739. * block, but only when acquiring spinlocks that are subject to priority
  740. * inheritance.
  741. */
  742. static inline void rcu_read_lock(void)
  743. {
  744. __rcu_read_lock();
  745. __acquire(RCU);
  746. rcu_lock_acquire(&rcu_lock_map);
  747. rcu_lockdep_assert(rcu_is_watching(),
  748. "rcu_read_lock() used illegally while idle");
  749. }
  750. /*
  751. * So where is rcu_write_lock()? It does not exist, as there is no
  752. * way for writers to lock out RCU readers. This is a feature, not
  753. * a bug -- this property is what provides RCU's performance benefits.
  754. * Of course, writers must coordinate with each other. The normal
  755. * spinlock primitives work well for this, but any other technique may be
  756. * used as well. RCU does not care how the writers keep out of each
  757. * others' way, as long as they do so.
  758. */
  759. /**
  760. * rcu_read_unlock() - marks the end of an RCU read-side critical section.
  761. *
  762. * See rcu_read_lock() for more information.
  763. */
  764. static inline void rcu_read_unlock(void)
  765. {
  766. rcu_lockdep_assert(rcu_is_watching(),
  767. "rcu_read_unlock() used illegally while idle");
  768. rcu_lock_release(&rcu_lock_map);
  769. __release(RCU);
  770. __rcu_read_unlock();
  771. }
  772. /**
  773. * rcu_read_lock_bh() - mark the beginning of an RCU-bh critical section
  774. *
  775. * This is equivalent of rcu_read_lock(), but to be used when updates
  776. * are being done using call_rcu_bh() or synchronize_rcu_bh(). Since
  777. * both call_rcu_bh() and synchronize_rcu_bh() consider completion of a
  778. * softirq handler to be a quiescent state, a process in RCU read-side
  779. * critical section must be protected by disabling softirqs. Read-side
  780. * critical sections in interrupt context can use just rcu_read_lock(),
  781. * though this should at least be commented to avoid confusing people
  782. * reading the code.
  783. *
  784. * Note that rcu_read_lock_bh() and the matching rcu_read_unlock_bh()
  785. * must occur in the same context, for example, it is illegal to invoke
  786. * rcu_read_unlock_bh() from one task if the matching rcu_read_lock_bh()
  787. * was invoked from some other task.
  788. */
  789. static inline void rcu_read_lock_bh(void)
  790. {
  791. local_bh_disable();
  792. __acquire(RCU_BH);
  793. rcu_lock_acquire(&rcu_bh_lock_map);
  794. rcu_lockdep_assert(rcu_is_watching(),
  795. "rcu_read_lock_bh() used illegally while idle");
  796. }
  797. /*
  798. * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section
  799. *
  800. * See rcu_read_lock_bh() for more information.
  801. */
  802. static inline void rcu_read_unlock_bh(void)
  803. {
  804. rcu_lockdep_assert(rcu_is_watching(),
  805. "rcu_read_unlock_bh() used illegally while idle");
  806. rcu_lock_release(&rcu_bh_lock_map);
  807. __release(RCU_BH);
  808. local_bh_enable();
  809. }
  810. /**
  811. * rcu_read_lock_sched() - mark the beginning of a RCU-sched critical section
  812. *
  813. * This is equivalent of rcu_read_lock(), but to be used when updates
  814. * are being done using call_rcu_sched() or synchronize_rcu_sched().
  815. * Read-side critical sections can also be introduced by anything that
  816. * disables preemption, including local_irq_disable() and friends.
  817. *
  818. * Note that rcu_read_lock_sched() and the matching rcu_read_unlock_sched()
  819. * must occur in the same context, for example, it is illegal to invoke
  820. * rcu_read_unlock_sched() from process context if the matching
  821. * rcu_read_lock_sched() was invoked from an NMI handler.
  822. */
  823. static inline void rcu_read_lock_sched(void)
  824. {
  825. preempt_disable();
  826. __acquire(RCU_SCHED);
  827. rcu_lock_acquire(&rcu_sched_lock_map);
  828. rcu_lockdep_assert(rcu_is_watching(),
  829. "rcu_read_lock_sched() used illegally while idle");
  830. }
  831. /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */
  832. static inline notrace void rcu_read_lock_sched_notrace(void)
  833. {
  834. preempt_disable_notrace();
  835. __acquire(RCU_SCHED);
  836. }
  837. /*
  838. * rcu_read_unlock_sched - marks the end of a RCU-classic critical section
  839. *
  840. * See rcu_read_lock_sched for more information.
  841. */
  842. static inline void rcu_read_unlock_sched(void)
  843. {
  844. rcu_lockdep_assert(rcu_is_watching(),
  845. "rcu_read_unlock_sched() used illegally while idle");
  846. rcu_lock_release(&rcu_sched_lock_map);
  847. __release(RCU_SCHED);
  848. preempt_enable();
  849. }
  850. /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */
  851. static inline notrace void rcu_read_unlock_sched_notrace(void)
  852. {
  853. __release(RCU_SCHED);
  854. preempt_enable_notrace();
  855. }
  856. /**
  857. * RCU_INIT_POINTER() - initialize an RCU protected pointer
  858. *
  859. * Initialize an RCU-protected pointer in special cases where readers
  860. * do not need ordering constraints on the CPU or the compiler. These
  861. * special cases are:
  862. *
  863. * 1. This use of RCU_INIT_POINTER() is NULLing out the pointer -or-
  864. * 2. The caller has taken whatever steps are required to prevent
  865. * RCU readers from concurrently accessing this pointer -or-
  866. * 3. The referenced data structure has already been exposed to
  867. * readers either at compile time or via rcu_assign_pointer() -and-
  868. * a. You have not made -any- reader-visible changes to
  869. * this structure since then -or-
  870. * b. It is OK for readers accessing this structure from its
  871. * new location to see the old state of the structure. (For
  872. * example, the changes were to statistical counters or to
  873. * other state where exact synchronization is not required.)
  874. *
  875. * Failure to follow these rules governing use of RCU_INIT_POINTER() will
  876. * result in impossible-to-diagnose memory corruption. As in the structures
  877. * will look OK in crash dumps, but any concurrent RCU readers might
  878. * see pre-initialized values of the referenced data structure. So
  879. * please be very careful how you use RCU_INIT_POINTER()!!!
  880. *
  881. * If you are creating an RCU-protected linked structure that is accessed
  882. * by a single external-to-structure RCU-protected pointer, then you may
  883. * use RCU_INIT_POINTER() to initialize the internal RCU-protected
  884. * pointers, but you must use rcu_assign_pointer() to initialize the
  885. * external-to-structure pointer -after- you have completely initialized
  886. * the reader-accessible portions of the linked structure.
  887. */
  888. #define RCU_INIT_POINTER(p, v) \
  889. do { \
  890. p = RCU_INITIALIZER(v); \
  891. } while (0)
  892. /**
  893. * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer
  894. *
  895. * GCC-style initialization for an RCU-protected pointer in a structure field.
  896. */
  897. #define RCU_POINTER_INITIALIZER(p, v) \
  898. .p = RCU_INITIALIZER(v)
  899. /*
  900. * Does the specified offset indicate that the corresponding rcu_head
  901. * structure can be handled by kfree_rcu()?
  902. */
  903. #define __is_kfree_rcu_offset(offset) ((offset) < 4096)
  904. /*
  905. * Helper macro for kfree_rcu() to prevent argument-expansion eyestrain.
  906. */
  907. #define __kfree_rcu(head, offset) \
  908. do { \
  909. BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
  910. kfree_call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \
  911. } while (0)
  912. /**
  913. * kfree_rcu() - kfree an object after a grace period.
  914. * @ptr: pointer to kfree
  915. * @rcu_head: the name of the struct rcu_head within the type of @ptr.
  916. *
  917. * Many rcu callbacks functions just call kfree() on the base structure.
  918. * These functions are trivial, but their size adds up, and furthermore
  919. * when they are used in a kernel module, that module must invoke the
  920. * high-latency rcu_barrier() function at module-unload time.
  921. *
  922. * The kfree_rcu() function handles this issue. Rather than encoding a
  923. * function address in the embedded rcu_head structure, kfree_rcu() instead
  924. * encodes the offset of the rcu_head structure within the base structure.
  925. * Because the functions are not allowed in the low-order 4096 bytes of
  926. * kernel virtual memory, offsets up to 4095 bytes can be accommodated.
  927. * If the offset is larger than 4095 bytes, a compile-time error will
  928. * be generated in __kfree_rcu(). If this error is triggered, you can
  929. * either fall back to use of call_rcu() or rearrange the structure to
  930. * position the rcu_head structure into the first 4096 bytes.
  931. *
  932. * Note that the allowable offset might decrease in the future, for example,
  933. * to allow something like kmem_cache_free_rcu().
  934. *
  935. * The BUILD_BUG_ON check must not involve any function calls, hence the
  936. * checks are done in macros here.
  937. */
  938. #define kfree_rcu(ptr, rcu_head) \
  939. __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
  940. #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL)
  941. static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
  942. {
  943. *delta_jiffies = ULONG_MAX;
  944. return 0;
  945. }
  946. #endif /* #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) */
  947. #if defined(CONFIG_RCU_NOCB_CPU_ALL)
  948. static inline bool rcu_is_nocb_cpu(int cpu) { return true; }
  949. #elif defined(CONFIG_RCU_NOCB_CPU)
  950. bool rcu_is_nocb_cpu(int cpu);
  951. #else
  952. static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
  953. #endif
  954. /* Only for use by adaptive-ticks code. */
  955. #ifdef CONFIG_NO_HZ_FULL_SYSIDLE
  956. bool rcu_sys_is_idle(void);
  957. void rcu_sysidle_force_exit(void);
  958. #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
  959. static inline bool rcu_sys_is_idle(void)
  960. {
  961. return false;
  962. }
  963. static inline void rcu_sysidle_force_exit(void)
  964. {
  965. }
  966. #endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
  967. #endif /* __LINUX_RCUPDATE_H */