提交 8387c1a4 编写于 作者: L Linus Torvalds

smpboot: fix cachesize comparison in smp_tune_scheduling()

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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a2b7d2e9
...@@ -943,10 +943,9 @@ static int __cpuinit __smp_prepare_cpu(int cpu) ...@@ -943,10 +943,9 @@ static int __cpuinit __smp_prepare_cpu(int cpu)
static void smp_tune_scheduling(void) static void smp_tune_scheduling(void)
{ {
unsigned long cachesize; /* kB */
if (cpu_khz) { 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) if (cachesize > 0)
max_cache_size = cachesize * 1024; max_cache_size = cachesize * 1024;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册