Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206153
b: refs/heads/master
c: 0e469db
h: refs/heads/master
i:
  206151: 4ebb953
v: v3
  • Loading branch information
Paul Mackerras authored and Thomas Gleixner committed Jul 28, 2010
1 parent 324e397 commit affd100
Show file tree
Hide file tree
Showing 50 changed files with 327 additions and 368 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 852db46d55e85b475a72e665ca08d3317769ceef
refs/heads/master: 0e469db8f70c2645acdc90981c0480a3e19d5e68
10 changes: 10 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,16 @@ Who: Avi Kivity <avi@redhat.com>

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

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 <johnstul@us.ibm.com>

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

What: KVM kernel-allocated memory slots
When: July 2010
Why: Since 2.6.25, kvm supports user-allocated memory slots, which are
Expand Down
3 changes: 2 additions & 1 deletion trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ 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 @@ -467,7 +468,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= Override the default clocksource
clocksource= [GENERIC_TIME] Override the default clocksource
Format: <string>
Override the default clocksource and use the clocksource
with the name specified.
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
def_bool y

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ 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: 3 additions & 0 deletions trunk/arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ 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: 3 additions & 0 deletions trunk/arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ 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: 3 additions & 0 deletions trunk/arch/cris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ 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: 4 additions & 0 deletions trunk/arch/frv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ 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: 4 additions & 0 deletions trunk/arch/h8300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_TIME
bool
default y

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

config GENERIC_TIME
bool
default y

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

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

Expand All @@ -488,9 +487,9 @@ void update_vsyscall(struct timespec *wall, struct timespec *wtm,
/* 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 = wtm->tv_sec
fsyscall_gtod_data.monotonic_time.tv_sec = wall_to_monotonic.tv_sec
+ wall->tv_sec;
fsyscall_gtod_data.monotonic_time.tv_nsec = wtm->tv_nsec
fsyscall_gtod_data.monotonic_time.tv_nsec = wall_to_monotonic.tv_nsec
+ wall->tv_nsec;

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

config GENERIC_TIME
def_bool y

config ARCH_USES_GETTIMEOFFSET
def_bool y

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

config GENERIC_TIME
def_bool y

config ARCH_USES_GETTIMEOFFSET
def_bool y

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

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
bool
default y
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ 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: 4 additions & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,10 @@ config GENERIC_CLOCKEVENTS
bool
default y

config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
bool
default y
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/mn10300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ 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: 4 additions & 0 deletions trunk/arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ 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: 3 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ config MMU
config GENERIC_CMOS_UPDATE
def_bool y

config GENERIC_TIME
def_bool y

config GENERIC_TIME_VSYSCALL
def_bool y

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/include/asm/vdso_datapage.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct vdso_data {
__s32 wtom_clock_sec; /* Wall to monotonic clock */
__s32 wtom_clock_nsec;
struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */
__u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */
__u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */
__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
};
Expand All @@ -105,6 +106,7 @@ struct vdso_data {
__s32 wtom_clock_sec; /* Wall to monotonic clock */
__s32 wtom_clock_nsec;
struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */
__u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */
__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
__u32 dcache_block_size; /* L1 d-cache block size */
__u32 icache_block_size; /* L1 i-cache block size */
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ int main(void)
DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
DEFINE(STAMP_XTIME, offsetof(struct vdso_data, stamp_xtime));
DEFINE(STAMP_SEC_FRAC, offsetof(struct vdso_data, stamp_sec_fraction));
DEFINE(CFG_ICACHE_BLOCKSZ, offsetof(struct vdso_data, icache_block_size));
DEFINE(CFG_DCACHE_BLOCKSZ, offsetof(struct vdso_data, dcache_block_size));
DEFINE(CFG_ICACHE_LOGBLOCKSZ, offsetof(struct vdso_data, icache_log_block_size));
Expand Down
58 changes: 35 additions & 23 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,25 +849,10 @@ static cycle_t timebase_read(struct clocksource *cs)
return (cycle_t)get_tb();
}

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

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;

/*
* 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 @@ -879,16 +864,43 @@ void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
* We expect the caller to have done the first increment of
* vdso_data->tb_update_count already.
*/
vdso_data->tb_orig_stamp = clock->cycle_last;
vdso_data->tb_orig_stamp = new_tb_stamp;
vdso_data->stamp_xsec = new_stamp_xsec;
vdso_data->tb_to_xs = new_tb_to_xs;
vdso_data->wtom_clock_sec = wtm->tv_sec;
vdso_data->wtom_clock_nsec = wtm->tv_nsec;
vdso_data->stamp_xtime = *wall_time;
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->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 Expand Up @@ -1093,7 +1105,7 @@ void __init time_init(void)
vdso_data->tb_orig_stamp = tb_last_jiffy;
vdso_data->tb_update_count = 0;
vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
vdso_data->stamp_xsec = (u64) get_seconds() * XSEC_PER_SEC;
vdso_data->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC;
vdso_data->tb_to_xs = tb_to_xs;

write_sequnlock_irqrestore(&xtime_lock, flags);
Expand Down
Loading

0 comments on commit affd100

Please sign in to comment.