Date: Sun, 4 May 1997 12:30:02 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs Subject: Re: kern/3491: kernel profiling broken with SMP kernel Message-ID: <199705041930.MAA12415@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/3491; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: andreas@klemm.gtn.com, FreeBSD-gnats-submit@FreeBSD.ORG Cc: Subject: Re: kern/3491: kernel profiling broken with SMP kernel Date: Mon, 5 May 1997 05:16:56 +1000 >Tried to create a kernel with enhanced profiling support. Don't do that. Even ordinary profiling doesn't actually work in SMP kernels. For ordinary profiling, I think clock interrupts are taken by only one (random) CPU and the other CPUs aren't accounted for. I think they need to all take clock interrupts and all except one handle only per-CPU profiling. A single profiling buffer should work OK unless you are interested in per-CPU statistics, but accesses to it would have to be locked. For enhanced profiling, there is a TSC and a set of performance counters for each CPU, so the global variables related to these must be arrays in the SMP case. This is not implemented. >Browsed through .../isa/clock.c >Seems to be ifdef'ed out for the SMP case ... Why ? > >[...snip...] >#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) >u_int i586_ctr_bias; >u_int i586_ctr_comultiplier; >u_int i586_ctr_freq; >u_int i586_ctr_multiplier; >#endif These need to be arrays, except possibly if the CPU frequencies are almost the same (e.g., +-1% for profiling and +-0.001% for timekeeping). Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705041930.MAA12415>