* [PATCH] smpboot: cachesize comparison fix in smp_tune_scheduling()
@ 2007-05-24 10:33 Jarek Poplawski
2007-05-24 23:02 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2007-05-24 10:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
smpboot: cachesize comparison fix in smp_tune_scheduling()
boot_cpu_data.x86_cache_size is signed int and can be < 0 too.
PS: this function is removed from current -mm.
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
---
diff -Nurp 2.6.22-rc2-git5-/arch/i386/kernel/smpboot.c 2.6.22-rc2-git5/arch/i386/kernel/smpboot.c
--- 2.6.22-rc2-git5-/arch/i386/kernel/smpboot.c 2007-05-24 09:37:11.000000000 +0200
+++ 2.6.22-rc2-git5/arch/i386/kernel/smpboot.c 2007-05-24 11:48:03.000000000 +0200
@@ -948,7 +948,7 @@ static void smp_tune_scheduling(void)
if (cpu_khz) {
cachesize = boot_cpu_data.x86_cache_size;
- if (cachesize > 0)
+ if ((long)cachesize > 0)
max_cache_size = cachesize * 1024;
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] smpboot: cachesize comparison fix in smp_tune_scheduling()
2007-05-24 10:33 [PATCH] smpboot: cachesize comparison fix in smp_tune_scheduling() Jarek Poplawski
@ 2007-05-24 23:02 ` Andrew Morton
2007-05-25 6:06 ` Jarek Poplawski
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-05-24 23:02 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: linux-kernel
On Thu, 24 May 2007 12:33:23 +0200
Jarek Poplawski <jarkao2@o2.pl> wrote:
>
> smpboot: cachesize comparison fix in smp_tune_scheduling()
>
> boot_cpu_data.x86_cache_size is signed int and can be < 0 too.
>
> PS: this function is removed from current -mm.
>
>
> Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
>
> ---
>
> diff -Nurp 2.6.22-rc2-git5-/arch/i386/kernel/smpboot.c 2.6.22-rc2-git5/arch/i386/kernel/smpboot.c
> --- 2.6.22-rc2-git5-/arch/i386/kernel/smpboot.c 2007-05-24 09:37:11.000000000 +0200
> +++ 2.6.22-rc2-git5/arch/i386/kernel/smpboot.c 2007-05-24 11:48:03.000000000 +0200
> @@ -948,7 +948,7 @@ static void smp_tune_scheduling(void)
> if (cpu_khz) {
> cachesize = boot_cpu_data.x86_cache_size;
>
> - if (cachesize > 0)
> + if ((long)cachesize > 0)
> max_cache_size = cachesize * 1024;
> }
> }
Under what conditions can boot_cpu_data.x86_cache_size be negative?
Have negative values of boot_cpu_data.x86_cache_size been observed in
practice?
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] smpboot: cachesize comparison fix in smp_tune_scheduling()
2007-05-24 23:02 ` Andrew Morton
@ 2007-05-25 6:06 ` Jarek Poplawski
0 siblings, 0 replies; 3+ messages in thread
From: Jarek Poplawski @ 2007-05-25 6:06 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
On Thu, May 24, 2007 at 04:02:07PM -0700, Andrew Morton wrote:
> On Thu, 24 May 2007 12:33:23 +0200
> Jarek Poplawski <jarkao2@o2.pl> wrote:
>
> >
> > smpboot: cachesize comparison fix in smp_tune_scheduling()
> >
> > boot_cpu_data.x86_cache_size is signed int and can be < 0 too.
...
> Under what conditions can boot_cpu_data.x86_cache_size be negative?
>
> Have negative values of boot_cpu_data.x86_cache_size been observed in
> practice?
Sorry, but IMHO every observations are only kind of illusions,
and should have no influence on any serious science, including
computer science.
But, from smpboot.c history:
"[PATCH] i386: Clean up smp_tune_scheduling()
Adrian Bunk [Thu, 7 Dec 2006 01:14:19 +0000 (02:14 +0100)]
- remove the write-only local variable "bandwidth"
- don't set "max_cache_size" in the (cachesize < 0) case:
that's already handled in kernel/sched.c:measure_migration_cost()"
So, it seems such strange phenomenon could've been observed
long time ago...
Thanks,
Jarek P.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-25 5:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24 10:33 [PATCH] smpboot: cachesize comparison fix in smp_tune_scheduling() Jarek Poplawski
2007-05-24 23:02 ` Andrew Morton
2007-05-25 6:06 ` Jarek Poplawski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox