lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTing_EuL2ei4dgcK-o7fP3brAJLCY4p9ySRYze6Q@mail.gmail.com>
Date:	Thu, 21 Oct 2010 12:10:29 -0700
From:	Venkatesh Pallipadi <venki@...gle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	linux-kernel@...r.kernel.org, Paul Turner <pjt@...gle.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Shaun Ruffell <sruffell@...ium.com>,
	Yong Zhang <yong.zhang0@...il.com>
Subject: Re: [PATCH 5/6] Account ksoftirq time as cpustat softirq

On Thu, Oct 21, 2010 at 7:53 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> 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?
>

Yes. As we are using this ksoftirqd_time at only one place,
this_softirq_task()->se.sum_exec_runtime with a comment on why we are
doing that would be simpler. Will do.

Thanks,
Venki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ