2003-01-16 11:55:33

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patch] Make prof_counter use per-cpu areas patch 3/4 -- x86_64 arch

On Mon, Jan 13, 2003 at 04:21:10PM +0100, Andi Kleen wrote:
> On Mon, Jan 13, 2003 at 06:06:02PM +0530, Ravikiran G Thirumalai wrote:
> > This one's for x86_64
>
> Thanks, applied.
>
> -Andi

Please apply this over the earlier patch. As Andrew pointed out,
the above patch will cause crashes when per-cpu areas are modified to
allocate for cpu_possible cpus only.

Reinit of prof_counter/prof_multiplier/prof_old_multiplier seems to be
redundant (They are already statically inited). Similar patch worked
for x86 for me.

Thanks,
Kiran


diff -ruN -X dontdiff linux-2.5.58/arch/x86_64/kernel/smpboot.c prof_counter-2.5.58/arch/x86_64/kernel/smpboot.c
--- linux-2.5.58/arch/x86_64/kernel/smpboot.c Thu Jan 16 17:01:18 2003
+++ prof_counter-2.5.58/arch/x86_64/kernel/smpboot.c Thu Jan 16 16:59:58 2003
@@ -772,24 +772,16 @@
* Cycle through the processors sending APIC IPIs to boot each.
*/

-extern int prof_multiplier[NR_CPUS];
-extern int prof_old_multiplier[NR_CPUS];
-DECLARE_PER_CPU(int, prof_counter);
-
static void __init smp_boot_cpus(unsigned int max_cpus)
{
int apicid, cpu;

/*
* Initialize the logical to physical CPU number mapping
- * and the per-CPU profiling counter/multiplier
*/

for (apicid = 0; apicid < NR_CPUS; apicid++) {
x86_apicid_to_cpu[apicid] = -1;
- per_cpu(prof_counter, apicid) = 1;
- prof_old_multiplier[apicid] = 1;
- prof_multiplier[apicid] = 1;
}

/*