Skip to content

Commit

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

* 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  um: Fix read_persistent_clock fallout
  kgdb: Do not access xtime directly
  powerpc: Clean up obsolete code relating to decrementer and timebase
  powerpc: Rework VDSO gettimeofday to prevent time going backwards
  clocksource: Add __clocksource_updatefreq_hz/khz methods
  x86: Convert common clocksources to use clocksource_register_hz/khz
  timekeeping: Make xtime and wall_to_monotonic static
  hrtimer: Cleanup direct access to wall_to_monotonic
  um: Convert to use read_persistent_clock
  timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
  powerpc: Cleanup xtime usage
  powerpc: Simplify update_vsyscall
  time: Kill off CONFIG_GENERIC_TIME
  time: Implement timespec_add
  x86: Fix vtime/file timestamp inconsistencies

Trivial conflicts in Documentation/feature-removal-schedule.txt

Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
per Thomas' earlier merge commit 47916be ("Merge branch
'powerpc.cherry-picks' into timers/clocksource")
  • Loading branch information
torvalds committed Aug 6, 2010
2 parents af39008 + b292307 commit b62ad9a
Show file tree
Hide file tree
Showing 46 changed files with 165 additions and 262 deletions.
10 changes: 0 additions & 10 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,6 @@ Who: Jan Kiszka <[email protected]>

----------------------------

What: xtime, wall_to_monotonic
When: 2.6.36+
Files: kernel/time/timekeeping.c include/linux/time.h
Why: Cleaning up timekeeping internal values. Please use
existing timekeeping accessor functions to access
the equivalent functionality.
Who: John Stultz <[email protected]>

----------------------------

What: KVM paravirt mmu host support
When: January 2011
Why: The paravirt mmu host support is slower than non-paravirt mmu, both
Expand Down
3 changes: 1 addition & 2 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ parameter is applicable:
MTD MTD (Memory Technology Device) support is enabled.
NET Appropriate network support is enabled.
NUMA NUMA support is enabled.
GENERIC_TIME The generic timeofday code is enabled.
NFS Appropriate NFS support is enabled.
OSS OSS sound support is enabled.
PV_OPS A paravirtualized kernel is enabled.
Expand Down Expand Up @@ -470,7 +469,7 @@ and is between 256 and 4096 characters. It is defined in the file
clocksource is not available, it defaults to PIT.
Format: { pit | tsc | cyclone | pmtmr }

clocksource= [GENERIC_TIME] Override the default clocksource
clocksource= Override the default clocksource
Format: <string>
Override the default clocksource and use the clocksource
with the name specified.
Expand Down
4 changes: 0 additions & 4 deletions arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
def_bool y

Expand Down
4 changes: 0 additions & 4 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ config SYS_SUPPORTS_APM_EMULATION
config GENERIC_GPIO
bool

config GENERIC_TIME
bool
default y

config ARCH_USES_GETTIMEOFFSET
bool
default n
Expand Down
3 changes: 0 additions & 3 deletions arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ config GENERIC_IRQ_PROBE
config RWSEM_GENERIC_SPINLOCK
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_CLOCKEVENTS
def_bool y

Expand Down
3 changes: 0 additions & 3 deletions arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,6 @@ comment "Kernel Timer/Scheduler"

source kernel/Kconfig.hz

config GENERIC_TIME
def_bool y

config GENERIC_CLOCKEVENTS
bool "Generic clock events"
default y
Expand Down
3 changes: 0 additions & 3 deletions arch/cris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM
bool

config GENERIC_TIME
def_bool y

config GENERIC_CMOS_UPDATE
def_bool y

Expand Down
4 changes: 0 additions & 4 deletions arch/frv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
bool
default y

config GENERIC_TIME
bool
default y

config TIME_LOW_RES
bool
default y
Expand Down
4 changes: 0 additions & 4 deletions arch/h8300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_BUG
bool
depends on BUG
Expand Down
4 changes: 0 additions & 4 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_TIME_VSYSCALL
bool
default y
Expand Down
7 changes: 4 additions & 3 deletions arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ void update_vsyscall_tz(void)
{
}

void update_vsyscall(struct timespec *wall, struct clocksource *c, u32 mult)
void update_vsyscall(struct timespec *wall, struct timespec *wtm,
struct clocksource *c, u32 mult)
{
unsigned long flags;

Expand All @@ -487,9 +488,9 @@ void update_vsyscall(struct timespec *wall, struct clocksource *c, u32 mult)
/* copy kernel time structures */
fsyscall_gtod_data.wall_time.tv_sec = wall->tv_sec;
fsyscall_gtod_data.wall_time.tv_nsec = wall->tv_nsec;
fsyscall_gtod_data.monotonic_time.tv_sec = wall_to_monotonic.tv_sec
fsyscall_gtod_data.monotonic_time.tv_sec = wtm->tv_sec
+ wall->tv_sec;
fsyscall_gtod_data.monotonic_time.tv_nsec = wall_to_monotonic.tv_nsec
fsyscall_gtod_data.monotonic_time.tv_nsec = wtm->tv_nsec
+ wall->tv_nsec;

/* normalize */
Expand Down
3 changes: 0 additions & 3 deletions arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ config HZ
int
default 100

config GENERIC_TIME
def_bool y

config ARCH_USES_GETTIMEOFFSET
def_bool y

Expand Down
3 changes: 0 additions & 3 deletions arch/m68k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ config HZ
int
default 100

config GENERIC_TIME
def_bool y

config ARCH_USES_GETTIMEOFFSET
def_bool y

Expand Down
4 changes: 0 additions & 4 deletions arch/m68knommu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
bool
default y
Expand Down
3 changes: 0 additions & 3 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ config GENERIC_IRQ_PROBE
config GENERIC_CALIBRATE_DELAY
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_TIME_VSYSCALL
def_bool n

Expand Down
4 changes: 0 additions & 4 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,6 @@ config GENERIC_CLOCKEVENTS
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
bool
default y
Expand Down
3 changes: 0 additions & 3 deletions arch/mn10300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ config GENERIC_FIND_NEXT_BIT
config GENERIC_HWEIGHT
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_BUG
def_bool y

Expand Down
4 changes: 0 additions & 4 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config TIME_LOW_RES
bool
depends on SMP
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ config MMU
config GENERIC_CMOS_UPDATE
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_TIME_VSYSCALL
def_bool y

Expand Down
60 changes: 27 additions & 33 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,30 @@ static cycle_t timebase_read(struct clocksource *cs)
return (cycle_t)get_tb();
}

static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
u64 new_tb_to_xs, struct timespec *now,
u32 frac_sec)
void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
struct clocksource *clock, u32 mult)
{
u64 new_tb_to_xs, new_stamp_xsec;
u32 frac_sec;

if (clock != &clocksource_timebase)
return;

/* Make userspace gettimeofday spin until we're done. */
++vdso_data->tb_update_count;
smp_mb();

/* XXX this assumes clock->shift == 22 */
/* 4611686018 ~= 2^(20+64-22) / 1e9 */
new_tb_to_xs = (u64) mult * 4611686018ULL;
new_stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
do_div(new_stamp_xsec, 1000000000);
new_stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;

BUG_ON(wall_time->tv_nsec >= NSEC_PER_SEC);
/* this is tv_nsec / 1e9 as a 0.32 fraction */
frac_sec = ((u64) wall_time->tv_nsec * 18446744073ULL) >> 32;

/*
* tb_update_count is used to allow the userspace gettimeofday code
* to assure itself that it sees a consistent view of the tb_to_xs and
Expand All @@ -811,43 +831,17 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
* We expect the caller to have done the first increment of
* vdso_data->tb_update_count already.
*/
vdso_data->tb_orig_stamp = new_tb_stamp;
vdso_data->tb_orig_stamp = clock->cycle_last;
vdso_data->stamp_xsec = new_stamp_xsec;
vdso_data->tb_to_xs = new_tb_to_xs;
vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
vdso_data->stamp_xtime = *now;
vdso_data->wtom_clock_sec = wtm->tv_sec;
vdso_data->wtom_clock_nsec = wtm->tv_nsec;
vdso_data->stamp_xtime = *wall_time;
vdso_data->stamp_sec_fraction = frac_sec;
smp_wmb();
++(vdso_data->tb_update_count);
}

void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
u32 mult)
{
u64 t2x, stamp_xsec;
u32 frac_sec;

if (clock != &clocksource_timebase)
return;

/* Make userspace gettimeofday spin until we're done. */
++vdso_data->tb_update_count;
smp_mb();

/* XXX this assumes clock->shift == 22 */
/* 4611686018 ~= 2^(20+64-22) / 1e9 */
t2x = (u64) mult * 4611686018ULL;
stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
do_div(stamp_xsec, 1000000000);
stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;

BUG_ON(wall_time->tv_nsec >= NSEC_PER_SEC);
/* this is tv_nsec / 1e9 as a 0.32 fraction */
frac_sec = ((u64) wall_time->tv_nsec * 18446744073ULL) >> 32;
update_gtod(clock->cycle_last, stamp_xsec, t2x, wall_time, frac_sec);
}

void update_vsyscall_tz(void)
{
/* Make userspace gettimeofday spin until we're done. */
Expand Down
3 changes: 0 additions & 3 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ config ARCH_HAS_ILOG2_U64
config GENERIC_HWEIGHT
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_TIME_VSYSCALL
def_bool y

Expand Down
8 changes: 4 additions & 4 deletions arch/s390/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ struct clocksource * __init clocksource_default_clock(void)
return &clocksource_tod;
}

void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
u32 mult)
void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
struct clocksource *clock, u32 mult)
{
if (clock != &clocksource_tod)
return;
Expand All @@ -219,8 +219,8 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
vdso_data->xtime_tod_stamp = clock->cycle_last;
vdso_data->xtime_clock_sec = wall_time->tv_sec;
vdso_data->xtime_clock_nsec = wall_time->tv_nsec;
vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
vdso_data->wtom_clock_sec = wtm->tv_sec;
vdso_data->wtom_clock_nsec = wtm->tv_nsec;
vdso_data->ntp_mult = mult;
smp_wmb();
++vdso_data->tb_update_count;
Expand Down
3 changes: 0 additions & 3 deletions arch/score/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ config GENERIC_CALIBRATE_DELAY
config GENERIC_CLOCKEVENTS
def_bool y

config GENERIC_TIME
def_bool y

config SCHED_NO_NO_OMIT_FRAME_POINTER
def_bool y

Expand Down
3 changes: 0 additions & 3 deletions arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ config GENERIC_CALIBRATE_DELAY
config GENERIC_IOMAP
bool

config GENERIC_TIME
def_bool y

config GENERIC_CLOCKEVENTS
def_bool y

Expand Down
3 changes: 0 additions & 3 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ config BITS
default 32 if SPARC32
default 64 if SPARC64

config GENERIC_TIME
def_bool y

config ARCH_USES_GETTIMEOFFSET
bool
default y if SPARC32
Expand Down
4 changes: 0 additions & 4 deletions arch/um/Kconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ config GENERIC_BUG
default y
depends on BUG

config GENERIC_TIME
bool
default y

config GENERIC_CLOCKEVENTS
bool
default y
Expand Down
Loading

0 comments on commit b62ad9a

Please sign in to comment.