Skip to content

Commit

Permalink
smpboot: fix cachesize comparison in smp_tune_scheduling()
Browse files Browse the repository at this point in the history
Jarek Poplawski noted that boot_cpu_data.x86_cache_size is signed int
and can be < 0 too.

In fact we test for it. Except we assigned it to an unsigned value..

Cc: Jarek Poplawski <jarkao2@o2.pl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed May 31, 2007
1 parent a2b7d2e commit 8387c1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,9 @@ static int __cpuinit __smp_prepare_cpu(int cpu)

static void smp_tune_scheduling(void)
{
unsigned long cachesize; /* kB */

if (cpu_khz) {
cachesize = boot_cpu_data.x86_cache_size;
/* cache size in kB */
long cachesize = boot_cpu_data.x86_cache_size;

if (cachesize > 0)
max_cache_size = cachesize * 1024;
Expand Down

0 comments on commit 8387c1a

Please sign in to comment.