Merge branch 'x86/core' into cpus4096
authorIngo Molnar <mingo@elte.hu>
Wed, 11 Mar 2009 09:49:34 +0000 (10:49 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 11 Mar 2009 09:49:34 +0000 (10:49 +0100)
arch/x86/kernel/cpu/intel_cacheinfo.c
drivers/char/sysrq.c
drivers/oprofile/buffer_sync.c
drivers/oprofile/buffer_sync.h
drivers/oprofile/oprof.c

index 7293508d8f5c82e4cd4f196c59e28ca332747bad..8e6ce2c146d65559a11bbf4b43bd210c5c909cac 100644 (file)
@@ -159,7 +159,7 @@ struct _cpuid4_info_regs {
        unsigned long can_disable;
 };
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_SYSFS)
 static struct pci_device_id k8_nb_id[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1203) },
@@ -324,15 +324,6 @@ __cpuinit cpuid4_cache_lookup_regs(int index,
        return 0;
 }
 
-static int
-__cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
-{
-       struct _cpuid4_info_regs *leaf_regs =
-               (struct _cpuid4_info_regs *)this_leaf;
-
-       return cpuid4_cache_lookup_regs(index, leaf_regs);
-}
-
 static int __cpuinit find_num_cache_leaves(void)
 {
        unsigned int            eax, ebx, ecx, edx;
@@ -508,6 +499,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
        return l2;
 }
 
+#ifdef CONFIG_SYSFS
+
 /* pointer to _cpuid4_info array (for each cache leaf) */
 static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info);
 #define CPUID4_INFO_IDX(x, y)  (&((per_cpu(cpuid4_info, x))[y]))
@@ -571,6 +564,15 @@ static void __cpuinit free_cache_attributes(unsigned int cpu)
        per_cpu(cpuid4_info, cpu) = NULL;
 }
 
+static int
+__cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
+{
+       struct _cpuid4_info_regs *leaf_regs =
+               (struct _cpuid4_info_regs *)this_leaf;
+
+       return cpuid4_cache_lookup_regs(index, leaf_regs);
+}
+
 static void __cpuinit get_cpu_leaves(void *_retval)
 {
        int j, *retval = _retval, cpu = smp_processor_id();
@@ -612,8 +614,6 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
        return retval;
 }
 
-#ifdef CONFIG_SYSFS
-
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
 
index 33a9351c896dfbaff7dbf9afb5515d998bbb943e..3df694e545454228ee8b47e1a3b3dc4e61f9c43b 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/vt_kern.h>
 #include <linux/workqueue.h>
 #include <linux/kexec.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/hrtimer.h>
 #include <linux/oom.h>
 
index c3ea5fa7d05a6db4079bebb99ecc865b89eefca5..8574622e36a51abec01aaa05d9f509b00b8ad9f0 100644 (file)
@@ -154,6 +154,10 @@ int sync_start(void)
 {
        int err;
 
+       if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
+               return -ENOMEM;
+       cpumask_clear(marked_cpus);
+
        start_cpu_work();
 
        err = task_handoff_register(&task_free_nb);
@@ -179,6 +183,7 @@ out2:
        task_handoff_unregister(&task_free_nb);
 out1:
        end_sync();
+       free_cpumask_var(marked_cpus);
        goto out;
 }
 
@@ -190,6 +195,7 @@ void sync_stop(void)
        profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
        task_handoff_unregister(&task_free_nb);
        end_sync();
+       free_cpumask_var(marked_cpus);
 }
 
 
@@ -565,20 +571,6 @@ void sync_buffer(int cpu)
        mutex_unlock(&buffer_mutex);
 }
 
-int __init buffer_sync_init(void)
-{
-       if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
-               return -ENOMEM;
-
-       cpumask_clear(marked_cpus);
-               return 0;
-}
-
-void __exit buffer_sync_cleanup(void)
-{
-       free_cpumask_var(marked_cpus);
-}
-
 /* The function can be used to add a buffer worth of data directly to
  * the kernel buffer. The buffer is assumed to be a circular buffer.
  * Take the entries from index start and end at index end, wrapping
index 0ebf5db626796965fca5d44b6cda4d09a9a82708..3110732c1835acc640dbbc248d7a5c02403f0d83 100644 (file)
@@ -19,8 +19,4 @@ void sync_stop(void);
 /* sync the given CPU's buffer */
 void sync_buffer(int cpu);
 
-/* initialize/destroy the buffer system. */
-int buffer_sync_init(void);
-void buffer_sync_cleanup(void);
-
 #endif /* OPROFILE_BUFFER_SYNC_H */
index ced39f602292b2b8328fbc64cb705d8504768ac8..3cffce90f82a9693999bb16c5741b6c2e4e842c2 100644 (file)
@@ -183,10 +183,6 @@ static int __init oprofile_init(void)
 {
        int err;
 
-       err = buffer_sync_init();
-       if (err)
-               return err;
-
        err = oprofile_arch_init(&oprofile_ops);
 
        if (err < 0 || timer) {
@@ -195,10 +191,8 @@ static int __init oprofile_init(void)
        }
 
        err = oprofilefs_register();
-       if (err) {
+       if (err)
                oprofile_arch_exit();
-               buffer_sync_cleanup();
-       }
 
        return err;
 }
@@ -208,7 +202,6 @@ static void __exit oprofile_exit(void)
 {
        oprofilefs_unregister();
        oprofile_arch_exit();
-       buffer_sync_cleanup();
 }