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 12:33:26PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 01 2020 at 10:20, Peter Zijlstra wrote:
> > On Tue, Dec 01, 2020 at 01:12:25AM +0100, Frederic Weisbecker wrote:
> > Why not something like:
> >
> > void irqtime_account_irq(struct task_struct *curr, unsigned int offset)
> > {
> > struct irqtime *irqtime = this_cpu_ptr(&cpu_irqtime);
> > unsigned int pc = preempt_count() - offset;
> > s64 delta;
> > int cpu;
> >
> > if (!sched_clock_irqtime)
> > return;
> >
> > cpu = smp_processor_id();
> > delta = sched_clock_cpu(cpu) - irqtime->irq_start_time;
> > irqtime->irq_start_time += delta;
> >
> > /*
> > * 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.
> > */
> > if (pc & HARDIRQ_MASK)
> > irqtime_account_delta(irqtime, delta, CPUTIME_IRQ);
> > else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd())
> > irqtime_account_delta(irqtime, delta, CPUTIME_SOFTIRQ);
> > }
>
> Why not making all of this explicit instead of these conditionals?

Hmm, I'm not sure I get what you suggest?

Thanks.

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