public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alessio Igor Bogani <abogani@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Avi Kivity <avi@redhat.com>, Chris Metcalf <cmetcalf@tilera.com>,
	Christoph Lameter <cl@linux.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Geoff Levand <geoff@infradead.org>,
	Gilad Ben Yossef <gilad@benyossef.com>,
	Hakan Akkan <hakanakkan@gmail.com>, Kevin Hilman <khilman@ti.com>,
	Max Krasnyansky <maxk@qualcomm.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sven-Thorsten Dietrich <thebigcorporation@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Luck,Tony" <tony.luck@intel.com>
Subject: Re: [RFC GIT PULL] nohz: Basic cputime accounting for adaptive tickless
Date: Mon, 18 Jun 2012 12:46:29 +0200	[thread overview]
Message-ID: <20120618124629.77d2c178@de.ibm.com> (raw)
In-Reply-To: <20120615173713.GA23238@somewhere.redhat.com>

On Fri, 15 Jun 2012 19:37:18 +0200
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> On Thu, Jun 14, 2012 at 05:18:00PM +0200, Martin Schwidefsky wrote:
> > On Thu, 14 Jun 2012 15:42:44 +0200
> > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > 
> > > On Thu, Jun 14, 2012 at 02:48:15PM +0200, Martin Schwidefsky wrote:
> > > > On Thu, 14 Jun 2012 13:22:45 +0200
> > > > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > > > 
> > > > > On Thu, Jun 14, 2012 at 01:21:23PM +0200, Thomas Gleixner wrote:
> > > > > > On Thu, 14 Jun 2012, Ingo Molnar wrote:
> > > > > > > * Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > > > > > > > You're right, I should have looked into CONFIG_VIRT_CPU_ACCOUNTING sooner
> > > > > > > > and see if I can reuse it.
> > > > > > > > 
> > > > > > > > I'll try something with that.
> > > > > > > 
> > > > > > > Maybe sanitize all the variants under a single set of 
> > > > > > > wrappers/callbacks?
> > > > > > 
> > > > > > Yes, please!
> > > > > 
> > > > > Sure, I'm working in it.
> > > >  
> > > > Please keep me in the loop, I want to avoid that things break on s390. Thanks.
> > > 
> > > Do you have any idea why s390 counts idle time from asm deep in the idle code
> > > rather than just hooking in account_system_vtime() like ppc or ia64?
> >  
> > Well what is idle time? For s390 it is the difference in the TOD clock between
> > the instruction that loaded the enabled-wait-PSW and the first instruction on
> > the interrupt handler. To get the best precision you need to get the TOD time
> > stamps as close to these two instructions as possible. For s390 it is the
> > following sequence:
> > 
> >         STCK    __IDLE_ENTER(%r2)	# idle enter time stamp
> >         ltr     %r5,%r5
> >         stpt    __VQ_IDLE_ENTER(%r3)
> >         jz      psw_idle_lpsw
> >         spt     0(%r1)
> > psw_idle_lpsw:
> >         lpswe   __SF_EMPTY(%r15)
> > 
> > <<< sleeping >>>
> > 
> > int_handler:
> >         STCK    __LC_INT_CLOCK		# idle exit time stamp
> > 
> > There are at maximum 5 instructions between the STCK for the idle
> > enter time stamp and the lpswe that puts the cpu to sleep.
> 
> I see. So s390 accounts only the time spent in low power mode whereas
> ppc/ia64 accounts everything that happens in the idle task.
> 
> I don't know which one has chosen the right semantics but this complicates
> any possible unification.
> 
> BTW, aren't you accounting the idle time as system time as well with
> account_sys_vtime()?

No, the accout_sys_vtime call is there to account for the time spent going
in and out if idle.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


      reply	other threads:[~2012-06-18 10:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 16:19 [RFC GIT PULL] nohz: Basic cputime accounting for adaptive tickless Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 1/7] nohz: Add more comment about CONFIG_NO_HZ Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 2/7] nohz: Introduce adaptive nohz config Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 3/7] nohz: Generalize tickless cpu time accounting Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 4/7] nohz: Account user and system times in adaptive nohz mode Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 5/7] x86: Syscall hooks for " Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 6/7] x86: Add adaptive tickless hooks on do_notify_resume() Frederic Weisbecker
2012-06-13 16:19 ` [PATCH 7/7] x86: Exception hooks for adaptive tickless Frederic Weisbecker
2012-06-13 16:35 ` [RFC GIT PULL] nohz: Basic cputime accounting " Frederic Weisbecker
2012-06-14  9:07 ` Peter Zijlstra
2012-06-14  9:10   ` Peter Zijlstra
2012-06-14 11:12   ` Frederic Weisbecker
2012-06-14 11:16     ` Ingo Molnar
2012-06-14 11:21       ` Thomas Gleixner
2012-06-14 11:22         ` Frederic Weisbecker
2012-06-14 12:48           ` Martin Schwidefsky
2012-06-14 13:04             ` Frederic Weisbecker
2012-06-14 14:36               ` Ingo Molnar
2012-06-14 17:34                 ` Frederic Weisbecker
2012-06-15 12:13                   ` Ingo Molnar
2012-06-14 13:42             ` Frederic Weisbecker
2012-06-14 15:18               ` Martin Schwidefsky
2012-06-15 17:37                 ` Frederic Weisbecker
2012-06-18 10:46                   ` Martin Schwidefsky [this message]

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=20120618124629.77d2c178@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=abogani@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux.com \
    --cc=cmetcalf@tilera.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=fweisbec@gmail.com \
    --cc=geoff@infradead.org \
    --cc=gilad@benyossef.com \
    --cc=hakanakkan@gmail.com \
    --cc=khilman@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=shemminger@vyatta.com \
    --cc=tglx@linutronix.de \
    --cc=thebigcorporation@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox