From: Mike Travis Date: Tue, 25 Mar 2008 22:06:59 +0000 (-0700) Subject: x86: oprofile: remove NR_CPUS arrays in arch/x86/oprofile/nmi_int.c X-Git-Tag: v2.6.26-rc1~1132^2~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d18d00f5dbcd1a95811617e9812cf0560bd465ee;p=pandora-kernel.git x86: oprofile: remove NR_CPUS arrays in arch/x86/oprofile/nmi_int.c Change the following arrays sized by NR_CPUS to be PERCPU variables: static struct op_msrs cpu_msrs[NR_CPUS]; static unsigned long saved_lvtpc[NR_CPUS]; Also some minor complaints from checkpatch.pl fixed. Based on: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git All changes were transparent except for: static void nmi_shutdown(void) { + struct op_msrs *msrs = &__get_cpu_var(cpu_msrs); nmi_enabled = 0; on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1); unregister_die_notifier(&profile_exceptions_nb); - model->shutdown(cpu_msrs); + model->shutdown(msrs); free_msrs(); } The existing code passed a reference to cpu 0's instance of struct op_msrs to model->shutdown, whilst the other functions are passed a reference to instance of a struct op_msrs. This seemed to be a bug to me even though as long as cpu 0 and are of the same type it would have the same effect...? Cc: Philippe Elie Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed