Skip to content

Commit

Permalink
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/linux-2.6-tip

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (62 commits)
  posix-clocks: Check write permissions in posix syscalls
  hrtimer: Remove empty hrtimer_init_hres_timer()
  hrtimer: Update hrtimer->state documentation
  hrtimer: Update base[CLOCK_BOOTTIME].offset correctly
  timers: Export CLOCK_BOOTTIME via the posix timers interface
  timers: Add CLOCK_BOOTTIME hrtimer base
  time: Extend get_xtime_and_monotonic_offset() to also return sleep
  time: Introduce get_monotonic_boottime and ktime_get_boottime
  hrtimers: extend hrtimer base code to handle more then 2 clockids
  ntp: Remove redundant and incorrect parameter check
  mn10300: Switch do_timer() to xtimer_update()
  posix clocks: Introduce dynamic clocks
  posix-timers: Cleanup namespace
  posix-timers: Add support for fd based clocks
  x86: Add clock_adjtime for x86
  posix-timers: Introduce a syscall for clock tuning.
  time: Splitout compat timex accessors
  ntp: Add ADJ_SETOFFSET mode bit
  time: Introduce timekeeping_inject_offset
  posix-timer: Update comment
  ...

Fix up new system-call-related conflicts in
	arch/x86/ia32/ia32entry.S
	arch/x86/include/asm/unistd_32.h
	arch/x86/include/asm/unistd_64.h
	arch/x86/kernel/syscall_table_32.S
(name_to_handle_at()/open_by_handle_at() vs clock_adjtime()), and some
due to movement of get_jiffies_64() in:
	kernel/time.c
  • Loading branch information
torvalds committed Mar 16, 2011
2 parents 9620639 + 6e6823d commit 420c1c5
Show file tree
Hide file tree
Showing 56 changed files with 1,276 additions and 508 deletions.
8 changes: 2 additions & 6 deletions arch/alpha/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void read_persistent_clock(struct timespec *ts)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
irqreturn_t timer_interrupt(int irq, void *dev)
{
Expand All @@ -172,8 +172,6 @@ irqreturn_t timer_interrupt(int irq, void *dev)
profile_tick(CPU_PROFILING);
#endif

write_seqlock(&xtime_lock);

/*
* Calculate how many ticks have passed since the last update,
* including any previous partial leftover. Save any resulting
Expand All @@ -187,9 +185,7 @@ irqreturn_t timer_interrupt(int irq, void *dev)
nticks = delta >> FIX_SHIFT;

if (nticks)
do_timer(nticks);

write_sequnlock(&xtime_lock);
xtime_update(nticks);

if (test_irq_work_pending()) {
clear_irq_work_pending();
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ void timer_tick(void)
{
profile_tick(CPU_PROFILING);
do_leds();
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
xtime_update(1);
#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-clps711x/include/mach/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ p720t_timer_interrupt(int irq, void *dev_id)
{
struct pt_regs *regs = get_irq_regs();
do_leds();
do_timer(1);
xtime_update(1);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
Expand Down
6 changes: 2 additions & 4 deletions arch/blackfin/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,14 @@ u32 arch_gettimeoffset(void)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
#ifdef CONFIG_CORE_TIMER_IRQ_L1
__attribute__((l1_text))
#endif
irqreturn_t timer_interrupt(int irq, void *dummy)
{
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
xtime_update(1);

#ifdef CONFIG_IPIPE
update_root_process_times(get_irq_regs());
Expand Down
4 changes: 2 additions & 2 deletions arch/cris/arch-v10/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ stop_watchdog(void)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/

//static unsigned short myjiff; /* used by our debug routine print_timestamp */
Expand Down Expand Up @@ -176,7 +176,7 @@ timer_interrupt(int irq, void *dev_id)

/* call the real timer interrupt handler */

do_timer(1);
xtime_update(1);

cris_do_profile(regs); /* Save profiling information */
return IRQ_HANDLED;
Expand Down
6 changes: 2 additions & 4 deletions arch/cris/arch-v32/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void handle_watchdog_bite(struct pt_regs *regs)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick.
* as well as call the "xtime_update()" routine every clocktick.
*/
extern void cris_do_profile(struct pt_regs *regs);

Expand Down Expand Up @@ -216,9 +216,7 @@ static inline irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;

/* Call the real timer interrupt handler */
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
xtime_update(1);
return IRQ_HANDLED;
}

Expand Down
14 changes: 2 additions & 12 deletions arch/frv/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,20 @@ static struct irqaction timer_irq = {

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
static irqreturn_t timer_interrupt(int irq, void *dummy)
{
profile_tick(CPU_PROFILING);
/*
* Here we are in the timer irq handler. We just have irqs locally
* disabled but we don't know if the timer_bh is running on the other
* CPU. We need to avoid to SMP race with it. NOTE: we don't need
* the irq version of write_lock because as just said we have irq
* locally disabled. -arca
*/
write_seqlock(&xtime_lock);

do_timer(1);
xtime_update(1);

#ifdef CONFIG_HEARTBEAT
static unsigned short n;
n++;
__set_LEDS(n);
#endif /* CONFIG_HEARTBEAT */

write_sequnlock(&xtime_lock);

update_process_times(user_mode(get_irq_regs()));

return IRQ_HANDLED;
Expand Down
4 changes: 1 addition & 3 deletions arch/h8300/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ void h8300_timer_tick(void)
{
if (current->pid)
profile_tick(CPU_PROFILING);
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
xtime_update(1);
update_process_times(user_mode(get_irq_regs()));
}

Expand Down
2 changes: 1 addition & 1 deletion arch/h8300/kernel/timer/timer8.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/

static irqreturn_t timer_interrupt(int irq, void *dev_id)
Expand Down
19 changes: 5 additions & 14 deletions arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,10 @@ timer_interrupt (int irq, void *dev_id)

new_itm += local_cpu_data->itm_delta;

if (smp_processor_id() == time_keeper_id) {
/*
* Here we are in the timer irq handler. We have irqs locally
* disabled, but we don't know if the timer_bh is running on
* another CPU. We need to avoid to SMP race by acquiring the
* xtime_lock.
*/
write_seqlock(&xtime_lock);
do_timer(1);
local_cpu_data->itm_next = new_itm;
write_sequnlock(&xtime_lock);
} else
local_cpu_data->itm_next = new_itm;
if (smp_processor_id() == time_keeper_id)
xtime_update(1);

local_cpu_data->itm_next = new_itm;

if (time_after(new_itm, ia64_get_itc()))
break;
Expand All @@ -222,7 +213,7 @@ timer_interrupt (int irq, void *dev_id)
* comfort, we increase the safety margin by
* intentionally dropping the next tick(s). We do NOT
* update itm.next because that would force us to call
* do_timer() which in turn would let our clock run
* xtime_update() which in turn would let our clock run
* too fast (with the potentially devastating effect
* of losing monotony of time).
*/
Expand Down
13 changes: 5 additions & 8 deletions arch/ia64/xen/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,11 @@ consider_steal_time(unsigned long new_itm)
run_posix_cpu_timers(p);
delta_itm += local_cpu_data->itm_delta * (stolen + blocked);

if (cpu == time_keeper_id) {
write_seqlock(&xtime_lock);
do_timer(stolen + blocked);
local_cpu_data->itm_next = delta_itm + new_itm;
write_sequnlock(&xtime_lock);
} else {
local_cpu_data->itm_next = delta_itm + new_itm;
}
if (cpu == time_keeper_id)
xtime_update(stolen + blocked);

local_cpu_data->itm_next = delta_itm + new_itm;

per_cpu(xen_stolen_time, cpu) += NS_PER_TICK * stolen;
per_cpu(xen_blocked_time, cpu) += NS_PER_TICK * blocked;
}
Expand Down
5 changes: 2 additions & 3 deletions arch/m32r/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ u32 arch_gettimeoffset(void)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
#ifndef CONFIG_SMP
profile_tick(CPU_PROFILING);
#endif
/* XXX FIXME. Uh, the xtime_lock should be held here, no? */
do_timer(1);
xtime_update(1);

#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/bvme6000/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ extern int bvme6000_set_clock_mmss (unsigned long);
extern void bvme6000_reset (void);
void bvme6000_set_vectors (void);

/* Save tick handler routine pointer, will point to do_timer() in
* kernel/sched.c, called via bvme6000_process_int() */
/* Save tick handler routine pointer, will point to xtime_update() in
* kernel/timer/timekeeping.c, called via bvme6000_process_int() */

static irq_handler_t tick_handler;

Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ static inline int set_rtc_mmss(unsigned long nowtime)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
static irqreturn_t timer_interrupt(int irq, void *dummy)
{
do_timer(1);
xtime_update(1);
update_process_times(user_mode(get_irq_regs()));
profile_tick(CPU_PROFILING);

Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/mvme147/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ extern void mvme147_reset (void);

static int bcd2int (unsigned char b);

/* Save tick handler routine pointer, will point to do_timer() in
* kernel/sched.c, called via mvme147_process_int() */
/* Save tick handler routine pointer, will point to xtime_update() in
* kernel/time/timekeeping.c, called via mvme147_process_int() */

irq_handler_t tick_handler;

Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/mvme16x/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ extern void mvme16x_reset (void);

int bcd2int (unsigned char b);

/* Save tick handler routine pointer, will point to do_timer() in
* kernel/sched.c, called via mvme16x_process_int() */
/* Save tick handler routine pointer, will point to xtime_update() in
* kernel/time/timekeeping.c, called via mvme16x_process_int() */

static irq_handler_t tick_handler;

Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/sun3/sun3ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static irqreturn_t sun3_int5(int irq, void *dev_id)
#ifdef CONFIG_SUN3
intersil_clear();
#endif
do_timer(1);
xtime_update(1);
update_process_times(user_mode(get_irq_regs()));
if (!(kstat_cpu(0).irqs[irq] % 20))
sun3_leds(led_pattern[(kstat_cpu(0).irqs[irq] % 160) / 20]);
Expand Down
8 changes: 2 additions & 6 deletions arch/m68knommu/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,15 @@ static inline int set_rtc_mmss(unsigned long nowtime)
#ifndef CONFIG_GENERIC_CLOCKEVENTS
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/
irqreturn_t arch_timer_interrupt(int irq, void *dummy)
{

if (current->pid)
profile_tick(CPU_PROFILING);

write_seqlock(&xtime_lock);

do_timer(1);

write_sequnlock(&xtime_lock);
xtime_update(1);

update_process_times(user_mode(get_irq_regs()));

Expand Down
6 changes: 1 addition & 5 deletions arch/mn10300/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
unsigned tsc, elapse;
irqreturn_t ret;

write_seqlock(&xtime_lock);

while (tsc = get_cycles(),
elapse = tsc - mn10300_last_tsc, /* time elapsed since last
* tick */
Expand All @@ -114,11 +112,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
mn10300_last_tsc += MN10300_TSC_PER_HZ;

/* advance the kernel's time tracking system */
do_timer(1);
xtime_update(1);
}

write_sequnlock(&xtime_lock);

ret = local_timer_interrupt();
#ifdef CONFIG_SMP
send_IPI_allbutself(LOCAL_TIMER_IPI);
Expand Down
7 changes: 2 additions & 5 deletions arch/parisc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,8 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
update_process_times(user_mode(get_irq_regs()));
}

if (cpu == 0) {
write_seqlock(&xtime_lock);
do_timer(ticks_elapsed);
write_sequnlock(&xtime_lock);
}
if (cpu == 0)
xtime_update(ticks_elapsed);

return IRQ_HANDLED;
}
Expand Down
4 changes: 1 addition & 3 deletions arch/sparc/kernel/pcic.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,8 @@ static void pcic_clear_clock_irq(void)

static irqreturn_t pcic_timer_handler (int irq, void *h)
{
write_seqlock(&xtime_lock); /* Dummy, to show that we remember */
pcic_clear_clock_irq();
do_timer(1);
write_sequnlock(&xtime_lock);
xtime_update(1);
#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
#endif
Expand Down
9 changes: 2 additions & 7 deletions arch/sparc/kernel/time_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int update_persistent_clock(struct timespec now)

/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
* as well as call the "xtime_update()" routine every clocktick
*/

#define TICK_SIZE (tick_nsec / 1000)
Expand All @@ -96,14 +96,9 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id)
profile_tick(CPU_PROFILING);
#endif

/* Protect counter clear so that do_gettimeoffset works */
write_seqlock(&xtime_lock);

clear_clock_irq();

do_timer(1);

write_sequnlock(&xtime_lock);
xtime_update(1);

#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
Expand Down
1 change: 1 addition & 0 deletions arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -855,4 +855,5 @@ ia32_sys_call_table:
.quad sys_prlimit64 /* 340 */
.quad sys_name_to_handle_at
.quad compat_sys_open_by_handle_at
.quad compat_sys_clock_adjtime
ia32_syscall_end:
3 changes: 2 additions & 1 deletion arch/x86/include/asm/unistd_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,11 @@
#define __NR_prlimit64 340
#define __NR_name_to_handle_at 341
#define __NR_open_by_handle_at 342
#define __NR_clock_adjtime 343

#ifdef __KERNEL__

#define NR_syscalls 343
#define NR_syscalls 344

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
Expand Down
Loading

0 comments on commit 420c1c5

Please sign in to comment.