aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/timer.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* timer: remove stray local_irq_enable()David Vrabel2012-09-061-1/+0
| | | | | | | | | | | migrate_timers_from_cpu() has a stray local_irq_enable() that does nothing (it's immediately after a spin_unlock_irq()) and has no matching local_irq_disable(). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* atomic: Define {read,write}_atomic() for reading/writing memory atomically.Keir Fraser2011-11-251-7/+7
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* eliminate first_cpu() etcJan Beulich2011-11-081-1/+1
| | | | | | | | This includes the conversion from for_each_cpu_mask() to for_each-cpu(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* timer: Don't hardcode cpu0 in migrate_timers_from_cpu().Keir Fraser2011-01-081-15/+27
| | | | | | | Although we don't allow cpu0 to be offlined, there's no need to hardcode that assumption in the timer subsystem. Signed-off-by: Keir Fraser <keir@xen.org>
* timer: Ensure that CPU field of a timer is read safely when lock-free.Keir Fraser2011-01-081-15/+16
| | | | | | | | | | Firstly, all updates must use atomic_write16(), and lock-free reads must use atomic_read16(). Secondly, we ensure ->cpu is the only field accessed without a lock. This requires us to place a special sentinel value in that field when a timer is killed, to avoid needing to read ->status outside a locked critical section. Signed-off-by: Keir Fraser <keir@xen.org>
* timer: Fix up timer-state teardown on CPU offline / online-failure.Keir Fraser2011-01-081-22/+20
| | | | | | | | | | | | The lock-free access to timer->cpu in timer_lock() is problematic, as the per-cpu data that is then dereferenced could disappear under our feet. Now that per-cpu data is freed via RCU, we simply add a RCU read-side critical section to timer_lock(). It is then also unnecessary to migrate timers on CPU_DYING (we can defer it to the nicer CPU_DEAD state) and we can also safely migrate timers on CPU_UP_CANCELED. Signed-off-by: Keir Fraser <keir@xen.org>
* timers: Fix printk format specifierKeir Fraser2010-08-191-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timers: Simplify implementation logic.Keir Fraser2010-08-181-50/+13
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timers: Improve debug-key printing.Keir Fraser2010-08-181-13/+12
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timer: Do not acquire a lock on a killed timer.Keir Fraser2010-06-041-18/+31
| | | | | | | | | Its cpu field might be stale and refer to an offlined cpu. Furthermore, this avoids performing invalid operations on killed timers. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timer: Migrate timers from dying CPU on CPU_DYING notification.Keir Fraser2010-06-031-6/+27
| | | | | | | | | Otherwise timer_lock() can race a timer's ->cpu field being updated by migrate_timers_from_cpu(). The rest of this patch is all debug paranoia. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timers: Track inactive timers and migrate them on cpu offline.Keir Fraser2010-06-021-34/+83
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timers: Migrate timers away from an offlined CPU.Keir Fraser2010-05-191-2/+24
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* cpu hotplug: tasklet and timer initialisation is high priority.Keir Fraser2010-05-181-4/+15
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Remove many uses of cpu_possible_map and iterators over NR_CPUS.Keir Fraser2010-05-141-7/+24
| | | | | | | The significant remaining culprits for x86 are credit2, hpet, and percpu-area subsystems. To be dealt with in a separate patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Replace process_pending_timers() with process_pending_softirqs().Keir Fraser2009-12-221-9/+0
| | | | | | | | | This ensures that any critical softirqs are handled in a timely manner (e.g., TIME_CALIBRATE_SOFTIRQ) while still avoiding being preempted by the scheduler (by SCHEDULE_SOFTIRQ), which is the reason for avoiding use of do_softirq() directly. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Allow HPET to set timers more sloppily by seeing each CPU'sKeir Fraser2009-12-111-6/+9
| | | | | | | acceptable deadline range, rather than just deadline start. Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Add a single trigger for all diagnostic keyhandlersKeir Fraser2009-08-021-1/+6
| | | | | | | | | | Add a new keyhandler that triggers all the side-effect-free keyhandlers. This lets automated tests (and users) log the full set of keyhandlers without having to be aware of which ones might reboot the host. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Rename for_each_cpu() to for_each_possible_cpu()Keir Fraser2009-07-151-1/+1
| | | | | | ... to be more precise in naming, and also to match Linux. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* hvm: Align periodic vpts.Keir Fraser2009-02-131-0/+7
| | | | | | | Aligned periodic vpts can improve the HVM guest power consumption a lot, especially while the guest using high HZ such as 1000HZ. Signed-off-by: Wei Gang <gang.wei@intel.com>
* Fix one timer range issueKeir Fraser2008-12-041-2/+2
| | | | | | | | | | | | | According to the timer sematic, the timer can be executed at any timer within [expires, expires_end], however, current implementation only allow timer to be executed after expires_end, which is not conform to the timer semantics. This patch fix the the SPECpower score regression (~5% downgrade) introduced by changeset 18744 "Change timer implementation to allow variable 'slop'" Signed-off-by: Yu Ke <ke.yu@intel.com>
* timer: Print timer fn when dump timer queueKeir Fraser2008-11-261-4/+6
| | | | | | | Print timer fn when dump timer queue, which would be useful to understand type of the timer. Signed-off-by Kevin Tian <kevin.tian@intel.com>
* Change timer implementation to allow variable 'slop' in how lateKeir Fraser2008-10-311-43/+70
| | | | | | | | | timers are fired. The default continues to be 50us, but this can be configured on Xen's command line. Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* timer: No dynamic memory allocation with IRQs disabled.Keir Fraser2008-10-211-26/+28
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fall back to a timer linked list when the timer heap overflows.Keir Fraser2008-08-271-30/+137
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Fix lapic timer stop issue in deep C stateKeir Fraser2008-05-211-2/+4
| | | | | | | | | | Local APIC timer may stop at deep C state (C3/C4...) entry/exit. this patch add the logic that use platform timer (HPET) to reenable local APIC timer at C state entry/exit. Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Add locking to platform timers.Keir Fraser2007-06-151-1/+1
| | | | | Handy for correctness. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Clean up some x86 bootstrap code. Replace some CPU iteratorskfraser@localhost.localdomain2006-08-221-1/+1
| | | | | | with for_each_cpu() -- we want to ensure that per_cpu areas are accessed only for cpus in cpu_possible_map. Signed-off-by: Keir Fraser <keir@xensource.com>
* Whitespace clean-ups. shand@kneesaa.uk.xensource.com2006-08-161-2/+2
| | | | | Signed-off-by: Steven Hand <steven@xensource.com>
* [XEN][IA64] IA64 build fixes after recent PER_CPU changes.kaf24@firebug.cl.cam.ac.uk2006-08-091-0/+1
| | | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* [XEN] Place per-cpu timer info in PER_CPU space.kaf24@firebug.cl.cam.ac.uk2006-08-081-39/+44
| | | | | Signed-of-fby: Keir Fraser <keir@xensource.com>
* [XEN] Various softirq cleanups. Main one is to alwayskfraser@dhcp93.uk.xensource.com2006-06-301-0/+9
| | | | | | | | | | call smp_processor_id() after any softirq, as rescheduling may cause us to move to another processor on ia64 (spotted by Isaku Yamahata). Also get rid of many direct callers of do_softirq() by creating new function process_pending_timers(). Signed-off-by: Keir Fraser <keir@xensource.com>
* Avoid spurious timer activations in migrate_timer().kaf24@firebug.cl.cam.ac.uk2006-04-221-4/+7
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix Xen timer interface to allow migration of timerskaf24@firebug.cl.cam.ac.uk2006-02-081-10/+86
| | | | | | | | | among CPUs (using new migrate_timer() call). Fix the locking protocol in light of this addition. Signed-off-by: Keir Fraser <keir@xensource.com>
* Add a new timer operation kill_timer(). Effectively thekaf24@firebug.cl.cam.ac.uk2006-01-131-9/+29
| | | | | | | | | | | 'opposite' of init_timer(), it marks the end of a timer's lifetime. After this call the timer will not be pending, its callback handler will not be running, and future calls to set_timer() will silently fail. Signed-off-by: Keir Fraser <keir@xensource.com>
* Add missing renamed files. Oops.kaf24@firebug.cl.cam.ac.uk2006-01-131-0/+288
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.970 (40d07ec6txkdBLgbvygm7O1rxKCY1A)kaf24@scramble.cl.cam.ac.uk2004-06-161-338/+0
| | | | | Cleanups allowed by new ngio world.
* bitkeeper revision 1.821 (406007d6uu0vZYDxa9P1ZfNO9kF_Cg)kaf24@scramble.cl.cam.ac.uk2004-03-231-10/+10
| | | | | | | | | | | | Many files: xeno -> xen renames. ide-xen.c: Rename: xen/drivers/ide/ide-xeno.c -> xen/drivers/ide/ide-xen.c xen.lds: Rename: xen/arch/i386/xeno.lds -> xen/arch/i386/xen.lds Many files: mvdir
* bitkeeper revision 1.775 (404f3d312IPf2eSF1VGO0WBwqhqeaA)kaf24@scramble.cl.cam.ac.uk2004-03-101-8/+8
| | | | | | | | trace.h: new file Many files: Fix compile errors in Xen headers.
* bitkeeper revision 1.530 (3f9d4b50eBCuXVk_ImRaxIb9MV1j3g)kaf24@scramble.cl.cam.ac.uk2003-10-271-397/+173
| | | | | | | | time.c: new file Many files: Major fixes to time in Xen and Xenolinux. DOM0 can now set the wallclock time, perhaps using ntpd, for all other domains.
* bitkeeper revision 1.496 (3f841becdre1gQrbAv8C5pF-O_M1fg)kaf24@scramble.cl.cam.ac.uk2003-10-081-35/+0
| | | | | | sched.h, pgalloc.h, timer.c, schedule.c, domain.c, smp.c: Various cleanups. Nothing major.
* bitkeeper revision 1.396 (3f4d2199UsCzVuRmn-0-L6lh9VGYZg)kaf24@scramble.cl.cam.ac.uk2003-08-271-7/+1
| | | | | | Many files: Small cleanups. Faster checksum calculation for console UDP packets.
* bitkeeper revision 1.94 (3e5a4f5fzVaxemjfCt0N0OH8PYPiuw)iap10@labyrinth.cl.cam.ac.uk2003-02-241-0/+603
Rename xen-2.4.16 to just "xen" to reflect that it hasn't got any relation to the Linux kernel version.