Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123016
b: refs/heads/master
c: 3cc6987
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Nov 5, 2008
1 parent 8495696 commit f1aa46f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 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: 597bc5c00b666fe123abb0af64f6e86f7ab72a90
refs/heads/master: 3cc698789a3f44dabc5eed389b6c123caf787c0f
20 changes: 0 additions & 20 deletions trunk/arch/powerpc/include/asm/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@ extern unsigned long ppc_proc_freq;
extern unsigned long ppc_tb_freq;
#define DEFAULT_TB_FREQ 125000000UL

/*
* By putting all of this stuff into a single struct we
* reduce the number of cache lines touched by do_gettimeofday.
* Both by collecting all of the data in one cache line and
* by touching only one TOC entry on ppc64.
*/
struct gettimeofday_vars {
u64 tb_to_xs;
u64 stamp_xsec;
u64 tb_orig_stamp;
};

struct gettimeofday_struct {
unsigned long tb_ticks_per_sec;
struct gettimeofday_vars vars[2];
struct gettimeofday_vars * volatile varp;
unsigned var_idx;
unsigned tb_to_us;
};

struct div_result {
u64 result_high;
u64 result_low;
Expand Down
35 changes: 0 additions & 35 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ static u64 tb_to_ns_scale __read_mostly;
static unsigned tb_to_ns_shift __read_mostly;
static unsigned long boot_tb __read_mostly;

static struct gettimeofday_struct do_gtod;

extern struct timezone sys_tz;
static long timezone_offset;

Expand Down Expand Up @@ -415,31 +413,9 @@ void udelay(unsigned long usecs)
}
EXPORT_SYMBOL(udelay);


/*
* There are two copies of tb_to_xs and stamp_xsec so that no
* lock is needed to access and use these values in
* do_gettimeofday. We alternate the copies and as long as a
* reasonable time elapses between changes, there will never
* be inconsistent values. ntpd has a minimum of one minute
* between updates.
*/
static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
u64 new_tb_to_xs)
{
unsigned temp_idx;
struct gettimeofday_vars *temp_varp;

temp_idx = (do_gtod.var_idx == 0);
temp_varp = &do_gtod.vars[temp_idx];

temp_varp->tb_to_xs = new_tb_to_xs;
temp_varp->tb_orig_stamp = new_tb_stamp;
temp_varp->stamp_xsec = new_stamp_xsec;
smp_mb();
do_gtod.varp = temp_varp;
do_gtod.var_idx = temp_idx;

/*
* 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 Down Expand Up @@ -515,9 +491,7 @@ static int __init iSeries_tb_recal(void)
tb_ticks_per_sec = new_tb_ticks_per_sec;
calc_cputime_factors();
div128_by_32( XSEC_PER_SEC, 0, tb_ticks_per_sec, &divres );
do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
tb_to_xs = divres.result_low;
do_gtod.varp->tb_to_xs = tb_to_xs;
vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
vdso_data->tb_to_xs = tb_to_xs;
}
Expand Down Expand Up @@ -989,15 +963,6 @@ void __init time_init(void)
sys_tz.tz_dsttime = 0;
}

do_gtod.varp = &do_gtod.vars[0];
do_gtod.var_idx = 0;
do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
__get_cpu_var(last_jiffy) = tb_last_jiffy;
do_gtod.varp->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC;
do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
do_gtod.varp->tb_to_xs = tb_to_xs;
do_gtod.tb_to_us = tb_to_us;

vdso_data->tb_orig_stamp = tb_last_jiffy;
vdso_data->tb_update_count = 0;
vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
Expand Down

0 comments on commit f1aa46f

Please sign in to comment.