Skip to content

Commit

Permalink
[PATCH] x86-64: Synchronize RDTSC on single core AMD
Browse files Browse the repository at this point in the history
There is no guarantee that two RDTSCs in a row are monotonic,
so don't assume it on single core AMD systems.
This will make gettimeofday slower again
Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Dec 7, 2006
1 parent a1a70c2 commit 6167796
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
/* Fix cpuid4 emulation for more */
num_cache_leaves = 3;

/* When there is only one core no need to synchronize RDTSC */
if (num_possible_cpus() == 1)
set_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
else
clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
/* RDTSC can be speculated around */
clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
}

static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
Expand Down

0 comments on commit 6167796

Please sign in to comment.