'\" t .\" Title: synchronize_sched .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "SYNCHRONIZE_SCHED" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" synchronize_sched \- wait until an rcu\-sched grace period has elapsed\&. .SH "SYNOPSIS" .HP \w'void\ synchronize_sched('u .BI "void synchronize_sched(" "void" ");" .SH "ARGUMENTS" .PP \fIvoid\fR .RS 4 no arguments .RE .SH "DESCRIPTION" .PP .PP Control will return to the caller some time after a full rcu\-sched grace period has elapsed, in other words after all currently executing rcu\-sched read\-side critical sections have completed\&. These read\-side critical sections are delimited by \fBrcu_read_lock_sched\fR and \fBrcu_read_unlock_sched\fR, and may be nested\&. Note that \fBpreempt_disable\fR, \fBlocal_irq_disable\fR, and so on may be used in place of \fBrcu_read_lock_sched\fR\&. .PP This means that all preempt_disable code sequences, including NMI and non\-threaded hardware\-interrupt handlers, in progress on entry will have completed before this primitive returns\&. However, this does not guarantee that softirq handlers will have completed, since in some kernels, these handlers can run in process context, and can block\&. .PP Note that this guarantee implies further memory\-ordering guarantees\&. On systems with more than one CPU, when \fBsynchronize_sched\fR returns, each CPU is guaranteed to have executed a full memory barrier since the end of its last RCU\-sched read\-side critical section whose beginning preceded the call to \fBsynchronize_sched\fR\&. In addition, each CPU having an RCU read\-side critical section that extends beyond the return from \fBsynchronize_sched\fR is guaranteed to have executed a full memory barrier after the beginning of \fBsynchronize_sched\fR and before the beginning of that RCU read\-side critical section\&. Note that these guarantees include CPUs that are offline, idle, or executing in user mode, as well as CPUs that are executing in the kernel\&. .PP Furthermore, if CPU A invoked \fBsynchronize_sched\fR, which returned to its caller on CPU B, then both CPU A and CPU B are guaranteed to have executed a full memory barrier during the execution of \fBsynchronize_sched\fR \-\- even if CPU A and CPU B are the same CPU (but again only if the system has more than one CPU)\&. .PP This primitive provides the guarantees made by the (now removed) \fBsynchronize_kernel\fR API\&. In contrast, \fBsynchronize_rcu\fR only guarantees that \fBrcu_read_lock\fR sections will have completed\&. In \(lqclassic RCU\(rq, these two guarantees happen to be one and the same, but can differ in realtime RCU implementations\&. .SH "COPYRIGHT" .br