sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/timers/delay_sleep_functionsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/timers/delay_sleep_functionsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/timers/delay_sleep_functionsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/timers/delay_sleep_functionsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/timers/delay_sleep_functionsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/timers/delay_sleep_functionsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions.rsthKubhsection)}(hhh](htitle)}(hDelay and sleep mechanismsh]hDelay and sleep mechanisms}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(haThis document seeks to answer the common question: "What is the RightWay (TM) to insert a delay?"h]heThis document seeks to answer the common question: “What is the RightWay (TM) to insert a delay?”}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThis question is most often faced by driver writers who have to deal with hardware delays and who may not be the most intimately familiar with the inner workings of the Linux Kernel.h]hThis question is most often faced by driver writers who have to deal with hardware delays and who may not be the most intimately familiar with the inner workings of the Linux Kernel.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hThe following table gives a rough overview about the existing function 'families' and their limitations. This overview table does not replace the reading of the function description before usage!h]hThe following table gives a rough overview about the existing function ‘families’ and their limitations. This overview table does not replace the reading of the function description before usage!}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1hhhubj)}(hhh]h}(h]h ]h"]h$]h&]j Kuh1hhhubj)}(hhh]h}(h]h ]h"]h$]h&]j Kuh1hhhubj)}(hhh]h}(h]h ]h"]h$]h&]j Kuh1hhhubj)}(hhh]h}(h]h ]h"]h$]h&]j Kuh1hhhubhthead)}(hhh](hrow)}(hhh](hentry)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hj6ubj:)}(hhh]h)}(h `*delay()`h]htitle_reference)}(hjIh]h*delay()}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjGubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubah}(h]h ]h"]h$]h&]uh1j9hj6ubj:)}(hhh]h)}(h`usleep_range*()`h]jL)}(hjkh]husleep_range*()}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjiubah}(h]h ]h"]h$]h&]uh1hhhhKhjfubah}(h]h ]h"]h$]h&]uh1j9hj6ubj:)}(hhh]h)}(h `*sleep()`h]jL)}(hjh]h*sleep()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hj6ubj:)}(hhh]h)}(h `fsleep()`h]jL)}(hjh]hfsleep()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hj6ubeh}(h]h ]h"]h$]h&]uh1j4hj1ubj5)}(hhh](j:)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hbusy-wait looph]hbusy-wait loop}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hhrtimers basedh]hhrtimers based}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(htimer list timers basedh]htimer list timers based}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hcombines the othersh]hcombines the others}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j9hjubeh}(h]h ]h"]h$]h&]uh1j4hj1ubeh}(h]h ]h"]h$]h&]uh1j/hhubhtbody)}(hhh](j5)}(hhh](j:)}(hhh]h)}(hUsage in atomic Contexth]hUsage in atomic Context}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHubah}(h]h ]h"]h$]h&]uh1j9hjEubj:)}(hhh]h)}(hyesh]hyes}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hj_ubah}(h]h ]h"]h$]h&]uh1j9hjEubj:)}(hhh]h)}(hnoh]hno}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjvubah}(h]h ]h"]h$]h&]uh1j9hjEubj:)}(hhh]h)}(hnoh]hno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1j9hjEubj:)}(hhh]h)}(hnoh]hno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjubah}(h]h ]h"]h$]h&]uh1j9hjEubeh}(h]h ]h"]h$]h&]uh1j4hjBubj5)}(hhh](j:)}(hhh]h)}(hprecise on "short intervals"h]h precise on “short intervals”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hyesh]hyes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hyesh]hyes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hdependsh]hdepends}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hj ubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hyesh]hyes}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hj ubah}(h]h ]h"]h$]h&]uh1j9hjubeh}(h]h ]h"]h$]h&]uh1j4hjBubj5)}(hhh](j:)}(hhh]h)}(hprecise on "long intervals"h]hprecise on “long intervals”}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hj@ubah}(h]h ]h"]h$]h&]uh1j9hj=ubj:)}(hhh]h)}(h Do not use!h]h Do not use!}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjWubah}(h]h ]h"]h$]h&]uh1j9hj=ubj:)}(hhh]h)}(hyesh]hyes}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjnubah}(h]h ]h"]h$]h&]uh1j9hj=ubj:)}(hhh]h)}(hmax 12.5% slackh]hmax 12.5% slack}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1j9hj=ubj:)}(hhh]h)}(hyesh]hyes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjubah}(h]h ]h"]h$]h&]uh1j9hj=ubeh}(h]h ]h"]h$]h&]uh1j4hjBubj5)}(hhh](j:)}(hhh]h)}(hinterruptible varianth]hinterruptible variant}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hnoh]hno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hyesh]hyes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hyesh]hyes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1j9hjubj:)}(hhh]h)}(hnoh]hno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1j9hjubeh}(h]h ]h"]h$]h&]uh1j4hjBubeh}(h]h ]h"]h$]h&]uh1j@hhubeh}(h]h ]h"]h$]h&]colsKuh1hhhubah}(h]h ]colwidths-givenah"]h$]h&]uh1hhhhhhNhNubh)}(h2A generic advice for non atomic contexts could be:h]h2A generic advice for non atomic contexts could be:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hhhhubhenumerated_list)}(hhh](h list_item)}(hPUse `fsleep()` whenever unsure (as it combines all the advantages of the others)h]h)}(hPUse `fsleep()` whenever unsure (as it combines all the advantages of the others)h](hUse }(hjbhhhNhNubjL)}(h `fsleep()`h]hfsleep()}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjbubhB whenever unsure (as it combines all the advantages of the others)}(hjbhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK6hj^ubah}(h]h ]h"]h$]h&]uh1j\hjYhhhhhNubj])}(h Use `*sleep()` whenever possibleh]h)}(hjh](hUse }(hjhhhNhNubjL)}(h `*sleep()`h]h*sleep()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubh whenever possible}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j\hjYhhhhhNubj])}(hGUse `usleep_range*()` whenever accuracy of `*sleep()` is not sufficienth]h)}(hjh](hUse }(hjhhhNhNubjL)}(h`usleep_range*()`h]husleep_range*()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubh whenever accuracy of }(hjhhhNhNubjL)}(h `*sleep()`h]h*sleep()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubh is not sufficient}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1j\hjYhhhhhNubj])}(h+Use `*delay()` for very, very short delays h]h)}(h*Use `*delay()` for very, very short delaysh](hUse }(hjhhhNhNubjL)}(h `*delay()`h]h*delay()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubh for very, very short delays}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1j\hjYhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jWhhhhhhhK6ubh)}(hWFind some more detailed information about the function 'families' in the next sections.h]h[Find some more detailed information about the function ‘families’ in the next sections.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKj?)j@huh1jhjhKJhjhhubjB)}(hhh]h)}(h8Inserting a delay based on nanoseconds with busy waitingh]h8Inserting a delay based on nanoseconds with busy waiting}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhh/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:74: ./include/asm-generic/delay.hhKEhj^hhubah}(h]h ]h"]h$]h&]uh1jAhjhhhjhKJubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjyjejyjfjgjhuh1j{hhhj/hNhNubjj)}(h**Parameters** ``unsigned long nsec`` requested delay in nanoseconds **Description** See udelay() for basic information about ndelay() and it's variants.h](h)}(h**Parameters**h]jt)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhh/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:74: ./include/asm-generic/delay.hhKIhj}ubj)}(hhh]j)}(h6``unsigned long nsec`` requested delay in nanoseconds h](j)}(h``unsigned long nsec``h]j)}(hjh]hunsigned long nsec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhh/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:74: ./include/asm-generic/delay.hhKFhjubj)}(hhh]h)}(hrequested delay in nanosecondsh]hrequested delay in nanoseconds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKFhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKFhjubah}(h]h ]h"]h$]h&]uh1jhj}ubh)}(h**Description**h]jt)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhh/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:74: ./include/asm-generic/delay.hhKHhj}ubh)}(hDSee udelay() for basic information about ndelay() and it's variants.h]hFSee udelay() for basic information about ndelay() and it’s variants.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhh/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:74: ./include/asm-generic/delay.hhKHhj}ubeh}(h]h ] kernelindentah"]h$]h&]uh1jihj/hhhNhNubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jwmdelay (C macro)c.mdelayhNtauh1jjhj/hhhNhNubj|)}(hhh](j)}(hmdelayh]j)}(hmdelayh]j)}(hmdelayh]j)}(hj h]hmdelay}(hj& hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK,ubah}(h]h ]h"]h$]h&]hhj3uh1jj4j5hj hhhj9 hK,ubah}(h]j ah ](j9j:eh"]h$]h&]j>j?)j@huh1jhj9 hK,hj hhubjB)}(hhh]h}(h]h ]h"]h$]h&]uh1jAhj hhhj9 hK,ubeh}(h]h ](j^macroeh"]h$]h&]jcj^jdjR jejR jfjgjhuh1j{hhhj/hNhNubh)}(h``mdelay (n)``h]j)}(hjX h]h mdelay (n)}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjV ubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK.hj/hhubh block_quote)}(h:Inserting a delay based on milliseconds with busy waiting h]h)}(h9Inserting a delay based on milliseconds with busy waitingh]h9Inserting a delay based on milliseconds with busy waiting}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK#hjp ubah}(h]h ]h"]h$]h&]uh1jn hj hK#hj/hhubjj)}(hX+**Parameters** ``n`` requested delay in milliseconds **Description** See udelay() for basic information about mdelay() and it's variants. Please double check, whether mdelay() is the right way to go or whether a refactoring of the code is the better variant to be able to use msleep() instead.h](h)}(h**Parameters**h]jt)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jshj ubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK'hj ubj)}(hhh]j)}(h&``n`` requested delay in milliseconds h](j)}(h``n``h]j)}(hj h]hn}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK$hj ubj)}(hhh]h)}(hrequested delay in millisecondsh]hrequested delay in milliseconds}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK$hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hK$hj ubah}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]jt)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jshj ubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK&hj ubh)}(hDSee udelay() for basic information about mdelay() and it's variants.h]hFSee udelay() for basic information about mdelay() and it’s variants.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK&hj ubh)}(hPlease double check, whether mdelay() is the right way to go or whether a refactoring of the code is the better variant to be able to use msleep() instead.h]hPlease double check, whether mdelay() is the right way to go or whether a refactoring of the code is the better variant to be able to use msleep() instead.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:77: ./include/linux/delay.hhK(hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jihj/hhhNhNubeh}(h]delay-family-of-functionsah ]h"]*delay() family of functionsah$]h&]uh1hhhhhhhhK@ubh)}(hhh](h)}(h4`usleep_range*()` and `*sleep()` family of functionsh](jL)}(h`usleep_range*()`h]husleep_range*()}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj/ ubh and }(hj/ hhhNhNubjL)}(h `*sleep()`h]h*sleep()}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj/ ubh family of functions}(hj/ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj, hhhhhKRubh)}(hThese functions use hrtimers or timer list timers to provide the requested sleeping duration. In order to decide which function is the right one to use, take some basic information into account:h]hThese functions use hrtimers or timer list timers to provide the requested sleeping duration. In order to decide which function is the right one to use, take some basic information into account:}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThj, hhubjX)}(hhh](j])}(hMhrtimers are more expensive as they are using an rb-tree (instead of hashing)h]h)}(hjp h]hMhrtimers are more expensive as they are using an rb-tree (instead of hashing)}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjn ubah}(h]h ]h"]h$]h&]uh1j\hjk hhhhhNubj])}(hhrtimers are more expensive when the requested sleeping duration is the first timer which means real hardware has to be programmedh]h)}(hhrtimers are more expensive when the requested sleeping duration is the first timer which means real hardware has to be programmedh]hhrtimers are more expensive when the requested sleeping duration is the first timer which means real hardware has to be programmed}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhj ubah}(h]h ]h"]h$]h&]uh1j\hjk hhhhhNubj])}(hLtimer list timers always provide some sort of slack as they are jiffy based h]h)}(hKtimer list timers always provide some sort of slack as they are jiffy basedh]hKtimer list timers always provide some sort of slack as they are jiffy based}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hj ubah}(h]h ]h"]h$]h&]uh1j\hjk hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjj uh1jWhj, hhhhhKXubh)}(h$The generic advice is repeated here:h]h$The generic advice is repeated here:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hj, hhubjX)}(hhh](j])}(hPUse `fsleep()` whenever unsure (as it combines all the advantages of the others)h]h)}(hPUse `fsleep()` whenever unsure (as it combines all the advantages of the others)h](hUse }(hj hhhNhNubjL)}(h `fsleep()`h]hfsleep()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj ubhB whenever unsure (as it combines all the advantages of the others)}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK_hj ubah}(h]h ]h"]h$]h&]uh1j\hj hhhhhNubj])}(h Use `*sleep()` whenever possibleh]h)}(hj h](hUse }(hj hhhNhNubjL)}(h `*sleep()`h]h*sleep()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj ubh whenever possible}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKahj ubah}(h]h ]h"]h$]h&]uh1j\hj hhhhhNubj])}(hHUse `usleep_range*()` whenever accuracy of `*sleep()` is not sufficient h]h)}(hGUse `usleep_range*()` whenever accuracy of `*sleep()` is not sufficienth](hUse }(hj# hhhNhNubjL)}(h`usleep_range*()`h]husleep_range*()}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj# ubh whenever accuracy of }(hj# hhhNhNubjL)}(h `*sleep()`h]h*sleep()}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhj# ubh is not sufficient}(hj# hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKbhj ubah}(h]h ]h"]h$]h&]uh1j\hj hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjj uh1jWhj, hhhhhK_ubh)}(hwFirst check fsleep() function description and to learn more about accuracy, please check msleep() function description.h]hwFirst check fsleep() function description and to learn more about accuracy, please check msleep() function description.}(hja hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhj, hhubh)}(hhh](h)}(h`usleep_range*()`h]jL)}(hjt h]husleep_range*()}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjr ubah}(h]h ]h"]h$]h&]uh1hhjo hhhhhKiubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jwusleep_range (C function)c.usleep_rangehNtauh1jjhjo hhhNhNubj|)}(hhh](j)}(h8void usleep_range (unsigned long min, unsigned long max)h]j)}(h7void usleep_range(unsigned long min, unsigned long max)h](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKKubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hKKubj)}(h usleep_rangeh]j)}(h usleep_rangeh]h usleep_range}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj hKKubj)}(h&(unsigned long min, unsigned long max)h](j)}(hunsigned long minh](j)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hlongh]hlong}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hminh]hmin}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhj ubj)}(hunsigned long maxh](j)}(hunsignedh]hunsigned}(hj0 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj, ubj)}(h h]h }(hj> hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj, ubj)}(hlongh]hlong}(hjL hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj, ubj)}(h h]h }(hjZ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj, ubj)}(hmaxh]hmax}(hjh hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj, ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhj ubeh}(h]h ]h"]h$]h&]hhuh1jhj hhhj hKKubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hj hhhj hKKubah}(h]j ah ](j9j:eh"]h$]h&]j>j?)j@huh1jhj hKKhj hhubjB)}(hhh]h)}(hSleep for an approximate timeh]hSleep for an approximate time}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKChj hhubah}(h]h ]h"]h$]h&]uh1jAhj hhhj hKKubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdj jej jfjgjhuh1j{hhhjo hNhNubjj)}(hX!**Parameters** ``unsigned long min`` Minimum time in microseconds to sleep ``unsigned long max`` Maximum time in microseconds to sleep **Description** For basic information please refere to usleep_range_state(). The task will be in the state TASK_UNINTERRUPTIBLE during the sleep.h](h)}(h**Parameters**h]jt)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jshj ubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKGhj ubj)}(hhh](j)}(h<``unsigned long min`` Minimum time in microseconds to sleep h](j)}(h``unsigned long min``h]j)}(hj h]hunsigned long min}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKDhj ubj)}(hhh]h)}(h%Minimum time in microseconds to sleeph]h%Minimum time in microseconds to sleep}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKDhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKDhj ubj)}(h<``unsigned long max`` Maximum time in microseconds to sleep h](j)}(h``unsigned long max``h]j)}(hj h]hunsigned long max}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKEhj ubj)}(hhh]h)}(h%Maximum time in microseconds to sleeph]h%Maximum time in microseconds to sleep}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj! hKEhj" ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj! hKEhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]jt)}(hjG h]h Description}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1jshjE ubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKGhj ubh)}(hj?)j@huh1jhj hKZhj hhubjB)}(hhh]h)}(h7Sleep for an approximate time with idle time accountingh]h7Sleep for an approximate time with idle time accounting}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKQhjhhubah}(h]h ]h"]h$]h&]uh1jAhj hhhj hKZubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjo hNhNubjj)}(hXD**Parameters** ``unsigned long min`` Minimum time in microseconds to sleep ``unsigned long max`` Maximum time in microseconds to sleep **Description** For basic information please refere to usleep_range_state(). The sleeping task has the state TASK_IDLE during the sleep to prevent contribution to the load avarage.h](h)}(h**Parameters**h]jt)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKUhjubj)}(hhh](j)}(h<``unsigned long min`` Minimum time in microseconds to sleep h](j)}(h``unsigned long min``h]j)}(hjh]hunsigned long min}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKRhjubj)}(hhh]h)}(h%Minimum time in microseconds to sleeph]h%Minimum time in microseconds to sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKRhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKRhjubj)}(h<``unsigned long max`` Maximum time in microseconds to sleep h](j)}(h``unsigned long max``h]j)}(hjh]hunsigned long max}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKShjubj)}(hhh]h)}(h%Maximum time in microseconds to sleeph]h%Maximum time in microseconds to sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKShjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKShjubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hj@h]h Description}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jshj>ubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:107: ./include/linux/delay.hhKUhjubh)}(hhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjLhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmaxh]hmax}(hjZhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(hunsigned int stateh](j)}(hunsignedh]hunsigned}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(hstateh]hstate}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjhhhjhMjubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hjhhhjhMjubah}(h]jah ](j9j:eh"]h$]h&]j>j?)j@huh1jhjhMjhjhhubjB)}(hhh]h)}(h.Sleep for an approximate time in a given stateh]h.Sleep for an approximate time in a given state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chMYhjhhubah}(h]h ]h"]h$]h&]uh1jAhjhhhjhMjubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjo hNhNubjj)}(hX/**Parameters** ``unsigned long min`` Minimum time in usecs to sleep ``unsigned long max`` Maximum time in usecs to sleep ``unsigned int state`` State of the current task that will be while sleeping **Description** usleep_range_state() sleeps at least for the minimum specified time but not longer than the maximum specified amount of time. The range might reduce power usage by allowing hrtimers to coalesce an already scheduled interrupt with this hrtimer. In the worst case, an interrupt is scheduled for the upper bound. The sleeping task is set to the specified state before starting the sleep. In non-atomic context where the exact wakeup time is flexible, use usleep_range() or its variants instead of udelay(). The sleep improves responsiveness by avoiding the CPU-hogging busy-wait of udelay().h](h)}(h**Parameters**h]jt)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chM]hjubj)}(hhh](j)}(h5``unsigned long min`` Minimum time in usecs to sleep h](j)}(h``unsigned long min``h]j)}(hjh]hunsigned long min}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chMZhjubj)}(hhh]h)}(hMinimum time in usecs to sleeph]hMinimum time in usecs to sleep}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hMZhj,ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj+hMZhj ubj)}(h5``unsigned long max`` Maximum time in usecs to sleep h](j)}(h``unsigned long max``h]j)}(hjOh]hunsigned long max}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chM[hjIubj)}(hhh]h)}(hMaximum time in usecs to sleeph]hMaximum time in usecs to sleep}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdhM[hjeubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1jhjdhM[hj ubj)}(hM``unsigned int state`` State of the current task that will be while sleeping h](j)}(h``unsigned int state``h]j)}(hjh]hunsigned int state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chM\hjubj)}(hhh]h)}(h5State of the current task that will be while sleepingh]h5State of the current task that will be while sleeping}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM\hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM\hj ubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chM^hjubh)}(hX5usleep_range_state() sleeps at least for the minimum specified time but not longer than the maximum specified amount of time. The range might reduce power usage by allowing hrtimers to coalesce an already scheduled interrupt with this hrtimer. In the worst case, an interrupt is scheduled for the upper bound.h]hX5usleep_range_state() sleeps at least for the minimum specified time but not longer than the maximum specified amount of time. The range might reduce power usage by allowing hrtimers to coalesce an already scheduled interrupt with this hrtimer. In the worst case, an interrupt is scheduled for the upper bound.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chM^hjubh)}(hJThe sleeping task is set to the specified state before starting the sleep.h]hJThe sleeping task is set to the specified state before starting the sleep.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chMdhjubh)}(hIn non-atomic context where the exact wakeup time is flexible, use usleep_range() or its variants instead of udelay(). The sleep improves responsiveness by avoiding the CPU-hogging busy-wait of udelay().h]hIn non-atomic context where the exact wakeup time is flexible, use usleep_range() or its variants instead of udelay(). The sleep improves responsiveness by avoiding the CPU-hogging busy-wait of udelay().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:110: ./kernel/time/sleep_timeout.chMfhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jihjo hhhNhNubeh}(h] usleep-rangeah ]h"]usleep_range*()ah$]h&]uh1hhj, hhhhhKiubh)}(hhh](h)}(h `*sleep()`h]jL)}(hjh]h*sleep()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKsubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jwmsleep (C function)c.msleephNtauh1jjhjhhhNhNubj|)}(hhh](j)}(h void msleep (unsigned int msecs)h]j)}(hvoid msleep(unsigned int msecs)h](j)}(hvoidh]hvoid}(hjHhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDhhhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM9ubj)}(h h]h }(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDhhhjVhM9ubj)}(hmsleeph]j)}(hmsleeph]hmsleep}(hjihhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjeubah}(h]h ](jjeh"]h$]h&]hhuh1jhjDhhhjVhM9ubj)}(h(unsigned int msecs)h]j)}(hunsigned int msecsh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmsecsh]hmsecs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhj}ubah}(h]h ]h"]h$]h&]hhuh1jhjDhhhjVhM9ubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hj@hhhjVhM9ubah}(h]j;ah ](j9j:eh"]h$]h&]j>j?)j@huh1jhjVhM9hj=hhubjB)}(hhh]h)}(h.sleep safely even with waitqueue interruptionsh]h.sleep safely even with waitqueue interruptions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMhjhhubah}(h]h ]h"]h$]h&]uh1jAhj=hhhjVhM9ubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjhNhNubjj)}(hX**Parameters** ``unsigned int msecs`` Requested sleep duration in milliseconds **Description** msleep() uses jiffy based timeouts for the sleep duration. Because of the design of the timer wheel, the maximum additional percentage delay (slack) is 12.5%. This is only valid for timers which will end up in level 1 or a higher level of the timer wheel. For explanation of those 12.5% please check the detailed description about the basics of the timer wheel. The slack of timers which will end up in level 0 depends on sleep duration (msecs) and HZ configuration and can be calculated in the following way (with the timer wheel design restriction that the slack is not less than 12.5%): ``slack = MSECS_PER_TICK / msecs`` When the allowed slack of the callsite is known, the calculation could be turned around to find the minimal allowed sleep duration to meet the constraints. For example: * ``HZ=1000`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 1 / (1/4) = 4``: all sleep durations greater or equal 4ms will meet the constraints. * ``HZ=1000`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 1 / (1/8) = 8``: all sleep durations greater or equal 8ms will meet the constraints. * ``HZ=250`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 4 / (1/4) = 16``: all sleep durations greater or equal 16ms will meet the constraints. * ``HZ=250`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 4 / (1/8) = 32``: all sleep durations greater or equal 32ms will meet the constraints. See also the signal aware variant msleep_interruptible().h](h)}(h**Parameters**h]jt)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMhjubj)}(hhh]j)}(h@``unsigned int msecs`` Requested sleep duration in milliseconds h](j)}(h``unsigned int msecs``h]j)}(hj(h]hunsigned int msecs}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMhj"ubj)}(hhh]h)}(h(Requested sleep duration in millisecondsh]h(Requested sleep duration in milliseconds}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj=hMhj>ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1jhj=hMhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hjch]h Description}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jshjaubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMhjubh)}(hXimsleep() uses jiffy based timeouts for the sleep duration. Because of the design of the timer wheel, the maximum additional percentage delay (slack) is 12.5%. This is only valid for timers which will end up in level 1 or a higher level of the timer wheel. For explanation of those 12.5% please check the detailed description about the basics of the timer wheel.h]hXimsleep() uses jiffy based timeouts for the sleep duration. Because of the design of the timer wheel, the maximum additional percentage delay (slack) is 12.5%. This is only valid for timers which will end up in level 1 or a higher level of the timer wheel. For explanation of those 12.5% please check the detailed description about the basics of the timer wheel.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMhjubh)}(hThe slack of timers which will end up in level 0 depends on sleep duration (msecs) and HZ configuration and can be calculated in the following way (with the timer wheel design restriction that the slack is not less than 12.5%):h]hThe slack of timers which will end up in level 0 depends on sleep duration (msecs) and HZ configuration and can be calculated in the following way (with the timer wheel design restriction that the slack is not less than 12.5%):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM$hjubjo )}(h#``slack = MSECS_PER_TICK / msecs`` h]h)}(h"``slack = MSECS_PER_TICK / msecs``h]j)}(hjh]hslack = MSECS_PER_TICK / msecs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM(hjubah}(h]h ]h"]h$]h&]uh1jn hjhM(hjubh)}(hWhen the allowed slack of the callsite is known, the calculation could be turned around to find the minimal allowed sleep duration to meet the constraints. For example:h]hWhen the allowed slack of the callsite is known, the calculation could be turned around to find the minimal allowed sleep duration to meet the constraints. For example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM*hjubh bullet_list)}(hhh](j])}(h``HZ=1000`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 1 / (1/4) = 4``: all sleep durations greater or equal 4ms will meet the constraints.h]h)}(h``HZ=1000`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 1 / (1/4) = 4``: all sleep durations greater or equal 4ms will meet the constraints.h](j)}(h ``HZ=1000``h]hHZ=1000}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh with }(hjhhhNhNubj)}(h ``slack=25%``h]h slack=25%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: }(hjhhhNhNubj)}(h*``MSECS_PER_TICK / slack = 1 / (1/4) = 4``h]h&MSECS_PER_TICK / slack = 1 / (1/4) = 4}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjub}]hE: all sleep durations greater or equal 4ms will meet the constraints.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM.hjubah}(h]h ]h"]h$]h&]uh1j\hjubj])}(h``HZ=1000`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 1 / (1/8) = 8``: all sleep durations greater or equal 8ms will meet the constraints.h]h)}(h``HZ=1000`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 1 / (1/8) = 8``: all sleep durations greater or equal 8ms will meet the constraints.h](j)}(h ``HZ=1000``h]hHZ=1000}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh with }(hjhhhNhNubj)}(h``slack=12.5%``h]h slack=12.5%}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: }(hjhhhNhNubj)}(h*``MSECS_PER_TICK / slack = 1 / (1/8) = 8``h]h&MSECS_PER_TICK / slack = 1 / (1/8) = 8}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhE: all sleep durations greater or equal 8ms will meet the constraints.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM0hjubah}(h]h ]h"]h$]h&]uh1j\hjubj])}(h``HZ=250`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 4 / (1/4) = 16``: all sleep durations greater or equal 16ms will meet the constraints.h]h)}(h``HZ=250`` with ``slack=25%``: ``MSECS_PER_TICK / slack = 4 / (1/4) = 16``: all sleep durations greater or equal 16ms will meet the constraints.h](j)}(h ``HZ=250``h]hHZ=250}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubh with }(hjghhhNhNubj)}(h ``slack=25%``h]h slack=25%}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubh: }(hjghhhNhNubj)}(h+``MSECS_PER_TICK / slack = 4 / (1/4) = 16``h]h'MSECS_PER_TICK / slack = 4 / (1/4) = 16}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubhF: all sleep durations greater or equal 16ms will meet the constraints.}(hjghhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM2hjcubah}(h]h ]h"]h$]h&]uh1j\hjubj])}(h``HZ=250`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 4 / (1/8) = 32``: all sleep durations greater or equal 32ms will meet the constraints. h]h)}(h``HZ=250`` with ``slack=12.5%``: ``MSECS_PER_TICK / slack = 4 / (1/8) = 32``: all sleep durations greater or equal 32ms will meet the constraints.h](j)}(h ``HZ=250``h]hHZ=250}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh with }(hjhhhNhNubj)}(h``slack=12.5%``h]h slack=12.5%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: }(hjhhhNhNubj)}(h+``MSECS_PER_TICK / slack = 4 / (1/8) = 32``h]h'MSECS_PER_TICK / slack = 4 / (1/8) = 32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhF: all sleep durations greater or equal 32ms will meet the constraints.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM4hjubah}(h]h ]h"]h$]h&]uh1j\hjubeh}(h]h ]h"]h$]h&]bullet*uh1jhjhM.hjubh)}(h9See also the signal aware variant msleep_interruptible().h]h9See also the signal aware variant msleep_interruptible().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chM7hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jihjhhhNhNubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jw!msleep_interruptible (C function)c.msleep_interruptiblehNtauh1jjhjhhhNhNubj|)}(hhh](j)}(h7unsigned long msleep_interruptible (unsigned int msecs)h]j)}(h6unsigned long msleep_interruptible(unsigned int msecs)h](j)}(hunsignedh]hunsigned}(hj0hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,hhhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMNubj)}(h h]h }(hj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,hhhj>hMNubj)}(hlongh]hlong}(hjMhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,hhhj>hMNubj)}(h h]h }(hj[hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,hhhj>hMNubj)}(hmsleep_interruptibleh]j)}(hmsleep_interruptibleh]hmsleep_interruptible}(hjmhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjiubah}(h]h ](jjeh"]h$]h&]hhuh1jhj,hhhj>hMNubj)}(h(unsigned int msecs)h]j)}(hunsigned int msecsh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmsecsh]hmsecs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubah}(h]h ]h"]h$]h&]hhuh1jhj,hhhj>hMNubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hj(hhhj>hMNubah}(h]j#ah ](j9j:eh"]h$]h&]j>j?)j@huh1jhj>hMNhj%hhubjB)}(hhh]h)}(hsleep waiting for signalsh]hsleep waiting for signals}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMChjhhubah}(h]h ]h"]h$]h&]uh1jAhj%hhhj>hMNubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjhNhNubjj)}(hX**Parameters** ``unsigned int msecs`` Requested sleep duration in milliseconds **Description** See msleep() for some basic information. The difference between msleep() and msleep_interruptible() is that the sleep could be interrupted by a signal delivery and then returns early. **Return** The remaining time of the sleep duration transformed to msecs (see schedule_timeout() for details).h](h)}(h**Parameters**h]jt)}(hj h]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshj ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMGhjubj)}(hhh]j)}(h@``unsigned int msecs`` Requested sleep duration in milliseconds h](j)}(h``unsigned int msecs``h]j)}(hj,h]hunsigned int msecs}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMDhj&ubj)}(hhh]h)}(h(Requested sleep duration in millisecondsh]h(Requested sleep duration in milliseconds}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAhMDhjBubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhjAhMDhj#ubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hjgh]h Description}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jshjeubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMFhjubh)}(h(See msleep() for some basic information.h]h(See msleep() for some basic information.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMFhjubh)}(hThe difference between msleep() and msleep_interruptible() is that the sleep could be interrupted by a signal delivery and then returns early.h]hThe difference between msleep() and msleep_interruptible() is that the sleep could be interrupted by a signal delivery and then returns early.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMHhjubh)}(h **Return**h]jt)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMKhjubh)}(hcThe remaining time of the sleep duration transformed to msecs (see schedule_timeout() for details).h]hcThe remaining time of the sleep duration transformed to msecs (see schedule_timeout() for details).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:117: ./kernel/time/sleep_timeout.chMKhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jihjhhhNhNubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jwssleep (C function)c.ssleephNtauh1jjhjhhhNhNubj|)}(hhh](j)}(h"void ssleep (unsigned int seconds)h]j)}(h!void ssleep(unsigned int seconds)h](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKeubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKeubj)}(hssleeph]j)}(hssleeph]hssleep}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhKeubj)}(h(unsigned int seconds)h]j)}(hunsigned int secondsh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hj;hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjIhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hsecondsh]hseconds}(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubah}(h]h ]h"]h$]h&]hhuh1jhjhhhjhKeubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hjhhhjhKeubah}(h]jah ](j9j:eh"]h$]h&]j>j?)j@huh1jhjhKehjhhubjB)}(hhh]h)}(h!wrapper for seconds around msleeph]h!wrapper for seconds around msleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhK`hj~hhubah}(h]h ]h"]h$]h&]uh1jAhjhhhjhKeubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjhNhNubjj)}(h**Parameters** ``unsigned int seconds`` Requested sleep duration in seconds **Description** Please refere to msleep() for detailed information.h](h)}(h**Parameters**h]jt)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKdhjubj)}(hhh]j)}(h=``unsigned int seconds`` Requested sleep duration in seconds h](j)}(h``unsigned int seconds``h]j)}(hjh]hunsigned int seconds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKahjubj)}(hhh]h)}(h#Requested sleep duration in secondsh]h#Requested sleep duration in seconds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKahjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKahjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKchjubh)}(h3Please refere to msleep() for detailed information.h]h3Please refere to msleep() for detailed information.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKchjubeh}(h]h ] kernelindentah"]h$]h&]uh1jihjhhhNhNubjk)}(hhh]h}(h]h ]h"]h$]h&]entries](jwfsleep (C function)c.fsleephNtauh1jjhjhhhNhNubj|)}(hhh](j)}(h!void fsleep (unsigned long usecs)h]j)}(h void fsleep(unsigned long usecs)h](j)}(hvoidh]hvoid}(hjBhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>hhhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKubj)}(h h]h }(hjQhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>hhhjPhKubj)}(hfsleeph]j)}(hfsleeph]hfsleep}(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj>hhhjPhKubj)}(h(unsigned long usecs)h]j)}(hunsigned long usecsh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubj)}(hlongh]hlong}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubj)}(husecsh]husecs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjwubah}(h]h ]h"]h$]h&]hhuh1jhj>hhhjPhKubeh}(h]h ]h"]h$]h&]hhj3uh1jj4j5hj:hhhjPhKubah}(h]j5ah ](j9j:eh"]h$]h&]j>j?)j@huh1jhjPhKhj7hhubjB)}(hhh]h)}(h3flexible sleep which autoselects the best mechanismh]h3flexible sleep which autoselects the best mechanism}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKnhjhhubah}(h]h ]h"]h$]h&]uh1jAhj7hhhjPhKubeh}(h]h ](j^functioneh"]h$]h&]jcj^jdjjejjfjgjhuh1j{hhhjhNhNubjj)}(hX**Parameters** ``unsigned long usecs`` requested sleep duration in microseconds **Description** flseep() selects the best mechanism that will provide maximum 25% slack to the requested sleep duration. Therefore it uses: * udelay() loop for sleep durations <= 10 microseconds to avoid hrtimer overhead for really short sleep durations. * usleep_range() for sleep durations which would lead with the usage of msleep() to a slack larger than 25%. This depends on the granularity of jiffies. * msleep() for all other sleep durations. **Note** When ``CONFIG_HIGH_RES_TIMERS`` is not set, all sleeps are processed with the granularity of jiffies and the slack might exceed 25% especially for short sleep durations.h](h)}(h**Parameters**h]jt)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKrhjubj)}(hhh]j)}(hA``unsigned long usecs`` requested sleep duration in microseconds h](j)}(h``unsigned long usecs``h]j)}(hj"h]hunsigned long usecs}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKohjubj)}(hhh]h)}(h(requested sleep duration in microsecondsh]h(requested sleep duration in microseconds}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hKohj8ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj7hKohjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jt)}(hj]h]h Description}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jshj[ubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKqhjubh)}(h{flseep() selects the best mechanism that will provide maximum 25% slack to the requested sleep duration. Therefore it uses:h]h{flseep() selects the best mechanism that will provide maximum 25% slack to the requested sleep duration. Therefore it uses:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKqhjubj)}(hhh](j])}(hpudelay() loop for sleep durations <= 10 microseconds to avoid hrtimer overhead for really short sleep durations.h]h)}(hpudelay() loop for sleep durations <= 10 microseconds to avoid hrtimer overhead for really short sleep durations.h]hpudelay() loop for sleep durations <= 10 microseconds to avoid hrtimer overhead for really short sleep durations.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKthjubah}(h]h ]h"]h$]h&]uh1j\hjubj])}(husleep_range() for sleep durations which would lead with the usage of msleep() to a slack larger than 25%. This depends on the granularity of jiffies.h]h)}(husleep_range() for sleep durations which would lead with the usage of msleep() to a slack larger than 25%. This depends on the granularity of jiffies.h]husleep_range() for sleep durations which would lead with the usage of msleep() to a slack larger than 25%. This depends on the granularity of jiffies.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKvhjubah}(h]h ]h"]h$]h&]uh1j\hjubj])}(h(msleep() for all other sleep durations. h]h)}(h'msleep() for all other sleep durations.h]h'msleep() for all other sleep durations.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhKyhjubah}(h]h ]h"]h$]h&]uh1j\hjubeh}(h]h ]h"]h$]h&]jjuh1jhjhKthjubh)}(h**Note**h]jt)}(hjh]hNote}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jshjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhK{hjubh)}(hWhen ``CONFIG_HIGH_RES_TIMERS`` is not set, all sleeps are processed with the granularity of jiffies and the slack might exceed 25% especially for short sleep durations.h](hWhen }(hjhhhNhNubj)}(h``CONFIG_HIGH_RES_TIMERS``h]hCONFIG_HIGH_RES_TIMERS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is not set, all sleeps are processed with the granularity of jiffies and the slack might exceed 25% especially for short sleep durations.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/timers/delay_sleep_functions:120: ./include/linux/delay.hhK{hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jihjhhhNhNubeh}(h]sleepah ]h"]*sleep()ah$]h&]uh1hhj, hhhhhKsubeh}(h]*usleep-range-and-sleep-family-of-functionsah ]h"]0usleep_range*() and *sleep() family of functionsah$]h&]uh1hhhhhhhhKRubeh}(h]delay-and-sleep-mechanismsah ]h"]delay and sleep mechanismsah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj9footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjPerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j+j(j) j& j#j jjjju nametypes}(j+j) j#jjuh}(j(hj& j/jyjjjj j j j, jjo j j j j jjjjj;j@j#j(jjj5j:u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.