lkml.org 
[lkml]   [2007]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [patch 17/17] Add a sched_clock paravirt_op
    Date
    On Monday 02 April 2007 07:57, Jeremy Fitzhardinge wrote:
    > The tsc-based get_scheduled_cycles interface is not a good match for
    > Xen's runstate accounting, which reports everything in nanoseconds.
    >
    > This patch replaces this interface with a sched_clock interface, which
    > matches both Xen and VMI's requirements.
    >
    > In order to do this, we:
    > 1. replace get_scheduled_cycles with sched_clock
    > 2. hoist cycles_2_ns into a common header
    > 3. update vmi accordingly
    >
    > One thing to note: because sched_clock is implemented as a weak
    > function in kernel/sched.c, we must define a real function in order to
    > override this weak binding. This means the usual paravirt_ops
    > technique of using an inline function won't work in this case.

    I think it would be much cleaner if you didn't implement your own sched_clock,
    but you adjust ns_base/last_tsc to account for your lost cycles.
    This could be done cleanly by adding a new function to sched-clock.c
    Possibly such a function could be used by other parts of the kernel
    in the future too.

    -Andi
    -
    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/

    \
     
     \ /
      Last update: 2007-04-02 08:13    [W:0.032 / U:93.348 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site