lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation
On Tue, Dec 01, 2020 at 03:35:45PM +0100, Frederic Weisbecker wrote:
> And that one too makes things simple. But note that
>
> account_hardirq_enter_time()
>
> will still need some preempt count checks to see if
> this is a nested hardirq, a hardirq interrupting a softirq
> or a hardirq interrupting a task.

So the current tests get that all correct in a single function.
Splitting it out will just result in more lines to get wrong.

That is, I don't think you can do it saner than:

account_softirq_enter() := irqtime_account_irq(curr, SOFTIRQ_OFFSET);
account_softirq_exit() := irqtime_account_irq(curr, 0);
account_hardirq_enter() := irqtime_account_irq(curr, HARDIRQ_OFFSET);
account_hardirq_exit() := irqtime_account_irq(curr, 0);

Fundamentally you have to determine the previous context to determine
where to account the delta to. Note that when the previous context is
task context we throw away the delta.

\
 
 \ /
  Last update: 2020-12-01 16:05    [W:0.060 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site