virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 14/33] xen: xen time implementation
@ 2007-06-06 11:00 Jan Beulich
  2007-06-06 11:52 ` [Xen-devel] " Keir Fraser
  2007-06-06 11:52 ` Keir Fraser
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Beulich @ 2007-06-06 11:00 UTC (permalink / raw)
  To: Keir Fraser
  Cc: Jeremy Fitzhardinge, Xen-devel, Andrew Morton, Andi Kleen, lkml,
	Chris Wright, virtualization, Ingo Molnar, Linus Torvalds,
	Thomas Gleixner

>>> Keir Fraser <keir@xensource.com> 06.06.07 11:56 >>>
>On 6/6/07 10:30, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>>> If you have an ACPI PM timer in your system (and if you have SMM then your
>>> system is almost certainly modern enough to have one) then surely the
>>> problem is fixed for all practical purposes? The problem was overflow of a
>>> fixed-width platform counter. The PIT wraps every ~50ms, but the ACPI PM
>>> timer will wrap only every ~4s. It would be quite unreasonable for SMM to
>>> take the CPU away for multiple seconds, even as a one-time boot operation.
>> 
>> No, I don't think the problem's gone with the PM timer - it is just much less
>> likely. Since you depend on the TSC (which must generally be assumed be
>> unsyncronized across CPUs) and on the error correction factor (which shows
>> non-zero values every few seconds), getting the interpolated times on two
>> CPUs out of sync is still possible, and given the way the time keeping code
>> works even being off by just a single nanosecond may be fatal.
>
>If the error across CPUS is +/- just a few microseconds at worst then having
>the clocksource clamp to no less than the last timestamp returned seems a
>reasonable fix. Time won't 'stop' for longer than the cross-CPU error, and
>that should always be a tiny value.

Are you sure this is also true when e.g. a CPU gets throttled due to thermal
conditions? It is my understanding that both the duty cycle adjustment and
the frequency reduction would yield a reduced rate TSC, which would be
accounted for only the next time the local clock gets calibrated. Otherwise,
immediate calibration (and vcpu update) would need to be forced out of the
thermal interrupt.

Jan

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [patch 14/33] xen: xen time implementation
@ 2007-06-06  9:30 Jan Beulich
  2007-06-06  9:56 ` [Xen-devel] " Keir Fraser
  2007-06-06  9:56 ` Keir Fraser
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Beulich @ 2007-06-06  9:30 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Keir Fraser
  Cc: Xen-devel, Andrew Morton, Andi Kleen, lkml, Chris Wright,
	virtualization, Ingo Molnar, Linus Torvalds, Thomas Gleixner

>>> Keir Fraser <keir@xensource.com> 06.06.07 10:54 >>>
>On 6/6/07 09:39, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>> The issue is
>> that on that system, transition into ACPI mode takes over 600ms (SMM
>> execution, and hence no interrupts delivered during that time), and with
>> Xen using the PIT (PM timer support was added by Keir as a result of this,
>> but that doesn't cure the problem here, it just reduces the likelihood it'll
>> be encountered) platform time and local time got pretty much out of sync.
>
>If you have an ACPI PM timer in your system (and if you have SMM then your
>system is almost certainly modern enough to have one) then surely the
>problem is fixed for all practical purposes? The problem was overflow of a
>fixed-width platform counter. The PIT wraps every ~50ms, but the ACPI PM
>timer will wrap only every ~4s. It would be quite unreasonable for SMM to
>take the CPU away for multiple seconds, even as a one-time boot operation.

No, I don't think the problem's gone with the PM timer - it is just much less
likely. Since you depend on the TSC (which must generally be assumed be
unsyncronized across CPUs) and on the error correction factor (which shows
non-zero values every few seconds), getting the interpolated times on two
CPUs out of sync is still possible, and given the way the time keeping code
works even being off by just a single nanosecond may be fatal.

Jan

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [patch 00/33] xen: Xen paravirt_ops implementation
@ 2007-05-22 14:09 Jeremy Fitzhardinge
  2007-05-22 14:09 ` [patch 14/33] xen: xen time implementation Jeremy Fitzhardinge
  0 siblings, 1 reply; 13+ messages in thread
From: Jeremy Fitzhardinge @ 2007-05-22 14:09 UTC (permalink / raw)
  To: Andrew Morton, Andi Kleen
  Cc: Chris Wright, virtualization, Xen-devel, Linus Torvalds, lkml

Hi,

This is the Xen implementation for the paravirt_ops interface.  The
series is based on 2.6.22-rc1-mm1, and I think its ready to be cooked
in -mm with a view to being merged in 2.6.23.

The first part of the series is some small changes to the core kernel.
Apart from the new code added in "Allocate and free vmalloc areas"
(posted many times before), they are simply a few one-liners around
the place.

	paravirt: add an "mm" argument to alloc_pt
	paravirt: add a hook for once the allocator is ready
	paravirt: increase IRQ limit
	paravirt: unstatic leave_mm
	paravirt: unstatic smp_store_cpu_info
	paravirt: make siblingmap functions visible
	paravirt: export __supported_pte_mask
	xen: Allocate and free vmalloc areas

 arch/i386/kernel/setup.c                           |    2 
 arch/i386/kernel/smp.c                             |    5 -
 arch/i386/kernel/smpboot.c                         |    8 -
 arch/i386/kernel/vsyscall-note.S                   |   28 +++++
 arch/i386/mm/init.c                                |    1 
 include/asm-i386/mach-default/irq_vectors_limits.h |    2 
 include/asm-i386/mmu_context.h                     |    2 
 include/asm-i386/paravirt.h                        |    8 +
 include/asm-i386/setup.h                           |    4 
 include/asm-i386/smp.h                             |    5 +
 include/linux/vmalloc.h                            |    4 
 mm/vmalloc.c                                       |   53 +++++++++++
 12 files changed, 114 insertions(+), 8 deletions(-)

The rest of the series is the Xen implementation itself.  This
includes the core of Xen itself, plus the Xenbus virtual bus, and
virtual console, disk and net drivers. The vast majority of it is new
code, with a few changes to non-Xen files to:

  1. Makefile/Kconfig build stuff
  2. add a new ELF note to the VDSO to select a Xen-optimised libc
  3. a chunk of new code in entry.S, to handle upcalls from Xen,
     which in turn need to jump into other entry.S labels
  4. Define a proper label for PG_owner_priv_1
  5. Define a major for the Xen virtual block device
  6. Increate NR_IRQ to 224 when CONFIG_PARAVIRT is enabled, even if
     there's no IO APIC.

	xen: Add nosegneg capability to the vsyscall page notes
	xen: Add Xen interface header files
	xen: Core Xen implementation
	xen: Xen virtual mmu
	xen: xen event channels
	xen: xen time implementation
	xen: xen configuration
	xen: add pinned page flag
	xen: Complete pagetable pinning for Xen
	xen: ignore RW mapping of RO pages in pagetable_init
	xen: Account for time stolen by Xen
	xen: Implement xen_sched_clock
	xen: Xen SMP guest support
	xen: Add support for preemption
	xen: lazy-mmu operations
	xen: hack to prevent bad segment register reload
	xen: Use the hvc console infrastructure for Xen console
	xen: Add Xen grant table support
	xen: Add the Xenbus sysfs and virtual device hotplug driver.
	xen: Add Xen virtual block device driver.
	xen: Add the Xen virtual network device driver.
	xen: Xen machine operations
	xen: handle external requests for shutdown, reboot and sysrq
	xen: Place vcpu_info structure into per-cpu memory, if possible
	xen: Attempt to patch inline versions of common operations

 arch/i386/Kconfig                     |    2 
 arch/i386/Makefile                    |    3 

 arch/i386/kernel/asm-offsets.c        |    7 
 arch/i386/kernel/entry.S              |   71 
 arch/i386/kernel/head.S               |    5 
 arch/i386/kernel/vmlinux.lds.S        |    1 

 arch/i386/xen/Kconfig                 |   11 
 arch/i386/xen/Makefile                |    4 
 arch/i386/xen/enlighten.c             | 1134 +++++++++++++
 arch/i386/xen/events.c                |  588 +++++++
 arch/i386/xen/features.c              |   29 
 arch/i386/xen/manage.c                |  143 +
 arch/i386/xen/mmu.c                   |  599 +++++++
 arch/i386/xen/mmu.h                   |   60 
 arch/i386/xen/multicalls.c            |  115 +
 arch/i386/xen/multicalls.h            |   45 
 arch/i386/xen/setup.c                 |   93 +
 arch/i386/xen/smp.c                   |  405 ++++
 arch/i386/xen/time.c                  |  585 +++++++
 arch/i386/xen/xen-asm.S               |  114 +
 arch/i386/xen/xen-head.S              |   36 
 arch/i386/xen/xen-ops.h               |   70 

 arch/x86_64/kernel/early_printk.c     |    5 

 drivers/Makefile                      |    2 
 drivers/block/Kconfig                 |    8 
 drivers/block/Makefile                |    1 
 drivers/block/xen-blkfront.c          |  988 +++++++++++

 drivers/char/Kconfig                  |    8 
 drivers/char/Makefile                 |    1 
 drivers/char/hvc_xen.c                |  159 +

 drivers/net/Kconfig                   |   12 
 drivers/net/Makefile                  |    1 
 drivers/net/xen-netfront.c            | 1995 ++++++++++++++++++++++++

 drivers/xen/Makefile                  |    2 
 drivers/xen/grant-table.c             |  582 +++++++
 drivers/xen/xenbus/Makefile           |    7 
 drivers/xen/xenbus/xenbus_client.c    |  569 ++++++
 drivers/xen/xenbus/xenbus_comms.c     |  233 ++
 drivers/xen/xenbus/xenbus_comms.h     |   46 
 drivers/xen/xenbus/xenbus_probe.c     |  935 +++++++++++
 drivers/xen/xenbus/xenbus_probe.h     |   74 
 drivers/xen/xenbus/xenbus_xs.c        |  861 ++++++++++

 include/asm-i386/irq.h                |    1 
 include/asm-i386/xen/hypercall.h      |  431 +++++
 include/asm-i386/xen/hypervisor.h     |   73 
 include/asm-i386/xen/interface.h      |  187 ++
 include/linux/major.h                 |    2 
 include/linux/page-flags.h            |    5 

 include/xen/events.h                  |   48 
 include/xen/features.h                |   23 
 include/xen/grant_table.h             |  107 +
 include/xen/hvc-console.h             |    6 
 include/xen/interface/elfnote.h       |  133 +
 include/xen/interface/event_channel.h |  195 ++
 include/xen/interface/features.h      |   43 
 include/xen/interface/grant_table.h   |  375 ++++
 include/xen/interface/io/blkif.h      |   94 +
 include/xen/interface/io/console.h    |   23 
 include/xen/interface/io/netif.h      |  156 +
 include/xen/interface/io/ring.h       |  260 +++
 include/xen/interface/io/xenbus.h     |   42 
 include/xen/interface/io/xs_wire.h    |   87 +
 include/xen/interface/memory.h        |  145 +
 include/xen/interface/physdev.h       |  145 +
 include/xen/interface/sched.h         |   77 
 include/xen/interface/vcpu.h          |  177 ++
 include/xen/interface/version.h       |   60 
 include/xen/interface/xen.h           |  446 +++++
 include/xen/page.h                    |  178 ++
 include/xen/xenbus.h                  |  234 ++
 70 files changed, 14361 insertions(+), 1 deletion(-)

-- 

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

end of thread, other threads:[~2007-06-06 14:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <C28C5EAB.1024D%keir@xensource.com>
2007-06-06 12:18 ` [Xen-devel] [patch 14/33] xen: xen time implementation Andi Kleen
2007-06-06 12:46   ` Jan Beulich
2007-06-06 12:53     ` Andi Kleen
2007-06-06 12:54     ` [Xen-devel] " Keir Fraser
2007-06-06 12:54     ` Keir Fraser
2007-06-06 11:00 Jan Beulich
2007-06-06 11:52 ` [Xen-devel] " Keir Fraser
2007-06-06 11:52 ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2007-06-06  9:30 Jan Beulich
2007-06-06  9:56 ` [Xen-devel] " Keir Fraser
2007-06-06  9:56 ` Keir Fraser
2007-05-22 14:09 [patch 00/33] xen: Xen paravirt_ops implementation Jeremy Fitzhardinge
2007-05-22 14:09 ` [patch 14/33] xen: xen time implementation Jeremy Fitzhardinge
2007-06-06  8:39   ` Jan Beulich
2007-06-06  8:54     ` [Xen-devel] " Keir Fraser
2007-06-06  8:54     ` Keir Fraser
2007-06-06 10:05     ` Jeremy Fitzhardinge
2007-06-06 10:26       ` Andi Kleen
2007-06-06 14:15         ` [Xen-devel] " Jeremy Fitzhardinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).