1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>synchronize_sched</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch01s09.html" title="Kernel utility functions"><link rel="prev" href="API-rcu-is-watching.html" title="rcu_is_watching"><link rel="next" href="API-synchronize-rcu-bh.html" title="synchronize_rcu_bh"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">synchronize_sched</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-rcu-is-watching.html">Prev</a> </td><th width="60%" align="center">Kernel utility functions</th><td width="20%" align="right"> <a accesskey="n" href="API-synchronize-rcu-bh.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-synchronize-sched"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>synchronize_sched — 2 wait until an rcu-sched grace period has elapsed. 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">synchronize_sched </b>(</code></td><td> <var class="pdparam">void</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1108620700"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>void</code></em></span></dt><dd><p> 4 no arguments 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1108622308"></a><h2>Description</h2><p> 6 </p><p> 7 8 Control will return to the caller some time after a full rcu-sched 9 grace period has elapsed, in other words after all currently executing 10 rcu-sched read-side critical sections have completed. These read-side 11 critical sections are delimited by <code class="function">rcu_read_lock_sched</code> and 12 <code class="function">rcu_read_unlock_sched</code>, and may be nested. Note that <code class="function">preempt_disable</code>, 13 <code class="function">local_irq_disable</code>, and so on may be used in place of 14 <code class="function">rcu_read_lock_sched</code>. 15 </p><p> 16 17 This means that all preempt_disable code sequences, including NMI and 18 non-threaded hardware-interrupt handlers, in progress on entry will 19 have completed before this primitive returns. However, this does not 20 guarantee that softirq handlers will have completed, since in some 21 kernels, these handlers can run in process context, and can block. 22 </p><p> 23 24 Note that this guarantee implies further memory-ordering guarantees. 25 On systems with more than one CPU, when <code class="function">synchronize_sched</code> returns, 26 each CPU is guaranteed to have executed a full memory barrier since the 27 end of its last RCU-sched read-side critical section whose beginning 28 preceded the call to <code class="function">synchronize_sched</code>. In addition, each CPU having 29 an RCU read-side critical section that extends beyond the return from 30 <code class="function">synchronize_sched</code> is guaranteed to have executed a full memory barrier 31 after the beginning of <code class="function">synchronize_sched</code> and before the beginning of 32 that RCU read-side critical section. Note that these guarantees include 33 CPUs that are offline, idle, or executing in user mode, as well as CPUs 34 that are executing in the kernel. 35 </p><p> 36 37 Furthermore, if CPU A invoked <code class="function">synchronize_sched</code>, which returned 38 to its caller on CPU B, then both CPU A and CPU B are guaranteed 39 to have executed a full memory barrier during the execution of 40 <code class="function">synchronize_sched</code> -- even if CPU A and CPU B are the same CPU (but 41 again only if the system has more than one CPU). 42 </p><p> 43 44 This primitive provides the guarantees made by the (now removed) 45 <code class="function">synchronize_kernel</code> API. In contrast, <code class="function">synchronize_rcu</code> only 46 guarantees that <code class="function">rcu_read_lock</code> sections will have completed. 47 In <span class="quote">“<span class="quote">classic RCU</span>”</span>, these two guarantees happen to be one and 48 the same, but can differ in realtime RCU implementations. 49</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-rcu-is-watching.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01s09.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-synchronize-rcu-bh.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">rcu_is_watching</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">synchronize_rcu_bh</span></td></tr></table></div></body></html> 50