07 Nov, 2011

1 commit


27 Sep, 2011

1 commit


25 Aug, 2011

1 commit

  • The tracing code used sched_clock() to get tracing timestamps, which
    ends up calling xen_clocksource_read(). xen_clocksource_read() must
    disable preemption, but if preemption tracing is enabled, this results
    in infinite recursion.

    I've only noticed this when boot-time tracing tests are enabled, but it
    seems like a generic bug. It looks like it would also affect
    kvm_clocksource_read().

    Reported-by: Konrad Rzeszutek Wilk
    Signed-off-by: Jeremy Fitzhardinge
    Cc: Avi Kivity
    Cc: Marcelo Tosatti

    Jeremy Fitzhardinge
     

20 May, 2011

1 commit

  • …x/kernel/git/tip/linux-2.6-tip

    * 'timers-clocksource-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    clocksource: convert mips to generic i8253 clocksource
    clocksource: convert x86 to generic i8253 clocksource
    clocksource: convert footbridge to generic i8253 clocksource
    clocksource: add common i8253 PIT clocksource
    blackfin: convert to clocksource_register_hz
    mips: convert to clocksource_register_hz/khz
    sparc: convert to clocksource_register_hz/khz
    alpha: convert to clocksource_register_hz
    microblaze: convert to clocksource_register_hz/khz
    ia64: convert to clocksource_register_hz/khz
    x86: Convert remaining x86 clocksources to clocksource_register_hz/khz
    Make clocksource name const

    Linus Torvalds
     

19 May, 2011

1 commit


14 May, 2011

1 commit


04 Mar, 2011

1 commit


22 Feb, 2011

1 commit


17 Dec, 2010

2 commits


28 Nov, 2010

1 commit

  • If the guest domain has been suspend/resumed or migrated, then the
    system clock backing the pvclock clocksource may revert to a smaller
    value (ie, can be non-monotonic across the migration/save-restore).

    Make sure we zero last_value in that case so that the domain
    continues to see clock updates.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

05 Oct, 2010

1 commit

  • if !xen_have_vector_callback do not initialize PV timer unconditionally
    because we still don't know how many cpus are available and if there is
    more than one we won't be able to receive the timer interrupts on
    cpu > 0.

    This patch fixes an hang at boot when Xen does not support vector
    callbacks and the guest has multiple vcpus.

    Signed-off-by: Stefano Stabellini
    Acked-by: Jeremy Fitzhardinge

    Stefano Stabellini
     

05 Aug, 2010

3 commits

  • * upstream/pvhvm:
    Introduce CONFIG_XEN_PVHVM compile option
    blkfront: do not create a PV cdrom device if xen_hvm_guest
    support multiple .discard.* sections to avoid section type conflicts
    xen/pvhvm: fix build problem when !CONFIG_XEN
    xenfs: enable for HVM domains too
    x86: Call HVMOP_pagetable_dying on exit_mmap.
    x86: Unplug emulated disks and nics.
    x86: Use xen_vcpuop_clockevent, xen_clocksource and xen wallclock.
    xen: Fix find_unbound_irq in presence of ioapic irqs.
    xen: Add suspend/resume support for PV on HVM guests.
    xen: Xen PCI platform device driver.
    x86/xen: event channels delivery on HVM.
    x86: early PV on HVM features initialization.
    xen: Add support for HVM hypercalls.

    Conflicts:
    arch/x86/xen/enlighten.c
    arch/x86/xen/time.c

    Jeremy Fitzhardinge
     
  • * upstream/core:
    xen/panic: use xen_reboot and fix smp_send_stop
    Xen: register panic notifier to take crashes of xen guests on panic
    xen: support large numbers of CPUs with vcpu info placement
    xen: drop xen_sched_clock in favour of using plain wallclock time
    pvops: do not notify callers from register_xenstore_notifier
    xen: make sure pages are really part of domain before freeing
    xen: release unused free memory

    Jeremy Fitzhardinge
     
  • xen_sched_clock only counts unstolen time. In principle this should
    be useful to the Linux scheduler so that it knows how much time a process
    actually consumed. But in practice this doesn't work very well as the
    scheduler expects the sched_clock time to be synchronized between
    cpus. It also uses sched_clock to measure the time a task spends
    sleeping, in which case "unstolen time" isn't meaningful.

    So just use plain xen_clocksource_read to return wallclock nanoseconds
    for sched_clock.

    Signed-off-by: Jeremy Fitzhardinge

    Jeremy Fitzhardinge
     

30 Jul, 2010

1 commit


27 Jul, 2010

1 commit

  • Use xen_vcpuop_clockevent instead of hpet and APIC timers as main
    clockevent device on all vcpus, use the xen wallclock time as wallclock
    instead of rtc and use xen_clocksource as clocksource.
    The pv clock algorithm needs to work correctly for the xen_clocksource
    and xen wallclock to be usable, only modern Xen versions offer a
    reliable pv clock in HVM guests (XENFEAT_hvm_safe_pvclock).

    Using the hpet as clocksource means a VMEXIT every time we read/write to
    the hpet mmio addresses, pvclock give us a better rating without
    VMEXITs. Same goes for the xen wallclock and xen_vcpuop_clockevent

    Signed-off-by: Stefano Stabellini
    Signed-off-by: Don Dutile
    Signed-off-by: Jeremy Fitzhardinge

    Stefano Stabellini
     

20 May, 2010

1 commit

  • …ernel/git/tip/linux-2.6-tip

    * 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    avr32: Fix typo in read_persistent_clock()
    sparc: Convert sparc to use read/update_persistent_clock
    cris: Convert cris to use read/update_persistent_clock
    m68k: Convert m68k to use read/update_persistent_clock
    m32r: Convert m32r to use read/update_peristent_clock
    blackfin: Convert blackfin to use read/update_persistent_clock
    ia64: Convert ia64 to use read/update_persistent_clock
    avr32: Convert avr32 to use read/update_persistent_clock
    h8300: Convert h8300 to use read/update_persistent_clock
    frv: Convert frv to use read/update_persistent_clock
    mn10300: Convert mn10300 to use read/update_persistent_clock
    alpha: Convert alpha to use read/update_persistent_clock
    xtensa: Fix unnecessary setting of xtime
    time: Clean up direct xtime usage in xen

    Linus Torvalds
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

13 Mar, 2010

1 commit


15 Dec, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (34 commits)
    m68k: rename global variable vmalloc_end to m68k_vmalloc_end
    percpu: add missing per_cpu_ptr_to_phys() definition for UP
    percpu: Fix kdump failure if booted with percpu_alloc=page
    percpu: make misc percpu symbols unique
    percpu: make percpu symbols in ia64 unique
    percpu: make percpu symbols in powerpc unique
    percpu: make percpu symbols in x86 unique
    percpu: make percpu symbols in xen unique
    percpu: make percpu symbols in cpufreq unique
    percpu: make percpu symbols in oprofile unique
    percpu: make percpu symbols in tracer unique
    percpu: make percpu symbols under kernel/ and mm/ unique
    percpu: remove some sparse warnings
    percpu: make alloc_percpu() handle array types
    vmalloc: fix use of non-existent percpu variable in put_cpu_var()
    this_cpu: Use this_cpu_xx in trace_functions_graph.c
    this_cpu: Use this_cpu_xx for ftrace
    this_cpu: Use this_cpu_xx in nmi handling
    this_cpu: Use this_cpu operations in RCU
    this_cpu: Use this_cpu ops for VM statistics
    ...

    Fix up trivial (famous last words) global per-cpu naming conflicts in
    arch/x86/kvm/svm.c
    mm/slab.c

    Linus Torvalds
     

04 Dec, 2009

2 commits

  • Otherwise the timer is disabled by dpm_suspend_noirq() which in turn prevents
    correct operation of stop_machine on multi-processor systems and breaks
    suspend.

    Signed-off-by: Ian Campbell
    Signed-off-by: Jeremy Fitzhardinge
    Cc: Stable Kernel

    Ian Campbell
     
  • This is necessary to ensure the runstate area is available to
    xen_sched_clock before any calls to printk which will require it in
    order to provide a timestamp.

    I chose to pull the xen_setup_runstate_info out of xen_time_init into
    the caller in order to maintain parity with calling
    xen_setup_runstate_info separately from calling xen_time_resume.

    Signed-off-by: Ian Campbell
    Signed-off-by: Jeremy Fitzhardinge
    Cc: Stable Kernel

    Ian Campbell
     

29 Oct, 2009

1 commit

  • This patch updates percpu related symbols in xen such that percpu
    symbols are unique and don't clash with local symbols. This serves
    two purposes of decreasing the possibility of global percpu symbol
    collision and allowing dropping per_cpu__ prefix from percpu symbols.

    * arch/x86/xen/smp.c, arch/x86/xen/time.c, arch/ia64/xen/irq_xen.c:
    add xen_ prefix to percpu variables

    * arch/ia64/xen/time.c: add xen_ prefix to percpu variables, drop
    processed_ prefix and make them static

    Partly based on Rusty Russell's "alloc_percpu: rename percpu vars
    which cause name clashes" patch.

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: Jeremy Fitzhardinge
    Cc: Chris Wright

    Tejun Heo
     

22 Apr, 2009

1 commit

  • Pass clocksource pointer to the read() callback for clocksources. This
    allows us to share the callback between multiple instances.

    [hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
    [akpm@linux-foundation.org: cleanup]
    Signed-off-by: Magnus Damm
    Acked-by: John Stultz
    Cc: Thomas Gleixner
    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     

04 Jan, 2009

1 commit


31 Dec, 2008

1 commit

  • The cpu time spent by the idle process actually doing something is
    currently accounted as idle time. This is plain wrong, the architectures
    that support VIRT_CPU_ACCOUNTING=y can do better: distinguish between the
    time spent doing nothing and the time spent by idle doing work. The first
    is accounted with account_idle_time and the second with account_system_time.
    The architectures that use the account_xxx_time interface directly and not
    the account_xxx_ticks interface now need to do the check for the idle
    process in their arch code. In particular to improve the system vs true
    idle time accounting the arch code needs to measure the true idle time
    instead of just testing for the idle process.
    To improve the tick based accounting as well we would need an architecture
    primitive that can tell us if the pt_regs of the interrupted context
    points to the magic instruction that halts the cpu.

    In addition idle time is no more added to the stime of the idle process.
    This field now contains the system time of the idle process as it should
    be. On systems without VIRT_CPU_ACCOUNTING this will always be zero as
    every tick that occurs while idle is running will be accounted as idle
    time.

    This patch contains the necessary common code changes to be able to
    distinguish idle system time and true idle time. The architectures with
    support for VIRT_CPU_ACCOUNTING need some changes to exploit this.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

13 Dec, 2008

1 commit


15 Oct, 2008

1 commit


25 Aug, 2008

1 commit

  • Note the changes from 2.6.18-xen CPU hotplugging:

    A vcpu_down request from the remote admin via Xenbus both hotunplugs the
    CPU, and disables it by removing it from the cpu_present map, and removing
    its entry in /sys.

    A vcpu_up request from the remote admin only re-enables the CPU, and does
    not immediately bring the CPU up. A udev event is emitted, which can be
    caught by the user if he wishes to automatically re-up CPUs when available,
    or implement a more complex policy.

    Signed-off-by: Alex Nixon
    Acked-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Alex Nixon
     

22 Aug, 2008

1 commit

  • Ingo Molnar wrote:
    > -tip testing found this build failure:
    >
    > arch/x86/xen/spinlock.c: In function ‘spin_time_start’:
    > arch/x86/xen/spinlock.c:60: error: implicit declaration of function ‘xen_clocksource_read’
    >
    > i've excluded these new commits for now from tip/master - could you
    > please send a delta fix against tip/x86/xen?

    Make xen_clocksource_read non-static.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

09 Jul, 2008

1 commit


25 Jun, 2008

2 commits


16 Jun, 2008

1 commit


12 Jun, 2008

1 commit

  • We have a few instances of the open-coded iterative div/mod loop, used
    when we don't expcet the dividend to be much bigger than the divisor.
    Unfortunately modern gcc's have the tendency to strength "reduce" this
    into a full mod operation, which isn't necessarily any faster, and
    even if it were, doesn't exist if gcc implements it in libgcc.

    The workaround is to put a dummy asm statement in the loop to prevent
    gcc from performing the transformation.

    This patch creates a single implementation of this loop, and uses it
    to replace the open-coded versions I know about.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Andrew Morton
    Cc: john stultz
    Cc: Segher Boessenkool
    Cc: Christian Kujau
    Cc: Robert Hancock
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

02 Jun, 2008

1 commit

  • On resume, the vcpu timer modes will not be restored. The timer
    infrastructure doesn't do this for us, since it assumes the cpus
    are offline. We can just poke the other vcpus into the right mode
    directly though.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

27 May, 2008

2 commits

  • Hook into the device model to make sure that timekeeping's resume handler
    is called. This deals with our clocksource's non-monotonicity over the
    save/restore. Explicitly call clock_has_changed() to make sure that
    all the timers get retriggered properly.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Thomas Gleixner

    Jeremy Fitzhardinge
     
  • This patch implements Xen save/restore and migration.

    Saving is triggered via xenbus, which is polled in
    drivers/xen/manage.c. When a suspend request comes in, the kernel
    prepares itself for saving by:

    1 - Freeze all processes. This is primarily to prevent any
    partially-completed pagetable updates from confusing the suspend
    process. If CONFIG_PREEMPT isn't defined, then this isn't necessary.

    2 - Suspend xenbus and other devices

    3 - Stop_machine, to make sure all the other vcpus are quiescent. The
    Xen tools require the domain to run its save off vcpu0.

    4 - Within the stop_machine state, it pins any unpinned pgds (under
    construction or destruction), performs canonicalizes various other
    pieces of state (mostly converting mfns to pfns), and finally

    5 - Suspend the domain

    Restore reverses the steps used to save the domain, ending when all
    the frozen processes are thawed.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Thomas Gleixner

    Jeremy Fitzhardinge
     

10 Feb, 2008

1 commit

  • Use xen_khz to denote xen_specific clock speed. Avoid shadowing
    cpu_khz.

    arch/x86/xen/time.c:220:6: warning: symbol 'cpu_khz' shadows an earlier one
    include/asm/tsc.h:17:21: originally declared here

    Signed-off-by: Harvey Harrison
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Harvey Harrison