xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Jan Beulich <JBeulich@suse.com>, Jeremy Fitzhardinge <jeremy@goop.org>
Cc: xen-devel@lists.xensource.com, Joe Jin <joe.jin@oracle.com>,
	Zhenzhong Duan <zhenzhong.duan@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] remove blocked time accounting from xen "clockchip"
Date: Thu, 20 Oct 2011 16:35:28 +0200	[thread overview]
Message-ID: <4EA031B0.2010400@redhat.com> (raw)
In-Reply-To: <4E9E9D97020000780005C1DE@nat28.tlf.novell.com>

On 10/19/11 09:51, Jan Beulich wrote:
>>>> On 18.10.11 at 22:42, Laszlo Ersek<lersek@redhat.com>  wrote:
>> ... because the "clock_event_device framework" already accounts for idle
>> time through the "event_handler" function pointer in
>> xen_timer_interrupt().
>
> As event_handler is being checked to be non-zero, shouldn't the
> code you remove simply become conditional (upon event_handler
> being zero)?

After experimenting further and reading more code, I think that the 
event_handler == NULL case is spurious and impossible in the long run. 
(I tested faking it periodically and the VM stops progressing during 
boot, after udev is started).

Furthermore / independently, these are the callers of 
account_idle_ticks() -- a complete tree:

account_idle_ticks() [kernel/sched.c]
   <- tick_nohz_restart_sched_tick() [kernel/time/tick-sched.c]
     <- cpu_idle() [various arches]

   <- do_stolen_accounting() [arch/x86/xen/time.c]
     <- xen_timer_interrupt()

   <- consider_steal_time() [arch/ia64/xen/time.c]
     <- xen_do_steal_accounting()
        = xen_time_ops.do_steal_accounting

(The ia64/xen time code seems to be modeled after the x86/xen code.)

Jeremy, could you please educate me why the original version of 
do_stolen_accounting() (commit f91a8b44) had added the

     account_steal_time(idle_task(smp_processor_id()), ticks);

part? I think it was wrong from the start.

In linux-2.6.18-xen, cpu_idle() [arch/x86_64/kernel/process-xen.c] 
doesn't seem to bump the idle time counter. So the interrupt handler 
routine timer_interrupt() [arch/i386/kernel/time-xen.c] has to, after 
doing the stolen accounting. I suspect this logic was transferred to the 
pvops kernel superfluously, where cpu_idle() was already handling the 
idle time accounting.

I believe my claim is consistent with the fact that only the 
xen-specific timer interrupt handlers care directly about idle time in 
the pvops kernel.

I'm convinced the patch is correct, and only the commit message might 
need a small fix (mentioning cpu_idle()). If the above reasoning is 
insufficient, whom should I mail directly to confirm/refute/complete it? 
I tried mingo and tglx in private, but got no answer yet.

If you can accept the reasoning, I'll resend the patch with an updated 
commit message.

Thank you very much,
Laszlo

  parent reply	other threads:[~2011-10-20 14:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18 20:42 [PATCH] remove blocked time accounting from xen "clockchip" Laszlo Ersek
2011-10-19  7:51 ` Jan Beulich
2011-10-19 14:54   ` Laszlo Ersek
2011-10-20 14:35   ` Laszlo Ersek [this message]
2011-10-20 15:02     ` Laszlo Ersek
2011-10-26 20:52       ` Konrad Rzeszutek Wilk
2011-11-09 13:35 ` Jan Beulich
2011-11-09 17:47   ` Laszlo Ersek
2011-11-10  8:32     ` Jan Beulich
2011-11-10 18:05   ` Jeremy Fitzhardinge
2012-01-19 19:42     ` Konrad Rzeszutek Wilk
2012-01-20  9:57       ` Jan Beulich
2012-01-20 16:00         ` Konrad Rzeszutek Wilk
2012-01-23 22:07         ` Konrad Rzeszutek Wilk
2011-12-21  8:32 ` Jan Beulich
2011-12-21 13:53   ` Laszlo Ersek
2011-12-21 14:58     ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2011-12-22  8:49 Jan Beulich

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=4EA031B0.2010400@redhat.com \
    --to=lersek@redhat.com \
    --cc=JBeulich@suse.com \
    --cc=jeremy@goop.org \
    --cc=joe.jin@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=zhenzhong.duan@oracle.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;
as well as URLs for NNTP newsgroup(s).