]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'linus' into tracing/kmemtrace2
authorIngo Molnar <mingo@elte.hu>
Tue, 6 Jan 2009 08:53:05 +0000 (09:53 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 6 Jan 2009 08:53:05 +0000 (09:53 +0100)
1  2 
MAINTAINERS
init/main.c
kernel/trace/trace.h
kernel/trace/trace_functions_graph.c
mm/slab.c
mm/slub.c

diff --combined MAINTAINERS
index 72d6eed3f204f8fafb4d94b2916634b54ec32c0e,141aff67bd6df3eae4545637cadeaffd7d0d368b..ec2fd64d227b7f0ac597d87d4354046cc615ace5
@@@ -2049,6 -2049,12 +2049,12 @@@ M:    mikulas@artax.karlin.mff.cuni.c
  W:    http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
  S:    Maintained
  
+ HSO   3G Modem Driver (hso.c)
+ P:    Denis Joseph Barrow
+ M:    d.barow@option.com
+ W:    http://www.pharscape.org
+ S:    Maintained
  HTCPEN TOUCHSCREEN DRIVER
  P:    Pau Oliva Fora
  M:    pof@eslack.org
@@@ -2146,11 -2152,6 +2152,6 @@@ M:     Gadi Oxman <gadio@netvision.net.il
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  
- IDE-SCSI DRIVER
- L:    linux-ide@vger.kernel.org
- L:    linux-scsi@vger.kernel.org
- S:    Orphan
  IDLE-I7300
  P:    Andy Henroid
  M:    andrew.d.henroid@intel.com
@@@ -2541,8 -2542,6 +2542,6 @@@ W:      http://kvm.qumranet.co
  S:    Supported
  
  KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64)
- P:    Anthony Xu
- M:    anthony.xu@intel.com
  P:    Xiantao Zhang
  M:    xiantao.zhang@intel.com
  L:    kvm-ia64@vger.kernel.org
@@@ -2573,12 -2572,6 +2572,12 @@@ M:    jason.wessel@windriver.co
  L:    kgdb-bugreport@lists.sourceforge.net
  S:    Maintained
  
 +KMEMTRACE
 +P:    Eduard - Gabriel Munteanu
 +M:    eduard.munteanu@linux360.ro
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +
  KPROBES
  P:    Ananth N Mavinakayanahalli
  M:    ananth@in.ibm.com
@@@ -2641,13 -2634,13 +2640,13 @@@ W:   http://www.hansenpartnership.com/voy
  S:    Maintained
  
  LINUX FOR POWERPC (32-BIT AND 64-BIT)
- P:    Paul Mackerras
- M:    paulus@samba.org
  P:    Benjamin Herrenschmidt
  M:    benh@kernel.crashing.org
+ P:    Paul Mackerras
+ M:    paulus@samba.org
  W:    http://www.penguinppc.org/
  L:    linuxppc-dev@ozlabs.org
- T:    git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git
+ T:    git kernel.org:/pub/scm/linux/kernel/git/benh/powerpc.git
  S:    Supported
  
  LINUX FOR POWER MACINTOSH
@@@ -4022,10 -4015,12 +4021,12 @@@ L:   alsa-devel@alsa-project.org (subscri
  W:    http://alsa-project.org/main/index.php/ASoC
  S:    Supported
  
- SPARC (sparc32)
- P:    William L. Irwin
- M:    wli@holomorphy.com
+ SPARC + UltraSPARC (sparc/sparc64)
+ P:    David S. Miller
+ M:    davem@davemloft.net
  L:    sparclinux@vger.kernel.org
+ T:    git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git
+ T:    git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
  S:    Maintained
  
  SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
@@@ -4309,13 -4304,6 +4310,6 @@@ M:     dushistov@mail.r
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  
- UltraSPARC (sparc64)
- P:    David S. Miller
- M:    davem@davemloft.net
- L:    sparclinux@vger.kernel.org
- T:    git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git
- S:    Maintained
  ULTRA-WIDEBAND (UWB) SUBSYSTEM:
  P:    David Vrabel
  M:    david.vrabel@csr.com
diff --combined init/main.c
index 77cb720fed4e2ea2783ceba3ede1cbdde6ab4867,cd168ebc592439b650042916ab26efd913f7ef42..72a521c0da07364c17ca1f0e958c62c0a158f526
  #include <asm/setup.h>
  #include <asm/sections.h>
  #include <asm/cacheflush.h>
 +#include <trace/kmemtrace.h>
  
  #ifdef CONFIG_X86_LOCAL_APIC
  #include <asm/smp.h>
  #endif
  
- /*
-  * This is one of the first .c files built. Error out early if we have compiler
-  * trouble.
-  */
- #if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0
- #warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
- #endif
  static int kernel_init(void *);
  
  extern void init_IRQ(void);
@@@ -381,12 -371,7 +372,7 @@@ EXPORT_SYMBOL(nr_cpu_ids)
  /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
  static void __init setup_nr_cpu_ids(void)
  {
-       int cpu, highest_cpu = 0;
-       for_each_possible_cpu(cpu)
-               highest_cpu = cpu;
-       nr_cpu_ids = highest_cpu + 1;
+       nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
  }
  
  #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
@@@ -528,9 -513,9 +514,9 @@@ static void __init boot_cpu_init(void
  {
        int cpu = smp_processor_id();
        /* Mark the boot cpu "present", "online" etc for SMP and UP case */
-       cpu_set(cpu, cpu_online_map);
-       cpu_set(cpu, cpu_present_map);
-       cpu_set(cpu, cpu_possible_map);
+       set_cpu_online(cpu, true);
+       set_cpu_present(cpu, true);
+       set_cpu_possible(cpu, true);
  }
  
  void __init __weak smp_setup_processor_id(void)
@@@ -541,15 -526,6 +527,6 @@@ void __init __weak thread_info_cache_in
  {
  }
  
- void __init __weak arch_early_irq_init(void)
- {
- }
- void __init __weak early_irq_init(void)
- {
-       arch_early_irq_init();
- }
  asmlinkage void __init start_kernel(void)
  {
        char * command_line;
        enable_debug_pagealloc();
        cpu_hotplug_init();
        kmem_cache_init();
 +      kmemtrace_init();
        debug_objects_mem_init();
        idr_init_cache();
        setup_per_cpu_pageset();
diff --combined kernel/trace/trace.h
index 534505bb39b0b3d21bf65d3fbd49863e96844c82,4d3d381bfd9537e3a43df767e30fb0d2991c66d0..742fe134927692649b81eaa8c087e8f14a2dd575
@@@ -9,7 -9,6 +9,7 @@@
  #include <linux/mmiotrace.h>
  #include <linux/ftrace.h>
  #include <trace/boot.h>
 +#include <trace/kmemtrace.h>
  
  enum trace_type {
        __TRACE_FIRST_TYPE = 0,
@@@ -30,8 -29,6 +30,8 @@@
        TRACE_GRAPH_ENT,
        TRACE_USER_STACK,
        TRACE_HW_BRANCHES,
 +      TRACE_KMEM_ALLOC,
 +      TRACE_KMEM_FREE,
        TRACE_POWER,
  
        __TRACE_LAST_TYPE
@@@ -173,24 -170,6 +173,24 @@@ struct trace_power 
        struct power_trace      state_data;
  };
  
 +struct kmemtrace_alloc_entry {
 +      struct trace_entry      ent;
 +      enum kmemtrace_type_id type_id;
 +      unsigned long call_site;
 +      const void *ptr;
 +      size_t bytes_req;
 +      size_t bytes_alloc;
 +      gfp_t gfp_flags;
 +      int node;
 +};
 +
 +struct kmemtrace_free_entry {
 +      struct trace_entry      ent;
 +      enum kmemtrace_type_id type_id;
 +      unsigned long call_site;
 +      const void *ptr;
 +};
 +
  /*
   * trace_flag_type is an enumeration that holds different
   * states when a trace occurs. These are:
@@@ -301,10 -280,6 +301,10 @@@ extern void __ftrace_bad_type(void)
                          TRACE_GRAPH_RET);             \
                IF_ASSIGN(var, ent, struct hw_branch_entry, TRACE_HW_BRANCHES);\
                IF_ASSIGN(var, ent, struct trace_power, TRACE_POWER); \
 +              IF_ASSIGN(var, ent, struct kmemtrace_alloc_entry,       \
 +                        TRACE_KMEM_ALLOC);    \
 +              IF_ASSIGN(var, ent, struct kmemtrace_free_entry,        \
 +                        TRACE_KMEM_FREE);     \
                __ftrace_bad_type();                                    \
        } while (0)
  
@@@ -393,7 -368,7 +393,7 @@@ struct trace_iterator 
        loff_t                  pos;
        long                    idx;
  
-       cpumask_t               started;
+       cpumask_var_t           started;
  };
  
  int tracing_is_enabled(void);
index bc7d90850be5c2977bfe4f81803d5d3f7c7bedec,930c08e5b38e0d35ab93b79896b0150907d31e50..8516e4f09e1b4559c8b450183f70c0cb39614950
@@@ -79,7 -79,7 +79,7 @@@ print_graph_cpu(struct trace_seq *s, in
        int i;
        int ret;
        int log10_this = log10_cpu(cpu);
-       int log10_all = log10_cpu(cpus_weight_nr(cpu_online_map));
+       int log10_all = log10_cpu(cpumask_weight(cpu_online_mask));
  
  
        /*
@@@ -592,12 -592,6 +592,12 @@@ print_graph_comment(struct print_entry 
        if (ent->flags & TRACE_FLAG_CONT)
                trace_seq_print_cont(s, iter);
  
 +      /* Strip ending newline */
 +      if (s->buffer[s->len - 1] == '\n') {
 +              s->buffer[s->len - 1] = '\0';
 +              s->len--;
 +      }
 +
        ret = trace_seq_printf(s, " */\n");
        if (!ret)
                return TRACE_TYPE_PARTIAL_LINE;
diff --combined mm/slab.c
index c65c52dc78d4f5ff11b5a19690d91aef6446d5b2,ddc41f337d587750122f54a44806a8a29a0a67c2..dae716b32915e12548cbd6c90ee70c592d5f37fe
+++ b/mm/slab.c
  #include      <linux/cpu.h>
  #include      <linux/sysctl.h>
  #include      <linux/module.h>
 +#include      <trace/kmemtrace.h>
  #include      <linux/rcupdate.h>
  #include      <linux/string.h>
  #include      <linux/uaccess.h>
@@@ -569,14 -568,6 +569,14 @@@ static void **dbg_userword(struct kmem_
  
  #endif
  
 +#ifdef CONFIG_KMEMTRACE
 +size_t slab_buffer_size(struct kmem_cache *cachep)
 +{
 +      return cachep->buffer_size;
 +}
 +EXPORT_SYMBOL(slab_buffer_size);
 +#endif
 +
  /*
   * Do not go above this order unless 0 objects fit into the slab.
   */
@@@ -2166,7 -2157,7 +2166,7 @@@ kmem_cache_create (const char *name, si
  
        /*
         * We use cache_chain_mutex to ensure a consistent view of
-        * cpu_online_map as well.  Please see cpuup_callback
+        * cpu_online_mask as well.  Please see cpuup_callback
         */
        get_online_cpus();
        mutex_lock(&cache_chain_mutex);
@@@ -3559,23 -3550,10 +3559,23 @@@ static inline void __cache_free(struct 
   */
  void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
  {
 -      return __cache_alloc(cachep, flags, __builtin_return_address(0));
 +      void *ret = __cache_alloc(cachep, flags, __builtin_return_address(0));
 +
 +      kmemtrace_mark_alloc(KMEMTRACE_TYPE_CACHE, _RET_IP_, ret,
 +                           obj_size(cachep), cachep->buffer_size, flags);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(kmem_cache_alloc);
  
 +#ifdef CONFIG_KMEMTRACE
 +void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags)
 +{
 +      return __cache_alloc(cachep, flags, __builtin_return_address(0));
 +}
 +EXPORT_SYMBOL(kmem_cache_alloc_notrace);
 +#endif
 +
  /**
   * kmem_ptr_validate - check if an untrusted pointer might be a slab entry.
   * @cachep: the cache we're checking against
  #ifdef CONFIG_NUMA
  void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
  {
 -      return __cache_alloc_node(cachep, flags, nodeid,
 -                      __builtin_return_address(0));
 +      void *ret = __cache_alloc_node(cachep, flags, nodeid,
 +                                     __builtin_return_address(0));
 +
 +      kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE, _RET_IP_, ret,
 +                                obj_size(cachep), cachep->buffer_size,
 +                                flags, nodeid);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(kmem_cache_alloc_node);
  
 +#ifdef CONFIG_KMEMTRACE
 +void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep,
 +                                  gfp_t flags,
 +                                  int nodeid)
 +{
 +      return __cache_alloc_node(cachep, flags, nodeid,
 +                                __builtin_return_address(0));
 +}
 +EXPORT_SYMBOL(kmem_cache_alloc_node_notrace);
 +#endif
 +
  static __always_inline void *
  __do_kmalloc_node(size_t size, gfp_t flags, int node, void *caller)
  {
        struct kmem_cache *cachep;
 +      void *ret;
  
        cachep = kmem_find_general_cachep(size, flags);
        if (unlikely(ZERO_OR_NULL_PTR(cachep)))
                return cachep;
 -      return kmem_cache_alloc_node(cachep, flags, node);
 +      ret = kmem_cache_alloc_node_notrace(cachep, flags, node);
 +
 +      kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC,
 +                                (unsigned long) caller, ret,
 +                                size, cachep->buffer_size, flags, node);
 +
 +      return ret;
  }
  
 -#ifdef CONFIG_DEBUG_SLAB
 +#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_KMEMTRACE)
  void *__kmalloc_node(size_t size, gfp_t flags, int node)
  {
        return __do_kmalloc_node(size, flags, node,
@@@ -3693,7 -3647,6 +3693,7 @@@ static __always_inline void *__do_kmall
                                          void *caller)
  {
        struct kmem_cache *cachep;
 +      void *ret;
  
        /* If you want to save a few bytes .text space: replace
         * __ with kmem_.
        cachep = __find_general_cachep(size, flags);
        if (unlikely(ZERO_OR_NULL_PTR(cachep)))
                return cachep;
 -      return __cache_alloc(cachep, flags, caller);
 +      ret = __cache_alloc(cachep, flags, caller);
 +
 +      kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC,
 +                           (unsigned long) caller, ret,
 +                           size, cachep->buffer_size, flags);
 +
 +      return ret;
  }
  
  
 -#ifdef CONFIG_DEBUG_SLAB
 +#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_KMEMTRACE)
  void *__kmalloc(size_t size, gfp_t flags)
  {
        return __do_kmalloc(size, flags, __builtin_return_address(0));
@@@ -3752,8 -3699,6 +3752,8 @@@ void kmem_cache_free(struct kmem_cache 
                debug_check_no_obj_freed(objp, obj_size(cachep));
        __cache_free(cachep, objp);
        local_irq_restore(flags);
 +
 +      kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, objp);
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
@@@ -3780,8 -3725,6 +3780,8 @@@ void kfree(const void *objp
        debug_check_no_obj_freed(objp, obj_size(c));
        __cache_free(c, (void *)objp);
        local_irq_restore(flags);
 +
 +      kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, objp);
  }
  EXPORT_SYMBOL(kfree);
  
diff --combined mm/slub.c
index 4fac7bbb029a735dae2f5cbae8a72b010b2735d8,f0e2892fe403e57c8b29dfde41d7abf6f3a6b1f6..509e96f411fcc592853d564b3a04c0d5d6951ef6
+++ b/mm/slub.c
@@@ -16,7 -16,6 +16,7 @@@
  #include <linux/slab.h>
  #include <linux/proc_fs.h>
  #include <linux/seq_file.h>
 +#include <trace/kmemtrace.h>
  #include <linux/cpu.h>
  #include <linux/cpuset.h>
  #include <linux/mempolicy.h>
@@@ -1624,46 -1623,18 +1624,46 @@@ static __always_inline void *slab_alloc
  
  void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
  {
 -      return slab_alloc(s, gfpflags, -1, _RET_IP_);
 +      void *ret = slab_alloc(s, gfpflags, -1, _RET_IP_);
 +
 +      kmemtrace_mark_alloc(KMEMTRACE_TYPE_CACHE, _RET_IP_, ret,
 +                           s->objsize, s->size, gfpflags);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(kmem_cache_alloc);
  
 +#ifdef CONFIG_KMEMTRACE
 +void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags)
 +{
 +      return slab_alloc(s, gfpflags, -1, _RET_IP_);
 +}
 +EXPORT_SYMBOL(kmem_cache_alloc_notrace);
 +#endif
 +
  #ifdef CONFIG_NUMA
  void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node)
  {
 -      return slab_alloc(s, gfpflags, node, _RET_IP_);
 +      void *ret = slab_alloc(s, gfpflags, node, _RET_IP_);
 +
 +      kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE, _RET_IP_, ret,
 +                                s->objsize, s->size, gfpflags, node);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(kmem_cache_alloc_node);
  #endif
  
 +#ifdef CONFIG_KMEMTRACE
 +void *kmem_cache_alloc_node_notrace(struct kmem_cache *s,
 +                                  gfp_t gfpflags,
 +                                  int node)
 +{
 +      return slab_alloc(s, gfpflags, node, _RET_IP_);
 +}
 +EXPORT_SYMBOL(kmem_cache_alloc_node_notrace);
 +#endif
 +
  /*
   * Slow patch handling. This may still be called frequently since objects
   * have a longer lifetime than the cpu slabs in most processing loads.
@@@ -1771,8 -1742,6 +1771,8 @@@ void kmem_cache_free(struct kmem_cache 
        page = virt_to_head_page(x);
  
        slab_free(s, page, x, _RET_IP_);
 +
 +      kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, x);
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
@@@ -2001,7 -1970,7 +2001,7 @@@ static DEFINE_PER_CPU(struct kmem_cache
                                kmem_cache_cpu)[NR_KMEM_CACHE_CPU];
  
  static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free);
- static cpumask_t kmem_cach_cpu_free_init_once = CPU_MASK_NONE;
+ static DECLARE_BITMAP(kmem_cach_cpu_free_init_once, CONFIG_NR_CPUS);
  
  static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s,
                                                        int cpu, gfp_t flags)
@@@ -2076,13 -2045,13 +2076,13 @@@ static void init_alloc_cpu_cpu(int cpu
  {
        int i;
  
-       if (cpu_isset(cpu, kmem_cach_cpu_free_init_once))
+       if (cpumask_test_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once)))
                return;
  
        for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--)
                free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu);
  
-       cpu_set(cpu, kmem_cach_cpu_free_init_once);
+       cpumask_set_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once));
  }
  
  static void __init init_alloc_cpu(void)
@@@ -2688,7 -2657,6 +2688,7 @@@ static struct kmem_cache *get_slab(size
  void *__kmalloc(size_t size, gfp_t flags)
  {
        struct kmem_cache *s;
 +      void *ret;
  
        if (unlikely(size > PAGE_SIZE))
                return kmalloc_large(size, flags);
        if (unlikely(ZERO_OR_NULL_PTR(s)))
                return s;
  
 -      return slab_alloc(s, flags, -1, _RET_IP_);
 +      ret = slab_alloc(s, flags, -1, _RET_IP_);
 +
 +      kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, ret,
 +                           size, s->size, flags);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(__kmalloc);
  
@@@ -2722,30 -2685,16 +2722,30 @@@ static void *kmalloc_large_node(size_t 
  void *__kmalloc_node(size_t size, gfp_t flags, int node)
  {
        struct kmem_cache *s;
 +      void *ret;
  
 -      if (unlikely(size > PAGE_SIZE))
 -              return kmalloc_large_node(size, flags, node);
 +      if (unlikely(size > PAGE_SIZE)) {
 +              ret = kmalloc_large_node(size, flags, node);
 +
 +              kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC,
 +                                        _RET_IP_, ret,
 +                                        size, PAGE_SIZE << get_order(size),
 +                                        flags, node);
 +
 +              return ret;
 +      }
  
        s = get_slab(size, flags);
  
        if (unlikely(ZERO_OR_NULL_PTR(s)))
                return s;
  
 -      return slab_alloc(s, flags, node, _RET_IP_);
 +      ret = slab_alloc(s, flags, node, _RET_IP_);
 +
 +      kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, ret,
 +                                size, s->size, flags, node);
 +
 +      return ret;
  }
  EXPORT_SYMBOL(__kmalloc_node);
  #endif
@@@ -2803,8 -2752,6 +2803,8 @@@ void kfree(const void *x
                return;
        }
        slab_free(page->slab, page, object, _RET_IP_);
 +
 +      kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, x);
  }
  EXPORT_SYMBOL(kfree);
  
@@@ -3274,7 -3221,6 +3274,7 @@@ static struct notifier_block __cpuinitd
  void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller)
  {
        struct kmem_cache *s;
 +      void *ret;
  
        if (unlikely(size > PAGE_SIZE))
                return kmalloc_large(size, gfpflags);
        if (unlikely(ZERO_OR_NULL_PTR(s)))
                return s;
  
 -      return slab_alloc(s, gfpflags, -1, caller);
 +      ret = slab_alloc(s, gfpflags, -1, caller);
 +
 +      /* Honor the call site pointer we recieved. */
 +      kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, caller, ret, size,
 +                           s->size, gfpflags);
 +
 +      return ret;
  }
  
  void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
                                        int node, unsigned long caller)
  {
        struct kmem_cache *s;
 +      void *ret;
  
        if (unlikely(size > PAGE_SIZE))
                return kmalloc_large_node(size, gfpflags, node);
        if (unlikely(ZERO_OR_NULL_PTR(s)))
                return s;
  
 -      return slab_alloc(s, gfpflags, node, caller);
 +      ret = slab_alloc(s, gfpflags, node, caller);
 +
 +      /* Honor the call site pointer we recieved. */
 +      kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, caller, ret,
 +                                size, s->size, gfpflags, node);
 +
 +      return ret;
  }
  
  #ifdef CONFIG_SLUB_DEBUG
@@@ -3518,7 -3451,7 +3518,7 @@@ struct location 
        long max_time;
        long min_pid;
        long max_pid;
-       cpumask_t cpus;
+       DECLARE_BITMAP(cpus, NR_CPUS);
        nodemask_t nodes;
  };
  
@@@ -3593,7 -3526,8 +3593,8 @@@ static int add_location(struct loc_trac
                                if (track->pid > l->max_pid)
                                        l->max_pid = track->pid;
  
-                               cpu_set(track->cpu, l->cpus);
+                               cpumask_set_cpu(track->cpu,
+                                               to_cpumask(l->cpus));
                        }
                        node_set(page_to_nid(virt_to_page(track)), l->nodes);
                        return 1;
        l->max_time = age;
        l->min_pid = track->pid;
        l->max_pid = track->pid;
-       cpus_clear(l->cpus);
-       cpu_set(track->cpu, l->cpus);
+       cpumask_clear(to_cpumask(l->cpus));
+       cpumask_set_cpu(track->cpu, to_cpumask(l->cpus));
        nodes_clear(l->nodes);
        node_set(page_to_nid(virt_to_page(track)), l->nodes);
        return 1;
@@@ -3705,11 -3639,12 +3706,12 @@@ static int list_locations(struct kmem_c
                        len += sprintf(buf + len, " pid=%ld",
                                l->min_pid);
  
-               if (num_online_cpus() > 1 && !cpus_empty(l->cpus) &&
+               if (num_online_cpus() > 1 &&
+                               !cpumask_empty(to_cpumask(l->cpus)) &&
                                len < PAGE_SIZE - 60) {
                        len += sprintf(buf + len, " cpus=");
                        len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50,
-                                       l->cpus);
+                                                to_cpumask(l->cpus));
                }
  
                if (num_online_nodes() > 1 && !nodes_empty(l->nodes) &&