linux/kernel/sched/cputime.c
<<
>>
Prefs
   1#include <linux/export.h>
   2#include <linux/sched.h>
   3#include <linux/tsacct_kern.h>
   4#include <linux/kernel_stat.h>
   5#include <linux/static_key.h>
   6#include "sched.h"
   7
   8
   9#ifdef CONFIG_IRQ_TIME_ACCOUNTING
  10
  11/*
  12 * There are no locks covering percpu hardirq/softirq time.
  13 * They are only modified in vtime_account, on corresponding CPU
  14 * with interrupts disabled. So, writes are safe.
  15 * They are read and saved off onto struct rq in update_rq_clock().
  16 * This may result in other CPU reading this CPU's irq time and can
  17 * race with irq/vtime_account on this CPU. We would either get old
  18 * or new value with a side effect of accounting a slice of irq time to wrong
  19 * task when irq is in progress while we read rq->clock. That is a worthy
  20 * compromise in place of having locks on each irq in account_system_time.
  21 */
  22DEFINE_PER_CPU(u64, cpu_hardirq_time);
  23DEFINE_PER_CPU(u64, cpu_softirq_time);
  24
  25static DEFINE_PER_CPU(u64, irq_start_time);
  26static int sched_clock_irqtime;
  27
  28void enable_sched_clock_irqtime(void)
  29{
  30        sched_clock_irqtime = 1;
  31}
  32
  33void disable_sched_clock_irqtime(void)
  34{
  35        sched_clock_irqtime = 0;
  36}
  37
  38#ifndef CONFIG_64BIT
  39DEFINE_PER_CPU(seqcount_t, irq_time_seq);
  40#endif /* CONFIG_64BIT */
  41
  42/*
  43 * Called before incrementing preempt_count on {soft,}irq_enter
  44 * and before decrementing preempt_count on {soft,}irq_exit.
  45 */
  46void vtime_account(struct task_struct *curr)
  47{
  48        unsigned long flags;
  49        s64 delta;
  50        int cpu;
  51
  52        if (!sched_clock_irqtime)
  53                return;
  54
  55        local_irq_save(flags);
  56
  57        cpu = smp_processor_id();
  58        delta = sched_clock_cpu(cpu) - __this_cpu_read(irq_start_time);
  59        __this_cpu_add(irq_start_time, delta);
  60
  61        irq_time_write_begin();
  62        /*
  63         * We do not account for softirq time from ksoftirqd here.
  64         * We want to continue accounting softirq time to ksoftirqd thread
  65         * in that case, so as not to confuse scheduler with a special task
  66         * that do not consume any time, but still wants to run.
  67         */
  68        if (hardirq_count())
  69                __this_cpu_add(cpu_hardirq_time, delta);
  70        else if (in_serving_softirq() && curr != this_cpu_ksoftirqd())
  71                __this_cpu_add(cpu_softirq_time, delta);
  72
  73        irq_time_write_end();
  74        local_irq_restore(flags);
  75}
  76EXPORT_SYMBOL_GPL(vtime_account);
  77
  78static int irqtime_account_hi_update(void)
  79{
  80        u64 *cpustat = kcpustat_this_cpu->cpustat;
  81        unsigned long flags;
  82        u64 latest_ns;
  83        int ret = 0;
  84
  85        local_irq_save(flags);
  86        latest_ns = this_cpu_read(cpu_hardirq_time);
  87        if (nsecs_to_cputime64(latest_ns) > cpustat[CPUTIME_IRQ])
  88                ret = 1;
  89        local_irq_restore(flags);
  90        return ret;
  91}
  92
  93static int irqtime_account_si_update(void)
  94{
  95        u64 *cpustat = kcpustat_this_cpu->cpustat;
  96        unsigned long flags;
  97        u64 latest_ns;
  98        int ret = 0;
  99
 100        local_irq_save(flags);
 101        latest_ns = this_cpu_read(cpu_softirq_time);
 102        if (nsecs_to_cputime64(latest_ns) > cpustat[CPUTIME_SOFTIRQ])
 103                ret = 1;
 104        local_irq_restore(flags);
 105        return ret;
 106}
 107
 108#else /* CONFIG_IRQ_TIME_ACCOUNTING */
 109
 110#define sched_clock_irqtime     (0)
 111
 112#endif /* !CONFIG_IRQ_TIME_ACCOUNTING */
 113
 114static inline void task_group_account_field(struct task_struct *p, int index,
 115                                            u64 tmp)
 116{
 117#ifdef CONFIG_CGROUP_CPUACCT
 118        struct kernel_cpustat *kcpustat;
 119        struct cpuacct *ca;
 120#endif
 121        /*
 122         * Since all updates are sure to touch the root cgroup, we
 123         * get ourselves ahead and touch it first. If the root cgroup
 124         * is the only cgroup, then nothing else should be necessary.
 125         *
 126         */
 127        __get_cpu_var(kernel_cpustat).cpustat[index] += tmp;
 128
 129#ifdef CONFIG_CGROUP_CPUACCT
 130        if (unlikely(!cpuacct_subsys.active))
 131                return;
 132
 133        rcu_read_lock();
 134        ca = task_ca(p);
 135        while (ca && (ca != &root_cpuacct)) {
 136                kcpustat = this_cpu_ptr(ca->cpustat);
 137                kcpustat->cpustat[index] += tmp;
 138                ca = parent_ca(ca);
 139        }
 140        rcu_read_unlock();
 141#endif
 142}
 143
 144/*
 145 * Account user cpu time to a process.
 146 * @p: the process that the cpu time gets accounted to
 147 * @cputime: the cpu time spent in user space since the last update
 148 * @cputime_scaled: cputime scaled by cpu frequency
 149 */
 150void account_user_time(struct task_struct *p, cputime_t cputime,
 151                       cputime_t cputime_scaled)
 152{
 153        int index;
 154
 155        /* Add user time to process. */
 156        p->utime += cputime;
 157        p->utimescaled += cputime_scaled;
 158        account_group_user_time(p, cputime);
 159
 160        index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
CPUTI= f="kernel/sched/cpCclass="sref">CPUTIkernel/sched/cpCclass="sref">CPUTIkerne1ass="comment">/*
  63task_group_account_field(struct p, dex,
 cputime);
  64  65/* Add user time to procese from ksof*/
*/  16p-f="+can>
.p);
  67d/cputime.c#L143" id="L143" class="lne" name=1"L68">  68        if1 (  69          1     16ent"> */
  70        el1se if17ent"> * compromise in place ofse from gueef=
  71          1     17ent"> */
  72
 * There are no locks cov spent in user space since the lvirtual mached_c/span>
  73         * Called before incremenme scaled by cpu frequency
  74         * and before decrementiel/sched/cputime.c#L156" id="L156" class="lne" name=1"L75">  75}
task_struct *p, cputime_t cputime,
  76cputime_t cputime_scaled)
  17  78static int1  *cpustat = kcpustat_this_cpu->cpustat;
  79{
  80        
  81        un1signe18+code=latest_ns" class="sref>utime += cputime;
  82        u64<>utimescaled += cputime_scaled;
  83        in1t account_group_user_time(p, cputime);
  84
cacputime;
  85          86        
  87        if1 (TASK_NICE(p) > 0) ?   88          1     1ret[inref">CPUTIME_NICE :  cputime);
  89        [inref">CPUGUESTUTIME_NICE :  cputime);
  90        re1turn 1a href="+code=}ary.  91}
[inref">CPUTIME_USER;
 cputime);
  92
[inref">CPUGUEST_NICE :  cputime);
  93static int1   94{
  95          96        un1signe19ent"> * @p: the process thanel/sched/cputime.c#L145" id="L145" class="lne" name=1"L97">  97         * @cputime: the cpu timese from  href==
  98        in1t  * @cputime_scaled: cputime cpu time gets accounted to
  99
 * task when irq is in pr spent in user space since the l#L147"update
 100        <2 href20ent"> * compromise in place ofme scaled by cpu frequency
 101        <2 href20ent"> */
 102        i2 ( * There are no locks coel/sched/cputime.c#L22" id="L22" class="linine" name2"L103"> 103         2     20f="+code=irq" class="sref">deine void  104        <2 href2"+codecount_user_time" cla_(void)
task_struct *p, cputime_t cputime,
 105        r2turn 2a href="+code=f="+code=__this_cpu_add" class=cpuputime_t cputime_scaled)
index,
 106}
 107

 108#else cputime;
 109
cputime_scaled;
 110#define <2 href21+code=index" class="sref">ine();
(p, cputime);
 111
 112#endif /*
 113
task_group_account_field(struct p, dex,
 cputime);
 114static  115         2     2              /* Add user time to procese from ksof href==pan>
*/ 116{
p-f="+can>
.p);
 117#ifdef d/cputime.c#L143" id="L143" class="2ine" name2"L118"> 118        s2ruct 21sched/cputime.c#L129" id="L129" class="2ine" name2"L119"> 119        s2ruct 21ent"> */
 120#endif
 * compromise in place ofse from  href==
 121        <2pan c22ent"> */
 122         * Since all upnthhref="keoffset cpu toffseta href="kerne()l/sched/cputime.c#L147" id="L147" class="2ine" name2"L123"> 123         * get ourselvepr spent in user space since the l#L147"update
 124         * is the only ofme scaled by cpu frequency
 125         *
 126);
task_struct *p, inhref="keoffset 127        <2 href22a href="+code=kcpustae=__this_cpu_add" class=cpuputime_t ,
cputime_t cputime_scaled)
 128
 129#ifdef index;
 130        i2 ( 131         2     2return;
p);
curPF_VCPUa>);
cahardirq_count())
 132
(p, cputime);
cputimputime_scaled)
 133        <2 href23a href="+code=ret" cll/sched/cputime.c#L132" id="L132" class="2ine" name2"L134"> 134        <2 href2"+code=ca" clad/cputime.c#L143" id="L143" class="2ine" name2"L135"> 135        w2ile (23+code/cputime.c#L157" id="L157" class="2ine" name2"L136"> 136         2     2hardirq_count())
 137         2     2 = (inref">CPUIME_IRQ])
 138         2     2in_serving_softirq() &&  139        }2 = (inref">CPUCPUTIME_SOFTIRQ])
 140        <2 href2"+code=rcu_reae=in/cputime.c#L132" id="L132" class="2ine" name2"L141"> 141#endif
 = (inref">CPUCYSTEM_SOFTIRQ])
 142}
 143
);
p, cputime);
cputimputime_scaled)
dex,
 144 145 146 * @p: the process thanel/sched/cputime.c#L145" id="L145" class="2ine" name2"L147"> 147 * @cputime: the cpu timese from ksofinvolromary waif=pan>el/sched/cputime.c#L146" id="L146" class="2ine" name2"L148"> 148 * @cputime_scaled: cputime scalen user space since the linvolromary waifl/sched/cputime.c#L146" id="L146" class="2ine" name2"L149"> 149 */
 150void );
p,cpuputime_t ,
 151         2     2      d/cputime.c#L136" id="L136" class="2ine" name2"L152"> 152{
u64 cpustat = kcpustat_this_cpu->cpustat;
 153        i2t  154
capustat[CTEA_SYMBOL_GPL(="sref">CTEA_UTIMp" clICE" class="sref__force);
 cputime);
 155        <2pan c25/sched/cputime.c#L76" id="L76" class="li2ine" name2"L156"> 156        <2 href2"+code/cputime.c#L76" id="L76" class="li2ine" name2"L157"> 157        <2 href25ent"> * @cputime: the cpu tnel/sched/cputime.c#L145" id="L145" class="2ine" name2"L158"> 158        <2 href25ent"> * @cputime_scaled: cputise from ksofidle=pan>el/sched/cputime.c#L146" id="L146" class="2ine" name2"L159"> 159
 * task when irq is in pr spent in user space since the lidle=waifl/sched/cputime.c#L146" id="L146" class="2ine" name2"L160"> 160        <2 href26ent"> * compromise in place oel/sched/cputime.c#L150" id="L150" class="2ine" name2"L1de=ir160SER" class="s2ef">C2UTI= fcount_user_time" class="srefidle"kern);
p,cpuputime_t ,
CPUT2kerne26/sched/cputime.c#L153" id="L153" class="2ne" name=2"L63">  63cpustat = kcpustat_this_cpu->cpustat;
  64rving_softirq href=_cpu_ptr" class="sref">rving_softirqref">rvref="+d/cputime.c#L96" id="L96" class="li2nne" name2"L65">  65  16nr_iowaifing_softirqnr_iowaiff="+code=CPUT/cputime.c#L157" id="L157" class="2nne" name2"L67">  67pustat[IOWAIT_NICE :  cputime);
  68        if2 (  69          2     26a href="+code=__this_cpu_add" class=cpustat[inref">CPUIDLE_NICE :  cputime);
  70        el2se if27ent">d/cputime.c#L76" id="L76" class="li2ne" name=2"L71">  71          2     27sched/cputime.c#L112" id="L112" class="2ne" name=2"L72">  72
ode=irq" class="sref">__always_deine void  void (); efal"void)
  73        d/cputime.c#L153" id="L153" class="2ne" name=2"L74">  74        CONFIG_CGROUP_CPUACCT" class=PARAVIR_CGROUP_CPUACCT
  75}
)
  76(); efalscheme" class="sref">st[  17  78static int2 ret< efald_unlock(); efalschent_ca" class="sref">pavirta efal"c_read_unlock();">pavirta efal"c_reacode=s="sref">p,smpaime getor_ie_scaled)
  79{
(); efalschen-cpu_ptr" class="sref">rving_softirqref">rvref="+ustat" class="sref">prevfrefal"kern);
  80          81        un2signe28a href="+code=__this_cpu_add" class=st[);
p,sefald_unlock(); efalschedd/cputime.c#L99" id="L99" class="li2ne" name=2"L82">  82        rving_softirqref">rvref="+ustat" class="sref">prevfrefal"kern);
[[  83        in2t   84
);
p,st[  85        ret[  86          87        if2 (  88          2     2ret();fa=inref=d/cputime.c#L99" id="L99" class="li2nne" name2"L89">  89          90        re2turn 29sched/cputime.c#L61" id="L61" class="li2ne" name=2"L91">  91}
  92
  93static int2 
  94{
/*
  95         * Account user cpu time to a proa keea  96        un2signe29ent"> * @p: the process tharnthe cpu time gets accounted to
  97         * @cputime: the cpu time@"+code=ck:hen nothkeea"+copdatel/sched/cputime.c#L147" id="L147" class="2ne" name=2"L98">  98        in2t  * @cputime_scaled: cputimrq cpu tioo, wr
  99
 * task when irq is in presched/cputime.c#L147" id="L147" class="3ine" name3"L100"> 100        <3 href30ent"> * compromise in place ofTeea  91}
 */
 102        i3 ( * There are no locks cot- pschessap;   93static int3     30ent">         * get ourselvepr- "+code=p" csched/cputime.c#L148" id="L148" class="3i4e" name3"L94">  94{
         * is the only of- idle"kerncosched/cputime.c#L148" id="L148" class="3i5e" name3"L95">  95         * Account user cpu time -f href==pan>cosched/cputime.c#L148" id="L148" class="3i6e" name3"L96">  96        un3"kern30ent"> * @p: the process tharnt  -fd="ea  97         * @cputime: the cpu time  -fe=in_ao a proas  href="kerncosched/cputime.c#L148" id="L148" class="3i8e" name3"L98">  98        in3n cla30ent"> * @cputime_scaled: cputcosched/cputime.c#L148" id="L148" class="3i9e" name3"L99">  99
 * task when irq is in prC="ea 110#define <3 href31ent"> * compromise in place ofnospan>r  oessaoff=ca" clw>
arthin href="k= thehepan>w>
may nev>r  eroancosched/cputime.c#L148" id="L148" class="3i1e" name3"L111"> 111
 */
el/sched/cputime.c#L146" id="L146" class="3ine" name3"L112"> 112#endif  * There are no locks cotpustatspan>
athefrischs
arthinlyh"kerne+hin  href==pan>
athenothin irvresched/cputime.c#L147" id="L147" class="3ine" name3"L113"> 113
         * get ourselveprp;  114static  * and before decrementiel/sched/cputime.c#L156" id="L156" class="3ine" name3"L115"> 115         3     31code=DEFINE_count_user_time" claa hode=cvoid)
();a hode=cvoid)
task_struct *p, in"+code=ck  116{
rving_softirq href=d/cputime.c#L94" id="L94" class="li3ine" name3"L117"> 117#ifdef  118        s3ruct 31+code=account_group_user_timcpuputime_t )
p,cpuputimone_jiffy_scaled)
 119        s3ruct 31+code=local_irq_restore" cla/a> cpustat = kcpustat_this_cpu->cpustat;
 120#endif
 121        <3pan c32eturn;
(); efal"void)
 122 123 124
();a hode=cvoid)

 125[inref">CPUIME_IRQ])
 cputimemone_jiffy_scaled)
 126
();a hode=cvoid)

 127        <3 href32a href="+code=kcpustacpu_add" class=cpustat[inref">CPUCPUTIME_SOFTIRQ])
 cputimemone_jiffy_scaled)
 128
p,  129#ifdef  130        i3 ( * compromise in place                 * kp; 
doenoth eroahref="kere lcod_p; el/sched/cputime.c#L146" id="L146" class="3ine" name3"L131"> 131         3     33ent"> */
patelyhotreel/sched/cputime.c#L146" id="L146" class="3ine" name3"L132"> 132
 * There are no locks c                * Also,>pustatspan>
needef="kbe="kerne+ ksofkp;  133        <3 href33ent">         * get ourselve                *el/sched/cputime.c#L156" id="L156" class="3ine" name3"L134"> 134        <3 href33+code=ca" cla=__this_cpu_add" class=_(void)
p, cputimemone_jiffy_scaled)
one_jiffymputime_scaled)
 135        w3ile (33 href="+code=f="+code=__this_=ca" cla=__this_cpu_add" class=ref">CPUCPUTIME_SOFTIRQ])
 136         3     33+code=latest_dee=in_serving_softirq" cl"+code=ck  137         3     3account_group_user_time(p, cputimemone_jiffy_scaled)
one_jiffymputime_scaled)
 138         3     338code=latest_dee=in_serving_softirq" cl p,rving_softirq href=ustat" class="sref">idled_unlock();adleputided/cputime.c#L136" id="L136" class="3ine" name3"L139"> 139        }3);
p,cpuputimone_jiffy_scaled)
 140        <3 href34 href="+code=}ary.curPF_VCPUa>);

or  ueef=pan>
*el/sched/cputime.c#L156" id="L156" class="3ine" name3"L141"> 141#endif
(p, cputimemone_jiffy_scaled)
one_jiffymputime_scaled)
 142}
 143
p, cputimemone_jiffy_scaled)
one_jiffymputime_scaled)
 144CPUCYSTEM_SOFTIRQ])
 145 146d/cputime.c#L76" id="L76" class="li3ine" name3"L147"> 147 148DEFINE_count_user_time" claa hode=cvoid)
);
inkeea/a>);
 149d/cputime.c#L136" id="L136" class="3ine" name3"L150"> 150void inda>);
 151         3     35a href="+codetask_struct" class="srrving_softirq href=_t" class="sref">rving_softirq href=_cpu_ptr" class="sref">rving_softirqref">rvref="+d/cputime.c#L96" id="L96" class="li3ine" name3"L152"> 152{
 153        i3t );
inda>);
inkeea/a>);
inda>);
 154
();a hode=cvoid)
currerq_count())
rving_softirq href=dd/cputime.c#L96" id="L96" class="li3ine" name3"L155"> 155        <3pan c35/sched/cputime.c#L76" id="L76" class="li3ine" name3"L156"> 156        <3 href3"+code#ry.

 157        <3 href35ent">DEFINE_count_user_time" claa hode=cvoid)
);
inkeea/a>);
 158        <3 href35ent">DEFINE_count_user_time" claa hode=cvoid)
();a hode=cvoid)
task_struct *p, in"+code=ck  159
rving_softirq href=d {d/cputime.c#L76" id="L76" class="li3ine" name3"L160"> 160        <3 href36ent">/sched//* Add user time to proce/a>

C36sched/cputime.c#L112" id="L112" class="3Ikernel/s3hed/cpCclass="sref">CPUT3kerne36ent"> * There are no locks nel/sched/cputime.c#L145" id="L145" class="3ne" name=3"L63">  63         * get ourselveprto a proa singlthkeea  64         * is the only ofme cpu time gets accounted to
  65 * Account user cpu time @"+code=ck:hechecates/sernothkeea  16 * @p: the process tharnel/sched/cputime.c#L156" id="L156" class="3ine" name3"L67">  67();void)
task_struct *p, in"+code=ck   68        if3 (  69          3     36+code=local_irq_restore" clacpuputime_t )
p,cpuputimone_jiffy_scaled)
  70        el3se if37 href="+code=task_struct" class="srrving_softirq href=_t" class="sref">rving_softirq href=_cpu_ptr" class="sref">rving_softirqref">rvref="+d/cputime.c#L96" id="L96" class="li3ne" name=3"L71">  71          3     37sched/cputime.c#L112" id="L112" class="3ne" name=3"L72">  72
(); d="L"c_rea_a hode=putided/cputime.c#L136" id="L136" class="3ne" name=3"L73">  73        ();a hode=cvoid)
 "+code=ck rving_softirq href=dd/cputime.c#L96" id="L96" class="li3ne" name=3"L74">  74          75}
  76  17(); efal"void)
  78static int3   79{
  80          81        un3signe38a href="+code=__this_cpu_add" class=void)
account_group_user_time(p, cputimemone_jiffy_scaled)
one_jiffymputime_scaled)
  82        p,rving_softirq href=ustat" class="sref">idled_unlock();adleputide||lass="sref">cahardirq_count())
p,HARD  83        in3t p, HARDcputimemone_jiffy_scaled)
  84
one_jiffymputime_scaled)
  85          86        );
p,cpuputimone_jiffy_scaled)
  87        if3 (d/cputime.c#L143" id="L143" class="3ne" name=3"L88">  88          3     38sched/cputime.c#L129" id="L129" class="3nne" name3"L89">  89         */
  90        re3turn 39ent"> * compromise in place ofse from multiple=packs  91}
 */
  92
         * Since all upnthpacks: numb  93static int3          * get ourselvepel/sched/cputime.c#L156" id="L156" class="3ne" name=3"L94">  94{
count_user_time" class="srefrefal"keea/a>);
inkeea/a>);
  95        d/cputime.c#L136" id="L136" class="3ne" name=3"L96">  96        un3signe39+code=p" class="sref">p-f=""srefrefal"kern);
p,jiffieskpom36" cla);
p,keea/a>);
  97        d/cputime.c#L143" id="L143" class="3ne" name=3"L98">  98        in3t   99
 * task when irq is innel/sched/cputime.c#L145" id="L145" class="4ine" name4"L100"> 100        <4 href40ent"> * compromise in place ofse from multiple=packsel/sched/cputime.c#L146" id="L146" class="4i1e" name4"L91">  91}
 */
 102        i4 ( * There are no locks coel/sched/cputime.c#L156" id="L156" class="4i3e" name4"L93">  93static int4     40ent">count_user_time" class="srefidle"keea/a>);
inkeea/a>);
  94{
d/cputime.c#L136" id="L136" class="4i5e" name4"L95">  95          96        un4"kern40a href="+codedirq_count" class=" d="L"c_rea_a hode=d_unlock(); d="L"c_rea_a hode=putided/cputime.c#L136" id="L136" class="4i7e" name4"L97">  97        );
inkeea/a>);
  98        in4n cla40a href="+code=ret" cll/sched/cputime.c#L132" id="L132" class="4i9e" name4"L99">  99
 110#define <4 href41sched/cputime.c#L61" id="L61" class="li4i1e" name4"L111"> 111
p-f=""srefidle"kern);
p,jiffieskpom36" cla);
p,keea/a>);
 112#endif d/cputime.c#L143" id="L143" class="4i3e" name4"L113"> 113
 114static /sched/cputime.c#L142" id="L142" class="4ine" name4"L115"> 115         4     41+code/cputime.c#L157" id="L157" class="4i6e" name4"L116"> 116{
 * @p: the process thanel/sched/cputime.c#L145" id="L145" class="4ine" name4"L117"> 117#ifdef  * @cputime: the cpu timeUs timecis tilatform DEFINskees/seravailabim:l/sched/cputime.c#L145" id="L145" class="4i8e" name4"L118"> 118        s4ruct 41ent"> * @cputime_scaled: cputel/sched/cputime.c#L156" id="L156" class="4ine" name4"L119"> 119        s4ruct 41+codeCONFIG_CGROUP_CPUACCT" class=VIR_kern 120#endif
task_struct *p,  p,ue_t  p,st[ 121        <4pan c42     d/cputime.c#L136" id="L136" class="4ine" name4"L122"> 122p,ue_t " cla);
 123p,st[sode=d_unlock();  clacoded/cputime.c#L99" id="L99" class="li4i4e" name4"L124"> 124 125 126);
task_struct *p,  p,ue_t  p,st[ 127        <4 href42/sched/cputime.c#L48" id="L48" class="li4ine" name4"L128"> 128
t36" cla);
t36" clautime_scaled" class=36" cla);
 129#ifdef  130        i4 ();
p, );
 131         4     43sched/cputime.c#L112" id="L112" class="4ine" name4"L132"> 132
p,ue_t );
" cla);
 133        <4 href433 href="+codess="sref">p,st[);
sode=d_unlock();  clacoded/cputime.c#L99" id="L99" class="li4ine" name4"L134"> 134        <4 href43/sched/cputime.c#L143" id="L143" class="4ine" name4"L135"> 135        w4ile (43+code/cputime.c#L157" id="L157" class="4ine" name4"L136"> 136         4     43ent"> * @p: the process thanel/sched/cputime.c#L145" id="L145" class="4ine" name4"L137"> 137         4     43ent"> * @cputime: the cpu timesrchts accoao a prountewhole=pan>ince the lunteidle=pf">l/sched/cputime.c#L145" id="L145" class="4ine" name4"L138"> 138         4     43ent"> * @cputime_scaled: cputi(outside irv)=an idle=pan> c@cprelyho luninf thejusthemplemerqnesched/cputime.c#L145" id="L145" class="4ine" name4"L139"> 139        }4 * task when irq is in prvode=cvoid)
 140        <4 href44ent"> * compromise in place ofhav
 (s390hinlyhincluden notnesched/cputime.c#L145" id="L145" class="4ine" name4"L141"> 141#endif
 */
 142}
         * Since all upntvode=cvoid)
<().nesched/cputime.c#L145" id="L145" class="4ine" name4"L143"> 143
         * get ourselvepel/sched/cputime.c#L156" id="L156" class="4ine" name4"L144"> 144CONnFIG_CGROUP_CPUACCT"__ARCH_HAS_Van>
();__ARCH_HAS_Van>
 145();vode=cvoid)
task_struct *p,tsk  146d/cputime.c#L48" id="L48" class="li4ine" name4"L147"> 147inags);
 148 149);
p,ags);
 150void  151         4     45eturn;
())
p,ksk  152{
();vode=cvoid)
p,ksk  153        i4t  154
();vode=cvoid)
p,ksk  155        <4pan c45+code/cputime.c#L157" id="L157" class="4ine" name4"L156"> 156        <4 href45+code=p" class="sref">p-local_a h_restor
a>);
p,ags);
 157        <4 href45ent">d/cputime.c#L143" id="L143" class="4ine" name4"L158"> 158        <4 href45ent">s="sref">p,EXPORT_SYMBOL_GPLa>);
p,vode=cvoid)
();vode=cvoid)
 159

 160        <4 href46sched/cputime.c#L61" id="L61" class="li4ine" name4"L1de=ir160SER" class="s4ef">C46sched#e=in/cputime.c#L157" id="L157" class="4Ikernel/s4hed/cpCclass="sref">CPUT4kerne46sched/cputime.c#L133" id="L133" class="4ne" name=4"L63">  63);
  64# FIGa><_CGROUP_CPUACCT"nsecskpom36" cla);
p-nsecskpomjiffies);
  65/sched/cputime.c#L142" id="L142" class="4nne" name4LL16">  16  67DEFINE_rq_restore" clacpuputime_t );
);
 );
 ();totalputid/cputime.c#L133" id="L133" class="4nne" name4"L68">  68        if4 (  69          4     46+code=local_irq_restore" cla/a>  r cla);
  70        el4se if47sched/cputime.c#L61" id="L61" class="li4ne" name=4"L71">  71          4     471code=p" class="sref">p-ef=  " cla);
  72
  73          74         p,kf=  132 href="32 hre)e" class="sref">totald_unlock();totalputidd/cputime.c#L99" id="L99" class="li4nne" name4"L75">  75}
  76 p,kf=  totald_unlock();totalputidd/cputime.c#L99" id="L99" class="li4nne" name4LL17">  17  78static int4  p,kf=   79{
  80          81        un4signe48a hrecount_user_time" claef="+lass/a>);
task_struct *p,  p,ue_t  p,st[  82          83        in4t  );
);
" cla);
();totalputint_ca" class="sref" cla);
sode=d_unlock();  clacoded/cputime.c#L99" id="L99" class="li4ne" name=4"L84">  84
  85          86         * @p: the process tharrrrrrrrrmeUs tCFS'shimecis tvoid)
  87        if4 ( * @cputime: the cpu tirrrrrrrrmel/sched/cputime.c#L156" id="L156" class="4ne" name=4"L88">  88          4     48+code=account_group_user_timr cla);
);
s=d_unlock(); autim." class="sref">sum_exec_r pran>d_unlock(); um_exec_r pran>putidd/cputime.c#L99" id="L99" class="li4nne" name4"L89">  89          90        re4turn 490href="+code=cs_t_scaled" class=totald_unlock();totalputid/cputime.c#L133" id="L133" class="4ne" name=4"L91">  91}
);
);
);
();totalputidd/cputime.c#L99" id="L99" class="li4ne" name=4"L92">  92
  93static int4   94{
  95          96        un4signe49ent"> * @p: the process tharrrrrrrrrmeComparthwithhimevious values,f="kkeep monotonicity:l/sched/cputime.c#L145" id="L145" class="4ne" name=4"L97">  97         * @cputime: the cpu tirrrrrrrrmel/sched/cputime.c#L156" id="L156" class="4ne" name=4"L98">  98        in4t imev"" cla);
imev"" cla);
);
  99
imev"sode=d_unlock();imev"sode=codent_ca" class="srefmax);
imev"sode=d_unlock();imev"sode=codemerq_restore" clar cla);
imev"" cla);
 100        <5 href50sched/cputime.c#L61" id="L61" class="li5i1e" name5"L91">  91}
p,ue_t imev"" cla);
  92
p,st[imev"sode=d_unlock();imev"sode=coded/cputime.c#L99" id="L99" class="li5i3e" name5"L93">  93static int5     50ent">d/cputime.c#L76" id="L76" class="li5i4e" name5"L94">  94{
  95         * Account user cpu tinel/sched/cputime.c#L145" id="L145" class="5i6e" name5"L96">  96        un5"kern50ent"> * @p: the process tharn Musthb> c@lledhwithhsig_rea helrel/sched/cputime.c#L146" id="L146" class="5i7e" name5"L97">  97         * @cputime: the cpu timel/sched/cputime.c#L156" id="L156" class="5i8e" name5"L98">  98        in5n cla50a hrecount_user_time" claehs_cp_group+lass/a>);
task_struct *p,  p,ue_t  p,st[  99
d/cputime.c#L136" id="L136" class="5ine" name5"L110"> 110#define <5 href51 href="+code=task_struct" class="srsignaltask_struct *p,sigruct *signalruct * 111
t36" cla);
t36" clautime_scaled" class=36" cla);
 112#endif  );
);
();totalputid/cputime.c#L99" id="L99" class="li5i3e" name5"L113"> 113
 114static );
p, );
 115         5     51+code/cputime.c#L157" id="L157" class="5i6e" name5"L116"> 116{
p-totald_unlock();totalputint_ca" class="sref36" cla);
" cla);
);
sode=d_unlock();  clacoded/cputime.c#L99" id="L99" class="li5ine" name5"L117"> 117#ifdef p-r cla);
);
);
sum_exec_r pran>d_unlock(); um_exec_r pran>putidd/cputime.c#L99" id="L99" class="li5i8e" name5"L118"> 118        s5ruct 51sched/cputime.c#L129" id="L129" class="5ine" name5"L119"> 119        s5ruct 51+code=local_ics_t_scaled" class=totald_unlock();totalputid/cputime.c#L133" id="L133" class="5ine" name5"L120"> 120#endif
);
);
" cla);
);
();totalputidd/cputime.c#L99" id="L99" class="li5i1e" name5"L121"> 121        <5pan c52a href="+codery. 122 123 124 *imev"" cla);
imev"" cla);
);
 125 *imev"sode=d_unlock();imev"sode=codent_ca" class="srefmax);
imev"sode=d_unlock();imev"sode=codemerq_restore" clar cla);
 *imev"" cla);
 126 127        <5 href527code=p" classs="sref">p,ue_t imev"" cla);
 128
p,st[ *imev"sode=d_unlock();imev"sode=coded/cputime.c#L99" id="L99" class="li5ine" name5"L129"> 129#ifdef  130        i5 (/sched/cputime.c#L76" id="L76" class="li5i1e" name5"L131"> 131         5     53sched


131footer"> The original LXR softwarthbyluntecputime.chttp://sourceforge.net/imojects/lxr">LXR the unitynel/meuninfexperi cpual versionhbylcputime.cmailto:lxr@lxr@ 131subfooter"> lxr.Redpill L/aimo ASnel/meimovid