From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v4 7/9] KVM-GST: KVM Steal time accounting Date: Sat, 02 Jul 2011 12:30:28 +0200 Message-ID: <1309602628.10073.24.camel@twins> References: <1309555369-16867-1-git-send-email-glommer@redhat.com> <1309555369-16867-8-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Rik van Riel , Jeremy Fitzhardinge , Avi Kivity , Anthony Liguori , Eric B Munson To: Glauber Costa Return-path: In-Reply-To: <1309555369-16867-8-git-send-email-glommer@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, 2011-07-01 at 17:22 -0400, Glauber Costa wrote: > @@ -3929,6 +3945,23 @@ void account_process_tick(struct task_struct *p, int user_tick) > return; > } > > +#ifdef CONFIG_PARAVIRT > + if (static_branch(¶virt_steal_enabled)) { > + u64 steal, st = 0; > + > + steal = paravirt_steal_clock(smp_processor_id()); > + steal -= this_rq()->prev_steal_time; > + > + st = steal_ticks(steal); > + this_rq()->prev_steal_time += st * TICK_NSEC; > + > + if (st) { > + account_steal_time(st); > + return; > + } > + } > +#endif > + > if (user_tick) > account_user_time(p, cputime_one_jiffy, one_jiffy_scaled); > else if ((p != rq->idle) || (irq_count() != HARDIRQ_OFFSET)) So I was about to send an Ack for this patch, when I noticed that this will all be dead code when CONFIG_IRQ_TIME_ACCOUNTING && sched_clock_irqtime. I think irqtime_account_process_tick() wants a similar hunk (which suggests splitting it out into an inline function).