Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752894AbcLFOee (ORCPT ); Tue, 6 Dec 2016 09:34:34 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36667 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbcLFOed (ORCPT ); Tue, 6 Dec 2016 09:34:33 -0500 Date: Tue, 6 Dec 2016 15:34:29 +0100 From: Frederic Weisbecker To: Paul Mackerras Cc: LKML , Tony Luck , Wanpeng Li , Peter Zijlstra , Michael Ellerman , Heiko Carstens , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Fenghua Yu , Rik van Riel , Martin Schwidefsky , Stanislaw Gruszka Subject: Re: [PATCH 00/10] vtime: Delay cputime accounting to tick Message-ID: <20161206143428.GA2507@lerouge> References: <1480991543-6557-1-git-send-email-fweisbec@gmail.com> <20161206042055.GB9068@fergus.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161206042055.GB9068@fergus.ozlabs.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2142 Lines: 63 On Tue, Dec 06, 2016 at 03:20:55PM +1100, Paul Mackerras wrote: > On Tue, Dec 06, 2016 at 03:32:13AM +0100, Frederic Weisbecker wrote: > > This follows up Martin Schwidefsky's patch which propose to delay > > cputime accounting to the tick in order to minimize the calls to > > account_system_time() and alikes as these functions can carry quite some > > overhead: > > > > http://lkml.kernel.org/r/20161121111728.13a0a3db@mschwide > > > > The set includes Martin's patch, rebased on top of tip:sched/core and > > latest s390 changes, and extends it to the other implementations of > > CONFIG_VIRT_CPU_ACCOUNTING_NATIVE (powerpc and ia64) along with a few > > core changes to adapt the whole. > > > > Only built-tested though as I don't have access to any of these archs. > > The patches look reasonable at a quick look. I assume that to test > them, we would want to run a guest in an overcommitted system, so as > to get some steal time. Do you have any more specific suggestions as > to what to run as a test? Just run some benchmark and see if the > user/system/irq times look reasonable? Or do you have something more > quantitative? So I guess we want to test both correctness and performance. To check correctness I use two little programs, one that does a userspace loop: int main(int argc, char **argv) { while (1); return 0; } And another that does a kernelspace loop. The latter is not 100% kernel loop but spends most of its time in kernel mode. int main(int argc, char **argv) { void *addr = sbrk(0); while (1) { brk(addr + 4096); brk(addr); } return 0; } Testing idle time just consist in checking the difference between two cat /proc/stat in a given timelapse for an idle CPU. For irqs it gets harder. There you just need to check if the numbers are reasonable. Now in order to measure performance, I think you need a workload that either does a lot of guest/host switch or does a lot of IRQs. Maybe just something that involves networking. Then comparing stime, hardirq and softirq should show some better nummbers. In order to increase the effect, you can set a very low HZ value (100?). Thanks.