All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Russell King <linux@arm.linux.org.uk>
Subject: Re: [PATCH 6/6] cputime: Make finegrained irqtime accounting generally available
Date: Mon, 10 Sep 2012 21:53:38 +0200	[thread overview]
Message-ID: <20120910195324.GA19268@somewhere> (raw)
In-Reply-To: <1347306193-21080-7-git-send-email-fweisbec@gmail.com>

On Mon, Sep 10, 2012 at 09:43:13PM +0200, Frederic Weisbecker wrote:
> There is no known reason for this option to be unavailable on other
> archs than x86. They just need to call enable_sched_clock_irqtime()
> if they have a sufficiently finegrained clock to make it working.
> 
> Move it to the general option and let the user choose between
> it and pure tick based or virtual cputime accounting.
> 
> Note that virtual cputime accounting already performs a finegrained
> irqtime accounting. CONFIG_IRQ_TIME_ACCOUNTING is a kind of middle ground
> between tick and virtual based accounting. So CONFIG_IRQ_TIME_ACCOUNTING
> and CONFIG_VIRT_CPU_ACCOUNTING are mutually exclusive choices.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> ---
>  arch/Kconfig     |    6 ++++++
>  arch/x86/Kconfig |   12 +-----------
>  init/Kconfig     |   30 +++++++++++++++++++++++++++++-
>  3 files changed, 36 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index f78de57..101c31a 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -284,4 +284,10 @@ config SECCOMP_FILTER
>  config HAVE_VIRT_CPU_ACCOUNTING
>  	bool
>  
> +config HAVE_IRQ_TIME_ACCOUNTING
> +	bool
> +	help
> +	  Archs need to ensure they use a high enough resolution clock to
> +	  support irq time accounting and then call enable_sched_clock_irqtime().
> +
>  source "kernel/gcov/Kconfig"
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 8ec3a1a..b86833a 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -97,6 +97,7 @@ config X86
>  	select KTIME_SCALAR if X86_32
>  	select GENERIC_STRNCPY_FROM_USER
>  	select GENERIC_STRNLEN_USER
> +	select HAVE_IRQ_TIME_ACCOUNTING
>  
>  config INSTRUCTION_DECODER
>  	def_bool (KPROBES || PERF_EVENTS || UPROBES)
> @@ -796,17 +797,6 @@ config SCHED_MC
>  	  making when dealing with multi-core CPU chips at a cost of slightly
>  	  increased overhead in some places. If unsure say N here.
>  
> -config IRQ_TIME_ACCOUNTING
> -	bool "Fine granularity task level IRQ time accounting"
> -	default n
> -	---help---
> -	  Select this option to enable fine granularity task irq time
> -	  accounting. This is done by reading a timestamp on each
> -	  transitions between softirq and hardirq state, so there can be a
> -	  small performance impact.
> -
> -	  If in doubt, say N here.
> -
>  source "kernel/Kconfig.preempt"
>  
>  config X86_UP_APIC
> diff --git a/init/Kconfig b/init/Kconfig
> index 2c5aa34..054114e 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -326,10 +326,25 @@ source "kernel/time/Kconfig"
>  
>  menu "CPU/Task time and stats accounting"
>  
> +choice
> +	prompt "Cputime accounting"
> +	default TICK_CPU_ACCOUNTING if !PPC64
> +	default VIRT_CPU_ACCOUNTING if PPC64
> +
> +# Kind of a stub config for the pure tick based cputime accounting
> +config TICK_CPU_ACCOUNTING
> +	bool "Simple tick based cputime accounting"
> +	depends on !S390
> +	help
> +	  This is the basic tick based cputime accounting that maintains
> +	  statistics about user, system and idle time spent on per jiffies
> +	  granularity.
> +
> +	  If unsure, say Y.
> +
>  config VIRT_CPU_ACCOUNTING
>  	bool "Deterministic task and CPU time accounting"
>  	depends on HAVE_VIRT_CPU_ACCOUNTING
> -	default y if PPC64
>  	help
>  	  Select this option to enable more accurate task and CPU time
>  	  accounting.  This is done by reading a CPU counter on each
> @@ -339,6 +354,19 @@ config VIRT_CPU_ACCOUNTING
>  	  this also enables accounting of stolen time on logically-partitioned
>  	  systems.
>  
> +config IRQ_TIME_ACCOUNTING
> +	bool "Fine granularity task level IRQ time accounting"
> +	depends on !S390 && HAVE_IRQ_TIME_ACCOUNTING

As Russell King pointed me, I don't need the !S390 here because it doesn't
select HAVE_IRQ_TIME_ACCOUNT anyway. I'll fix this. Just waiting for more
reviews before sending a v2.

Thanks.


> +	help
> +	  Select this option to enable fine granularity task irq time
> +	  accounting. This is done by reading a timestamp on each
> +	  transitions between softirq and hardirq state, so there can be a
> +	  small performance impact.
> +
> +	  If in doubt, say N here.
> +
> +endchoice
> +
>  config BSD_PROCESS_ACCT
>  	bool "BSD Process Accounting"
>  	help
> -- 
> 1.7.5.4
> 

  reply	other threads:[~2012-09-10 19:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 19:43 [PATCH 0/6] cputime: More cleanups Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 1/6] cputime: Use a proper subsystem naming for vtime related APIs Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 2/6] vtime: Consolidate system/idle context detection Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 3/6] ia64: Consolidate user vtime accounting Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 4/6] ia64: Reuse system and user vtime accounting functions on task switch Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 5/6] cputime: Gather time/stats accounting config options into a single menu Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 6/6] cputime: Make finegrained irqtime accounting generally available Frederic Weisbecker
2012-09-10 19:53   ` Frederic Weisbecker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25 15:06 [GIT PULL] cputime: More cleanups v2 Frederic Weisbecker
2012-09-25 15:06 ` [PATCH 6/6] cputime: Make finegrained irqtime accounting generally available Frederic Weisbecker

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=20120910195324.GA19268@somewhere \
    --to=fweisbec@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=fenghua.yu@intel.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.