'\" t .\" Title: rcu_read_lock_sched_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_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" rcu_read_lock_sched_held \- might we be in RCU\-sched read\-side critical section? .SH "SYNOPSIS" .HP \w'int\ rcu_read_lock_sched_held('u .BI "int rcu_read_lock_sched_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\-sched read\-side critical section\&. In absence of CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU\-sched read\-side critical section unless it can prove otherwise\&. Note that disabling of preemption (including disabling irqs) counts as an RCU\-sched read\-side critical section\&. This is useful for debug checks in functions that required that they be called within an RCU\-sched read\-side critical section\&. .PP Check \fBdebug_lockdep_rcu_enabled\fR to prevent false positives during boot and while lockdep is disabled\&. .PP Note that if the CPU is in the idle loop from an RCU point of view (ie: that we are in the section between \fBrcu_idle_enter\fR and \fBrcu_idle_exit\fR) then \fBrcu_read_lock_held\fR returns false even if the CPU did an \fBrcu_read_lock\fR\&. The reason for this is that RCU ignores CPUs that are in such a section, considering these as in extended quiescent state, so such a CPU is effectively never in an RCU read\-side critical section regardless of what RCU primitives it invokes\&. This state of affairs is required \-\-\- we need to keep an RCU\-free window in idle where the CPU may possibly enter into low power mode\&. This way we can notice an extended quiescent state to other CPUs that started a grace period\&. Otherwise we would delay any grace period as long as we run in the idle task\&. .PP Similarly, we avoid claiming an SRCU read lock held if the current CPU is offline\&. .SH "COPYRIGHT" .br