Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527Ab3EFOzm (ORCPT ); Mon, 6 May 2013 10:55:42 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:43807 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753865Ab3EFOzl (ORCPT ); Mon, 6 May 2013 10:55:41 -0400 X-IronPort-AV: E=Sophos;i="4.87,622,1363158000"; d="scan'208";a="44491540" Message-ID: <5187C46B.5070309@codeaurora.org> Date: Mon, 06 May 2013 10:55:39 -0400 From: Christopher Covington User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Stefano Stabellini CC: Marc Zyngier , "xen-devel@lists.xensource.com" , "linux@arm.linux.org.uk" , Ian Campbell , Arnd Bergmann , "konrad.wilk@oracle.com" , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , "john.stultz@linaro.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [Xen-devel] [PATCH 1/3] arm_arch_timer: introduce arch_timer_stolen_ticks References: <1367436460-10183-1-git-send-email-stefano.stabellini@eu.citrix.com> <51817CBE.4050003@codeaurora.org> <1367482772.21869.26.camel@zakaz.uk.xensource.com> <5182DBA9.9080609@codeaurora.org> <5183976A.6000703@arm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2177 Lines: 55 On 05/05/2013 12:47 PM, Stefano Stabellini wrote: > On Fri, 3 May 2013, Marc Zyngier wrote: >> On 03/05/13 11:43, Stefano Stabellini wrote: >>> On Thu, 2 May 2013, Christopher Covington wrote: >>>>> So the virtual timer should appear to have been running even while time >>>>> is being stolen and therefore stolen time needs to be accounted via some >>>>> other means. >>>> >>>> Something that's not currently obvious to me is that given that the stolen >>>> cycle accounting should be done, what makes the architected timer interrupt >>>> handler the ideal place to do it? >>> >>> That is a good question and I would appreciate suggestions to improve >>> the patch. >>> >>> Given that Xen x86 and ia64 does stolen time accounting from the timer >>> interrupt handler: >>> >>> arch/x86/xen/time.c:xen_timer_interrupt >>> arch/ia64/kernel/time.c:timer_interrupt >>> >>> and given that the arch_timer is the only timer used by Xen on ARM and >>> that it includes a virt_timer that is made on purpose to be used by >>> virtual machines, I thought that it might be a good place for it. >>> >>> I also thought that doing it this way, KVM should be able to reuse the >>> same hook. >> >> Indeed. I just need to understand how time stealing works there ;-). >> >> Now, KVM is not necessarily limited to arch_timers, and we've run KVM >> using a QEMU-provided timer in the past. Can you think of a more generic >> location for this hook? Possibly something that would satisfy the >> requirements of other architectures while we're at it? > > Probably the best option would be to reuse > > kernel/sched/cputime.c:steal_account_process_tick > > but that also means introducing CONFIG_PARAVIRT on arm. > I am up for that, what do you think? That sounds like a good move to me. Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/