]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'topic/kmemtrace' of git://git.kernel.org/pub/scm/linux/kernel/git/penbe...
authorIngo Molnar <mingo@elte.hu>
Mon, 29 Dec 2008 14:16:24 +0000 (15:16 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 29 Dec 2008 14:16:24 +0000 (15:16 +0100)
1  2 
Documentation/kernel-parameters.txt
MAINTAINERS
init/main.c
mm/slob.c
mm/slub.c

index a2d8805c03d5588f317a9677add758c94051e6a6,542c2d8843db793cc7f6b999e91e387091925dab..af600c0fe0eccbc6e571535fcca99a64a24a23e9
@@@ -49,6 -49,7 +49,7 @@@ parameter is applicable
        ISAPNP  ISA PnP code is enabled.
        ISDN    Appropriate ISDN support is enabled.
        JOY     Appropriate joystick support is enabled.
+       KMEMTRACE kmemtrace is enabled.
        LIBATA  Libata driver is enabled
        LP      Printer support is enabled.
        LOOP    Loopback device support is enabled.
@@@ -89,7 -90,6 +90,7 @@@
        SPARC   Sparc architecture is enabled.
        SWSUSP  Software suspend (hibernation) is enabled.
        SUSPEND System suspend states are enabled.
 +      FTRACE  Function tracing enabled.
        TS      Appropriate touchscreen support is enabled.
        USB     USB support is enabled.
        USBHID  USB Human Interface Device support is enabled.
@@@ -221,17 -221,14 +222,17 @@@ and is between 256 and 4096 characters
                        Bits in debug_level correspond to a level in
                        ACPI_DEBUG_PRINT statements, e.g.,
                            ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
 -                      See Documentation/acpi/debug.txt for more information
 -                      about debug layers and levels.
 +                      The debug_level mask defaults to "info".  See
 +                      Documentation/acpi/debug.txt for more information about
 +                      debug layers and levels.
  
 +                      Enable processor driver info messages:
 +                          acpi.debug_layer=0x20000000
 +                      Enable PCI/PCI interrupt routing info messages:
 +                          acpi.debug_layer=0x400000
                        Enable AML "Debug" output, i.e., stores to the Debug
                        object while interpreting AML:
                            acpi.debug_layer=0xffffffff acpi.debug_level=0x2
 -                      Enable PCI/PCI interrupt routing info messages:
 -                          acpi.debug_layer=0x400000 acpi.debug_level=0x4
                        Enable all messages related to ACPI hardware:
                            acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
  
                        parameter will force ia64_sal_cache_flush to call
                        ia64_pal_cache_flush instead of SAL_CACHE_FLUSH.
  
 +      ftrace=[tracer]
 +                      [ftrace] will set and start the specified tracer
 +                      as early as possible in order to facilitate early
 +                      boot debugging.
 +
 +      ftrace_dump_on_oops
 +                      [ftrace] will dump the trace buffers on oops.
 +
        gamecon.map[2|3]=
                        [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
                        support via parallel port (up to 5 devices per port)
  
        hlt             [BUGS=ARM,SH]
  
 +      hvc_iucv=       [S390] Number of z/VM IUCV Hypervisor console (HVC)
 +                             back-ends. Valid parameters: 0..8
 +
        i8042.debug     [HW] Toggle i8042 debug mode
        i8042.direct    [HW] Put keyboard port into non-translated mode
        i8042.dumbkbd   [HW] Pretend that controller can only read data from
                        use the HighMem zone if it exists, and the Normal
                        zone if it does not.
  
+       kmemtrace.enable=       [KNL,KMEMTRACE] Format: { yes | no }
+                               Controls whether kmemtrace is enabled
+                               at boot-time.
+       kmemtrace.subbufs=n     [KNL,KMEMTRACE] Overrides the number of
+                       subbufs kmemtrace's relay channel has. Set this
+                       higher than default (KMEMTRACE_N_SUBBUFS in code) if
+                       you experience buffer overruns.
        movablecore=nn[KMG]     [KNL,X86-32,IA-64,PPC,X86-64] This parameter
                        is similar to kernelcore except it specifies the
                        amount of memory used for migratable allocations.
                        when a NMI is triggered.
                        Format: [state][,regs][,debounce][,die]
  
 -      nmi_watchdog=   [KNL,BUGS=X86-32] Debugging features for SMP kernels
 +      nmi_watchdog=   [KNL,BUGS=X86-32,X86-64] Debugging features for SMP kernels
 +                      Format: [panic,][num]
 +                      Valid num: 0,1,2
 +                      0 - turn nmi_watchdog off
 +                      1 - use the IO-APIC timer for the NMI watchdog
 +                      2 - use the local APIC for the NMI watchdog using
 +                      a performance counter. Note: This will use one performance
 +                      counter and the local APIC's performance vector.
 +                      When panic is specified panic when an NMI watchdog timeout occurs.
 +                      This is useful when you use a panic=... timeout and need the box
 +                      quickly up again.
 +                      Instead of 1 and 2 it is possible to use the following
 +                      symbolic names: lapic and ioapic
 +                      Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic
  
        no387           [BUGS=X86-32] Tells the kernel to use the 387 maths
                        emulation library even if a 387 maths coprocessor
                        instruction doesn't work correctly and not to
                        use it.
  
 +      no_file_caps    Tells the kernel not to honor file capabilities.  The
 +                      only way then for a file to be executed with privilege
 +                      is to be setuid root or executed by root.
 +
        nohalt          [IA-64] Tells the kernel not to use the power saving
                        function PAL_HALT_LIGHT when idle. This increases
                        power-consumption. On the positive side, it reduces
                nomsi           [MSI] If the PCI_MSI kernel config parameter is
                                enabled, this kernel boot option can be used to
                                disable the use of MSI interrupts system-wide.
 +              noioapicquirk   [APIC] Disable all boot interrupt quirks.
 +                              Safety option to keep boot IRQs enabled. This
 +                              should never be necessary.
 +              ioapicreroute   [APIC] Enable rerouting of boot IRQs to the
 +                              primary IO-APIC for bridges that cannot disable
 +                              boot IRQs. This fixes a source of spurious IRQs
 +                              when the system masks IRQs.
 +              noioapicreroute [APIC] Disable workaround that uses the
 +                              boot IRQ equivalent of an IRQ that connects to
 +                              a chipset where boot IRQs cannot be disabled.
 +                              The opposite of ioapicreroute.
                biosirq         [X86-32] Use PCI BIOS calls to get the interrupt
                                routing table. These calls are known to be buggy
                                on several machines and they hang the machine
        st=             [HW,SCSI] SCSI tape parameters (buffers, etc.)
                        See Documentation/scsi/st.txt.
  
 +      stacktrace      [FTRACE]
 +                      Enabled the stack tracer on boot up.
 +
        sti=            [PARISC,HW]
                        Format: <num>
                        Set the STI (builtin display/keyboard on the HP-PARISC
                        See comment before function dc390_setup() in
                        drivers/scsi/tmscsim.c.
  
 +      topology=       [S390]
 +                      Format: {off | on}
 +                      Specify if the kernel should make use of the cpu
 +                      topology informations if the hardware supports these.
 +                      The scheduler will make use of these informations and
 +                      e.g. base its process migration decisions on it.
 +                      Default is off.
 +
        tp720=          [HW,PS2]
  
        trix=           [HW,OSS] MediaTrix AudioTrix Pro
                        Format:
                        <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq>
  
 +      tsc=            Disable clocksource-must-verify flag for TSC.
 +                      Format: <string>
 +                      [x86] reliable: mark tsc clocksource as reliable, this
 +                      disables clocksource verification at runtime.
 +                      Used to enable high-resolution timer mode on older
 +                      hardware, and in virtualized environment.
 +
        turbografx.map[2|3]=    [HW,JOY]
                        TurboGraFX parallel port interface
                        Format:
diff --combined MAINTAINERS
index 08d0ab7fa1615b093864bf30444a4427109b6d00,e2b3c85550510906a9900c5ad682317df8a85f8d..857c877eee20647c662e38b42540b7a823cf08cc
@@@ -742,7 -742,7 +742,7 @@@ M: jirislaby@gmail.co
  P:    Nick Kossifidis
  M:    mickflemm@gmail.com
  P:    Luis R. Rodriguez
 -M:    mcgrof@gmail.com
 +M:    lrodriguez@atheros.com
  P:    Bob Copeland
  M:    me@bobcopeland.com
  L:    linux-wireless@vger.kernel.org
@@@ -779,7 -779,6 +779,7 @@@ AT
  P:    Chas Williams
  M:    chas@cmf.nrl.navy.mil
  L:    linux-atm-general@lists.sourceforge.net (subscribers-only)
 +L:    netdev@vger.kernel.org
  W:    http://linux-atm.sourceforge.net
  S:    Maintained
  
@@@ -1527,10 -1526,10 +1527,10 @@@ W:   http://ebtables.sourceforge.net
  S:    Maintained
  
  ECRYPT FILE SYSTEM
 -P:    Mike Halcrow, Phillip Hellewell
 -M:    mhalcrow@us.ibm.com, phillip@hellewell.homeip.net
 -L:    ecryptfs-devel@lists.sourceforge.net
 -W:    http://ecryptfs.sourceforge.net/
 +P:    Tyler Hicks, Dustin Kirkland
 +M:    tyhicks@linux.vnet.ibm.com, kirkland@canonical.com
 +L:    ecryptfs-devel@lists.launchpad.net
 +W:    https://launchpad.net/ecryptfs
  S:    Supported
  
  EDAC-CORE
@@@ -1607,6 -1606,11 +1607,6 @@@ L:     acpi4asus-user@lists.sourceforge.ne
  W:    http://sourceforge.net/projects/acpi4asus
  S:    Maintained
  
 -EEPRO100 NETWORK DRIVER
 -P:    Andrey V. Savochkin
 -M:    saw@saw.sw.com.sg
 -S:    Maintained
 -
  EFS FILESYSTEM
  W:    http://aeschi.ch.eu.org/efs/
  S:    Orphan
@@@ -1844,7 -1848,7 +1844,7 @@@ P:      Haavard Skinnemoe
  M:    hskinnemoen@atmel.com
  S:    Supported
  
 -GENERIC HDLC DRIVER, N2, C101, PCI200SYN and WANXL DRIVERS
 +GENERIC HDLC (WAN) DRIVERS
  P:    Krzysztof Halasa
  M:    khc@pm.waw.pl
  W:    http://www.kernel.org/pub/linux/utils/net/hdlc/
@@@ -2186,9 -2190,9 +2186,9 @@@ S:      Supporte
  
  INOTIFY
  P:    John McCutchan
 -M:    ttb@tentacle.dhs.org
 +M:    john@johnmccutchan.com
  P:    Robert Love
 -M:    rml@novell.com
 +M:    rlove@rlove.org
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  
@@@ -2243,11 -2247,6 +2243,11 @@@ M:    dan.j.williams@intel.co
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  
 +INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
 +P:    Krzysztof Halasa
 +M:    khc@pm.waw.pl
 +S:    Maintained
 +
  INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
  P:    Deepak Saxena
  M:    dsaxena@plexity.net
@@@ -2566,6 -2565,12 +2566,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
@@@ -3614,26 -3619,16 +3620,26 @@@ L:   linux-hams@vger.kernel.or
  W:    http://www.linux-ax25.org/
  S:    Maintained
  
 -RTL818X WIRELESS DRIVER
 -P:    Michael Wu
 -M:    flamingice@sourmilk.net
 -P:    Andrea Merello
 -M:    andreamrl@tiscali.it
 +RTL8180 WIRELESS DRIVER
 +P:    John W. Linville
 +M:    linville@tuxdriver.com
  L:    linux-wireless@vger.kernel.org
  W:    http://linuxwireless.org/
 -T:    git kernel.org:/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
 +T:    git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
  
 +RTL8187 WIRELESS DRIVER
 +P:     Herton Ronaldo Krzesinski
 +M:      herton@mandriva.com.br
 +P:      Hin-Tak Leung
 +M       htl10@users.sourceforge.net
 +P:      Larry Finger
 +M:      Larry.Finger@lwfinger.net
 +L:      linux-wireless@vger.kernel.org
 +W:      http://linuxwireless.org/
 +T:      git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git
 +S:      Maintained
 +
  S3 SAVAGE FRAMEBUFFER DRIVER
  P:    Antonino Daplas
  M:    adaplas@gmail.com
@@@ -3769,15 -3764,6 +3775,15 @@@ M:    drzeus-sdhci@drzeus.c
  L:    sdhci-devel@list.drzeus.cx
  S:    Maintained
  
 +SECURITY SUBSYSTEM
 +F:    security/
 +P:    James Morris
 +M:    jmorris@namei.org
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-security-module@vger.kernel.org (suggested Cc:)
 +T:    git kernel.org:pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
 +S:    Supported
 +
  SECURITY CONTACT
  P:    Security Officers
  M:    security@kernel.org
@@@ -3923,18 -3909,6 +3929,18 @@@ M:    mhoffman@lightlink.co
  L:    lm-sensors@lm-sensors.org
  S:    Maintained
  
 +SMSC911x ETHERNET DRIVER
 +P:    Steve Glendinning
 +M:    steve.glendinning@smsc.com
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +
 +SMSC9420 PCI ETHERNET DRIVER
 +P:    Steve Glendinning
 +M:    steve.glendinning@smsc.com
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +
  SMX UIO Interface
  P:    Ben Nizette
  M:    bn@niasdigital.com
@@@ -3999,7 -3973,7 +4005,7 @@@ M:      tiwai@suse.d
  L:    alsa-devel@alsa-project.org (subscribers-only)
  S:    Maintained
  
 -SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT
 +SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
  P:    Liam Girdwood
  M:    lrg@slimlogic.co.uk
  P:    Mark Brown
@@@ -4267,7 -4241,7 +4273,7 @@@ M:      dedekind@infradead.or
  P:    Adrian Hunter
  M:    ext-adrian.hunter@nokia.com
  L:    linux-mtd@lists.infradead.org
 -T:    git git://git.infradead.org/~dedekind/ubifs-2.6.git
 +T:    git git://git.infradead.org/ubifs-2.6.git
  W:    http://www.linux-mtd.infradead.org/doc/ubifs.html
  S:    Maintained
  
@@@ -4321,7 -4295,7 +4327,7 @@@ P:      Artem Bityutski
  M:    dedekind@infradead.org
  W:    http://www.linux-mtd.infradead.org/
  L:    linux-mtd@lists.infradead.org
 -T:    git git://git.infradead.org/~dedekind/ubi-2.6.git
 +T:    git git://git.infradead.org/ubi-2.6.git
  S:    Maintained
  
  USB ACM DRIVER
@@@ -4551,7 -4525,7 +4557,7 @@@ S:      Maintaine
  USB VIDEO CLASS
  P:    Laurent Pinchart
  M:    laurent.pinchart@skynet.be
 -L:    linux-uvc-devel@lists.berlios.de
 +L:    linux-uvc-devel@lists.berlios.de (subscribers-only)
  L:    video4linux-list@redhat.com
  W:    http://linux-uvc.berlios.de
  S:    Maintained
diff --combined init/main.c
index 17e9757bfde2310c6bc7a8407fee6eba7cd4b0ad,be1fe2242a55e9a8703e3d252e9212aa9b6b9b8b..9711586aa7c9d7dc416f8f57ebc75f525c899d1b
  #include <linux/signal.h>
  #include <linux/idr.h>
  #include <linux/ftrace.h>
 +#include <trace/boot.h>
  
  #include <asm/io.h>
  #include <asm/bugs.h>
  #include <asm/setup.h>
  #include <asm/sections.h>
  #include <asm/cacheflush.h>
+ #include <linux/kmemtrace.h>
  
  #ifdef CONFIG_X86_LOCAL_APIC
  #include <asm/smp.h>
@@@ -654,6 -654,7 +655,7 @@@ asmlinkage void __init start_kernel(voi
        enable_debug_pagealloc();
        cpu_hotplug_init();
        kmem_cache_init();
+       kmemtrace_init();
        debug_objects_mem_init();
        idr_init_cache();
        setup_per_cpu_pageset();
                efi_enter_virtual_mode();
  #endif
        thread_info_cache_init();
 +      cred_init();
        fork_init(num_physpages);
        proc_caches_init();
        buffer_init();
@@@ -705,35 -705,31 +707,35 @@@ core_param(initcall_debug, initcall_deb
  int do_one_initcall(initcall_t fn)
  {
        int count = preempt_count();
 -      ktime_t delta;
 +      ktime_t calltime, delta, rettime;
        char msgbuf[64];
 -      struct boot_trace it;
 +      struct boot_trace_call call;
 +      struct boot_trace_ret ret;
  
        if (initcall_debug) {
 -              it.caller = task_pid_nr(current);
 -              printk("calling  %pF @ %i\n", fn, it.caller);
 -              it.calltime = ktime_get();
 +              call.caller = task_pid_nr(current);
 +              printk("calling  %pF @ %i\n", fn, call.caller);
 +              calltime = ktime_get();
 +              trace_boot_call(&call, fn);
 +              enable_boot_trace();
        }
  
 -      it.result = fn();
 +      ret.result = fn();
  
        if (initcall_debug) {
 -              it.rettime = ktime_get();
 -              delta = ktime_sub(it.rettime, it.calltime);
 -              it.duration = (unsigned long long) delta.tv64 >> 10;
 +              disable_boot_trace();
 +              rettime = ktime_get();
 +              delta = ktime_sub(rettime, calltime);
 +              ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
 +              trace_boot_ret(&ret, fn);
                printk("initcall %pF returned %d after %Ld usecs\n", fn,
 -                      it.result, it.duration);
 -              trace_boot(&it, fn);
 +                      ret.result, ret.duration);
        }
  
        msgbuf[0] = 0;
  
 -      if (it.result && it.result != -ENODEV && initcall_debug)
 -              sprintf(msgbuf, "error code %d ", it.result);
 +      if (ret.result && ret.result != -ENODEV && initcall_debug)
 +              sprintf(msgbuf, "error code %d ", ret.result);
  
        if (preempt_count() != count) {
                strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
                printk("initcall %pF returned with %s\n", fn, msgbuf);
        }
  
 -      return it.result;
 +      return ret.result;
  }
  
  
@@@ -888,7 -884,7 +890,7 @@@ static int __init kernel_init(void * un
         * we're essentially up and running. Get rid of the
         * initmem segments and start the user-mode stuff..
         */
 -      stop_boot_trace();
 +
        init_post();
        return 0;
  }
diff --combined mm/slob.c
index bf7e8fc3aed806542e44cc7b1d222d9e2b56dc3a,55de44ae5d30b4292e698b994ff7ff0d349cfb65..0f1a49f40690e583d98a23bcabdfbb794e4aa3a3
+++ b/mm/slob.c
@@@ -65,6 -65,7 +65,7 @@@
  #include <linux/module.h>
  #include <linux/rcupdate.h>
  #include <linux/list.h>
+ #include <linux/kmemtrace.h>
  #include <asm/atomic.h>
  
  /*
@@@ -463,27 -464,38 +464,38 @@@ void *__kmalloc_node(size_t size, gfp_
  {
        unsigned int *m;
        int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
+       void *ret;
  
        if (size < PAGE_SIZE - align) {
                if (!size)
                        return ZERO_SIZE_PTR;
  
                m = slob_alloc(size + align, gfp, align, node);
                if (!m)
                        return NULL;
                *m = size;
-               return (void *)m + align;
+               ret = (void *)m + align;
+               kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC,
+                                         _RET_IP_, ret,
+                                         size, size + align, gfp, node);
        } else {
-               void *ret;
+               unsigned int order = get_order(size);
  
-               ret = slob_new_page(gfp | __GFP_COMP, get_order(size), node);
+               ret = slob_new_page(gfp | __GFP_COMP, order, node);
                if (ret) {
                        struct page *page;
                        page = virt_to_page(ret);
                        page->private = size;
                }
-               return ret;
+               kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC,
+                                         _RET_IP_, ret,
+                                         size, PAGE_SIZE << order, gfp, node);
        }
+       return ret;
  }
  EXPORT_SYMBOL(__kmalloc_node);
  
@@@ -501,6 -513,8 +513,8 @@@ void kfree(const void *block
                slob_free(m, *m + align);
        } else
                put_page(&sp->page);
+       kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, block);
  }
  EXPORT_SYMBOL(kfree);
  
@@@ -535,7 -549,7 +549,7 @@@ struct kmem_cache *kmem_cache_create(co
        struct kmem_cache *c;
  
        c = slob_alloc(sizeof(struct kmem_cache),
 -              flags, ARCH_KMALLOC_MINALIGN, -1);
 +              GFP_KERNEL, ARCH_KMALLOC_MINALIGN, -1);
  
        if (c) {
                c->name = name;
@@@ -569,10 -583,19 +583,19 @@@ void *kmem_cache_alloc_node(struct kmem
  {
        void *b;
  
-       if (c->size < PAGE_SIZE)
+       if (c->size < PAGE_SIZE) {
                b = slob_alloc(c->size, flags, c->align, node);
-       else
+               kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE,
+                                         _RET_IP_, b, c->size,
+                                         SLOB_UNITS(c->size) * SLOB_UNIT,
+                                         flags, node);
+       } else {
                b = slob_new_page(flags, get_order(c->size), node);
+               kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE,
+                                         _RET_IP_, b, c->size,
+                                         PAGE_SIZE << get_order(c->size),
+                                         flags, node);
+       }
  
        if (c->ctor)
                c->ctor(b);
@@@ -608,6 -631,8 +631,8 @@@ void kmem_cache_free(struct kmem_cache 
        } else {
                __kmem_cache_free(b, c->size);
        }
+       kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, b);
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
diff --combined mm/slub.c
index a2cd47d89e0aa1f159d8e9e6ed2dcee32969068f,e27472368cc3dcf48202ebca331ca85ed6b7c8a3..4cd7bfd2ab2c1fe45c80f360db744d006ec95d05
+++ b/mm/slub.c
@@@ -24,6 -24,7 +24,7 @@@
  #include <linux/kallsyms.h>
  #include <linux/memory.h>
  #include <linux/math64.h>
+ #include <linux/kmemtrace.h>
  
  /*
   * Lock order:
@@@ -178,7 -179,7 +179,7 @@@ static LIST_HEAD(slab_caches)
   * Tracking user of a slab.
   */
  struct track {
-       void *addr;             /* Called from address */
+       unsigned long addr;     /* Called from address */
        int cpu;                /* Was running on cpu */
        int pid;                /* Pid context */
        unsigned long when;     /* When did the operation occur */
@@@ -367,7 -368,7 +368,7 @@@ static struct track *get_track(struct k
  }
  
  static void set_track(struct kmem_cache *s, void *object,
-                               enum track_item alloc, void *addr)
+                       enum track_item alloc, unsigned long addr)
  {
        struct track *p;
  
@@@ -391,8 -392,8 +392,8 @@@ static void init_tracking(struct kmem_c
        if (!(s->flags & SLAB_STORE_USER))
                return;
  
-       set_track(s, object, TRACK_FREE, NULL);
-       set_track(s, object, TRACK_ALLOC, NULL);
+       set_track(s, object, TRACK_FREE, 0UL);
+       set_track(s, object, TRACK_ALLOC, 0UL);
  }
  
  static void print_track(const char *s, struct track *t)
                return;
  
        printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n",
-               s, t->addr, jiffies - t->when, t->cpu, t->pid);
+               s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid);
  }
  
  static void print_tracking(struct kmem_cache *s, void *object)
@@@ -866,7 -867,7 +867,7 @@@ static void setup_object_debug(struct k
  }
  
  static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
-                                               void *object, void *addr)
+                                       void *object, unsigned long addr)
  {
        if (!check_slab(s, page))
                goto bad;
@@@ -906,7 -907,7 +907,7 @@@ bad
  }
  
  static int free_debug_processing(struct kmem_cache *s, struct page *page,
-                                               void *object, void *addr)
+                                       void *object, unsigned long addr)
  {
        if (!check_slab(s, page))
                goto fail;
@@@ -1029,10 -1030,10 +1030,10 @@@ static inline void setup_object_debug(s
                        struct page *page, void *object) {}
  
  static inline int alloc_debug_processing(struct kmem_cache *s,
-       struct page *page, void *object, void *addr) { return 0; }
+       struct page *page, void *object, unsigned long addr) { return 0; }
  
  static inline int free_debug_processing(struct kmem_cache *s,
-       struct page *page, void *object, void *addr) { return 0; }
+       struct page *page, void *object, unsigned long addr) { return 0; }
  
  static inline int slab_pad_check(struct kmem_cache *s, struct page *page)
                        { return 1; }
@@@ -1499,8 -1500,8 +1500,8 @@@ static inline int node_match(struct kme
   * we need to allocate a new slab. This is the slowest path since it involves
   * a call to the page allocator and the setup of a new slab.
   */
- static void *__slab_alloc(struct kmem_cache *s,
-               gfp_t gfpflags, int node, void *addr, struct kmem_cache_cpu *c)
+ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
+                         unsigned long addr, struct kmem_cache_cpu *c)
  {
        void **object;
        struct page *new;
@@@ -1584,7 -1585,7 +1585,7 @@@ debug
   * Otherwise we can simply pick the next object from the lockless free list.
   */
  static __always_inline void *slab_alloc(struct kmem_cache *s,
-               gfp_t gfpflags, int node, void *addr)
+               gfp_t gfpflags, int node, unsigned long addr)
  {
        void **object;
        struct kmem_cache_cpu *c;
  
  void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
  {
-       return slab_alloc(s, gfpflags, -1, __builtin_return_address(0));
+       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, __builtin_return_address(0));
+       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.
   * handling required then we can return immediately.
   */
  static void __slab_free(struct kmem_cache *s, struct page *page,
-                               void *x, void *addr, unsigned int offset)
+                       void *x, unsigned long addr, unsigned int offset)
  {
        void *prior;
        void **object = (void *)x;
@@@ -1704,7 -1733,7 +1733,7 @@@ debug
   * with all sorts of special processing.
   */
  static __always_inline void slab_free(struct kmem_cache *s,
-                       struct page *page, void *x, void *addr)
+                       struct page *page, void *x, unsigned long addr)
  {
        void **object = (void *)x;
        struct kmem_cache_cpu *c;
@@@ -1731,7 -1760,9 +1760,9 @@@ void kmem_cache_free(struct kmem_cache 
  
        page = virt_to_head_page(x);
  
-       slab_free(s, page, x, __builtin_return_address(0));
+       slab_free(s, page, x, _RET_IP_);
+       kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, x);
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
@@@ -2650,6 -2681,7 +2681,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, __builtin_return_address(0));
+       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);
  
@@@ -2678,16 -2715,30 +2715,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, __builtin_return_address(0));
+       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
@@@ -2744,7 -2795,9 +2795,9 @@@ void kfree(const void *x
                put_page(page);
                return;
        }
-       slab_free(page->slab, page, object, __builtin_return_address(0));
+       slab_free(page->slab, page, object, _RET_IP_);
+       kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, x);
  }
  EXPORT_SYMBOL(kfree);
  
@@@ -2931,10 -2984,8 +2984,10 @@@ static int slab_memory_callback(struct 
        case MEM_CANCEL_OFFLINE:
                break;
        }
 -
 -      ret = notifier_from_errno(ret);
 +      if (ret)
 +              ret = notifier_from_errno(ret);
 +      else
 +              ret = NOTIFY_OK;
        return ret;
  }
  
@@@ -3202,9 -3253,10 +3255,10 @@@ static struct notifier_block __cpuinitd
  
  #endif
  
- void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, void *caller)
+ 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, void *caller)
+                                       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
@@@ -3429,7 -3494,7 +3496,7 @@@ static void resiliency_test(void) {}
  
  struct location {
        unsigned long count;
-       void *addr;
+       unsigned long addr;
        long long sum_time;
        long min_time;
        long max_time;
@@@ -3477,7 -3542,7 +3544,7 @@@ static int add_location(struct loc_trac
  {
        long start, end, pos;
        struct location *l;
-       void *caddr;
+       unsigned long caddr;
        unsigned long age = jiffies - track->when;
  
        start = -1;
@@@ -3597,7 -3662,7 +3664,7 @@@ static int list_locations(struct kmem_c
        for (i = 0; i < t.count; i++) {
                struct location *l = &t.loc[i];
  
 -              if (len > PAGE_SIZE - 100)
 +              if (len > PAGE_SIZE - KSYM_SYMBOL_LEN - 100)
                        break;
                len += sprintf(buf + len, "%7ld ", l->count);