'\" t .\" Title: rcu_read_lock_held .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "RCU_READ_LOCK_HELD" "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" rcu_read_lock_held \- might we be in RCU read\-side critical section? .SH "SYNOPSIS" .HP \w'int\ rcu_read_lock_held('u .BI "int rcu_read_lock_held(" "void" ");" .SH "ARGUMENTS" .PP \fIvoid\fR .RS 4 no arguments .RE .SH "DESCRIPTION" .PP .PP If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU read\-side critical section\&. In absence of CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU read\-side critical section unless it can prove otherwise\&. This is useful for debug checks in functions that require that they be called within an RCU read\-side critical section\&. .PP Checks \fBdebug_lockdep_rcu_enabled\fR to prevent false positives during boot and while lockdep is disabled\&. .PP Note that \fBrcu_read_lock\fR and the matching \fBrcu_read_unlock\fR must occur in the same context, for example, it is illegal to invoke \fBrcu_read_unlock\fR in process context if the matching \fBrcu_read_lock\fR was invoked from within an irq handler\&. .PP Note that \fBrcu_read_lock\fR is disallowed if the CPU is either idle or offline from an RCU perspective, so check for those as well\&. .SH "COPYRIGHT" .br