1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Delaying, scheduling, and timer routines</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="Basics.html" title="Chapter&#160;1.&#160;Driver Basics"><link rel="prev" href="API-atomic-inc-short.html" title="atomic_inc_short"><link rel="next" href="API-struct-cputime.html" title="struct cputime"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Delaying, scheduling, and timer routines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-atomic-inc-short.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;1.&#160;Driver Basics</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-struct-cputime.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1106673692"></a>Delaying, scheduling, and timer routines</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-cputime.html"><span class="phrase">struct cputime</span></a></span><span class="refpurpose"> &#8212; 
2  snaphsot of system and user cputime
3 </span></dt><dt><span class="refentrytitle"><a href="API-struct-task-cputime.html"><span class="phrase">struct task_cputime</span></a></span><span class="refpurpose"> &#8212; 
4     collected CPU time counts
5 </span></dt><dt><span class="refentrytitle"><a href="API-struct-thread-group-cputimer.html"><span class="phrase">struct thread_group_cputimer</span></a></span><span class="refpurpose"> &#8212; 
6     thread group interval timer counts
7 </span></dt><dt><span class="refentrytitle"><a href="API-pid-alive.html"><span class="phrase">pid_alive</span></a></span><span class="refpurpose"> &#8212; 
8     check that a task structure is not stale
9 </span></dt><dt><span class="refentrytitle"><a href="API-is-global-init.html"><span class="phrase">is_global_init</span></a></span><span class="refpurpose"> &#8212; 
10     check if a task structure is init
11 </span></dt><dt><span class="refentrytitle"><a href="API-task-nice.html"><span class="phrase">task_nice</span></a></span><span class="refpurpose"> &#8212; 
12     return the nice value of a given task.
13 </span></dt><dt><span class="refentrytitle"><a href="API-is-idle-task.html"><span class="phrase">is_idle_task</span></a></span><span class="refpurpose"> &#8212; 
14     is the specified task an idle task?
15 </span></dt><dt><span class="refentrytitle"><a href="API-threadgroup-lock.html"><span class="phrase">threadgroup_lock</span></a></span><span class="refpurpose"> &#8212; 
16     lock threadgroup
17 </span></dt><dt><span class="refentrytitle"><a href="API-threadgroup-unlock.html"><span class="phrase">threadgroup_unlock</span></a></span><span class="refpurpose"> &#8212; 
18     unlock threadgroup
19 </span></dt><dt><span class="refentrytitle"><a href="API-wake-up-process.html"><span class="phrase">wake_up_process</span></a></span><span class="refpurpose"> &#8212; 
20  Wake up a specific process
21 </span></dt><dt><span class="refentrytitle"><a href="API-preempt-notifier-register.html"><span class="phrase">preempt_notifier_register</span></a></span><span class="refpurpose"> &#8212; 
22     tell me when current is being preempted &amp; rescheduled
23 </span></dt><dt><span class="refentrytitle"><a href="API-preempt-notifier-unregister.html"><span class="phrase">preempt_notifier_unregister</span></a></span><span class="refpurpose"> &#8212; 
24     no longer interested in preemption notifications
25 </span></dt><dt><span class="refentrytitle"><a href="API-preempt-schedule-context.html"><span class="phrase">preempt_schedule_context</span></a></span><span class="refpurpose"> &#8212; 
26     preempt_schedule called by tracing
27 </span></dt><dt><span class="refentrytitle"><a href="API-sched-setscheduler.html"><span class="phrase">sched_setscheduler</span></a></span><span class="refpurpose"> &#8212; 
28     change the scheduling policy and/or RT priority of a thread.
29 </span></dt><dt><span class="refentrytitle"><a href="API-yield.html"><span class="phrase">yield</span></a></span><span class="refpurpose"> &#8212; 
30     yield the current processor to other threads.
31 </span></dt><dt><span class="refentrytitle"><a href="API-yield-to.html"><span class="phrase">yield_to</span></a></span><span class="refpurpose"> &#8212; 
32     yield the current processor to another thread in your thread group, or accelerate that thread toward the processor it's on.
33 </span></dt><dt><span class="refentrytitle"><a href="API-cpupri-find.html"><span class="phrase">cpupri_find</span></a></span><span class="refpurpose"> &#8212; 
34  find the best (lowest-pri) CPU in the system
35 </span></dt><dt><span class="refentrytitle"><a href="API-cpupri-set.html"><span class="phrase">cpupri_set</span></a></span><span class="refpurpose"> &#8212; 
36     update the cpu priority setting
37 </span></dt><dt><span class="refentrytitle"><a href="API-cpupri-init.html"><span class="phrase">cpupri_init</span></a></span><span class="refpurpose"> &#8212; 
38     initialize the cpupri structure
39 </span></dt><dt><span class="refentrytitle"><a href="API-cpupri-cleanup.html"><span class="phrase">cpupri_cleanup</span></a></span><span class="refpurpose"> &#8212; 
40     clean up the cpupri structure
41 </span></dt><dt><span class="refentrytitle"><a href="API-get-sd-load-idx.html"><span class="phrase">get_sd_load_idx</span></a></span><span class="refpurpose"> &#8212; 
42  Obtain the load index for a given sched domain.
43 </span></dt><dt><span class="refentrytitle"><a href="API-update-sg-lb-stats.html"><span class="phrase">update_sg_lb_stats</span></a></span><span class="refpurpose"> &#8212; 
44     Update sched_group's statistics for load balancing.
45 </span></dt><dt><span class="refentrytitle"><a href="API-update-sd-pick-busiest.html"><span class="phrase">update_sd_pick_busiest</span></a></span><span class="refpurpose"> &#8212; 
46     return 1 on busiest group
47 </span></dt><dt><span class="refentrytitle"><a href="API-update-sd-lb-stats.html"><span class="phrase">update_sd_lb_stats</span></a></span><span class="refpurpose"> &#8212; 
48     Update sched_domain's statistics for load balancing.
49 </span></dt><dt><span class="refentrytitle"><a href="API-check-asym-packing.html"><span class="phrase">check_asym_packing</span></a></span><span class="refpurpose"> &#8212; 
50     Check to see if the group is packed into the sched doman.
51 </span></dt><dt><span class="refentrytitle"><a href="API-fix-small-imbalance.html"><span class="phrase">fix_small_imbalance</span></a></span><span class="refpurpose"> &#8212; 
52     Calculate the minor imbalance that exists amongst the groups of a sched_domain, during load balancing.
53 </span></dt><dt><span class="refentrytitle"><a href="API-calculate-imbalance.html"><span class="phrase">calculate_imbalance</span></a></span><span class="refpurpose"> &#8212; 
54     Calculate the amount of imbalance present within the groups of a given sched_domain during load balance.
55 </span></dt><dt><span class="refentrytitle"><a href="API-find-busiest-group.html"><span class="phrase">find_busiest_group</span></a></span><span class="refpurpose"> &#8212; 
56     Returns the busiest group within the sched_domain if there is an imbalance. If there isn't an imbalance, and the user has opted for power-savings, it returns a group whose CPUs can be put to idle by rebalancing those tasks elsewhere, if such a group exists.
57 </span></dt><dt><span class="refentrytitle"><a href="API-DECLARE-COMPLETION.html"><span class="phrase">DECLARE_COMPLETION</span></a></span><span class="refpurpose"> &#8212; 
58  declare and initialize a completion structure
59 </span></dt><dt><span class="refentrytitle"><a href="API-DECLARE-COMPLETION-ONSTACK.html"><span class="phrase">DECLARE_COMPLETION_ONSTACK</span></a></span><span class="refpurpose"> &#8212; 
60     declare and initialize a completion structure
61 </span></dt><dt><span class="refentrytitle"><a href="API-init-completion.html"><span class="phrase">init_completion</span></a></span><span class="refpurpose"> &#8212; 
62     Initialize a dynamically allocated completion
63 </span></dt><dt><span class="refentrytitle"><a href="API-reinit-completion.html"><span class="phrase">reinit_completion</span></a></span><span class="refpurpose"> &#8212; 
64     reinitialize a completion structure
65 </span></dt><dt><span class="refentrytitle"><a href="API---round-jiffies.html"><span class="phrase">__round_jiffies</span></a></span><span class="refpurpose"> &#8212; 
66  function to round jiffies to a full second
67 </span></dt><dt><span class="refentrytitle"><a href="API---round-jiffies-relative.html"><span class="phrase">__round_jiffies_relative</span></a></span><span class="refpurpose"> &#8212; 
68     function to round jiffies to a full second
69 </span></dt><dt><span class="refentrytitle"><a href="API-round-jiffies.html"><span class="phrase">round_jiffies</span></a></span><span class="refpurpose"> &#8212; 
70     function to round jiffies to a full second
71 </span></dt><dt><span class="refentrytitle"><a href="API-round-jiffies-relative.html"><span class="phrase">round_jiffies_relative</span></a></span><span class="refpurpose"> &#8212; 
72     function to round jiffies to a full second
73 </span></dt><dt><span class="refentrytitle"><a href="API---round-jiffies-up.html"><span class="phrase">__round_jiffies_up</span></a></span><span class="refpurpose"> &#8212; 
74     function to round jiffies up to a full second
75 </span></dt><dt><span class="refentrytitle"><a href="API---round-jiffies-up-relative.html"><span class="phrase">__round_jiffies_up_relative</span></a></span><span class="refpurpose"> &#8212; 
76     function to round jiffies up to a full second
77 </span></dt><dt><span class="refentrytitle"><a href="API-round-jiffies-up.html"><span class="phrase">round_jiffies_up</span></a></span><span class="refpurpose"> &#8212; 
78     function to round jiffies up to a full second
79 </span></dt><dt><span class="refentrytitle"><a href="API-round-jiffies-up-relative.html"><span class="phrase">round_jiffies_up_relative</span></a></span><span class="refpurpose"> &#8212; 
80     function to round jiffies up to a full second
81 </span></dt><dt><span class="refentrytitle"><a href="API-set-timer-slack.html"><span class="phrase">set_timer_slack</span></a></span><span class="refpurpose"> &#8212; 
82     set the allowed slack for a timer
83 </span></dt><dt><span class="refentrytitle"><a href="API-init-timer-key.html"><span class="phrase">init_timer_key</span></a></span><span class="refpurpose"> &#8212; 
84     initialize a timer
85 </span></dt><dt><span class="refentrytitle"><a href="API-mod-timer-pending.html"><span class="phrase">mod_timer_pending</span></a></span><span class="refpurpose"> &#8212; 
86     modify a pending timer's timeout
87 </span></dt><dt><span class="refentrytitle"><a href="API-mod-timer.html"><span class="phrase">mod_timer</span></a></span><span class="refpurpose"> &#8212; 
88     modify a timer's timeout
89 </span></dt><dt><span class="refentrytitle"><a href="API-mod-timer-pinned.html"><span class="phrase">mod_timer_pinned</span></a></span><span class="refpurpose"> &#8212; 
90     modify a timer's timeout
91 </span></dt><dt><span class="refentrytitle"><a href="API-add-timer.html"><span class="phrase">add_timer</span></a></span><span class="refpurpose"> &#8212; 
92     start a timer
93 </span></dt><dt><span class="refentrytitle"><a href="API-add-timer-on.html"><span class="phrase">add_timer_on</span></a></span><span class="refpurpose"> &#8212; 
94     start a timer on a particular CPU
95 </span></dt><dt><span class="refentrytitle"><a href="API-del-timer.html"><span class="phrase">del_timer</span></a></span><span class="refpurpose"> &#8212; 
96     deactive a timer.
97 </span></dt><dt><span class="refentrytitle"><a href="API-try-to-del-timer-sync.html"><span class="phrase">try_to_del_timer_sync</span></a></span><span class="refpurpose"> &#8212; 
98     Try to deactivate a timer
99 </span></dt><dt><span class="refentrytitle"><a href="API-del-timer-sync.html"><span class="phrase">del_timer_sync</span></a></span><span class="refpurpose"> &#8212; 
100     deactivate a timer and wait for the handler to finish.
101 </span></dt><dt><span class="refentrytitle"><a href="API-schedule-timeout.html"><span class="phrase">schedule_timeout</span></a></span><span class="refpurpose"> &#8212; 
102     sleep until timeout
103 </span></dt><dt><span class="refentrytitle"><a href="API-msleep.html"><span class="phrase">msleep</span></a></span><span class="refpurpose"> &#8212; 
104     sleep safely even with waitqueue interruptions
105 </span></dt><dt><span class="refentrytitle"><a href="API-msleep-interruptible.html"><span class="phrase">msleep_interruptible</span></a></span><span class="refpurpose"> &#8212; 
106     sleep waiting for signals
107 </span></dt><dt><span class="refentrytitle"><a href="API-usleep-range.html"><span class="phrase">usleep_range</span></a></span><span class="refpurpose"> &#8212; 
108     Drop in replacement for udelay where wakeup is flexible
109 </span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-atomic-inc-short.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="Basics.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-struct-cputime.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">atomic_inc_short</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct cputime</span></td></tr></table></div></body></html>
110