'\" t .\" Title: wake_up_bit .\" 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 "WAKE_UP_BIT" "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" wake_up_bit \- wake up a waiter on a bit .SH "SYNOPSIS" .HP \w'void\ wake_up_bit('u .BI "void wake_up_bit(void\ *\ " "word" ", int\ " "bit" ");" .SH "ARGUMENTS" .PP \fIword\fR .RS 4 the word being waited on, a kernel virtual address .RE .PP \fIbit\fR .RS 4 the bit of the word being waited on .RE .SH "DESCRIPTION" .PP There is a standard hashed waitqueue table for generic use\&. This is the part of the hashtable\*(Aqs accessor API that wakes up waiters on a bit\&. For instance, if one were to have waiters on a bitflag, one would call \fBwake_up_bit\fR after clearing the bit\&. .PP In order for this to function properly, as it uses \fBwaitqueue_active\fR internally, some kind of memory barrier must be done prior to calling this\&. Typically, this will be \fBsmp_mb__after_atomic\fR, but in some cases where bitflags are manipulated non\-atomically under a lock, one may need to use a less regular barrier, such fs/inode\&.c\*(Aqs \fBsmp_mb\fR, because \fBspin_unlock\fR does not guarantee a memory barrier\&. .SH "COPYRIGHT" .br