lkml.org 
[lkml]   [2011]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFD 3/9] Display /proc/stat information per cgroup
    From
    Date
    On Fri, 2011-09-23 at 19:20 -0300, Glauber Costa wrote:
    > +static inline void task_cgroup_account_field(struct task_struct *p,
    > + cputime64_t tmp, int index)
    > +{
    > + struct kernel_stat *kstat;
    > + struct task_group *tg = task_group(p);
    > +
    > + do {
    > + kstat = this_cpu_ptr(tg->cpustat);
    > + kstat->cpustat[index] = cputime64_add(kstat->cpustat[index],
    > + tmp);

    So aside from the cputime64_t nonsense you could actually write that as:

    __this_cpu_add(tg->cpustat[index], tmp);

    which should yield better asm I think, a quick grep seems to confirm
    cputime64_t is indeed a u64 all over so its fair to just ignore that.

    > + tg = tg->parent;
    > + } while (tg);
    > +}




    \
     
     \ /
      Last update: 2011-09-27 23:51    [W:0.018 / U:37.568 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site