lkml.org 
[lkml]   [2010]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 5/6] Account ksoftirq time as cpustat softirq
    From
    Date
    On Wed, 2010-10-20 at 15:49 -0700, Venkatesh Pallipadi wrote:
    > @@ -1979,15 +1980,20 @@ void account_system_vtime(struct task_struct *curr)
    > delta = now - per_cpu(irq_start_time, cpu);
    > per_cpu(irq_start_time, cpu) = now;
    > /*
    > - * We do not account for softirq time from ksoftirqd here.
    > * We want to continue accounting softirq time to ksoftirqd thread
    > * in that case, so as not to confuse scheduler with a special task
    > * that do not consume any time, but still wants to run.
    > + * So, softirq time in ksoftirqd is accounted separately and used
    > + * for softirq time reporting in /proc/stat.
    > */
    > - if (in_irq())
    > + if (in_irq()) {
    > per_cpu(cpu_hardirq_time, cpu) += delta;
    > - else if (in_serving_softirq() && !(is_ksoftirqd_context()))
    > - per_cpu(cpu_softirq_time, cpu) += delta;
    > + } else if (in_serving_softirq()) {
    > + if (is_ksoftirqd_context())
    > + per_cpu(cpu_ksoftirqd_time, cpu) += delta;
    > + else
    > + per_cpu(cpu_softirq_time, cpu) += delta;
    > + }
    >
    > local_irq_restore(flags);
    > }
    > @@ -2025,7 +2031,9 @@ static int irqtime_account_si_update(void)
    > int ret = 0;
    >
    > local_irq_save(flags);
    > - latest_ns = __get_cpu_var(cpu_softirq_time);
    > + latest_ns = __get_cpu_var(cpu_softirq_time) +
    > + __get_cpu_var(cpu_ksoftirqd_time);

    wouldn't something like:

    latest_ns = this_cpu_read(cpu_softirq_time) +
    this_softirq_task()->se.sum_exec_runtime;

    be easier?




    \
     
     \ /
      Last update: 2010-10-21 16:57    [W:0.038 / U:29.048 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site