Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-29 Thread Qais Yousef
On 12/29/20 15:30, Frederic Weisbecker wrote: > On Tue, Dec 29, 2020 at 02:12:31PM +, Qais Yousef wrote: > > On 12/29/20 14:41, Frederic Weisbecker wrote: > > > > > -void vtime_account_irq(struct task_struct *tsk) > > > > > +void vtime_account_irq(struct task_struct *tsk, unsigned int offset)

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-29 Thread Frederic Weisbecker
On Tue, Dec 29, 2020 at 02:12:31PM +, Qais Yousef wrote: > On 12/29/20 14:41, Frederic Weisbecker wrote: > > > > -void vtime_account_irq(struct task_struct *tsk) > > > > +void vtime_account_irq(struct task_struct *tsk, unsigned int offset) > > > > { > > > > - if (hardirq_count()) { > >

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-29 Thread Qais Yousef
On 12/29/20 14:41, Frederic Weisbecker wrote: > On Mon, Dec 28, 2020 at 02:15:29AM +, Qais Yousef wrote: > > Hi Frederic > > > > On 12/02/20 12:57, Frederic Weisbecker wrote: > > > @@ -66,9 +68,9 @@ void irqtime_account_irq(struct task_struct *curr) > > >* in that case, so as not to

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-29 Thread Frederic Weisbecker
On Mon, Dec 28, 2020 at 02:15:29AM +, Qais Yousef wrote: > Hi Frederic > > On 12/02/20 12:57, Frederic Weisbecker wrote: > > @@ -66,9 +68,9 @@ void irqtime_account_irq(struct task_struct *curr) > > * in that case, so as not to confuse scheduler with a special task > > * that do not

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-27 Thread Qais Yousef
Hi Frederic On 12/02/20 12:57, Frederic Weisbecker wrote: > #endif /* _LINUX_KERNEL_VTIME_H */ > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c > index 02163d4260d7..5f611658eeab 100644 > --- a/kernel/sched/cputime.c > +++ b/kernel/sched/cputime.c > @@ -44,12 +44,13 @@ static void

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-02 Thread Peter Zijlstra
On Wed, Dec 02, 2020 at 12:57:31PM +0100, Frederic Weisbecker wrote: > IRQ time entry is currently accounted before HARDIRQ_OFFSET or > SOFTIRQ_OFFSET are incremented. This is convenient to decide to which > index the cputime to account is dispatched. > > Unfortunately it prevents

[PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-02 Thread Frederic Weisbecker
IRQ time entry is currently accounted before HARDIRQ_OFFSET or SOFTIRQ_OFFSET are incremented. This is convenient to decide to which index the cputime to account is dispatched. Unfortunately it prevents tick_irq_enter() from being called under HARDIRQ_OFFSET because tick_irq_enter() has to be

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Thomas Gleixner
On Tue, Dec 01 2020 at 16:01, Peter Zijlstra wrote: > 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

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Peter Zijlstra
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

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Frederic Weisbecker
On Tue, Dec 01, 2020 at 02:34:49PM +0100, Thomas Gleixner wrote: > On Tue, Dec 01 2020 at 12:40, Frederic Weisbecker wrote: > > On Tue, Dec 01, 2020 at 12:33:26PM +0100, Thomas Gleixner wrote: > >> > /* > >> > * We do not account for softirq time from ksoftirqd here. > >> > * We want to

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Thomas Gleixner
On Tue, Dec 01 2020 at 12:40, Frederic Weisbecker wrote: > On Tue, Dec 01, 2020 at 12:33:26PM +0100, Thomas Gleixner wrote: >> >/* >> > * We do not account for softirq time from ksoftirqd here. >> > * We want to continue accounting softirq time to ksoftirqd thread >> > * in that

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Frederic Weisbecker
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

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Thomas Gleixner
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(_irqtime); >

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Frederic Weisbecker
On Tue, Dec 01, 2020 at 10:20:11AM +0100, Peter Zijlstra wrote: > On Tue, Dec 01, 2020 at 01:12:25AM +0100, Frederic Weisbecker wrote: > > +static s64 irqtime_get_delta(struct irqtime *irqtime) > > { > > + int cpu = smp_processor_id(); > > s64 delta; > > > > delta =

Re: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-12-01 Thread Peter Zijlstra
On Tue, Dec 01, 2020 at 01:12:25AM +0100, Frederic Weisbecker wrote: > +static s64 irqtime_get_delta(struct irqtime *irqtime) > { > + int cpu = smp_processor_id(); > s64 delta; > > delta = sched_clock_cpu(cpu) - irqtime->irq_start_time; > irqtime->irq_start_time += delta;

[PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation

2020-11-30 Thread Frederic Weisbecker
IRQ time entry is currently accounted before HARDIRQ_OFFSET or SOFTIRQ_OFFSET are incremented. This is convenient to decide to which index the cputime to account is dispatched. Unfortunately it prevents tick_irq_enter() from being called under HARDIRQ_OFFSET because tick_irq_enter() has to be