Re: [PATCH v2] delayaccy/sched: add SOFTIRQ delay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Taking the difference of two successive readings of a given
> counter (say cpu_delay_total) for a task will give the delay
>@@ -123,6 +124,8 @@ Get sum and peak of delays, since system boot, for all pids with tgid 242::
>                   156       11215873          0.072ms     0.207403ms     0.033913ms
>     IRQ         count    delay total  delay average      delay max      delay min
>                     0              0          0.000ms     0.000000ms     0.000000ms
>+    SOFTIRQ     count    delay total  delay average      delay max      delay min
>+                    0              0          0.000ms     0.000000ms     0.000000ms
>
> Get IO accounting for pid 1, it works only with -p::

If possible, you can construct some abnormal scenarios to assign values to IRQ and SOFTIRQ,
highlighting the differences between them. Additionally, this should cover the testing of
new features. If the delay info is entirely zero, it may fail to demonstrate such differences.

>+    /*
>+     * We only account softirq time when we are called by
>+     * account_softirq_enter{,exit}
>+     * and we do not account ksoftirqd here.
>+     */
>+    if (curr != this_cpu_ksoftirqd() &&
>+        ((offset & SOFTIRQ_OFFSET) || (pc & SOFTIRQ_OFFSET))) {
>+        delta_soft = cpu_clock - irqtime->soft_start_time;
>+        irqtime->soft_start_time += delta_soft;
>+    }
>+
>     /*
>      * We do not account for softirq time from ksoftirqd here.
>      * We want to continue accounting softirq time to ksoftirqd thread
>@@ -75,9 +88,9 @@ void irqtime_account_irq(struct task_struct *curr, unsigned int offset)
>      * that do not consume any time, but still wants to run.
>      */
>     if (pc & HARDIRQ_MASK)
>-        irqtime_account_delta(irqtime, delta, CPUTIME_IRQ);
>+        irqtime_account_delta(irqtime, delta, delta_soft, CPUTIME_IRQ);
>     else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd())
>-        irqtime_account_delta(irqtime, delta, CPUTIME_SOFTIRQ);
>+        irqtime_account_delta(irqtime, delta, delta_soft, CPUTIME_SOFTIRQ);
> }
>
> static u64 irqtime_tick_accounted(u64 maxtime)

As you mentioned, delta_soft represents SOFTIRQ, but it appears to have been accumulated once
under the condition of (pc & HARDIRQ_MASK). Is there a potential double-counting issue?
replacing delta_soft with 0 when in HARDIRQ might make it more intuitive.

Thanks,
Yaxin




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux