Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1536777

Re: [PATCH 00/10] vtime: Delay cputime accounting to tick

From Christian Borntraeger <borntraeger@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 00/10] vtime: Delay cputime accounting to tick
Date 2016-12-06 09:50 +0100
Message-ID <sLjBL-8aU-27@gated-at.bofh.it> (permalink)
References <sLdPH-4nv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/06/2016 03:32 AM, 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.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> 	vtime/acc
> 

I have not checked the results yet (1), but this branch reduces the overhead
of calculating the times a lot. I have a microbenchmark that does some simple
KVM hypercalls under s390 and the average time shrinks from 280ns to 260ns.
(we call accounting at guest enter and exit)
About 50% of the savings seems to be Martins changes in vtime_account_irq_enter,
the other 50% seems to be common code accounting doing less work.

These savings of ~20ns per guest exit will also help virtio, pagefault and any
other host activity on behalf of KVM guests. Nice.


(1) the values seem to make sense but I have not done any calculation yet.


> HEAD: ee6c393b212193bc01818c7cf4ae9cba3f469f00
> 
> Thanks,
> 	Frederic
> ---
> 
> Frederic Weisbecker (9):
>       powerpc32: Fix stale scaled stime on context switch
>       ia64: Fix wrong start cputime assignment on task switch
>       cputime: Allow accounting system time using cpustat index
>       cputime: Export account_guest_time
>       powerpc: Prepare accounting structure for cputime flush on tick
>       powerpc: Migrate stolen_time field to accounting structure
>       powerpc/vtime: Accumulate cputime and account only on tick/task switch
>       ia64: Accumulate cputime and account only on tick/task switch
>       vtime: Rename vtime_account_user() to vtime_flush()
> 
> Martin Schwidefsky (1):
>       s390/cputime: delayed accounting of system time
> 
> 
>  arch/ia64/include/asm/thread_info.h   |   6 ++
>  arch/ia64/kernel/time.c               |  66 +++++++++++-----
>  arch/powerpc/include/asm/accounting.h |  14 +++-
>  arch/powerpc/include/asm/paca.h       |   1 -
>  arch/powerpc/kernel/asm-offsets.c     |   8 +-
>  arch/powerpc/kernel/time.c            | 138 +++++++++++++++++++++-------------
>  arch/powerpc/xmon/xmon.c              |   8 +-
>  arch/s390/include/asm/lowcore.h       |  65 ++++++++--------
>  arch/s390/include/asm/processor.h     |   3 +
>  arch/s390/kernel/vtime.c              | 116 +++++++++++++++++-----------
>  include/linux/kernel_stat.h           |   7 +-
>  include/linux/vtime.h                 |   7 +-
>  kernel/sched/cputime.c                |  25 +++---
>  13 files changed, 295 insertions(+), 169 deletions(-)
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] vtime: Delay cputime accounting to tick Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [FIX][PATCH 02/10] ia64: Fix wrong start cputime assignment on task switch Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
    Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-10 02:50 +0100
  [PATCH 06/10] powerpc: Migrate stolen_time field to accounting structure Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 03/10] cputime: Allow accounting system time using cpustat index Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 10/10] vtime: Rename vtime_account_user() to vtime_flush() Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 07/10] powerpc/vtime: Accumulate cputime and account only on tick/task switch Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 08/10] ia64: Accumulate cputime and account only on tick/task switch Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  [PATCH 04/10] cputime: Export account_guest_time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 03:40 +0100
  Re: [PATCH 00/10] vtime: Delay cputime accounting to tick Paul Mackerras <paulus@ozlabs.org> - 2016-12-06 05:30 +0100
    Re: [PATCH 00/10] vtime: Delay cputime accounting to tick Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-12-06 08:10 +0100
    Re: [PATCH 00/10] vtime: Delay cputime accounting to tick Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-06 15:40 +0100
  Re: [PATCH 00/10] vtime: Delay cputime accounting to tick Christian Borntraeger <borntraeger@de.ibm.com> - 2016-12-06 09:50 +0100

csiph-web