[parisc-linux-cvs] Re: DIFF 2.4.18-pa47 smp_memset
Grant Grundler
grundler@dsl2.external.hp.com
Thu, 04 Jul 2002 13:43:13 -0600
Grant Grundler wrote:
> . : Makefile
> arch/parisc/kernel: processor.c
>
> Log message:
> 2.4.18-pa47
> Fixup bootcpu cpu_data[] - gets clobbered by memset.
> this fixes the problem of 50% idle on 2-way CPU.
> But now all idle time is attributed to "System".
> Also cleanup warning about cpu_info not used.
Basic problem that Thomas and I found at LinuxTag was
the boot cpu wasn't getting any statistics. top was
reporting %50 idle all the time. This patch fixes that.
Outstanding problem is all idle time is now reported
as "System" and idle is always zero.
grant
Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.317
diff -u -p -r1.317 Makefile
--- Makefile 2002/07/01 23:17:08 1.317
+++ Makefile 2002/07/04 19:30:11
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 18
-EXTRAVERSION = -pa46
+EXTRAVERSION = -pa47
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
Index: arch/parisc/kernel/processor.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/processor.c,v
retrieving revision 1.12
diff -u -p -r1.12 processor.c
--- arch/parisc/kernel/processor.c 2002/05/27 22:15:53 1.12
+++ arch/parisc/kernel/processor.c 2002/07/04 19:30:11
@@ -96,7 +96,10 @@ static int __init processor_probe(struct
ulong status;
unsigned long bytecnt;
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
+#undef USE_PAT_CPUID
+#ifdef USE_PAT_CPUID
struct pdc_pat_cpu_num cpu_info;
+#endif
status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,
dev->mod_index, PA_VIEW, &pa_pdc_cell);
@@ -109,7 +112,6 @@ static int __init processor_probe(struct
txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */
-#undef USE_PAT_CPUID
#ifdef USE_PAT_CPUID
/* We need contiguous numbers for cpuid. Firmware's notion
* of cpuid is for physical CPUs and we just don't care yet.
@@ -148,6 +150,15 @@ static int __init processor_probe(struct
p->txn_addr = txn_addr; /* save CPU IRQ address */
#ifdef CONFIG_SMP
p->lock = SPIN_LOCK_UNLOCKED;
+
+ /*
+ ** FIXME: review if any other initialization is clobbered
+ ** for boot_cpu by the above memset().
+ */
+
+ /* stolen from init_percpu_prof() */
+ cpu_data[cpuid].prof_counter = 1;
+ cpu_data[cpuid].prof_multiplier = 1;
#endif
/*