]> git.proxmox.com Git - mirror_spl-debian.git/commit
Add cv_timedwait_interruptible() function
authorNeependra Khare <neependra@kqinfotech.com>
Mon, 6 Dec 2010 11:35:58 +0000 (17:05 +0530)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 11 Jan 2011 20:14:48 +0000 (12:14 -0800)
commit3f688a8c381d298062467a318994bb5849b1c8c1
tree9928481bcc392993b97eabdeeffac8dfa5b5485e
parent6bf4d76f4782a13f3ed378d77a0bc17967c3642a
Add cv_timedwait_interruptible() function

The cv_timedwait() function by definition must wait unconditionally
for cv_signal()/cv_broadcast() before waking.  This causes processes
to go in the D state which increases the load average.  The load
average is the summation of processes in D state and run queue.

To avoid this it can be desirable to sleep interruptibly.  These
processes do not count against the load average but may be woken by
a signal.  It is up to the caller to determine why the process
was woken it may be for one of three reasons.

  1) cv_signal()/cv_broadcast()
  2) the timeout expired
  3) a signal was received

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/condvar.h
module/spl/spl-condvar.c