'\" t .\" Title: flush_scheduled_work .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "FLUSH_SCHEDULED_WORK" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "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" flush_scheduled_work \- ensure that any scheduled work has run to completion\&. .SH "SYNOPSIS" .HP \w'void\ flush_scheduled_work('u .BI "void flush_scheduled_work(" "void" ");" .SH "ARGUMENTS" .PP \fIvoid\fR .RS 4 no arguments .RE .SH "DESCRIPTION" .PP .PP Forces execution of the kernel\-global workqueue and blocks until its completion\&. .PP Think twice before calling this function! It\*(Aqs very easy to get into trouble if you don\*(Aqt take great care\&. Either of the following situations .SH "WILL LEAD TO DEADLOCK" .PP .PP One of the work items currently on the workqueue needs to acquire a lock held by your code or its caller\&. .PP Your code is running in the context of a work routine\&. .PP They will be detected by lockdep when they occur, but the first might not occur very often\&. It depends on what work items are on the workqueue and what locks they need, which you have no control over\&. .PP In most situations flushing the entire workqueue is overkill; you merely need to know that a particular work item isn\*(Aqt queued and isn\*(Aqt running\&. In such cases you should use \fBcancel_delayed_work_sync\fR or \fBcancel_work_sync\fR instead\&. .SH "COPYRIGHT" .br