public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@kernel.org, pbonzini@redhat.com, fweisbec@redhat.com,
	wanpeng.li@hotmail.com, efault@gmx.de, tglx@linutronix.de,
	rkrcmar@redhat.com, kernel@kyup.com
Subject: Re: [PATCH v3 1/4] sched,time: count actually elapsed irq & softirq time
Date: Wed, 6 Jul 2016 16:15:22 +0200	[thread overview]
Message-ID: <20160706141518.GA12876@lerouge> (raw)
In-Reply-To: <20160705124707.199ba315@annuminas.surriel.com>

On Tue, Jul 05, 2016 at 12:47:07PM -0400, Rik van Riel wrote:
> On Tue, 5 Jul 2016 14:40:34 +0200
> Frederic Weisbecker <fweisbec@gmail.com> wrote:
> 
> > ...
> 
> Thanks for the review Frederic. Here is a fixed version of patch 1,
> the other three still seem to apply cleanly.
> 
> ---8<---
> 
> Subject: sched,time: count actually elapsed irq & softirq time
> 
> Currently, if there was any irq or softirq time during 'ticks'
> jiffies, the entire period will be accounted as irq or softirq
> time.
> 
> This is inaccurate if only a subset of the time was actually spent
> handling irqs, and could conceivably mis-count all of the ticks during
> a period as irq time, when there was some irq and some softirq time.
> 
> This can actually happen when irqtime_account_process_tick is called
> from account_idle_ticks, which can pass a larger number of ticks down
> all at once.
> 
> Fix this by changing irqtime_account_hi_update, irqtime_account_si_update,
> and steal_account_process_ticks to work with cputime_t time units, and
> return the amount of time spent in each mode.
> 
> Rename steal_account_process_ticks to steal_account_process_time, to
> reflect that time is now accounted in cputime_t, instead of ticks.
> 
> Additionally, have irqtime_account_process_tick take into account how
> much time was spent in each of steal, irq, and softirq time.
> 
> The latter could help improve the accuracy of cputime
> accounting when returning from idle on a NO_HZ_IDLE CPU.
> 
> Properly accounting how much time was spent in hardirq and
> softirq time will also allow the NO_HZ_FULL code to re-use
> these same functions for hardirq and softirq accounting.
> 
> Signed-off-by: Rik van Riel <riel@redhat.com>
> ---
>  include/asm-generic/cputime_nsecs.h |   2 +
>  kernel/sched/cputime.c              | 124 ++++++++++++++++++++++--------------
>  2 files changed, 79 insertions(+), 47 deletions(-)
> 
> diff --git a/include/asm-generic/cputime_nsecs.h b/include/asm-generic/cputime_nsecs.h
> index 0f1c6f315cdc..918ebb01486c 100644
> --- a/include/asm-generic/cputime_nsecs.h
> +++ b/include/asm-generic/cputime_nsecs.h
> @@ -50,6 +50,8 @@ typedef u64 __nocast cputime64_t;
>  	(__force u64)(__ct)
>  #define nsecs_to_cputime(__nsecs)	\
>  	(__force cputime_t)(__nsecs)
> +#define nsecs_to_cputime64(__nsecs)	\
> +	(__force cputime_t)(__nsecs)

(__force cputime64_t) :-)

Although functionally that shouldn't matter for cputime_nsecs.h. You probably
won't get a warning either.

Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>

Thanks!

  reply	other threads:[~2016-07-06 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 19:35 [PATCH v3 0/4] sched,time: fix irq time accounting with nohz_idle riel
2016-06-30 19:35 ` [PATCH 1/4] sched,time: count actually elapsed irq & softirq time riel
2016-07-05 12:40   ` Frederic Weisbecker
2016-07-05 13:08     ` Rik van Riel
2016-07-05 14:00       ` Frederic Weisbecker
2016-07-05 16:47     ` [PATCH v3 " Rik van Riel
2016-07-06 14:15       ` Frederic Weisbecker [this message]
2016-06-30 19:35 ` [PATCH 2/4] nohz,cputime: replace VTIME_GEN irq time code with IRQ_TIME_ACCOUNTING code riel
2016-06-30 19:35 ` [PATCH 3/4] irqtime: add irq type parameter to irqtime_account_irq riel
2016-06-30 19:35 ` [PATCH 4/4] irqtime: drop local_irq_save/restore from irqtime_account_irq riel
2016-07-08 12:30   ` Frederic Weisbecker
2016-07-08 13:19     ` Rik van Riel
2016-07-08 14:01       ` Frederic Weisbecker
2016-07-08 14:34       ` Paolo Bonzini
2016-07-08 15:56         ` Rik van Riel
2016-07-08 23:58           ` Frederic Weisbecker
2016-07-05 13:02 ` [PATCH v3 0/4] sched,time: fix irq time accounting with nohz_idle Nikolay Borisov
2016-07-05 13:09   ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160706141518.GA12876@lerouge \
    --to=fweisbec@gmail.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@redhat.com \
    --cc=kernel@kyup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox