linux/fs/select.c
<<
>>
Prefs
   1/*
   2 * This file contains the procedures for the handling of select and poll
   3 *
   4 * Created for Linux based loosely upon Mathius Lattner's minix
   5 * patches by Peter MacDonald. Heavily edited by Linus.
   6 *
   7 *  4 February 1994
   8 *     COFF/ELF binary emulation. If the process has the STICKY_TIMEOUTS
   9 *     flag set in its personality we do *not* modify the given timeout
  10 *     parameter to reflect time remaining.
  11 *
  12 *  24 January 2000
  13 *     Changed sys_poll()/do_poll() to use PAGE_SIZE chunk-based allocation 
  14 *     of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian).
  15 */
  16
  17#include <linux/kernel.h>
  18#include <linux/sched.h>
  19#include <linux/syscalls.h>
  20#include <linux/export.h>
  21#include <linux/slab.h>
  22#include <linux/poll.h>
  23#include <linux/personality.h> /* for STICKY_TIMEOUTS */
  24#include <linux/file.h>
  25#include <linux/fdtable.h>
  26#include <linux/fs.h>
  27#include <linux/rcupdate.h>
  28#include <linux/hrtimer.h>
  29
  30#include <asm/uaccess.h>
  31
  32
  33/*
  34 * Estimate expected accuracy in ns from a timeval.
  35 *
  36 * After quite a bit of churning around, we've settled on
  37 * a simple thing of taking 0.1% of the timeout as the
  38 * slack, with a cap of 100 msec.
  39 * "nice" tasks get a 0.5% slack instead.
  40 *
  41 * Consider this comment an open invitation to come up with even
  42 * better solutions..
  43 */
  44
  45#define MAX_SLACK       (100 * NSEC_PER_MSEC)
  46
  47static long __estimate_accuracy(struct timespec *tv)
  48{
  49        long slack;
  50        int divfactor = 1000;
  51
  52        if (tv->tv_sec < 0)
  53                return 0;
  54
  55        if (task_nice(current) > 0)
  56                divfactor = divfactor / 5;
  57
  58        if (tv->tv_sec > MAX_SLACK / (NSEC_PER_SEC/divfactor))
  59                return MAX_SLACK;
  60
  61        slack = tv->tv_nsec / divfactor;
  62        slack += tv->tv_sec * (NSEC_PER_SEC/divfactor);
  63
  64        if (slack > MAX_SLACK)
  65                return MAX_SLACK;
  66
  67        return slack;
  68}
  69
  70long select_estimate_accuracy(struct timespec *tv)
  71{
  72        unsigned long ret;
  73        struct timespec now;
  74
  75        /*
  76         * Realtime tasks get a slack of 0 for obvious reasons.
  77         */
  78
  79        if (rt_task(current))
  80                return 0;
  81
  82        ktime_get_ts(&now);
  83        now = timespec_sub(*tv, now);
  84        ret = __estimate_accuracy(&now);
  85        if (ret < current->timer_slack_ns)
  86                return current->timer_slack_ns;
  87        return ret;
  88}
  89
  90
  91
  92struct poll_table_page {
  93        struct poll_table_page * next;
  94        struct poll_table_entry * entry;
  95        struct poll_table_entry entries[0];
  96};
  97
  98#define POLL_TABLE_FULL(table) \
  99        ((unsigned long)((table)->entry+1) > PAGE_SIZE + (unsigned long)(table))
 100
 101/*
 102 * Ok, Peter made a complicated, but straightforward multiple_wait() function.
 103 * I have rewritten this, taking some shortcuts: This code may not be easy to
 104 * follow, but it should be free of race-conditions, and it's practical. If you
 105 * understand what I'm doing here, then you understand how the linux
 106 * sleep/wakeup mechanism works.
 107 *
 108 * Two very simple procedures, poll_wait() and poll_freewait() make all the
 109 * work.  poll_wait() is an inline-function defined in <linux/poll.h>,
 110 * as all select/poll functions have to call it to add an entry to the
 111 * poll table.
 112 */
 113static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
 114                       poll_table *p);
 115
 116void poll_initwait(struct poll_wqueues *pwq)
 117{
 118        init_poll_funcptr(&pwq->pt, __pollwait);
 119        pwq->polling_task = current;
 120        pwq->triggered = 0;
 121        pwq->error = 0;
 122        pwq->table = NULL;
 123        pwq->inline_index = 0;
 124}
 125EXPORT_SYMBOL(poll_initwait);
 126
 127static void table = 
 u:8.6.12.1"
	  >
  v2.6.12.12clude <1;__polremove" namfile;

 u:8.elect.c#L123" id="L1ss="sref">filp, spng" al6.17.7
 u:8.elect.c#L123" id="L1ss="lp, >
cfpu"lp, 
 u:8.elect.c#L123" id="L1_pollwait" class="sref">__pXPORT_SYMBOL" class="sref"iass="srefaccess.h|include/asm-xte1nsa/u1ccess.class="sref">inline_indexcess.h>
  311
 116void poll_initwait(struct    href="+code=tv" class="1a> * Estima1te ex13href="+code=entry" class="sref">entry;
4"> 114           122         = 0;
PORT_SYMBOL" class="sref"iEXPORT_SY id="L35" class="line" n1ame="13slack_ns" clalack" class="sref">iine" name="L123"22">PORT_SYMBOL" class="sref"iait);ent"> * After quite a bi1t of 13slack_ns" clad="L" id="L125" clasiine" name="L123"22">  iine" name="L123"22">lect.c#L85" id="L85" ">NULL;
 123       k" class="sref">iine" name="L123"22">++ruct  * a simple thin1g of 13117" class="lcurrent" class="sref">cf26
NULL;
        struct23" cla  95iine" name="L123"22">XPORT_SYMBOL" class="sref"include &18">  38 114           " class="line" name="L92"1pan class1="comment"> * "nice1"14"+code=current" class=next" class="sref">next;
  94        struct next;
neols="line" name="Lolsref="+code=poll_table_entry"1cess.h * Consider this comme1nt an14 id="L31" class="line" name=1class="li1ne" name="L42">  42<1span 14de=tv_sec" class="sre" name="L94">  94        struct          114          " class="line" name="L99">  99        ((unsig"+code=poll_table_entry"1c     Changged sys_poll()/do_poll() me="14address" class="sref"do" class="line" name="L92"1p>
  94        struct cf26

 u:8.6"+code=poll_table_entry"1cait);)
        struct  114          " class="line" name="L99        struct time1spec<14117" class="lcurrent" class="sref">cols="line" name="Lolsref= 122         114          "+code=poll_table_entry"1cnclude &1/a>)
c4"> 114           122         114          " class="line" name=  93        struct   49        l1ong <15"+code=current" class class="sref">cf26cols="line" name="Lolsref=6"+code=poll_table_entry"1">  50        int inline_indexor = 11000;
inline_indexolass="li1="sref">tv-> 124}
  53           1     retu1rn 0;
 127static void table =  116void  114           53">  53           1 EXPORT_SY">task_nice(1divfactor = next;
ne22" class="line" name="L122"> 122         114          " class="line" name=22" class="line" name="L122">PORT_SYMBOL" class="sref"actor1 / 5;
    1ass="sref1">NSEC_PER_SEC/ 114          " class="line" name=23" class="line" name="L123"> 123       ect.c#L85" id="L85" N_INLINE_ect.cENTRIESf="+code=pwq" cl_INLINE_ect.cENTRIES     53">  53           159   1             return  114          " class="line" name=23" cla  95        struct23" cla  95o"> 114          " class="line" name=23" class="line" name="L123"> 123      ++PORT_SYMBOL" class="sref"MAX_SLACK1;
tv_nsec / ne22" class="line" name="L122"> ||ass="line" name="L97">  97
  98#define NSEC_PER_SEC/next;
nenew="fs/select.c#L114" inew="fs/s22">PORT_SYMBOL" class="sref"ivfactor<1/a>);
  53           1 class="s1ref">slack > nenew="fs/select.c#L114" inew="fs/s22"> 12s="line" name="L127"> 127statihref="fs/select.c#L93" id="L93" class="lt" class="sref">c_".c#Lf26   1             return nenew="fs/select.c#L114" inew="fs/s22"> " class="line" name="L92"1a="sref">1;
c4"> 114          elect.c#L121" id="L121" class="line" name="L121"> 12-class="line" namNOMEM4}
PORT_SYMBOL" class="sref"ictor1L67">  67        ret1urn <16117" class="lcurrent"t" class="sref"w" class="sref" href="+code=pwq" class="sref">pwq->slack<1/a>;
inline_indexL68">  681}
cnew="fs/select.c#L114" inew="fs/s22">" class="line" name="L99">  99        ((unsig 122        " class="line" name="L99        struct pwq->time1spec<171+code=current" class2        " class="line" name=  93        struct PORT_SYMBOL" class="sref"sref">tv<1/a>)
c4"> 114          elect.c#L121" id="L122" class="line" name="L122"> 122        PORT_SYMBOL" class="sref"name="L721">  72        unsign1ed lo17de=tv_sec" class="sre" name="L94">  22" class="line" name="L122"> 122        PORT_SYMBOL" class="sref"nvfactor<1spec" class="sref">times1pecinline_indexLclass="s1;
  717slack_ns" cla="sref"w" class="sref"22" class="line" name="L122">" class="line" name="L99">  99        ((unsign+PORT_SYMBOL" class="sref"s="commen1t">         * Realtime t1asks 1et a sclass="sref">inline_indexLctor1 class="line" name="L77"1>  771/a>    1     */
class="skf="fs/select.c#L_"ass="skfL98" class="line" naef">filefilehref,ss="line" +code=filp" clam clfile" class="srm clhref,slack" class="sref">syn
  99      ke"     53">  53           1_task" cl1ass="sref">rt_task(<1a hre1="+cod class="line" name="L92"1s/select.1c#L80" id="L80" class="l1ine" 181+code=currenL116" class="line" name="L116"> 116void poll_initwait(st 122        hrefelect.c#L119" id="L11rivatf="fs/select.c#L9rivatf22">PORT_SYMBOL" class="sref"     retu1rn 0;
NULL;
 119      6"+code=poll_table_entry"1_ts" clas1s="sref">ktime_get_ts(&am18de=divfactor" class="sref">d1t1v1  100
__estimate_accuracy(&am18, and it's practical. Ifffffffff* Althoughpan>
<109" id="lassals="l" cla ss="ode=p lohe
->/*
->


_up()"  100
  881}
  819
  910
error = 0;
 120   1"+code=poll_table_entry"1"ts" clas1struct d1ge" class1="sref">poll_table_page<1/a> *19 100
poll_table_entry * <19, and it's practical. Ifffffffff* Pereturnnamedefault"an>
clasoper41" iduselect dummy"> 100
         /*
->hy it.noslacereace> 103 * " class="1sref">POLL_TABLE_FULL(
PAGE_S2ZE + (unsigned long)2
_up_8" id="f="cin bmeused dir=c;hy
_fs/selecfile" class="srdefault_an>
_fs/selecL98" ="line" name="L118">dummy_ss="file" class="srdummy_ss="href,s#L85" id="L85" m clfile" class="srm clhref,s" class="sref">syn
  99      ke"     " name="L19">  19#incl#inclade a complicated, but s2raigh2forwarclass="sref">inline_inde2I have re2ritten this, taking some2short20me="L53">  53           2, but it 2hould be free of race-co2ditio20 id=" class=lack" class="sref">ass="skf="fs/select.c#Lass="skfL98" class="line" naef">filefilehref,ss="line" +code=filp" clam clfile" class="srm clhref,slack" class="sref">syn
  99      ke"     53">  53           2"> * unde2stand what I'm doing2here,20curre class="line" name="L92"2name="L102"> 106next;
table = 
 u:8." name="L19">  19#incllude <"L107" class="line" name2"L10720a>    2* Two ver2 simple procedures, poll2wait(20pollwait" class="sref">__pol"L99">  99        ((unsig 122          99      contaedur_ofL98" class="line" naef">file" class="sref">href,s=next" class="sref">next;
tableollwait(struct href " name="L19">  19#inc work.  p2ll_wait() is an inline-f2nctio21href="+code=sl=now" class="sref"ke">  99      ke"     ="lin="lin !shref="+code=entw" class="sref"ke">  99      ke"     ="line" name="L94">  94        struct   99      ke"      53">  53           2nt"> * as2all select/poll function2 have211+code=current" class="sref">current))
 1112/a>file" class="sref">href,s#L85" id="L85" m clfile" class="srm clhref,s" class="sref">syn
  99      ke"     " name="L19">  19#incL112" id=2L112" class="line" name=2L112"21orwarclass="sref">inline_inde2ait_queue2head_t *  53           2e=poll_ta2le" class="sref">poll_ta2le
p)2
 */
 113static void __pollwait(struct file *filp, 2wqueues" 2lass="sref">poll_wqueues2/a> *217lack_ns" class="srefcurrent"ait" class="sref">__polhref="fs/select.c#L114" id="L114" class="line" name="L114"> 114           e_head_t" class="sref">2wlude < *pt,  116void poll_initwait(st 122          99      contaedur_ofL98" class="line" na4"> 114          ,s=next" class="sref">next 116void init_ " name="L19">  19#incclass="sr2f">polling_task = next;
table = 
 u:8. 122        poll_initwait(st " name="L19">  19#incct"> * as2">pwq->nespng" al6.17.7
 u:8.6.12.1"
	  >
  v2.6.12.12e=pwq" cl2ss="sref">pwq->  19#incc112" id=2e" class="sref">table 113sta.c#Lf"L1 id="twait" class="s_pollwait" class="sref">__pXPORT_SYMBOL" class="sref2sref">pwq2/a>->
 u:8.elect.c#L123" id="L1_pollwait" class="sref">__p 122        __pPORT_SYMBOL" class="sref2s=poll_ta2
 u:8.elect.c#L123" id="L1ss="sref">filp, filp, p)2MBOL(
 u:8.elect.c#L123" id="L1ke">  99      ke"     122         114          " class="line" name=_ke">  99      _ke"    PORT_SYMBOL" class="sref2squeues" 2
spng" al6.17.7
 u:8.elect.c#L123" id="L1ss="lp, 
 u:8.elect.c#L123" id="L1ss="lp,  122         = 0;
__polde=" namfile;
fref">filp, spng" al6.17.7
 u:8.elect.c#L123" id="L1ss="lp, inline_inde2iass="sre2access.h|include/asm-xte2nsa/u23 id="L90" class="line" name=2cess.h>
ass=+id="Lul/a "L37" d  116void poll_initwait(st,slack" class="sref">statf="fs/select.c#Lstatf_queue_head_t" class="sref">2"L31">  321
__polselect d         struct xpir/ahref,ss="line" s="line" name="L48">  48{

  v2.6.12.12ct.c#L33"2 id="L33" class="line" n2ame="233">   href="+code=tv" class="2a> * Estima2te ex23href="+code=elack" class="sref">r
 12-class="line" namINTRpoll_ini2iait)2ent"> * After quite a bi2t of 237a href="+code=now" class="sset_a>->_statf="fs/select.c#Lset_a>->_statfL98" class="line" nastatf="fs/select.c#Lstatf_queXPORT_SYMBOL" class="sref2ilude <omment"> * a simple thin2g of 23 id="L57" class="!class="sref">neor = 0;
 1206.12.1"
	  >
  v2.6.12.12ct" class28">  38 12class="line" nasd="Lul/ahr "L37" _ranef="fs/select.c#Lsd="Lul/ahr "L37" _ranefL98" class="line" nasxpir/a>        struct xpir/ahref,sne" name="L48">  48{
HRTIMER_MODE_ABSf="+code=pwq" cHRTIMER_MODE_ABS_queXPORT_SYMBOL" class="sref2pan class2="comment"> * "nice2"24"+code=currens="comment"> */->_statf="fs/select.c#L->_statfL98" class="line" naTASK_RUNNING="fs/select.c#LTASK_RUNNING_queXPORT_SYMBOL" class="sref2pass="sre2 id="L40" class="line" n2ame="24 id="L90" class="line" name=2cess.h * Consider this comme2nt an24code=error" clclass="line" name="L100"> 100
  42<2span 24orward multiple_wait() functtttttttt* Preparead="Lnameuct  iter41" i        /*
clasfs/s""sys visible aftla ss>
clatime2spec<24 107 120panear19<"  100

  49        l2ong <25defined in <linux/poll.h&easons.  50        int  * poll taeasons.
tv->neor = 0;
 120, 0XPORT_SYMBOL" class="sref2"     Cha2c#L53" id="L53" class="l2ine" 2ame="L53">  53           2     retu2rn 0;
timer_slack_n
PORT_SYMBOL" class="sref2"EXPORT_S2">task_nice(inline_inde2s="sref">2divfactor =  124}
    2ass="sref2">NSEC_PER_SEC/
  83 variref"ad="Lnamefinal  "L37" id 100
tv_nsec / @sec:aeasons.sed="Ls (fromeuser a>
NSEC_PER_SEC/

slack >   83 d="Lnameuser a>
valren"l="fsat.lacereacest;,2;
2L67">  67        ret2urn <26 107Rs="srs -EINVALass=sed/nsec areanamenormalized. Ot#L1wise 0;
  682}
ass=+i111" /set_ "L37" d   83="line" name="L13">  83 =  83="line" name="Lsec, s="line" name="L48">n 83="line" name="Lnsec6.12.1"
	  >
  v2.6.12.12+code=tim2espec" class="sref">time2spec<271+cod href="+code=tv" class="2sref">tv<2/a>)
  83="line" name="L13">  83 ass="line" name=>                t_que 12{..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322"> 12class="line" nas83="line" name="Lsec, ..c#L119" id="L1tv_n 83="line" name="Ltv_n 8322"> 12class="line" nan 83="line" name="Lnsecentries" class="sref">ent2name="L722">  72        unsign2ed lo27de=divfactor" class="sref">d2nvfactor<2spec" class="sref">times2pecne23">  83_valis="line" name="L13">  83_valisL98" ="line" name="L118">=>                t_que  53">  53           2Lclass="s2;
PORT_SYMBOL" class="sref2" id="L752" class="line" name="L752">  727twait" class="sref">poll_ini2s="commen2t">         * Realtime t2asks 277a href="+codetors limit (Tigran Ai/* Op13"ize d="Lnamezeroe "L37"  valuec#L10l le.
  7727 id="L57" class="!class="sref">nes83="line" name="Lsec ="lin="lin !ne" name="L48">n 83="line" name="Lnsec6" class="line" name="L92"2     */
 12class="line" nato="line" name="L1oelect.c#L122" id="L12v_n 83="line" name="Ltv_n 8322"> 12>current))
rt_task(<2a hre28"+code=curren} else  class="line" name="L92"2s/select.2c#L80" id="L80" class="l2ine" 281+code=current" class2                       select.c#L=>L125" id="L125" clasto="line" name="L1oXPORT_SYMBOL" class="sref2     retu2rn 0;
  83_de="saff="fs/select.c#Lt3">  83_de="saffL125"= =>                t_que PORT_SYMBOL" class="sref2 ame="L722s="sref">ktime_get_ts(&am28ref="+code=NUclass="sref">inline_inde2t2v2 current))
__estimate_accuracy(&am28, andclass="sref">inline_inde2< id="L752t->poll_ini2a="commen2t->ass=+i111" /copy_remainingd   83="line" name="L13">  83 = ,  class="comment"> */2a#include2&<n3">val="line" name="L13">val>(st,slack" class="sref">="s
  v2.6.12.12a    */;
  882}
ne=3">  83="line" name="L13">  83 ass="line" namer=>               rtt_quePORT_SYMBOL" class="sref2"L89">  829
val="line" name="L13">val>(st ass="line" namer=v               rtv_quePORT_SYMBOL" class="sref2"    retu20
neod 
  v2.6.12.12ge" class2="sref">poll_table_page<2/a> *29="spoll_table_entry * <29* wq" class="sref">pwq-> ="lin"" class="sref">STICKY_TIMEOUTSf="+code=pwq" cSTICKY_TIMEOUTS_que6.12.1"
	  >
  v2.6.12.12g="commen20];
stickid };
    2" class="2sref">POLL_TABLE_FULL(
PAGE_S3ZE + (unsigned long)3nespd_ "L3 al6.17.7elect.c#L122" id="L12v_ 83="line" name="Ltv_ 8322"> ="lin="lin !ne" name="L48">spd_ "L3 al6.17.7elect.c#L122" id="L12v_n 83="line" name="Ltv_n 8322">6.12.1"
	  >
  v2.6.12.13able)3
="s#inc3ade a complicated, but s3raigh30ref="+code=NULL" class="srefselect.c#L=>               select.c#L=>L125"="line" name="L118">r=>               rtt_que PORT_SYMBOL" class="sref3I have re3ritten this, taking some3short30  83_sub="fs/select.c#Lt3">  83_subL125"= , e" name="L118">r=>               rtt_que PORT_SYMBOL" class="sref3I5have re3ref">poll_table_entryr=>               rtt_que..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322"> ect.c06.12.1"
	  >
  v2.6.12.13a6have re3roll_table_entry r=>               rtt_que..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322"> 12class="line" nar=>               rtt_que..c#L119" id="L1tv_n 83="line" name="Ltv_n 8322"> 12>current))
 106};
val="line" name="L13">val>(st6" class="line" name="L92"3* Two ver3 simple procedures, poll3wait(30pollwait" claef="+codss="sizeof"" class="sref">r=v               rtv_que) long)sizeof"" class="sref">r=v               rtv_que..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322">) +)sizeof"" class="sref">r=v               rtv_que..c#L119" id="L1tv_u 83="line" name="Ltv_u 8322">)6.12.1"
	  >
  v2.6.12.13 work.  p3ll_wait() is an inline-f3nctio31"+code=current" classss="sref" class="sref">mems"sr=v               rtv_que, 0,)sizeof"" class="sref">r=v               rtv_que) PORT_SYMBOL" class="sref3nt"> * as3all select/poll function3 have311+code=current" class" class="sref">r=v               rtv_que..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322"> 12class="line" nar=>               rtt_que..c#L119" id="L1tv_ 83="line" name="Ltv_ 8322">PORT_SYMBOL" class="sref3nL101" id3="line" name="L111"> 1113/a>cr=v               rtv_que..c#L119" id="L1tv_u 83="line" name="Ltv_u 8322"> 12class="line" nar=>               rtt_que..c#L119" id="L1tv_n 83="line" name="Ltv_n 8322"> /"w" class="sref" SEC_PER_USEC="line" name="L SEC_PER_USEC22">PORT_SYMBOL" class="sref3n#inc3L112" class="line" name=3L112"31de=divfactor" class="sref">d3ait_queue3head_t *necopy_to/user="fs/select.c#Lcopy_to/userL125" id="L125" clas4"> 114          ,s="line" name="L118">r=v               rtv_que, sizeof"" class="sref">r=v               rtv_que) 6.12.1"
	  >
  v2.6.12.13 5have re3le" class="sref">poll_ta3le="sp)3
poll_ini3wqueues" 3lass="sref">poll_wqueues3/a> *317lack_ns" cla} else l=no!class="sref">necopy_to/user="fs/select.c#Lcopy_to/userL125" id="L125" clas4"> 114          ,s="line" name="L118">r=>               rtt_que, sizeof"" class="sref">r=>               rtt_que  6.12.1"
	  >
  v2.6.12.13 8me="L103="spt, polling_task =  100
 * as3">pwq->valrin"="ad-only memory, we"> 100
pwq-> * poll taeasons. *3c112" id=3e" class="sref">table *3cit_queue3/a>-> *3c5have re3p)3MBOL(/*
))
stickid r"s6.12.1"
	  >
  v2.6.12.13imer.h>
cr"s="sinline_inde3"L31">  331
d3ct.c#L33"3 id="L33" class="line" n3ame="333">  #defass"" class="sref">FDS_IN               fd>, e" name="L118">cfile" class="srn22">)          " id="L125" clasfd>               fd>" class="line" name=23               in22">cfile" class="srn22">)vfactor" class="sref">d3c5have re3lass="comment"> * Estima3te ex33href=#defass"" class="sref">FDS_OUT               fd>, e" name="L118">cfile" class="srn22">)         " id="L125" clasfd>               fd>" class="line" name=7" d cfile" class="srn22">)vfactor" class="sref">d3c">p)3 id="L35" class="line" n3ame="33twait#defass"" class="sref">FDS_EX               fd>, e" name="L118">cfile" class="srn22">)          " id="L125" clasfd>               fd>" class="line" name="line" name="L123       a " class="sref">cfile" class="srn22">)vfactor" class="sref">d3cqueues" 3ent"> * After quite a bi3t of 337lackurrent))
 * a simple thin3g of 33 id="#defass"" class="sref">BITSf="+code=pwq" cBITSL125" id="L125" clasfd>               fd>, e" name="L118">cfile" class="srn22">)    "=                fd>, e" name="L118">cfile" class="srn22">)|=                fd>, e" name="L118">cfile" class="srn22">)|=                fd>, e" name="L118">cfile" class="srn22">))vfactor" class="sref">d3c Two ver38">  38 * "nice3"34"+cod class=lack" class="sref">max"i111" /fs="line" name="Lmax"i111" /fsL125"s="line" s="line" name="L48">cfile" class="srn22">, e" name="L118">fd/set_bi=>               fd/set_bi=>     =                fd>)vfactor" class="sref">d3pass="sre3 id="L40" class="line" n3ame="341+cod href="+code=tv" class="3cess.h * Consider this comme3nt an34code=error" cs="line" s="li=                open_fd>PORT_SYMBOL" class="sref3class="li3ne" name="L42">  42<3span 343ode=error" cs="line" s="li" class="sref">s"smax="line" name="LmaxPORT_SYMBOL" class="sref3c5have re3span>
PORT_SYMBOL" class="sref3c">p)3     (100 * poll_ini3cait)3)

time3spec<34117" class="line" name="L117s"s ="lin"" id="L125" clasBITS_PER_LONG="fs/select.c#LBITS_PER_LONG"1)) PORT_SYMBOL" class="sref3cnclude &3/a>)
__polcfile" class="srn22"> /12class="line" naBITS_PER_LONG="fs/select.c#LBITS_PER_LONGPORT_SYMBOL" class="sref3ine" name3="L49">  49        l3ong <35"+code=currens="comment"> */fdspwq->)PORT_SYMBOL" class="sref3iass="sre3>        int                open_fd> 122                       open_fd> a " class="sref">cfile" class="srn22">PORT_SYMBOL" class="sref3iess.herrmax="line" name="Lmax 12>current))
tv->s"s               fd>, e" name="L118">cfile" class="srn22">)current))
s"sp)3">task_nice(s"s               open_fd>))vfactor" class="sref">d3s="sref">3divfactor = .c#Lmax="line" name="L.c#Lmax22">PORT_SYMBOL" class="sref3ilude <3 / 5;
PORT_SYMBOL" class="sref3include &3">NSEC_PER_SEC/inline_inde359   3             return inline_inde35ass="sre3;
6" class="line" name="L92"3Mr = 3sref">tv_nsec / copen_fd>               open_fd>--PORT_SYMBOL" class="sref3ass="sref3">NSEC_PER_SEC/  cfile" class="srn22">--PORT_SYMBOL" class="sref3a     Cha3/a>);
               fd>, e" name="L118">cfile" class="srn22">)current))
slack > nes8sp)3             return ))
3;
s"s               open_fd>)urrent))
  67        ret3urn <36117" class="lcurrent"t" classss="sre-class="line" namBADFPORT_SYMBOL" class="sref3ass="sref3/a>;
errmax="line" name="Lmax)urrent))
  683}
time3spec<371+cod" class="sref">.c#Lmax="line" name="L.c#Lmax22">:urrent))
tv<3/a>)
  72        unsign3ed lo37de=tv_sec" class="sret"ait" class="sref">errmax="line" name="Lmax++current))
times3pecerrs"s;
p)3" class="line" name="L753">  737slack_ns" class="sref" class="sref">max="line" name="Lmax +12class="line" nanfile" class="srn22"> *2class="line" naBITS_PER_LONG="fs/select.c#LBITS_PER_LONGPORT_SYMBOL" class="sref3s="commen3t">         * Realtime t3asks 377a href="+cod}lass="sref">inline_inde3Lctor3 class="line" name="L77"3>  7737a>    3     */
max="line" name="LmaxPORT_SYMBOL" class="sref3_task" cl3ass="sref">rt_task(<3a hre38code=class="sref">inline_inde3s/select.3c#L80" id="L80" class="l3ine" 38 id="L90" class="line" name=3     retu3rn 0;
POLLIN_SETPOLLRDBANDPOLLINPOLLHUPPOLLERRktime_get_ts(&am38ref="#defass"" class="sref">POLLOUT_SETPOLLWRNORMPOLLOUTPOLLERRt3v383">  #defass"" class="sref">POLLEX_SET__estimate_accuracy(&am38*-> */ namfkey_s8shref,ss="line" s="li" class="sref">23               in22">ue_head_t" class="sref">3a="commen3t->7" d b="file" class="srbit6urrent))
 *__polss="file" class="sref">href" class="line" name=_ke">  99      _ke"     12class="line" naPOLLEX_SET  883}
<="lin"" class="sref">b="file" class="srbit6urrent))
  839
ss="file" class="sref">href" class="line" name=_ke">  99      _ke"     |12class="line" naPOLLIN_SETb="file" class="srbit6urrent))
  ss="file" class="sref">href" class="line" name=_ke">  99      _ke"     |12class="line" naPOLLOUT_SETpoll_table_page<3/a> *39inline_inde3"ss="sref3ref">poll_table_entry * <39* do"i111" cfile" class="srn22">, e" name="L118">fd/set_bi=>               fd/set_bi=>     =                fd>,s=next" class="sref">ne=3">  83="line" name="L13">  83 = 6urrent))
};
  ,s= POLL_TABLE_FULL( 116void PAGE_S4ZE + (unsigned long)4 */href="fs/select.c#L114" id="L114" class="line" name="L11ss="file" class="sref">hrefPORT_SYMBOL" class="sref4f1>PAGE_S4Z
="sval="line" name="L="sval22">, e" name="L118">i               i22">, e" name="L118">elecd_7" d  12>current))
{
d4I have re4ritten this, taking some4short40{
poll_table_entry="sval="line" name="L="sval22"> 12class="line" namax"i111" /fs="line" name="Lmax"i111" /fsL125"" class="sref">cfile" class="srn22">, e" name="L118">fd>               fd>)"+code=poll_table_entry"4I6have re4roll_table_entry {
};
 ect.c06.12.1"
	  >
  v2.6.12.14* Two ver4 simple procedures, poll4wait(40pollwait" claef="+cod="sref"" class="sref">="sval="line" name="L="sval22">"+code=poll_table_entry"4 work.  p4ll_wait() is an inline-f4nctio41"+code=currens="comment"> */nfile" class="srn22"> 12class="line" nar"sval="line" name="L="sval22">"+code=poll_table_entry"4 1>PAGE_S4all select/poll function4 have41 id="L90" class="line" name=4nL101" id4="line" name="L111"> 1114/a>errd="L1#L11ss="file" class="srd="L1#L11ss="L125"="line" name="L118">=fs/select.c#L114" i14" class6"+code=poll_table_entry"4n#inc4L112" class="line" name=4L112"41ref="+code=NULL" class="srefss="file" class="sref">href 12="line" name="L118">=fs/select.c#L114" i14" class..c#L119" id="L11"file" class="srd>hrefPORT_SYMBOL" class="sref4ait_queue4head_t * ="lin="lin !ne" name="L48">spd_ "L3 al6.17.7elect.c#L122" id="L12v_ 83="line" name="Ltv_ 8322"> ="lin="lin !ne" name="L48">spd_ "L3 al6.17.7elect.c#L122" id="L12v_n 83="line" name="Ltv_n 8322">6" class="line" name="L92"4 5have re4le" class="sref">poll_ta4le  ss="file" class="sref">href" class="line" name=_qpro3="line" name="L_qpro3 12class="line" naNULLp)4
elecd_7" d  121"+code=poll_table_entry"4wqueues" 4lass="sref">poll_wqueues4/a> *417a href="+cod}lass="sref">inline_inde4 8me="L104    4f Two ver4"sref">pt, end_ "L3 al6.17.7 ="lin="lin !ne" name="L48">elecd_7" d 6.12.1"
	  >
  v2.6.12.14class="sr4f">polling_task = cs 48{
end_ "L3 al6.17.76"+code=poll_table_entry"4ct"> * as4">pwq->pwq->err="sval="line" name="L="sval22"> 12>current))
table-> 114     rin4,s=  114     r7" 4,s=  114     rex4,s=  114     in4,s=  114     7" 4,s=  114     ex4current))
p)4MBOL(in4"> 114     in4 122                       fd>" class="line" name=23               in22">n"" class="sref">7" 4"> 114     7" 4 122                       fd>" class="line" name=7" d ex4"> 114     ex4 122                       fd>" class="line" name="line" name="L123      current))
 114     rin4 122                       fd>" class="line" name=res_23               res_23id="n"" class="sref">r7" 4"> 114     r7" 4 122                       fd>" class="line" name=res_7" d rex4"> 114     rex4 122                       fd>" class="line" name=res_"line" name="L123res_"l    current))
    4s Two ver4lt;i               i22"> 12>c e" name="L118">i               i22"> ect.cs="comment"> */nfile" class="srn22">; ++  114     rin4,s++  114     r7" 4,s++  114     rex46" class="line" name="L92"4imer.h>
, e" name="L118">7" d                a"L1bi=>    ,sss="line" name=b="file" class="srbit 121,sss="line" name=mas{
{
res_7" d res_"line" name="L123res_"l     12>current))
 12class="line" naNULL  341
  53           4c5have re4lass="comment"> * Estima4te ex43ode=MAX_SLACK" class=ass="sress="line" name=23               in22"> 12=  114     in4++n"" class="sref">7" d  114     7" 4++n"" class="sref">"line" name="L123       12=  114     ex4++current))
p)4 id="L35" class="line" n4ame="43slack_ns" class="sref" class=ss="line" name=a"L1bi=>               a"L1bi=>     12class="line" na23               in22"> |"" class="sref">7" d "line" name="L123      current))
 * After quite a bi4t of 437lack_ns" class="srefcurrent"ss="" class="sref">a"L1bi=>               a"L1bi=>     112>6" class="line" name="L92"4i8me="L104omment"> * a simple thin4g of 43117" class="lcurrent"t" classsssssssse" name="L118">i               i22"> +12class="line" naBITS_PER_LONG="fs/select.c#LBITS_PER_LONGPORT_SYMBOL" class="sref4c Two ver48">  38 * "nice4"44"+code=current" classef="+cod}lass="sref">inline_inde4pass="sre4 id="L40" class="line" n4ame="44 id="L90" class="line" name=4cess.h * Consider this comme4nt an44id="L71" clascurrent"""""""""d="L(e" name="L118">j/a>{
j/a>{
 */BITS_PER_LONG="fs/select.c#LBITS_PER_LONGPs++ {
, e" name="L118">b="file" class="srbit ect.ect.1216" class="line" name="L92"4class="li4ne" name="L42">  42<4span 44de=tv_sec" class="sret"ait" ccccccccclack" class="sref">fput_needes="line" name="Lfput_needesPORT_SYMBOL" class="sref4c     Cha4gged sys_poll()/do_poll(4 me="44 ecla  s="comment"> */nfile" class="srn22">6.12.1"
	  >
  v2.6.12.14c5have re4span>
p)4     (100 * b="file" class="srbit e"lin"" class="sref">a"L1bi=>               a"L1bi=>    ))vfactor" class="sref">d4cait)4)
))
time4spec<44117" class="lcurrent"t" classsssssssse" name="L118">fileelect.c#L114" i=poe     12class="line" naf.c#Llighsi               i22">, ="line" name="L118">fput_needes="line" name="Lfput_needes6"+code=poll_table_entry"4cnclude &4/a>)
  49        l4ong <45"+code=current" classef="+codt" classsssssssse" name="L118">f_opelect.c#L114" i=_op 12class="line" nafileelect.c#L114" i=poe    elect.c#L123" id="L1=_opelect.c#L114" i=_op"+code=poll_table_entry"4iass="sre4>        int mas{
{
 ="lin="lin w" class="sref"f_opelect.c#L114" i=_opelect.c#L123" id="L11oll="line" name="L1oll    6" class="line" name="L92"4ilass="li4="sref">tv-> namfkey_s8shref,sss="line" name=23               in22">, e" name="L118">7" d mas{
elect.c#L123" id="L11oll="line" name="L1oll    6ow" class="sref"fileelect.c#L114" i=poe    ,sss="line" name=ss="file" class="sref">href6"+code=poll_table_entry"4i5have re4rn 0;
inline_inde4"">p)4">task_nice(fput_lighs4divfactor = errmas{
<="lin"" class="sref">b="file" class="srbit66" class="line" name="L92"4i8me="L104 / 5;
res_23               res_23id=" |12class="line" nab="file" class="srbit"+code=poll_table_entry"4snclude &4">NSEC_PER_SEC/resval="line" name="L="sval22">++current))
ss="file" class="sref">href" class="line" name=_qpro3="line" name="L_qpro3 12class="line" naNULL;
inline_inde4Mr = 4sref">tv_nsec / errmas{
b="file" class="srbit66" class="line" name="L92"4ass="sref4">NSEC_PER_SEC/res_7" d );
resval="line" name="L="sval22">++current))
slack > ss="file" class="sref">href" class="line" name=_qpro3="line" name="L_qpro3 12class="line" naNULLp)4             return inline_inde4M="sref">4;
errmas{
b="file" class="srbit66" class="line" name="L92"4a8me="L104L67">  67        ret4urn <46117" class="lcurrent"t" classt" classsssssssssssssssse" name="L118">res_"line" name="L123res_"l     |12class="line" nab="file" class="srbit"+code=poll_table_entry"4anclude &4/a>;
resval="line" name="L="sval22">++current))
  684}
ss="file" class="sref">href" class="line" name=_qpro3="line" name="L_qpro3 12class="line" naNULLtime4spec<471+code=current" classef="+codt" classssssssss}lass="sref">inline_inde4sref">tv<4/a>)
inline_inde4sss="sref4">  72        unsign4ed lo47de=tv_sec" class="sret"ait" c}lass="sref">inline_inde4s     Cha4spec" class="sref">times4pecd4Lclass="s4;
 114     rin4 12class="line" nar"s_23               res_23id="nvfactor" class="sref">d4L">p)4" class="line" name="L754">  747slack_ns" class="sreft"ait" css="lass="line" nam="s_7" d d4L="sref">4t">         * Realtime t4asks 477lack_ns" class="srefffffffffffffffff=  114     r7" 4 12class="line" nar"s_7" d d4L8me="L104 class="line" name="L77"4>  7747117" class="lcurrent"t" classss="lass="line" nam="s_"line" name="L123res_"l    )vfactor" class="sref">d4Lnclude &4span>
 114     rex4 12class="line" nar"s_"line" name="L123res_"l    current))
rt_task(<4a hre48"+code=current" classss="sref" class="sref">cond_resches="line" name="Lcond_reschesL125"6"+code=poll_table_entry"4s/select.4c#L80" id="L80" class="l4ine" 481+code=current" class}lass="sref">inline_inde4     retu4rn 0;
css="file" class="sref">href" class="line" name=_qpro3="line" name="L_qpro3 12class="line" naNULLktime_get_ts(&am48de=tv_sec" class="sress="lass="line" nam="sval="line" name="L="sval22"> ||"" class="sref">elecd_7" d  ||"" class="sref">"linal_pendingd pwq->d4      Cha4+code=tv" class="sref">t4v48__estimate_accuracy(&am48ode=MAX_SLACK" class=ss="" class="sref">=fs/select.c#L114" i14" class..c#L119" id="L1error="fs/select.c#Lerror    6" class="line" name="L92"4< id="L754t-> 12class="line" na=fs/select.c#L114" i14" class..c#L119" id="L1error="fs/select.c#Lerror    PORT_SYMBOL" class="sref4 ="sref">4t->inline_inde4 nclude &4/a>;
  884}
 100
  849


 * poll taeasons.<<<<<<<< *4"ame="L724struct poll_table_page<4/a> *49ts: This code may not be eastttttttt<<<<<<<
poll_table_entry * <49ode=MAX_SLACK" class=ss="" class="sref">end_ "L3 al6.17.7 ="lin="lin !ne" name="L48">eo="line" name="L1o6" class="line" name="L92"4  id="L754poll_table_entry  12class="line" na=3">  83_to_k "L3 al6.17.7  83_to_k "L3L125"= 6PORT_SYMBOL" class="sref4"="commen40];
eo="line" name="L1o 12="line" name="L118">expir/ al6.17.7PORT_SYMBOL" class="sref4"8me="L104/a>};
inline_inde4L    */POLL_TABLE_FULL(PAGE_S5ZE + (unsigned long)5ned="L1schesule_elec7" ="line" name="L1oll1schesule_elec7" L125"="line" name="L118">=fs/select.c#L114" i14" class,sss="line" name=TASK_INTERRUPTIBLEelect.c#L114" iTASK_INTERRUPTIBLElass,ORT_SYMBOL" class="sref5f1>PAGE_S5Z
eo="line" name="L1o,sss="line" name=s 48{
d5#L101" id5"L101" class="line" name5"L10150id="L71" clascurrent"t" class" class="sref">elecd_7" d  121"+code=poll_table_entry"5#3101" id5"truct inline_inde5I have re5ritten this, taking some5short50me="L53">  53           5I5have re5ref">poll_table_entry1oll1freess="file" class="srd="L1freess="L125"="line" name="L118">=fs/select.c#L114" i14" class6PORT_SYMBOL" class="sref5I6have re5roll_table_entry poll_ini5I7have re5r];
="sval="line" name="L="sval22">"+code=poll_table_entry"5n8me="L105"a>};
inline_inde5I9me="L105"ref">POLL_TABLE_FULL 100
 100
 1115/a> * poll ta* likme 1 be"certain this leadse 1 no pro" cms. So Ia="sref"> 100
 100
poll_ta5le *5f">p)5
poll_wqueues5/a> *517a hrd multiple_wait() funct*le.
core_sys_i111" cfile" class="srn22">, e" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     in4,se" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     7" 4,n>
pt, fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     ex4,s=next" class="sref">ne=3">  83="line" name="L13">  83 = 6urrent))
polling_task =  * as5">pwq->               fd/set_bi=>     ss="line" name=fd>               fd>"+code=poll_table_entry"5cL101" id5ss="sref">pwq->               bi=>    "+code=poll_table_entry"5c3101" id5e" class="sref">table="s="line" name="L="s,se" name="L118">max"fd>               max"fd>    "+code=poll_table_entry"5cit_queue5/a>->siz3 al6.17.7PORT_SYMBOL" class="sref5s">p)5MBOL(
               stack"fd>lack[ id="L125" clasSELECT_STACK_ALLOC               SELECT_STACK_ALLOClack/siz3of(s="l)]PORT_SYMBOL" class="sref5s8me="L105;    5s Two ver5lt;__pol="s="line" name="L="s 12-class="line" namINVALnfile" class="srn22"> ect.c06.12.1"
	  >
  v2.6.12.15iass="sre5access.h|include/asm-xte5nsa/u531+code=current" classgotok" class="sref">out_nofd>               out_nofd>PORT_SYMBOL" class="sref5iL101" id5>>

"cassincrease, s1 grab it oncme 1 a clasracme*le.
{
 * Estima5te ex535ef="+code=NU" class="sref">fdspwq->p)5 id="L35" class="line" n5ame="536a href="+code=now" class="smax"fd>               max"fd>     122                       max"fd>    "+code=poll_table_entry"5cqueues" 5ent"> * After quite a bi5t of 537lack_ns" clae=now" class="srcu_="ad_unlo8{
 * a simple thin5g of 53 id="L57" class="lass="line" namnfile" class="srn22"> egt.cs="comment"> */max"fd>               max"fd>    6.12.1"
	  >
  v2.6.12.15i Two ver58">  38 12class="line" namax"fd>               max"fd>    "+code=poll_table_entry"5pan class5="comment"> * "nice5"54"+cod+code=poll_table_entry"5pass="sre5 id="L40" class="line" n5ame="541e=tv_sec" cletors limit (Tigran Ai/*e.
 * Consider this comme5nt an54n class="comment"> * poll taeasons.<* We"need 6 bi=maps (in/out/ex d="Lbothsincoming"and outgoing),e.
  42<5span 54orward multiple_wait() functtttttttt* sincmewe used fd>etewe need  1 alpocate memory inds=i s ofe.

p)5     (100 * )current))
               stack"fd>lackcurrent))
time5spec<54 id="L57" class="lass="line" namsiz3 al6.17.7               stack"fd>lack) / 66" class="line" name="L92"5cnclude &5/a>)
  49        l5ong <55"+code=current" classss="sref">__pol="s="line" name="L="s 12-class="line" namNOMEMGFP_KERNEL)current))
nebi=>               bi=>    6.12.1"
	  >
  v2.6.12.15ilass="li5="sref">tv->out_nofd>               out_nofd>PORT_SYMBOL" class="sref5i     Cha5c#L53" id="L53" class="l5ine" 55inline_inde5i5have re5rn 0;
fd>               fd>..c#L119" id="L123               in22"><<<<<<12class="line" nab=">               bi=>    "+code=poll_table_entry"5"">p)5">task_nice()5divfactor = NSEC_PER_SEC/__polfd>               fd>..c#L119" id="L1res_7" d    5             return __polfd>               fd>..c#L119" id="L1res_"line" name="L123res_"l      12class="line" nab=">               bi=>     +c5= ;
 = 5sref">tv_nsec /  12lass="line" nam.c#Lfd/setfile" class="sr.c#Lfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=234"> 114     in4,se" name="L118">fd>               fd>..c#L119" id="L123               in22">)) ||L90" class="line" name=5Mlass="li5">NSEC_PER_SEC/ 12lass="line" nam.c#Lfd/setfile" class="sr.c#Lfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=7" 4"> 114     7" 4,se=now" class="sfd>               fd>..c#L119" id="L17" d );
 12lass="line" nam.c#Lfd/setfile" class="sr.c#Lfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=ex4"> 114     ex4,se=now" class="sfd>               fd>..c#L119" id="L1"line" name="L123      )))vfactor" class="sref">d555have re5ref">slack > outd p)5             return ,sss="line" name=fd>               fd>..c#L119" id="L1res_23               res_23id=")current))
5;
,sss="line" name=fd>               fd>..c#L119" id="L1res_7" d   67        ret5urn <56117" class="line" name="L117zeroLfd/setfile" class="srzeroLfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=fd>               fd>..c#L119" id="L1res_"line" name="L123res_"l    )current))
  685}
__pol="s="line" name="L="s 12lass="line" namdo"i111" ,s="line" name="L118">fd>               fd>,s.c#L119" id="L1"nd_ "L3 al6.17.76PORT_SYMBOL" class="sref5+code=tim5espec" class="sref">time5spec<57 id="L90" class="line" name=5sref">tv<5/a>)
__pol="s="line" name="L="s ect.c06.12.1"
	  >
  v2.6.12.15sss="sref5">  72        unsign5ed lo57de=tv_sec" class="sregotok" class="sref">outd times5pecne="s="line" name="L="s6" class="line" name="L92"5Lclass="s5;
__pol="s="line" name="L="s 12-class="line" namRESTARTNOHANDp)5" class="line" name="L755">  757slack_ns" class="srefss="lass="line" namsiinal_pendingd pwq->d5L="sref">5t">         * Realtime t5asks 577lack_ns" class="srefffffffffgotok" class="sref">outd   7757117" class="lcurrent"ss="sref">__pol="s="line" name="L="s 12>current))
inline_inde5_task" cl5ass="sref">rt_task(<5a hre58"+cod+code=poll_table_entry"5s/select.5c#L80" id="L80" class="l5ine" 581+code=currenss="lass="line" namsc#Lfd/setfile" class="srsc#Lfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=234"> 114     in4,se" name="L118">fd>               fd>..c#L119" id="L1res_23               res_23id=") ||L90" class="line" name=5     retu5rn 0;
,sss="line" name=7" 4"> 114     7" 4,se=now" class="sfd>               fd>..c#L119" id="L1res_7" d ktime_get_ts(&am58de=tv_sec" class=lass="line" namsc#Lfd/setfile" class="srsc#Lfd/setL125" id="L125" clascfile" class="srn22">,sss="line" name=ex4"> 114     ex4,se=now" class="sfd>               fd>..c#L119" id="L1res_"line" name="L123res_"l    ))vfactor" class="sref">d5      Cha5+code=tv" class="sref">t5v58__pol="s="line" name="L="s 12-class="line" namFAULT__estimate_accuracy(&am58*->outd 5t->               stack"fd>lack)vfactor" class="sref">d5 8me="L105&<               bi=>    6"+code=poll_table_entry"5 nclude &5/a>;
out_nofd>               out_nofd>:ref="+code=p" class="sr5L88">  885}
="s="line" name="L="s"+code=poll_table_entry"5"L89">  859
inline_inde5"    retu50
SYSCALL_DEFINE5="line" name="LSYSCALL_DEFINE5L125" id="L125" clasi111" , e" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=234"> 114     in4,se" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=7" 4"> 114     7" 4,n>
poll_table_page<5/a> *59__polfd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=ex4"> 114     ex4,s=next" class="sref">ne=3">val="line" name="L=3">vallack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=tv4"> 114     tv4lack)vfactor" class="sref">d5"ss="sref5ref">poll_table_entry * <59ode=M class="line" name="L92"5  id="L755poll_table_entry ne=3">  83="line" name="L13">  83 .c#L119" id="L1"nd_ "L3 al6.17.7,s= ne=3">val="line" name="L=3">vallack_ss="line" name=tv"> 114     tvollwPORT_SYMBOL" class="sref5"8me="L105/a>};
="s="line" name="L="sPORT_SYMBOL" class="sref5"nclude &5sref">POLL_TABLE_FULL(PAGE_S6ZE + (unsigned long)6tv4"> 114     tv4lack)" class="line" name="L92"6f1>PAGE_S6Z
copy_from_user="fs/select.c#Lcopy_from_userL125"="line" name="L118">=v"> 114     tvollw,sss="line" name=tv4"> 114     tv4lack,csiz3of( id="L125" clas=v"> 114     tvollw)))vfactor" class="sref">d6#L101" id6"L101" class="line" name6"L10160id="L71" clascurrent"t" class="sref"-class="line" namFAULTpoll_table_page<6short60__poleo="line" name="L1o 12="line" name="L118">end_ "L3 al6.17.7"+code=poll_table_entry"6#5101" id6"ef">poll_table_entry1oll1sle_en/set_elec7" ="line" name="L1oll1sle_en/set_elec7" L125" id="L125" claseo="line" name="L1o,+code=poll_table_entry"6#6101" id6"oll_table_entry  114     tvollw..c#L119" id="L1tv/se3="line" name="L1v/se3lack_+="" class="sref">tv"> 114     tvollw..c#L119" id="L1tv/use3="line" name="L1v/use3lack_/= id="L125" clasUSEC_PER_SEC="line" name="LUSEC_PER_SECollw),+code=poll_table_entry"6#7101" id6"];
tv"> 114     tvollw..c#L119" id="L1tv/use3="line" name="L1v/use3lack_%.cs="comment"> */USEC_PER_SEC="line" name="LUSEC_PER_SECollw) *2class="line" naNSEC_PER_USEC="line" name="LNSEC_PER_USEC    ))vfactor" class="sref">d6n8me="L106"a>};
POLL_TABLE_FULLinline_inde6 work.  p6ll_wait() is an inline-f6nctio61"+cod+code=poll_table_entry"6 1>PAGE_S6all select/poll function6 have61 id="L60" class="line" name=="s="line" name="L="s 12lass="line" namcore_sys_i111" ,sss="line" name=234"> 114     in4,se" name="L118">7" 4"> 114     7" 4,se=now" class="sex4"> 114     ex4,se=now" class="seo="line" name="L1o6PORT_SYMBOL" class="sref6 L101" id6="line" name="L111"> 1116/a> 12lass="line" nam1oll1sle_en/copy_remainingd "nd_ "L3 al6.17.7,sss="line" name=tv4"> 114     tv4lack,c1,sss="line" name=="s="line" name="L="s6PORT_SYMBOL" class="sref6 3101" id6L112" class="line" name=6L112"61de=tv+code=poll_table_entry"6ait_queue6head_t *="s="line" name="L="s"+code=poll_table_entry"6 5have re6le" class="sref">poll_ta6leinline_inde6 6101" id6
poll_ini6a7have re6lass="sref">poll_wqueues6/a> *617a hrstaticas="li id="L125" clasdo_pi111" cfile" class="srn22">, e" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     in4,se" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     7" 4,n>
fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=  114     ex4,s=next" class="sref">ne=3">  83="line" name="L13">  83 ss="line" name=__user="fs/select.c#L__userlack_=  114     ts4,n>
pt, sigset_e,se" name="L118">siz3_ed6class="sr6f">polling_task =  * as6">pwq->{
sigsaves="line" name="Lsigsaves"+code=poll_table_entry"6cL101" id6ss="sref">pwq->ne=3">  83="line" name="L13">  83 ss="line" name==>               t>,s.c#L119" id="L1"nd_ "L3 al6.17.7,s= table="s="line" name="L="sPORT_SYMBOL" class="sref6cit_queue6/a>->  53           6c5have re6ts4"> 114     ts4)" class="line" name="L92"6s">p)6MBOL(=>               t>,s.c#L119" id="L1ts4"> 114     ts4,csiz3of( id="L125" clas=>               t>)))vfactor" class="sref">d6cqueues" 6
    6s Two ver6lt;end_ "L3 al6.17.7"+code=poll_table_entry"6imer.h>
1oll1sle_en/set_elec7" ="line" name="L1oll1sle_en/set_elec7" L125" id="L125" claseo="line" name="L1o, ss="line" name==>               t>..c#L119" id="L1tv/se3="line" name="L1v/se3lack, ss="line" name==>               t>..c#L119" id="L1tv/nse3="line" name="L1v/nse3lack))vfactor" class="sref">d6iass="sre6access.h|include/asm-xte6nsa/u631+code=current" classffffffff="sref"-class="line" namINVAL>
inline_inde6i3101" id61
{
 * Estima6te ex63ode=MAX_SLACK" class=stors limit (Tigran Ai/* XXX: Don't preclude"handling"diffe>csiz3d iigset_e's.tt*le.
p)6 id="L35" class="line" n6ame="63slack_ns" class="srefss="lass="line" namsiisetsiz3 al6.17.7d6iqueues" 6ent"> * After quite a bi6t of 637lack_ns" class="srefffffffff="sref"-class="line" namINVAL * a simple thin6g of 63117" class="lcurrent"ss="lass="line" namcopy_from_user="fs/select.c#Lcopy_from_userL125"="line" name="L118">kiigmas{
sigmas{
{
d6i Two ver68">  38 * "nice6"64"+cod+code=poll_table_entry"6pass="sre6 id="L40" class="line" n6ame="641+code=current" classe=now" class="siigdelsetmas{
kiigmas{
sigmas{
sigmas{
 * Consider this comme6nt an64id="L71" clascurrent" class="sref">ciigpro3mas{
kiigmas{
sigsaves="line" name="Lsigsaves)"+code=poll_table_entry"6p3101" id6ne" name="L42">  42<6span 64de=tv_sec" cl}lass="sref">inline_inde6cit_queue6gged sys_poll()/do_poll(6 me="64me="L53">  53           6c5have re6span>
="s="line" name="L="s 12lass="line" namcore_sys_i111" ,sss="line" name=234"> 114     in4,se" name="L118">7" 4"> 114     7" 4,se=now" class="sex4"> 114     ex4,se=now" class="seo="line" name="L1o6PORT_SYMBOL" class="sref6c">p)6     (100 *  12lass="line" nam1oll1sle_en/copy_remainingd "nd_ "L3 al6.17.7,sss="line" name=ts4"> 114     ts4,c0,sss="line" name=="s="line" name="L="s6PORT_SYMBOL" class="sref6cait)6)
time6spec<64 id="L57" class="lass="line" nam="s="line" name="L="s 112-class="line" namRESTARTNOHAND)
  49        l6ong <65"+codlclass="line" name="L1aef="+codffffffff* Don't ="store =ameslinal mas< yet. Let do"ilinal() deliverL1
        int  * poll taeasons.<<<<<<<<tv->{
wq" class="sref">pwq->,s="line" name="L118">sigsaves="line" name="Lsigsaves,n>
p)6">task_nice()6divfactor = set_="store_siimas{
inline_inde6"nclude &6">NSEC_PER_SEC/{
inline_inde659   6             return ciigpro3mas{
sigsaves="line" name="Lsigsaves,2 ;
 = 6sref">tv_nsec / ="s="line" name="L="s"+code=poll_table_entry"6Mlass="li6">NSEC_PER_SEC/inline_inde6M     Cha6/a>);
  53           655have re6ref">slack > p)6             return 

  67        ret6urn <66117" d multiple_wait() funct* whpchahas a pointla =me=amesliset_e its/sf followed byeac=iz3_escontainingL1
  686}
time6spec<67 id=" id="L125" clasSYSCALL_DEFINE6,2lac,se=now" class="scfile" class="srn22">, e" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=234"> 114     in4,se" name="L118">fd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=7" 4"> 114     7" 4,n>
tv<6/a>)
cfd/setfile" class="srfd/setlack_ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=ex4"> 114     ex4,s=next" class="sref">ne=3">  83="line" name="L13">  83 ss="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=ts4"> 114     ts4,n>
  72        unsign6ed lo67de=tv_sec" class="sre classs="line" name=__user="fs/select.c#L__userlack_=,sss="line" name=sli="line" name="Lsig)lass="sref">inline_inde6s     Cha6spec" class="sref">times6pec;
siz3_ecurrent))
p)6" class="line" name="L756">  7676a href="+code=now" class="ssigset_e 114     up 12lass="line" namNULL6t">         * Realtime t6asks 677lackORT_SYMBOL" class="sref6s8me="L106 class="line" name="L77"6>  7767 id="L57" class="lass="line" namsii="line" name="Lsig)" class="line" name="L92"6Lnclude &6span>
neaccess_o{
sig="line" name="Lsig,ssiz3of( clas=)+siz3of( id="L125" classiz3_ed6_task" cl6ass="sref">rt_task(<6a hre68"+code=current" classssss|| ss="line" name=__.c#Luser="fs/select.c#L__.c#Luser( id="L125" clasu4"> 114     up,="lass="line" namsiiset_einline_inde6s/select.6c#L80" id="L80" class="l6ine" 681+code=current" classffff|| ss="line" name=__.c#Luser="fs/select.c#L__.c#Luser( id="L125" clasiigsetsiz3 al6.17.7
d6 ss="sref6s="sref">ktime_get_ts(&am68de=tv_sec" class=============="sref"-class="line" namFAULTt6v68inline_inde6 class="s6">__estimate_accuracy(&am68*->do_pi111" ,sss="line" name=234"> 114     in4,se" name="L118">7" 4"> 114     7" 4,se=now" class="sex4"> 114     ex4,se=now" class="ses4"> 114     ts4,c id="L125" clasu4"> 114     up,= id="L125" clasiigsetsiz3 al6.17.76t->inline_inde6 8me="L106&<    6 nclude &6/a>;
    6L88">  886}
nemen_arg_=next"/a>{
  869
PORT_SYMBOL" class="sref6"    retu60
 114     in4,s=  114     7" 4,_=  114     ex4PORT_SYMBOL" class="sref6"ss="sref6struct ne=3">val="line" name="L=3">vallack_ss="line" name=__user="fs/select.c#L__userlack_=class="sref">ne=v4"> 114     tv4lackPORT_SYMBOL" class="sref6"     Cha6="sref">poll_table_page<6/a> *69poll_table_entry * <69* SYSCALL_DEFINE1"> 114     SYSCALL_DEFINE1L125" id="L125" clasold_i111" ,s=next" class="sref">nemen_arg_=next"/a>{
{
inline_inde6"="commen60];
nemen_arg_=next"/a>{
{
POLL_TABLE_FULL(PAGE_S7ZE + (unsigned long)7copy_from_user="fs/select.c#Lcopy_from_userL125"="line" name="L118">a/a>{
{
{
d7f1>PAGE_S7Z
sys_i111" {
,sss="line" name=a/a>{
 114     in4,se" name="L118">a/a>{
 114     7" 4,se=now" class="sa/a>{
 114     ex4,se=now" class="sa/a>{
 114     tv4lack)"+code=poll_table_entry"7#3101" id7"truct inline_inde7#4101" id7""sref">poll_table_page<7short70inline_inde7#5101" id7"ef">poll_table_entry ne1oll1lis ="line" name="L1oll1lis a hre class="line" name="L92"7#7101" id7"];
ne1oll1lis ="line" name="L1oll1lis a hre=class="sref">nenex ="line" name="Lnex id=""+code=poll_table_entry"7#8101" id7"a>};
lecfile" class="srlecid=""+code=poll_table_entry"7#9101" id7"ref">POLL_TABLE_FULLne1ollfs="line" name="L1ollfsa hress="line" name=entrieselect.c#L114" ientriesa hr[0]"+code=poll_table_entry"7 work.  p7ll_wait() is an inline-f7nctio71"+cod}PORT_SYMBOL" class="sref7 1>PAGE_S7all select/poll function7 have71 id="L90" class="line" name=7 L101" id7="line" name="L111"> 1117/a>ne1oll1lis ="line" name="L1oll1lis a hr)) / siz3of(=next" class="sref">ne1ollfs="line" name="L1ollfsa hr))vfactor" class="sref">d7 3101" id7L112" class="line" name=7L112"71de=tv+code=poll_table_entry"7ait_queue7head_t *poll_ta7le
poll_wqueues7/a> *717a hrd multiple_wait() funct* matching"=aat mas< is bothsrecordedeind1ollfselectrev fus and ="srefed. Th/
pt, polling_task =  * as7">pwq->do"pollfs="line" name="Ldo"pollfsL125"=next" class="sref">ne1ollfs="line" name="L1ollfsa hre=class="sref">ne1ollfs="line" name="L1ollfsa hr,se=now" class="s1oll_table="line" name="L1oll1tablea hre=class="sref">ne1wait="line" name="L1wait)lass="sref">inline_inde7cL101" id7ss="sref">pwq->tablemas{
fs="line" name="Lfs"+code=poll_table_entry"7c5have re7p)7MBOL( 12>current))
fput_needes="line" name="Lfput_needes"+code=poll_table_entry"7imer.h>
nefile="line" name="Lfilea hre= class="sref">nefile="line" name="Lfilea hr"+code=poll_table_entry"7it"> * as7access.h|include/asm-xte7nsa/u73 id="L90" class="line" name=7iL101" id7>>
cfile="line" name="Lfilea hre12lass="line" namf.c#Llightfile" class="srf.c#LlightL125" id="L125" clasfd="line" name="Lfs,s="line" name="L118">fput_needes="line" name="Lfput_needes)"+code=poll_table_entry"7i3101" id71
 12ss="line" name=POLLNVAL * Estima7te ex73ode=MAX_SLACK" class=ass=====e=now" class="smas{
p)7 id="L35" class="line" n7ame="73slack_ns" class="srefL57" class="lass="line" namfile="line" name="Lfilea hrelect.c#L123" id="L1f_o4"> 114     f_o4 l"linl"lin" class="sref">cfile="line" name="Lfilea hrelect.c#L123" id="L1f_o4"> 114     f_o4elect.c#L123" id="L11oll="line" name="L1ollollw6" class="line" name="L92"7cqueues" 7ent"> * After quite a bi7t of 737lack_ns" class="srefffffffffass=====e=now" class="s1wait="line" name="L1waitelect.c#L123" id="L1_key/a>{
POLLERRPOLLHUP * a simple thin7g of 73117" class="lcurrent"" class=ass=====e=now" class="smas{
 114     f_o4elect.c#L123" id="L11oll="line" name="L1ollollw"lass="line" namfile="line" name="Lfilea hr,se=now" class="s1wait="line" name="L1wait)"+code=poll_table_entry"7i Two ver78">  38inline_inde7pan class7="comment"> * "nice7"74"+code=current" classssss====etors limit (Tigran Ai/* Mas< outUs=needesdev fus.a/le.
 l"lin12lass="line" nam1ollfs="line" name="L1ollfsa hrelect.c#L123" id="L1ev fuselect.c#L114" iev fusa hr | ss="line" name=POLLERR * Consider this comme7nt an74id="L71" clascurrent"ass=====e=now" class="sfput_lightfile" class="srfput_lightollw"lass="line" namfile="line" name="Lfilea hr,se=now" class="sfput_needes="line" name="Lfput_needes)"+code=poll_table_entry"7p3101" id7ne" name="L42">  42<7span 74de=tv_sec" class=====}lass="sref">inline_inde7pit_queue7gged sys_poll()/do_poll(7 me="74inline_inde7c5have re7span>
1ollfs="line" name="L1ollfsa hrelect.c#L123" id="L1rev fuselect.c#L114" irev fusa hr 12lass="line" nammas{
p)7     (100 * poll_ini7cait)7)
mas{
time7spec<74 id="}lass="sref">inline_inde7c Two ver7/a>)
  49        l7ong <750id="staticalack" class="sref">do"poll="line" name="Ldo"pollollw"s="line" lack" class="sref">nfd>               nfd>,sa=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hre=class="sref">nelis ="line" name="Llis a hr,n>
        int ne1oll1wqueueselect.c#L114" i1oll1wqueuesa hre=class="sref">newait="line" name="Lwait,s=next" class="sref">ne=3">  83="line" name="L13">  83 = )lass="sref">inline_inde7iL101" id71000;
tv->1oll_table="line" name="L1oll1tablea hr= class="sref">nep ="line" name="L1s 12="line" name="L118">wait="line" name="Lwaitelect.c#L123" id="L11 ="line" name="L1sPORT_SYMBOL" class="sref7i     Cha7c#L53" id="L53" class="l7ine" 75,s=class="sref">ne=o="line" name="L1o 12  "L3d_7" d  12>,se=now" class="scoulass="sref">pwq 12>current))
p)7">task_nice({
)7divfactor = 
NSEC_PER_SEC/ l"linl"lin"!class="sref">neend_ "L3 al6.17.7elect.c#L123" id="L1tv/se3="line" name="L1v/se3lack_l"linl"lin"!class="sref">neend_ "L3 al6.17.7elect.c#L123" id="L1tv/nse3="line" name="L1v/nse3lack)" class="line" name="L92"759   7             return c1 ="line" name="L1select.c#L123" id="L1_qpro3/a>{
;
 121PORT_SYMBOL" class="sref75L101" id7sref">tv_nsec / inline_inde7Mlass="li7">NSEC_PER_SEC/);
 l"linl"lin"!class="sref">ne "L3d_7" d )lass="sref">inline_inde755have re7ref">slack > {
{
)PORT_SYMBOL" class="sref75">p)7             return poll_ini75ait)7;
  67        ret7urn <76117" class="lcurrent"=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hre=class="sref">newal{
  687}
newal{
cwal{
cwal{
{
time7spec<771+code=current" classass======next" class="sref">ne1ollfs="line" name="L1ollfsa hre= class="sref">ne1fs="line" name="L1fs,s= class="sref">ne1fs_ond="line" name="L1fs_ondollwPORT_SYMBOL" class="sref7sref">tv<7/a>)
  72        unsign7ed lo77de=tv_sec" class="sret" class class="sref">c1fs="line" name="L1fs 12 id="L125" claswal{
times7pecc1fs_ond="line" name="L1fs_ondollw 12lass="line" nam1fs="line" name="L1fs +2 id="L125" claswal{
;
p)7" class="line" name="L757">  777slack_ns" class="sref" class========= is code may not be ea/*e.
7t">         * Realtime t7asks 777a hrd multiple_wait() functtttttttttttttttttttttttttttttttt* Fish d="Lev fus.aIf we fould one,srecord ite.
  7777117" d multiple_wait() functtttttttttttttttttttttttttttttttt* and kill 1oll1tableelect_qpro3, so we don'te.

rt_task(<7a hre78"+codlclass="line" name="L1aef="+codfffffffftttttttttttttttt* this. Th/y'll get iamediatelysderegis eres
 * poll taeasons.<<<<<<<<
ktime_get_ts(&am78de=tv_sec" class=====================ss="lass="line" namdo"pollfs="line" name="Ldo"pollfsL125"class="sref">ne1fs="line" name="L1fs,s class="sref">c1 ="line" name="L1s))" class="line" name="L92"7      Cha7+code=tv" class="sref">t7v78pwq++"+code=poll_table_entry"7 class="s7">__estimate_accuracy(&am78ode=MAX_SLACK" class=ass=====sssssssssssssssse=now" class="s1 ="line" name="L1select.c#L123" id="L1_qpro3/a>{
->inline_inde7<="sref">7t->inline_inde7<8me="L107&<inline_inde7 nclude &7/a>;
  887}


 * poll taeasons.<<<<<<<<
 12 poll_table_page<7/a> *79necoulass="sref">pwq)" class="line" name="L92"7"class="s7ref">poll_table_entry * <79ode=MAX_SLACK" class=ass=====e=now" class="scoulass="sref">pwq 12e" name="L118">wait="line" name="Lwaitelect.c#L123" id="L1error="fs/select.c#LerrorollwPORT_SYMBOL" class="sref7" id="L757poll_table_entry newq" class="sref">pwq->d7"="commen70];
pwq 12-class="line" namINTRinline_inde7"nclude &7sref">POLL_TABLE_FULL(pwq || ss="line" name= "L3d_7" d )lass="sref">inline_inde8f">PAGE_S8ZE + (unsigned long)8

poll_table_page<8short80ts: This code may not be eattttttttt<<<<<<<
poll_table_entry 
 l"linl"lin"!class="sref">ne o="line" name="L1o6" class="line" name="L92"8#8101" id8"a>};
 12e" name="L118">13">  83_to_k "L3 al6.17.7  83_to_k "L3L125"= )PORT_SYMBOL" class="sref8f9101" id8"ref">POLL_TABLE_FULLne=o="line" name="L1o 12="line" name="L118">"xpir3 al6.17.7PORT_SYMBOL" class="sref8 work.  p8ll_wait() is an inline-f8nctio81"+code=current" class}lass="sref">inline_inde8 1>PAGE_S8all select/poll function8 have81 id="L90" class="line" name=8 L101" id8="line" name="L111"> 1118/a>ne1oll1schedule_elec7" ="line" name="L1oll1schedule_elec7" L125"class="sref">newait="line" name="Lwait,sclass="sref">neTASK_INTERRUPTIBLE="line" name="LTASK_INTERRUPTIBLE,sclass="sref">neeo="line" name="L1o, ss="line" name=slac{
d8 3101" id8L112" class="line" name=8L112"81de=tv_sec" class="sret" class class="sref">c "L3d_7" d  121PORT_SYMBOL" class="sref8ait_queue8head_t *inline_inde8 5have re8le" class="sref">poll_ta8lecoulass="sref">pwqPORT_SYMBOL" class="sref8a6101" id8
inline_inde8 7101" id8lass="sref">poll_wqueues8/a> *817lackORT_SYMBOL" class="sref8 8me="L1086"- siz3of(=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hr))  / \ORT_SYMBOL" class="sref8 9101" id8"sref">pt, ne1ollfs="line" name="L1ollfsa hr))vfactor" class="sref">d8class="sr8f">polling_task =  * as8">pwq->do"sys_poll="line" name="Ldo"sys_pollL125"=next" class="sref">ne1ollfs="line" name="L1ollfsa hress="line" name=__user="fs/select.c#L__userlack_=                ufd>,ss="line" lack" class="sref">nfd>               nfd>,+code=poll_table_entry"8cL101" id8ss="sref">pwq->ne=3">  83="line" name="L13">  83 = )lass="sref">inline_inde8c3101" id8e" class="sref">table->ne1oll1wqueueselect.c#L114" i1oll1wqueuesa hreclass="sref">ne=able="line" name="Ltablea hrPORT_SYMBOL" class="sref8c5have re8err="fs/select.c#Lerr 12-class="line" namFAULTfdcoulass="sref">pwqlecfile" class="srlecid=",= id="L125" clasiiz3 al6.17.7(


[ id="L125" clasPOLL_STACK_ALLOCelect.c#L114" iPOLL_STACK_ALLOC/siz3of(s="l)]"+code=poll_table_entry"8imer.h>
ne1oll1lis ="line" name="L1oll1lis a hre=cons" class="sref">neheas="line" name="Lheas 12(=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hr_=)ss="line" name=stac<_ppselect.c#L114" istac<_pps"+code=poll_table_entry"8it"> * as8access.h|include/asm-xte8nsa/u831+code=curren=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hre= id="L125" claswal{
heas="line" name="Lheas"+code=poll_table_entry"8iL101" id8>>
               nfd>"+code=poll_table_entry"8i3101" id81
               nfd> lect2 neRLIMIT_NOFILE="line" name="LRLIMIT_NOFILEa hr))vfactor" class="sref">d8c5have re8lass="comment"> * Estima8te ex83ode=MAX_SLACK" class=="sref"-class="line" namINVALpoll_ini8cqueues" 8ent"> * After quite a bi8t of 837lack_ns" clae=now" class="slecfile" class="srlecid=" 12lass="line" nammin_e * a simple thin8g of 83117" class="ld="L(;;)" class="line" name="L92"8i Two ver88">  38{
 * "nice8"84"+code=current" class id="L125" claswal{
nelecfile" class="srlecid=")vfactor" class="sref">d8pL101" id8"> * Consider this comme8nt an84id="L71" clascurrent"ass=====brea  42<8span 84de=tv+code=poll_table_entry"8pit_queue8gged sys_poll()/do_poll(8 me="84copy_from_user="fs/select.c#Lcopy_from_userL125" id="L125" claswal{
               ufd> +2 id="L125" clascfd>               nfd>-class="line" natodo="line" name="L1odo,+code=poll_table_entry"8c5have re8span>
ne1ollfs="line" name="L1ollfsa hr)s= class="sref">newal{
d8c">p)8     (100 * )
time8spec<84117" class="lcurrent" id="L125" clastodo="line" name="L1odo -12 id="L125" claswal{
)
netodo="line" name="L1odo)vfactor" class="sref">d8ine" name8="L49">  49        l8ong <85"+code=current" classssss====brea        int clecfile" class="srlecid=" 12lass="line" nammintv->ne1oll1lis ="line" name="L1oll1lis a hr) +2siz3of(=next" class="sref">ne1ollfs="line" name="L1ollfsa hr)s= class="sref">nelecfile" class="srlecid=""+code=poll_table_entry"8i     Cha8c#L53" id="L53" class="l8ine" 85{
wal{
newal{
p)8">task_nice(err="fs/select.c#Lerr 12-class="line" namNOMEM = inline_inde8"nclude &8">NSEC_PER_SEC/inline_inde859   8             return ;
ne1oll1initwait="line" name="L1oll1initwaitL125"="line" name="L118">=able="line" name="Ltablea hr)PORT_SYMBOL" class="sref85L101" id8sref">tv_nsec / pwq=able="line" name="Ltablea hr,se=now" class="send_ "L3 al6.17.7)PORT_SYMBOL" class="sref8Mlass="li8">NSEC_PER_SEC/1oll_freewait="line" name="L1oll1freewaitL125"="line" name="L118">=able="line" name="Ltablea hr)PORT_SYMBOL" class="sref85     Cha8/a>);
slack > newal{
wal{
cwal{
{
p)8             return ne1ollfs="line" name="L1ollfsa hre=class="sref">nefd>               fd> 12 id="L125" claswal{
jelect.c#L114" ija hrPORT_SYMBOL" class="sref858me="L108L67">  67        ret8urn <86a>    85nclude &8/a>;
nejelect.c#L114" ija hr 12>ck" class="sref">jelect.c#L114" ija hr &lct2 {
jelect.c#L114" ija hr++,c id="L125" clasufd>               ufd>++)vfactor" class="sref">d8L68">  688}
__put_user="fs/select.c#L__put_userollw"e=now" class="sfd>               fd>[ id="L125" clasjelect.c#L114" ija hr]..c#L119" id="L1rev fuselect.c#L114" irev fusa hr,s="line" name="L118">ufd>               ufd>elect.c#L123" id="L1rev fuselect.c#L114" irev fusa hr))vfactor" class="sref">d8+code=tim8espec" class="sref">time8spec<871+code=current" classass=============go=me.c#L123" id="L1out_fd>               out_fd>id=""+code=poll_table_entry"8sref">tv<8/a>)
inline_inde8slass="li8">  72        unsign8ed lo87de=tv+code=poll_table_entry"8s     Cha8spec" class="sref">times8pecerr="fs/select.c#Lerr 12ss="line" name=fdcoulass="sref">pwq;
p)8" class="line" name="L758">  7876a href="+code=now" class="swal{
)8t">         * Realtime t8asks 877lack_ns" clawhile (class="sref">newal{
  7787117" class="lcurrent"=next" class="sref">ne1oll1lis ="line" name="L1oll1lis a hre=class="sref">neposelect.c#L114" i1o> 12 id="L125" claswal{

{
{
rt_task(<8a hre88"+code=current" class id="L125" claskfree/a>{
)PORT_SYMBOL" class="sref8_code=tim8c#L80" id="L80" class="l8ine" 881ode=error" c}lass="sref">inline_inde8     retu8rn 0;
ktime_get_ts(&am88de=tv_sec" cl="sref"" class="sref">err="fs/select.c#LerrPORT_SYMBOL" class="sref8_     Cha8+code=tv" class="sref">t8v88inline_inde8 5have re8">__estimate_accuracy(&am88*->neaestart"bloc{
neaestart"bloc{
d8<="sref">8t->ne1ollfs="line" name="L1ollfsa hress="line" name=__user="fs/select.c#L__userlack_=                ufd> 12 id="L125" clasaestart"bloc{
nfd>               nfd> 12 id="L125" clasaestart"bloc{
  888}
ne=3">  83="line" name="L13">  83 = "+code=poll_table_entry"8Lcode=tim89
="s/a>{

aestart"bloc{
poll_table_page<8/a> *89..c#L119" id="L1tv/se3="line" name="L1v/se3lack_12 id="L125" clasaestart"bloc{
poll_table_entry * <89ode=MAX_SLACK" class=e=now" class="send_ "L3 al6.17.7..c#L119" id="L1tv/nse3="line" name="L1v/nse3lack_12 id="L125" clasaestart"bloc{
"nd_ "L3 al6.17.7"+code=poll_table_entry"8L="sref">80];
inline_inde8"8me="L108/a>};
    8"nclude &8sref">POLL_TABLE_FULL(="s/a>{
PAGE_S9ZE + (unsigned long)9PAGE_S9Z
aes/a>{
{
{
poll_table_page<9short90inline_inde9#5101" id9"ef">poll_table_entry="s/a>{
 inline_inde9#7101" id9"];
};
SYSCALL_DEFINE3/a>{
ne1ollfs="line" name="L1ollfsa hress="line" name=__user="fs/select.c#L__userlack_=,c id="L125" clasufd>               ufd>,ss="line" lac,se=now" class="scfd>               nfd>,ORT_SYMBOL" class="sref9#9101" id9"ref">POLL_TABLE_FULL               elec7" _mse3>a hr)vfactor" class="sref">d9 work.  p9ll_wait() is an inline-f9nctio91"+cod class="line" name="L92"9 1>PAGE_S9all select/poll function9 have911+code=curren=next" class="sref">ne=3">  83="line" name="L13">  83 e" name="L118">"nd_ "L3 al6.17.7,s=class="sref">ne=o="line" name="L1o 12  1119/a>="s/a>{
 *elec7" _mse3>               elec7" _mse3>a hr lect= 0)" class="line" name="L92"9 5have re9le" class="sref">poll_ta9le"nd_ "L3 al6.17.7"+code=poll_table_entry"9a6101" id9
               elec7" _mse3>a hr / ss="line" name=MSEC_PER_SEC               MSEC_PER_SEC,ORT_SYMBOL" class="sref9 7101" id9lass="sref">poll_wqueues9/a> *917lack_ns" class="srefffffffff elec7" _mse3>               elec7" _mse3>a hr l#37"k" class="sref">MSEC_PER_SEC               MSEC_PER_SEC)6"+code=poll_table_entry"9 8me="L109inline_inde9 9101" id9"sref">pt, polling_task = ="s/a>{
 * as9">pwq->pwq->aes/a>{
tableneaestart"bloc{
neaestart"bloc{
->{
a>->_thread_info="line" name="La>->_thread_infoL125")elect.c#L123" id="L1restart"bloc{
({
{
               ufd>PORT_SYMBOL" class="sref9c8me="L109;{
               nfd>"+code=poll_table_entry"9s Two ver9lt;elec7" _mse3>               elec7" _mse3>a hr lect= 0)" class="line" name="L92"9it"> * as9access.h|include/asm-xte9nsa/u931+code=current" classass===== id="L125" clasaestart"bloc{
..c#L119" id="L1tv/se3="line" name="L1v/se3lack"+code=poll_table_entry"9iL101" id9>>
{
..c#L119" id="L1tv/nse3="line" name="L1v/nse3lack"+code=poll_table_entry"9i3101" id91
caestart"bloc{
 * Estima9te ex93ode=MAX_SLACK" class=t" class class="sref">caestart"bloc{
current))
poll_ini9cqueues" 9ent"> * After quite a bi9t of 937lack_ns" class="sref id="L125" clasaes/a>{
 * a simple thin9g of 93117" class="l}lass="sref">inline_inde9i Two ver98">  38="s/a>{
 * "nice9"94"+cod}lass="sref">inline_inde9pass="sre9 id="L40" class="line" n9ame="94 id="L90" class="line" name=9pL101" id9"> * Consider this comme9nt an94id="L" class="sref">SYSCALL_DEFINE5/a>{
ne1ollfs="line" name="L1ollfsa hress="line" name=__user="fs/select.c#L__userlack_=,c id="L125" clasufd>               ufd>,ss="line" lac,se=now" class="scfd>               nfd>,ORT_SYMBOL" class="sref9p3101" id9ne" name="L42">  42<9span 94de=tv_sec" class======next" class="sref">ne=3">  83="line" name="L13">  83 e" name="L118">__user="fs/select.c#L__userlack_=,c id="L125" clastsp="line" name="L1sp,scons" class="sref">ne"lislt_e="line" name="L"lislt_e e" name="L118">__user="fs/select.c#L__userlack_=,c id="L125" clas"limas{
,sss="line" name="lisltiiz3 al6.17.7d9c5have re9span>
p)9     (100 *  e" name="L118">k"limas{
)
ne=3">  83="line" name="L13">  83 e" name="L118">uselect.c#L114" it>,sss="line" name="nd_ "L3 al6.17.7,s=class="sref">ne=o="line" name="L1o 12 time9spec<94117" class="llack" class="sref">="s/a>{
)
  49        l9ong <95"+code=currenss="" class="sref">esp="line" name="L1sp)" class="line" name="L92"9iass="sre9>        int aopy_from_user="fs/select.c#Lcopy_from_userL125"="line" name="L118">=select.c#L114" it>,sss="line" name=tsp="line" name="L1sp,ssiz3of( id="L125" clas=select.c#L114" it>)))vfactor" class="sref">d9iL101" id91000;
tv->"nd_ "L3 al6.17.7"+code=poll_table_entry"9i5have re9rn 0;
..c#L119" id="L1tv/se3="line" name="L1v/se3lack, ss="line" name=eselect.c#L114" it>..c#L119" id="L1tv/nse3="line" name="L1v/nse3lack))vfactor" class="sref">d9i">p)9">task_nice( = inline_inde9"8me="L109 / 5;
    9"nclude &9">NSEC_PER_SEC/{
   9             return 
;
"lisltiiz3 al6.17.7))vfactor" class="sref">d95L101" id9sref">tv_nsec / NSEC_PER_SEC/aopy_from_user="fs/select.c#Lcopy_from_userL125"="line" name="L118">k"limas{
{
{
d95     Cha9/a>);
slack > p)9             return {
k"limas{
{
{
;
{
k"limas{
"lisaves="line" name="L"lisavesid=")"+code=poll_table_entry"958me="L109L67">  67        ret9urn <96117" class="l}lass="sref">inline_inde95nclude &9/a>;
  689}
="s/a>{
time9spec<97 id="L90" class="line" name=9sref">tv<9/a>)

  72        unsign9ed lo97de=tv_sec" clss="" class="sref">aes/a>{
times9pec

p)9" class="line" name="L759">  797slackd multiple_wait() functtttttttt<<<<<<<
         * Realtime t9asks 977a hrd multiple_wait() functtttttttttt<<<<<  7797117" d multiple_wait() functtttttttttt<<<<<
{
rt_task(<9a hre98"+code=current" classe=curren" class="sref">memcpy/a>{
a>->="fs/select.c#Lc>->a hrelect.c#L123" id="L1saves_slimas{
"lisaves="line" name="L"lisavesid=",ORT_SYMBOL" class="sref9_code=tim9c#L80" id="L80" class="l9ine" 981+code=current" classass=====================siz3of( id="L125" clas"lisaves="line" name="L"lisavesid=")6"+code=poll_table_="sref9     retu9rn 0;
{
ktime_get_ts(&am98de=tv_sec" class=====}lass="sref">inline_inde9_     Cha9+code=tv" class="sref">t9v98{
__estimate_accuracy(&am98ode=MAX_SLACK} elsedss="lass="line" namslimas{
p)9t->{
"lisaves="line" name="L"lisavesid=",2 ->="s/a>{
"nd_ "L3 al6.17.7,sss="line" name=tsp="line" name="L1sp,s0,sss="line" name=="s/a>{
;
  889}
="s/a>{

inline_inde9"    retu90



Tameoriginal LXR software by =ameass="srefhttp://sourceforge.net/projne_s/lxr">LXR it()unity,sthis experi) fual version by ass="srefmailto:lxr@ef=ux.no">lxr@ef=ux.no.
lxr.ef=ux.no kindlyRedpill Lf=pro AS,sprovider of Lf=uxsconsult rg and operations services since 1995.