All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/30] cputime: Convert task/cpu cputime accounting to nsecs
@ 2014-11-28 18:23 Frederic Weisbecker
  2014-11-28 18:23 ` [RFC PATCH 01/30] jiffies: Remove HZ > USEC_PER_SEC special case Frederic Weisbecker
                   ` (29 more replies)
  0 siblings, 30 replies; 49+ messages in thread
From: Frederic Weisbecker @ 2014-11-28 18:23 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Tony Luck, Peter Zijlstra, Heiko Carstens,
	Benjamin Herrenschmidt, Thomas Gleixner, Oleg Nesterov,
	Paul Mackerras, Wu Fengguang, Ingo Molnar, Rik van Riel,
	Martin Schwidefsky

Hi,

Thomas suggested to store the cpu and task stats in nanoseconds in order
to avoid back and forth conversion between cputime_t to nsecs.

This patchset does that (plus many fixes and cleanups).

There should be a performance impact for CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
configurations which account cputime from arch's kernel entrypoint. As
this config always use cputime_t as a time source, the conversion to nsecs
is required on each accounting update. This concern only powerpc and s390
(ia64 also support this mode but its cputime_t wraps nsecs so the conversion
is a noop there). I'm not sure how much this config is used in powerpc,
it doesn't appear in its defconfigs and that mode is expected to be a
bit slower than tick based accounting anyway. But s390 only supports
this mode (no support for tick based accounting).

But on the other side of the balance, it simplifies the core code a bit.

The patchset isn't complete, I have yet to convert the posix cpu timers
code as well. I just need to post the current state before moving forward
to details.

I need to get your opinion on that patchset before going deeper. Is this
conversion a right direction to take?

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	cpustat/nsecs

HEAD: 3539960cb3be04512d5f601c8e83c8bab658e0c1

Thanks,
	Frederic
---

Frederic Weisbecker (30):
      jiffies: Remove HZ > USEC_PER_SEC special case
      time: Introduce jiffies64_to_nsecs()
      cputime: Introduce nsecs_to_cputime64()
      s390: Convert open coded idle time seqcount
      s390: Translate cputime magic constants to macros
      s390: Introduce cputime64_to_nsecs()
      cputime: Convert kcpustat to nsecs
      apm32: Fix cputime == jiffies assumption
      alpha: Fix jiffies based cputime assumption
      cputime: Convert guest time accounting to nsecs
      cputime: Special API to return old-typed cputime
      cputime: Convert task/group cputime to nsecs
      alpha: Convert obsolete cputime_t to nsecs
      x86: Convert obsolete cputime type to nsecs
      isdn: Convert obsolete cputime type to nsecs
      binfmt: Convert obsolete cputime type to nsecs
      acct: Convert obsolete cputime type to nsecs
      delaycct: Convert obsolete cputime type to nsecs
      tsacct: Convert obsolete cputime type to nsecs
      signal: Convert obsolete cputime type to nsecs
      cputime: Remove task_cputime_t_scaled
      u64_stats_sync: Introduce preempt-unsafe readers
      cputime: Convert irq_time_accounting to use u64_stats_sync
      cputime: Increment kcpustat directly on irqtime account
      cputime: Remove temporary irqtime states
      cputime: Push time to account_user_time() in nanosecs
      cputime: Push time to account_steal_time() in nanosecs
      cputime: Push time to account_idle_time() in nanosecs
      cputime: Push time to account_guest_time() in nanosecs
      cputime: Push time to account_system_time() in nanosecs


 arch/alpha/kernel/osf_sys.c        |  15 ++-
 arch/ia64/kernel/time.c            |   9 +-
 arch/powerpc/kernel/time.c         |  10 +-
 arch/s390/appldata/appldata_os.c   |  16 +--
 arch/s390/include/asm/cputime.h    |  52 +++++----
 arch/s390/include/asm/idle.h       |   3 +-
 arch/s390/kernel/idle.c            |  30 ++---
 arch/s390/kernel/vtime.c           |  15 ++-
 arch/x86/kernel/apm_32.c           |   6 +-
 drivers/cpufreq/cpufreq.c          |   6 +-
 drivers/cpufreq/cpufreq_governor.c |  14 +--
 drivers/isdn/mISDN/stack.c         |   4 +-
 drivers/macintosh/rack-meter.c     |   2 +-
 fs/binfmt_elf.c                    |  15 +--
 fs/binfmt_elf_fdpic.c              |  14 +--
 fs/compat_binfmt_elf.c             |  20 ++--
 fs/proc/array.c                    |  15 ++-
 fs/proc/stat.c                     |  68 +++++------
 fs/proc/uptime.c                   |   6 +-
 include/linux/cputime.h            |  22 ++++
 include/linux/init_task.h          |   2 +-
 include/linux/jiffies.h            |   2 +
 include/linux/kernel_stat.h        |  10 +-
 include/linux/sched.h              |  83 ++++++++++----
 include/linux/u64_stats_sync.h     |  29 +++--
 kernel/acct.c                      |   7 +-
 kernel/delayacct.c                 |   6 +-
 kernel/exit.c                      |   4 +-
 kernel/sched/cputime.c             | 224 ++++++++++++++++++-------------------
 kernel/sched/sched.h               |  44 ++------
 kernel/sched/stats.h               |   8 +-
 kernel/signal.c                    |  12 +-
 kernel/sys.c                       |  16 +--
 kernel/time/itimer.c               |   2 +-
 kernel/time/posix-cpu-timers.c     |  44 ++++----
 kernel/time/time.c                 |  21 +++-
 kernel/time/timeconst.bc           |   6 +
 kernel/tsacct.c                    |  18 +--
 38 files changed, 475 insertions(+), 405 deletions(-)

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2014-12-01 20:21 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-28 18:23 [RFC PATCH 00/30] cputime: Convert task/cpu cputime accounting to nsecs Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 01/30] jiffies: Remove HZ > USEC_PER_SEC special case Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 02/30] time: Introduce jiffies64_to_nsecs() Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 03/30] cputime: Introduce nsecs_to_cputime64() Frederic Weisbecker
2014-12-01 14:05   ` Martin Schwidefsky
2014-11-28 18:23 ` [RFC PATCH 04/30] s390: Convert open coded idle time seqcount Frederic Weisbecker
2014-12-01 13:46   ` Heiko Carstens
2014-11-28 18:23 ` [RFC PATCH 05/30] s390: Translate cputime magic constants to macros Frederic Weisbecker
2014-12-01 13:47   ` Heiko Carstens
2014-12-01 16:23     ` Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 06/30] s390: Introduce cputime64_to_nsecs() Frederic Weisbecker
2014-12-01 12:24   ` Heiko Carstens
2014-12-01 13:58     ` Martin Schwidefsky
2014-12-01 16:23     ` Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 07/30] cputime: Convert kcpustat to nsecs Frederic Weisbecker
2014-12-01 14:14   ` Martin Schwidefsky
2014-12-01 16:10     ` Frederic Weisbecker
2014-12-01 16:48       ` Martin Schwidefsky
2014-12-01 17:15         ` Thomas Gleixner
2014-12-01 17:27           ` Martin Schwidefsky
2014-12-01 19:59             ` Frederic Weisbecker
2014-12-01 20:14           ` Christian Borntraeger
2014-12-01 20:21             ` Thomas Gleixner
2014-11-28 18:23 ` [RFC PATCH 08/30] apm32: Fix cputime == jiffies assumption Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 09/30] alpha: Fix jiffies based cputime assumption Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 10/30] cputime: Convert guest time accounting to nsecs Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 11/30] cputime: Special API to return old-typed cputime Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 12/30] cputime: Convert task/group cputime to nsecs Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 13/30] alpha: Convert obsolete cputime_t " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 14/30] x86: Convert obsolete cputime type " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 15/30] isdn: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 16/30] binfmt: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 17/30] acct: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 18/30] delaycct: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 19/30] tsacct: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 20/30] signal: " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 21/30] cputime: Remove task_cputime_t_scaled Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 22/30] u64_stats_sync: Introduce preempt-unsafe readers Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 23/30] cputime: Convert irq_time_accounting to use u64_stats_sync Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 24/30] cputime: Increment kcpustat directly on irqtime account Frederic Weisbecker
2014-12-01 14:41   ` Martin Schwidefsky
2014-12-01 16:15     ` Frederic Weisbecker
2014-12-01 16:50       ` Martin Schwidefsky
2014-11-28 18:23 ` [RFC PATCH 25/30] cputime: Remove temporary irqtime states Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 26/30] cputime: Push time to account_user_time() in nanosecs Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 27/30] cputime: Push time to account_steal_time() " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 28/30] cputime: Push time to account_idle_time() " Frederic Weisbecker
2014-11-28 18:23 ` [RFC PATCH 29/30] cputime: Push time to account_guest_time() " Frederic Weisbecker
2014-11-28 18:24 ` [RFC PATCH 30/30] cputime: Push time to account_system_time() " Frederic Weisbecker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.