public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: schwidefsky@de.ibm.com, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org
Subject: Process accounting in interrupt diabled cases
Date: Fri, 06 Mar 2009 15:03:35 -0800	[thread overview]
Message-ID: <1236380615.4637.67.camel@alok-dev1> (raw)

Hi,

I am not sure, but I think this may be a process accounting bug.

If interrupts are disabled for a considerable amount of time ( say
multiple ticks), the process accounting code will still account a single
tick for such cases, on the next interrupt tick.
Shouldn't we have some way to fix that case like we do for NO_HZ
restart_sched_tick case, where we account for multiple idle ticks.
 
IOW, doesn't process accounting need to account for these cases when
interrupts are disabled for more than one tick period?

I stumbled across this while trying to find a solution to figure out the
amount of stolen time from Linux, when it is running under a hypervisor.
One of the solutions could be to ask the hypervisor directly for this
info, but in my quest to find a generic solution I think the below would
work too.
The total process time accounted by the system on a cpu ( system, idle,
wait and etc) when deducted from the amount TSC counter has advanced
since boot, should give us this info about the cputime stolen from the
kernel  (by either hypervisor or other cases like say, SMI) on a
particular CPU. 
i.e. PCPU_STOLEN = (TSC since boot)  - (PCPU-idle + system + wait + ...)

But for this to work the above problem about process accounting in
interrupt disabled cases need to work correctly. 

Let me know if I overlooking any case where the above assumption might
not hold true.

Thanks,
Alok




             reply	other threads:[~2009-03-06 23:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 23:03 Alok Kataria [this message]
2009-03-07  0:37 ` Process accounting in interrupt diabled cases Jeremy Fitzhardinge
2009-03-07  0:59   ` Alok Kataria
2009-03-07  1:26     ` Jeremy Fitzhardinge
2009-03-07  8:59       ` Alok Kataria
2009-03-11  8:47         ` Martin Schwidefsky

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=1236380615.4637.67.camel@alok-dev1 \
    --to=akataria@vmware.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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