27 Apr, 2013

1 commit

  • For the nsec resolution conversions to be useable on non 64-bit
    architectures, the helpers in need to be used so the
    right arch-specific 64-bit math helpers can be used (e.g. do_div())

    Signed-off-by: Kevin Hilman
    Cc: Christoph Lameter
    Cc: Hakan Akkan
    Cc: Ingo Molnar
    Cc: Kevin Hilman
    Cc: Li Zhong
    Cc: Paul E. McKenney
    Cc: Paul Gortmaker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Signed-off-by: Frederic Weisbecker

    Kevin Hilman
     

24 Feb, 2013

1 commit

  • Saw the following compiler warning on the linux-next tree:

    kernel/itimer.c: In function 'set_cpu_itimer':
    kernel/itimer.c:152:2: warning: passing argument 1 of 'timeval_to_cputime' discards 'const' qualifier from pointer target type [enabled by default]
    ...

    timeval_to_cputime() is always passed a constant timeval in
    argument, we need to teach the nsecs based cputime
    implementation about that.

    Signed-off-by: Li Zhong
    Signed-off-by: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Kevin Hilman
    Link: http://lkml.kernel.org/r/1361636925-22288-2-git-send-email-fweisbec@gmail.com
    Signed-off-by: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Kevin Hilman

    Li Zhong
     

28 Jan, 2013

2 commits

  • If we want to stop the tick further idle, we need to be
    able to account the cputime without using the tick.

    Virtual based cputime accounting solves that problem by
    hooking into kernel/user boundaries.

    However implementing CONFIG_VIRT_CPU_ACCOUNTING require
    low level hooks and involves more overhead. But we already
    have a generic context tracking subsystem that is required
    for RCU needs by archs which plan to shut down the tick
    outside idle.

    This patch implements a generic virtual based cputime
    accounting that relies on these generic kernel/user hooks.

    There are some upsides of doing this:

    - This requires no arch code to implement CONFIG_VIRT_CPU_ACCOUNTING
    if context tracking is already built (already necessary for RCU in full
    tickless mode).

    - We can rely on the generic context tracking subsystem to dynamically
    (de)activate the hooks, so that we can switch anytime between virtual
    and tick based accounting. This way we don't have the overhead
    of the virtual accounting when the tick is running periodically.

    And one downside:

    - There is probably more overhead than a native virtual based cputime
    accounting. But this relies on hooks that are already set anyway.

    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: Ingo Molnar
    Cc: Li Zhong
    Cc: Namhyung Kim
    Cc: Paul E. McKenney
    Cc: Paul Gortmaker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner

    Frederic Weisbecker
     
  • The full dynticks cputime accounting that we'll soon introduce
    will rely on sched_clock(). And its clock can have a per
    nanosecond granularity.

    To prepare for this, we need to have a cputime_t implementation
    that has this precision.

    ia64 virtual cputime accounting already uses that granularity
    so all we need is to librarize its implementation in the asm
    generic headers.

    Also librarize the default per jiffy granularity cputime_t
    as well so that we can easily pick either implementation
    depending on the cputime accounting config we choose.

    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: Ingo Molnar
    Cc: Li Zhong
    Cc: Namhyung Kim
    Cc: Paul E. McKenney
    Cc: Paul Gortmaker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Fenghua Yu

    Frederic Weisbecker