Merge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penber...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Jul 2013 22:14:29 +0000 (15:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Jul 2013 22:14:29 +0000 (15:14 -0700)
Pull slab update from Pekka Enberg:
 "Highlights:

  - Fix for boot-time problems on some architectures due to
    init_lock_keys() not respecting kmalloc_caches boundaries
    (Christoph Lameter)

  - CONFIG_SLUB_CPU_PARTIAL requested by RT folks (Joonsoo Kim)

  - Fix for excessive slab freelist draining (Wanpeng Li)

  - SLUB and SLOB cleanups and fixes (various people)"

I ended up editing the branch, and this avoids two commits at the end
that were immediately reverted, and I instead just applied the oneliner
fix in between myself.

* 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux
  slub: Check for page NULL before doing the node_match check
  mm/slab: Give s_next and s_stop slab-specific names
  slob: Check for NULL pointer before calling ctor()
  slub: Make cpu partial slab support configurable
  slab: add kmalloc() to kernel API documentation
  slab: fix init_lock_keys
  slob: use DIV_ROUND_UP where possible
  slub: do not put a slab to cpu partial list when cpu_partial is 0
  mm/slub: Use node_nr_slabs and node_nr_objs in get_slabinfo
  mm/slub: Drop unnecessary nr_partials
  mm/slab: Fix /proc/slabinfo unwriteable for slab
  mm/slab: Sharing s_next and s_stop between slab and slub
  mm/slab: Fix drain freelist excessively
  slob: Rework #ifdeffery in slab.h
  mm, slab: moved kmem_cache_alloc_node comment to correct place

1  2 
init/Kconfig
mm/slab.c
mm/slab_common.c
mm/slob.c
mm/slub.c

diff --combined init/Kconfig
index 54d3fa5ae7234a1664c16adcc53d289359d7402f,3b34a88cf34e272f9644f1da587e78779de07d26..247084be059030162838199c953ebac6409f7e01
@@@ -20,14 -20,49 +20,14 @@@ config CONSTRUCTOR
        bool
        depends on !UML
  
 -config HAVE_IRQ_WORK
 -      bool
 -
  config IRQ_WORK
        bool
 -      depends on HAVE_IRQ_WORK
  
  config BUILDTIME_EXTABLE_SORT
        bool
  
  menu "General setup"
  
 -config EXPERIMENTAL
 -      bool "Prompt for development and/or incomplete code/drivers"
 -      ---help---
 -        Some of the various things that Linux supports (such as network
 -        drivers, file systems, network protocols, etc.) can be in a state
 -        of development where the functionality, stability, or the level of
 -        testing is not yet high enough for general use. This is usually
 -        known as the "alpha-test" phase among developers. If a feature is
 -        currently in alpha-test, then the developers usually discourage
 -        uninformed widespread use of this feature by the general public to
 -        avoid "Why doesn't this work?" type mail messages. However, active
 -        testing and use of these systems is welcomed. Just be aware that it
 -        may not meet the normal level of reliability or it may fail to work
 -        in some special cases. Detailed bug reports from people familiar
 -        with the kernel internals are usually welcomed by the developers
 -        (before submitting bug reports, please read the documents
 -        <file:README>, <file:MAINTAINERS>, <file:REPORTING-BUGS>,
 -        <file:Documentation/BUG-HUNTING>, and
 -        <file:Documentation/oops-tracing.txt> in the kernel source).
 -
 -        This option will also make obsoleted drivers available. These are
 -        drivers that have been replaced by something else, and/or are
 -        scheduled to be removed in a future kernel release.
 -
 -        Unless you intend to help test and develop a feature or driver that
 -        falls into this category, or you have a situation that requires
 -        using these features, you should probably say N here, which will
 -        cause the configurator to present you with fewer choices. If
 -        you say Y here, you will be offered the choice of using features or
 -        drivers that are currently considered to be in the alpha-test phase.
 -
  config BROKEN
        bool
  
@@@ -53,20 -88,6 +53,20 @@@ config CROSS_COMPIL
          need to set this unless you want the configured kernel build
          directory to select the cross-compiler automatically.
  
 +config COMPILE_TEST
 +      bool "Compile also drivers which will not load"
 +      default n
 +      help
 +        Some drivers can be compiled on a different platform than they are
 +        intended to be run on. Despite they cannot be loaded there (or even
 +        when they load they cannot be used due to missing HW support),
 +        developers still, opposing to distributors, might want to build such
 +        drivers to compile-test them.
 +
 +        If you are a developer and want to build everything available, say Y
 +        here. If you are a user/distributor, say N here to exclude useless
 +        drivers to be distributed.
 +
  config LOCALVERSION
        string "Local version - append to kernel release"
        help
@@@ -112,13 -133,10 +112,13 @@@ config HAVE_KERNEL_X
  config HAVE_KERNEL_LZO
        bool
  
 +config HAVE_KERNEL_LZ4
 +      bool
 +
  choice
        prompt "Kernel compression mode"
        default KERNEL_GZIP
 -      depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO
 +      depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4
        help
          The linux kernel is a kind of self-extracting executable.
          Several compression algorithms are available, which differ
@@@ -185,18 -203,6 +185,18 @@@ config KERNEL_LZ
          size is about 10% bigger than gzip; however its speed
          (both compression and decompression) is the fastest.
  
 +config KERNEL_LZ4
 +      bool "LZ4"
 +      depends on HAVE_KERNEL_LZ4
 +      help
 +        LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding.
 +        A preliminary version of LZ4 de/compression tool is available at
 +        <https://code.google.com/p/lz4/>.
 +
 +        Its compression ratio is worse than LZO. The size of the kernel
 +        is about 8% bigger than LZO. But the decompression speed is
 +        faster than LZO.
 +
  endchoice
  
  config DEFAULT_HOSTNAME
@@@ -241,7 -247,7 +241,7 @@@ config SYSVIPC_SYSCT
  
  config POSIX_MQUEUE
        bool "POSIX Message Queues"
 -      depends on NET && EXPERIMENTAL
 +      depends on NET
        ---help---
          POSIX variant of message queues is a part of IPC. In POSIX message
          queues every message has a priority which decides about succession
@@@ -320,18 -326,15 +320,18 @@@ source "kernel/time/Kconfig
  
  menu "CPU/Task time and stats accounting"
  
 +config VIRT_CPU_ACCOUNTING
 +      bool
 +
  choice
        prompt "Cputime accounting"
        default TICK_CPU_ACCOUNTING if !PPC64
 -      default VIRT_CPU_ACCOUNTING if PPC64
 +      default VIRT_CPU_ACCOUNTING_NATIVE if PPC64
  
  # Kind of a stub config for the pure tick based cputime accounting
  config TICK_CPU_ACCOUNTING
        bool "Simple tick based cputime accounting"
 -      depends on !S390
 +      depends on !S390 && !NO_HZ_FULL
        help
          This is the basic tick based cputime accounting that maintains
          statistics about user, system and idle time spent on per jiffies
  
          If unsure, say Y.
  
 -config VIRT_CPU_ACCOUNTING
 +config VIRT_CPU_ACCOUNTING_NATIVE
        bool "Deterministic task and CPU time accounting"
 -      depends on HAVE_VIRT_CPU_ACCOUNTING
 +      depends on HAVE_VIRT_CPU_ACCOUNTING && !NO_HZ_FULL
 +      select VIRT_CPU_ACCOUNTING
        help
          Select this option to enable more accurate task and CPU time
          accounting.  This is done by reading a CPU counter on each
          this also enables accounting of stolen time on logically-partitioned
          systems.
  
 +config VIRT_CPU_ACCOUNTING_GEN
 +      bool "Full dynticks CPU time accounting"
 +      depends on HAVE_CONTEXT_TRACKING && 64BIT
 +      select VIRT_CPU_ACCOUNTING
 +      select CONTEXT_TRACKING
 +      help
 +        Select this option to enable task and CPU time accounting on full
 +        dynticks systems. This accounting is implemented by watching every
 +        kernel-user boundaries using the context tracking subsystem.
 +        The accounting is thus performed at the expense of some significant
 +        overhead.
 +
 +        For now this is only useful if you are working on the full
 +        dynticks subsystem development.
 +
 +        If unsure, say N.
 +
  config IRQ_TIME_ACCOUNTING
        bool "Fine granularity task level IRQ time accounting"
 -      depends on HAVE_IRQ_TIME_ACCOUNTING
 +      depends on HAVE_IRQ_TIME_ACCOUNTING && !NO_HZ_FULL
        help
          Select this option to enable fine granularity task irq time
          accounting. This is done by reading a timestamp on each
@@@ -408,7 -393,7 +408,7 @@@ config BSD_PROCESS_ACCT_V
          at <http://www.gnu.org/software/acct/>.
  
  config TASKSTATS
 -      bool "Export task/process statistics through netlink (EXPERIMENTAL)"
 +      bool "Export task/process statistics through netlink"
        depends on NET
        default n
        help
          Say N if unsure.
  
  config TASK_DELAY_ACCT
 -      bool "Enable per-task delay accounting (EXPERIMENTAL)"
 +      bool "Enable per-task delay accounting"
        depends on TASKSTATS
        help
          Collect information on time spent by a task waiting for system
          Say N if unsure.
  
  config TASK_XACCT
 -      bool "Enable extended accounting over taskstats (EXPERIMENTAL)"
 +      bool "Enable extended accounting over taskstats"
        depends on TASKSTATS
        help
          Collect extended task accounting data and send the data
          Say N if unsure.
  
  config TASK_IO_ACCOUNTING
 -      bool "Enable per-task storage I/O accounting (EXPERIMENTAL)"
 +      bool "Enable per-task storage I/O accounting"
        depends on TASK_XACCT
        help
          Collect information on the number of bytes of storage I/O which this
@@@ -460,7 -445,6 +460,7 @@@ choic
  config TREE_RCU
        bool "Tree-based hierarchical RCU"
        depends on !PREEMPT && SMP
 +      select IRQ_WORK
        help
          This option selects the RCU implementation that is
          designed for very large SMP system with hundreds or
  
  config TREE_PREEMPT_RCU
        bool "Preemptible tree-based hierarchical RCU"
 -      depends on PREEMPT && SMP
 +      depends on PREEMPT
        help
          This option selects the RCU implementation that is
          designed for very large SMP systems with hundreds or
          is also required.  It also scales down nicely to
          smaller systems.
  
 +        Select this option if you are unsure.
 +
  config TINY_RCU
        bool "UP-only small-memory-footprint RCU"
        depends on !PREEMPT && !SMP
          is not required.  This option greatly reduces the
          memory footprint of RCU.
  
 -config TINY_PREEMPT_RCU
 -      bool "Preemptible UP-only small-memory-footprint RCU"
 -      depends on PREEMPT && !SMP
 -      help
 -        This option selects the RCU implementation that is designed
 -        for real-time UP systems.  This option greatly reduces the
 -        memory footprint of RCU.
 -
  endchoice
  
  config PREEMPT_RCU
 -      def_bool ( TREE_PREEMPT_RCU || TINY_PREEMPT_RCU )
 +      def_bool TREE_PREEMPT_RCU
        help
          This option enables preemptible-RCU code that is common between
          the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
  
 +config RCU_STALL_COMMON
 +      def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE )
 +      help
 +        This option enables RCU CPU stall code that is common between
 +        the TINY and TREE variants of RCU.  The purpose is to allow
 +        the tiny variants to disable RCU CPU stall warnings, while
 +        making these warnings mandatory for the tree variants.
 +
  config CONTEXT_TRACKING
         bool
  
@@@ -527,7 -509,6 +527,7 @@@ config RCU_USER_Q
  config CONTEXT_TRACKING_FORCE
        bool "Force context tracking"
        depends on CONTEXT_TRACKING
 +      default CONTEXT_TRACKING
        help
          Probe on user/kernel boundaries by default in order to
          test the features that rely on it such as userspace RCU extended
@@@ -598,19 -579,16 +598,19 @@@ config RCU_FANOUT_EXAC
  
  config RCU_FAST_NO_HZ
        bool "Accelerate last non-dyntick-idle CPU's grace periods"
 -      depends on NO_HZ && SMP
 +      depends on NO_HZ_COMMON && SMP
        default n
        help
 -        This option causes RCU to attempt to accelerate grace periods in
 -        order to allow CPUs to enter dynticks-idle state more quickly.
 -        On the other hand, this option increases the overhead of the
 -        dynticks-idle checking, thus degrading scheduling latency.
 +        This option permits CPUs to enter dynticks-idle state even if
 +        they have RCU callbacks queued, and prevents RCU from waking
 +        these CPUs up more than roughly once every four jiffies (by
 +        default, you can adjust this using the rcutree.rcu_idle_gp_delay
 +        parameter), thus improving energy efficiency.  On the other
 +        hand, this option increases the duration of RCU grace periods,
 +        for example, slowing down synchronize_rcu().
  
 -        Say Y if energy efficiency is critically important, and you don't
 -              care about real-time response.
 +        Say Y if energy efficiency is critically important, and you
 +              don't care about increased grace-period durations.
  
          Say N if you are unsure.
  
@@@ -688,72 -666,16 +688,72 @@@ config RCU_NOCB_CP
  
          This option offloads callback invocation from the set of
          CPUs specified at boot time by the rcu_nocbs parameter.
 -        For each such CPU, a kthread ("rcuoN") will be created to
 -        invoke callbacks, where the "N" is the CPU being offloaded.
 -        Nothing prevents this kthread from running on the specified
 -        CPUs, but (1) the kthreads may be preempted between each
 -        callback, and (2) affinity or cgroups can be used to force
 -        the kthreads to run on whatever set of CPUs is desired.
 -
 -        Say Y here if you want reduced OS jitter on selected CPUs.
 +        For each such CPU, a kthread ("rcuox/N") will be created to
 +        invoke callbacks, where the "N" is the CPU being offloaded,
 +        and where the "x" is "b" for RCU-bh, "p" for RCU-preempt, and
 +        "s" for RCU-sched.  Nothing prevents this kthread from running
 +        on the specified CPUs, but (1) the kthreads may be preempted
 +        between each callback, and (2) affinity or cgroups can be used
 +        to force the kthreads to run on whatever set of CPUs is desired.
 +
 +        Say Y here if you want to help to debug reduced OS jitter.
          Say N here if you are unsure.
  
 +choice
 +      prompt "Build-forced no-CBs CPUs"
 +      default RCU_NOCB_CPU_NONE
 +      help
 +        This option allows no-CBs CPUs (whose RCU callbacks are invoked
 +        from kthreads rather than from softirq context) to be specified
 +        at build time.  Additional no-CBs CPUs may be specified by
 +        the rcu_nocbs= boot parameter.
 +
 +config RCU_NOCB_CPU_NONE
 +      bool "No build_forced no-CBs CPUs"
 +      depends on RCU_NOCB_CPU && !NO_HZ_FULL
 +      help
 +        This option does not force any of the CPUs to be no-CBs CPUs.
 +        Only CPUs designated by the rcu_nocbs= boot parameter will be
 +        no-CBs CPUs, whose RCU callbacks will be invoked by per-CPU
 +        kthreads whose names begin with "rcuo".  All other CPUs will
 +        invoke their own RCU callbacks in softirq context.
 +
 +        Select this option if you want to choose no-CBs CPUs at
 +        boot time, for example, to allow testing of different no-CBs
 +        configurations without having to rebuild the kernel each time.
 +
 +config RCU_NOCB_CPU_ZERO
 +      bool "CPU 0 is a build_forced no-CBs CPU"
 +      depends on RCU_NOCB_CPU && !NO_HZ_FULL
 +      help
 +        This option forces CPU 0 to be a no-CBs CPU, so that its RCU
 +        callbacks are invoked by a per-CPU kthread whose name begins
 +        with "rcuo".  Additional CPUs may be designated as no-CBs
 +        CPUs using the rcu_nocbs= boot parameter will be no-CBs CPUs.
 +        All other CPUs will invoke their own RCU callbacks in softirq
 +        context.
 +
 +        Select this if CPU 0 needs to be a no-CBs CPU for real-time
 +        or energy-efficiency reasons, but the real reason it exists
 +        is to ensure that randconfig testing covers mixed systems.
 +
 +config RCU_NOCB_CPU_ALL
 +      bool "All CPUs are build_forced no-CBs CPUs"
 +      depends on RCU_NOCB_CPU
 +      help
 +        This option forces all CPUs to be no-CBs CPUs.  The rcu_nocbs=
 +        boot parameter will be ignored.  All CPUs' RCU callbacks will
 +        be executed in the context of per-CPU rcuo kthreads created for
 +        this purpose.  Assuming that the kthreads whose names start with
 +        "rcuo" are bound to "housekeeping" CPUs, this reduces OS jitter
 +        on the remaining CPUs, but might decrease memory locality during
 +        RCU-callback invocation, thus potentially degrading throughput.
 +
 +        Select this if all CPUs need to be no-CBs CPUs for real-time
 +        or energy-efficiency reasons.
 +
 +endchoice
 +
  endmenu # "RCU Subsystem"
  
  config IKCONFIG
@@@ -795,9 -717,6 +795,9 @@@ config LOG_BUF_SHIF
  config HAVE_UNSTABLE_SCHED_CLOCK
        bool
  
 +config GENERIC_SCHED_CLOCK
 +      bool
 +
  #
  # For architectures that want to enable the support for NUMA-affine scheduler
  # balancing logic:
@@@ -917,7 -836,7 +917,7 @@@ config MEMC
  
          Note that setting this option increases fixed memory overhead
          associated with each page of memory in the system. By this,
 -        20(40)bytes/PAGE_SIZE on 32(64)bit system will be occupied by memory
 +        8(16)bytes/PAGE_SIZE on 32(64)bit system will be occupied by memory
          usage tracking struct at boot. Total amount of this is printed out
          at boot.
  
@@@ -961,8 -880,8 +961,8 @@@ config MEMCG_SWAP_ENABLE
          select this option (if, for some reason, they need to disable it
          then swapaccount=0 does the trick).
  config MEMCG_KMEM
 -      bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
 -      depends on MEMCG && EXPERIMENTAL
 +      bool "Memory Resource Controller Kernel Memory accounting"
 +      depends on MEMCG
        depends on SLUB || SLAB
        help
          The Kernel Memory extension for Memory Resource Controller can limit
  
  config CGROUP_HUGETLB
        bool "HugeTLB Resource Controller for Control Groups"
 -      depends on RESOURCE_COUNTERS && HUGETLB_PAGE && EXPERIMENTAL
 +      depends on RESOURCE_COUNTERS && HUGETLB_PAGE
        default n
        help
          Provides a cgroup Resource Controller for HugeTLB pages.
@@@ -1013,6 -932,7 +1013,6 @@@ config FAIR_GROUP_SCHE
  
  config CFS_BANDWIDTH
        bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
 -      depends on EXPERIMENTAL
        depends on FAIR_GROUP_SCHED
        default n
        help
  
  config RT_GROUP_SCHED
        bool "Group scheduling for SCHED_RR/FIFO"
 -      depends on EXPERIMENTAL
        depends on CGROUP_SCHED
        default n
        help
@@@ -1105,7 -1026,8 +1105,7 @@@ config IPC_N
          different IPC objects in different namespaces.
  
  config USER_NS
 -      bool "User namespace (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
 +      bool "User namespace"
        depends on UIDGID_CONVERTED
        select UIDGID_STRICT_TYPE_CHECKS
  
        help
          This allows containers, i.e. vservers, to use user namespaces
          to provide different user info for different servers.
 +
 +        When user namespaces are enabled in the kernel it is
 +        recommended that the MEMCG and MEMCG_KMEM options also be
 +        enabled and that user-space use the memory control groups to
 +        limit the amount of memory a memory unprivileged users can
 +        use.
 +
          If unsure, say N.
  
  config PID_NS
@@@ -1148,7 -1063,20 +1148,7 @@@ config UIDGID_CONVERTE
        bool
        default y
  
 -      # Networking
 -      depends on NET_9P = n
 -
        # Filesystems
 -      depends on 9P_FS = n
 -      depends on AFS_FS = n
 -      depends on CEPH_FS = n
 -      depends on CIFS = n
 -      depends on CODA_FS = n
 -      depends on GFS2_FS = n
 -      depends on NCP_FS = n
 -      depends on NFSD = n
 -      depends on NFS_FS = n
 -      depends on OCFS2_FS = n
        depends on XFS_FS = n
  
  config UIDGID_STRICT_TYPE_CHECKS
@@@ -1254,7 -1182,7 +1254,7 @@@ config CC_OPTIMIZE_FOR_SIZ
          Enabling this option will pass "-Os" instead of "-O2" to gcc
          resulting in a smaller kernel.
  
 -        If unsure, say Y.
 +        If unsure, say N.
  
  config SYSCTL
        bool
  config ANON_INODES
        bool
  
 +config HAVE_UID16
 +      bool
 +
 +config SYSCTL_EXCEPTION_TRACE
 +      bool
 +      help
 +        Enable support for /proc/sys/debug/exception-trace.
 +
 +config SYSCTL_ARCH_UNALIGN_NO_WARN
 +      bool
 +      help
 +        Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
 +        Allows arch to define/use @no_unaligned_warning to possibly warn
 +        about unaligned access emulation going on under the hood.
 +
 +config SYSCTL_ARCH_UNALIGN_ALLOW
 +      bool
 +      help
 +        Enable support for /proc/sys/kernel/unaligned-trap
 +        Allows arches to define/use @unaligned_enabled to runtime toggle
 +        the unaligned access emulation.
 +        see arch/parisc/kernel/unaligned.c for reference
 +
 +config HAVE_PCSPKR_PLATFORM
 +      bool
 +
  menuconfig EXPERT
        bool "Configure standard kernel features (expert users)"
        # Unhide debug options, to make the on-by-default options visible
            environments which can tolerate a "non-standard" kernel.
            Only use this if you really know what you are doing.
  
 -config HAVE_UID16
 -      bool
 -
  config UID16
        bool "Enable 16-bit UID system calls" if EXPERT
        depends on HAVE_UID16
@@@ -1322,6 -1227,11 +1322,6 @@@ config SYSCTL_SYSCAL
  
          If unsure say N here.
  
 -config SYSCTL_EXCEPTION_TRACE
 -      bool
 -      help
 -        Enable support for /proc/sys/debug/exception-trace.
 -
  config KALLSYMS
         bool "Load all symbols for debugging/ksymoops" if EXPERT
         default y
@@@ -1347,10 -1257,12 +1347,10 @@@ config KALLSYMS_AL
  
           Say N unless you really need all symbols.
  
 -config HOTPLUG
 -      def_bool y
 -
  config PRINTK
        default y
        bool "Enable support for printk" if EXPERT
 +      select IRQ_WORK
        help
          This option enables normal printk support. Removing it
          eliminates most of the message strings from the kernel image
@@@ -1385,6 -1297,9 +1385,6 @@@ config PCSPKR_PLATFOR
            This option allows to disable the internal PC-Speaker
            support, saving some memory.
  
 -config HAVE_PCSPKR_PLATFORM
 -      bool
 -
  config BASE_FULL
        default y
        bool "Enable full-sized data structures for core" if EXPERT
@@@ -1456,17 -1371,8 +1456,17 @@@ config AI
        default y
        help
          This option enables POSIX asynchronous I/O which may by used
 -          by some high performance threaded applications. Disabling
 -          this option saves about 7k.
 +        by some high performance threaded applications. Disabling
 +        this option saves about 7k.
 +
 +config PCI_QUIRKS
 +      default y
 +      bool "Enable PCI quirk workarounds" if EXPERT
 +      depends on PCI
 +      help
 +        This enables workarounds for various PCI chipset
 +        bugs/quirks. Disable this only if your target machine is
 +        unaffected by PCI quirks.
  
  config EMBEDDED
        bool "Embedded system"
@@@ -1541,6 -1447,15 +1541,6 @@@ config VM_EVENT_COUNTER
          on EXPERT systems.  /proc/vmstat will only show page counts
          if VM event counters are disabled.
  
 -config PCI_QUIRKS
 -      default y
 -      bool "Enable PCI quirk workarounds" if EXPERT
 -      depends on PCI
 -      help
 -        This enables workarounds for various PCI chipset
 -          bugs/quirks. Disable this only if your target machine is
 -          unaffected by PCI quirks.
 -
  config SLUB_DEBUG
        default y
        bool "Enable SLUB debugging support" if EXPERT
@@@ -1596,6 -1511,17 +1596,17 @@@ config SLO
  
  endchoice
  
+ config SLUB_CPU_PARTIAL
+       default y
+       depends on SLUB
+       bool "SLUB per cpu partial cache"
+       help
+         Per cpu partial caches accellerate objects allocation and freeing
+         that is local to a processor at the price of more indeterminism
+         in the latency of the free. On overflow these caches will be cleared
+         which requires the taking of locks that may cause latency spikes.
+         Typically one would choose no for a realtime system.
  config MMAP_ALLOW_UNINITIALIZED
        bool "Allow mmapped anonymous memory to be uninitialized"
        depends on EXPERT && !MMU
@@@ -1693,7 -1619,7 +1704,7 @@@ config MODULE_UNLOA
  
  config MODULE_FORCE_UNLOAD
        bool "Forced module unloading"
 -      depends on MODULE_UNLOAD && EXPERIMENTAL
 +      depends on MODULE_UNLOAD
        help
          This option allows you to force a module to unload, even if the
          kernel believes it is unsafe: the kernel will remove the module
@@@ -1750,17 -1676,6 +1761,17 @@@ config MODULE_SIG_FORC
          Reject unsigned modules or signed modules for which we don't have a
          key.  Without this, such modules will simply taint the kernel.
  
 +config MODULE_SIG_ALL
 +      bool "Automatically sign all modules"
 +      default y
 +      depends on MODULE_SIG
 +      help
 +        Sign all modules during make modules_install. Without this option,
 +        modules must be signed manually, using the scripts/sign-file tool.
 +
 +comment "Do not forget to sign required modules with scripts/sign-file"
 +      depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL
 +
  choice
        prompt "Which hash algorithm should modules be signed with?"
        depends on MODULE_SIG
@@@ -1793,15 -1708,6 +1804,15 @@@ config MODULE_SIG_SHA51
  
  endchoice
  
 +config MODULE_SIG_HASH
 +      string
 +      depends on MODULE_SIG
 +      default "sha1" if MODULE_SIG_SHA1
 +      default "sha224" if MODULE_SIG_SHA224
 +      default "sha256" if MODULE_SIG_SHA256
 +      default "sha384" if MODULE_SIG_SHA384
 +      default "sha512" if MODULE_SIG_SHA512
 +
  endif # MODULES
  
  config INIT_ALL_POSSIBLE
diff --combined mm/slab.c
index 8ccd296c6d9c7586fca85fc89bfd9f7a4023e220,57ab42297d96b402775689c004e1cc5ec3491b15..35cb0c861508c898264c56818ac431086c6f39e1
+++ b/mm/slab.c
@@@ -565,7 -565,7 +565,7 @@@ static void init_node_lock_keys(int q
        if (slab_state < UP)
                return;
  
-       for (i = 1; i < PAGE_SHIFT + MAX_ORDER; i++) {
+       for (i = 1; i <= KMALLOC_SHIFT_HIGH; i++) {
                struct kmem_cache_node *n;
                struct kmem_cache *cache = kmalloc_caches[i];
  
@@@ -714,7 -714,7 +714,7 @@@ static void __slab_error(const char *fu
        printk(KERN_ERR "slab error in %s(): cache `%s': %s\n",
               function, cachep->name, msg);
        dump_stack();
 -      add_taint(TAINT_BAD_PAGE);
 +      add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
  }
  #endif
  
@@@ -1180,6 -1180,12 +1180,12 @@@ static int init_cache_node_node(int nod
        return 0;
  }
  
+ static inline int slabs_tofree(struct kmem_cache *cachep,
+                                               struct kmem_cache_node *n)
+ {
+       return (n->free_objects + cachep->num - 1) / cachep->num;
+ }
  static void __cpuinit cpuup_canceled(long cpu)
  {
        struct kmem_cache *cachep;
@@@ -1241,7 -1247,7 +1247,7 @@@ free_array_cache
                n = cachep->node[node];
                if (!n)
                        continue;
-               drain_freelist(cachep, n, n->free_objects);
+               drain_freelist(cachep, n, slabs_tofree(cachep, n));
        }
  }
  
@@@ -1408,7 -1414,7 +1414,7 @@@ static int __meminit drain_cache_node_n
                if (!n)
                        continue;
  
-               drain_freelist(cachep, n, n->free_objects);
+               drain_freelist(cachep, n, slabs_tofree(cachep, n));
  
                if (!list_empty(&n->slabs_full) ||
                    !list_empty(&n->slabs_partial)) {
@@@ -1917,9 -1923,11 +1923,9 @@@ static void print_objinfo(struct kmem_c
        }
  
        if (cachep->flags & SLAB_STORE_USER) {
 -              printk(KERN_ERR "Last user: [<%p>]",
 -                      *dbg_userword(cachep, objp));
 -              print_symbol("(%s)",
 -                              (unsigned long)*dbg_userword(cachep, objp));
 -              printk("\n");
 +              printk(KERN_ERR "Last user: [<%p>](%pSR)\n",
 +                     *dbg_userword(cachep, objp),
 +                     *dbg_userword(cachep, objp));
        }
        realobj = (char *)objp + obj_offset(cachep);
        size = cachep->object_size;
@@@ -2532,7 -2540,7 +2538,7 @@@ static int __cache_shrink(struct kmem_c
                if (!n)
                        continue;
  
-               drain_freelist(cachep, n, n->free_objects);
+               drain_freelist(cachep, n, slabs_tofree(cachep, n));
  
                ret += !list_empty(&n->slabs_full) ||
                        !list_empty(&n->slabs_partial);
@@@ -3338,18 -3346,6 +3344,6 @@@ done
        return obj;
  }
  
- /**
-  * kmem_cache_alloc_node - Allocate an object on the specified node
-  * @cachep: The cache to allocate from.
-  * @flags: See kmalloc().
-  * @nodeid: node number of the target node.
-  * @caller: return address of caller, used for debug information
-  *
-  * Identical to kmem_cache_alloc but it will allocate memory on the given
-  * node, which can improve the performance for cpu bound structures.
-  *
-  * Fallback to other node is possible if __GFP_THISNODE is not set.
-  */
  static __always_inline void *
  slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
                   unsigned long caller)
@@@ -3643,6 -3639,17 +3637,17 @@@ EXPORT_SYMBOL(kmem_cache_alloc_trace)
  #endif
  
  #ifdef CONFIG_NUMA
+ /**
+  * kmem_cache_alloc_node - Allocate an object on the specified node
+  * @cachep: The cache to allocate from.
+  * @flags: See kmalloc().
+  * @nodeid: node number of the target node.
+  *
+  * Identical to kmem_cache_alloc but it will allocate memory on the given
+  * node, which can improve the performance for cpu bound structures.
+  *
+  * Fallback to other node is possible if __GFP_THISNODE is not set.
+  */
  void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
  {
        void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_);
@@@ -4431,20 -4438,10 +4436,10 @@@ static int leaks_show(struct seq_file *
        return 0;
  }
  
- static void *s_next(struct seq_file *m, void *p, loff_t *pos)
- {
-       return seq_list_next(p, &slab_caches, pos);
- }
- static void s_stop(struct seq_file *m, void *p)
- {
-       mutex_unlock(&slab_mutex);
- }
  static const struct seq_operations slabstats_op = {
        .start = leaks_start,
-       .next = s_next,
-       .stop = s_stop,
+       .next = slab_next,
+       .stop = slab_stop,
        .show = leaks_show,
  };
  
diff --combined mm/slab_common.c
index 2d414508e9ecb32e64df911c72bf0dd2682b87b8,eacdffaf71c92317d0145960e87b06ced89c4777..538bade6df7dc2a3f27c9ad5ac5f0efc8a6d08bc
@@@ -373,10 -373,8 +373,10 @@@ struct kmem_cache *kmalloc_slab(size_t 
  {
        int index;
  
 -      if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
 +      if (size > KMALLOC_MAX_SIZE) {
 +              WARN_ON_ONCE(!(flags & __GFP_NOWARN));
                return NULL;
 +      }
  
        if (size <= 192) {
                if (!size)
@@@ -448,18 -446,18 +448,18 @@@ void __init create_kmalloc_caches(unsig
                if (!kmalloc_caches[i]) {
                        kmalloc_caches[i] = create_kmalloc_cache(NULL,
                                                        1 << i, flags);
 +              }
  
 -                      /*
 -                       * Caches that are not of the two-to-the-power-of size.
 -                       * These have to be created immediately after the
 -                       * earlier power of two caches
 -                       */
 -                      if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
 -                              kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
 +              /*
 +               * Caches that are not of the two-to-the-power-of size.
 +               * These have to be created immediately after the
 +               * earlier power of two caches
 +               */
 +              if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
 +                      kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
  
 -                      if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
 -                              kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
 -              }
 +              if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
 +                      kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
        }
  
        /* Kmalloc array is now usable */
  
  
  #ifdef CONFIG_SLABINFO
+ #ifdef CONFIG_SLAB
+ #define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR)
+ #else
+ #define SLABINFO_RIGHTS S_IRUSR
+ #endif
  void print_slabinfo_header(struct seq_file *m)
  {
        /*
@@@ -531,12 -536,12 +538,12 @@@ static void *s_start(struct seq_file *m
        return seq_list_start(&slab_caches, *pos);
  }
  
static void *s_next(struct seq_file *m, void *p, loff_t *pos)
void *slab_next(struct seq_file *m, void *p, loff_t *pos)
  {
        return seq_list_next(p, &slab_caches, pos);
  }
  
static void s_stop(struct seq_file *m, void *p)
void slab_stop(struct seq_file *m, void *p)
  {
        mutex_unlock(&slab_mutex);
  }
@@@ -613,8 -618,8 +620,8 @@@ static int s_show(struct seq_file *m, v
   */
  static const struct seq_operations slabinfo_op = {
        .start = s_start,
-       .next = s_next,
-       .stop = s_stop,
+       .next = slab_next,
+       .stop = slab_stop,
        .show = s_show,
  };
  
@@@ -633,7 -638,8 +640,8 @@@ static const struct file_operations pro
  
  static int __init slab_proc_init(void)
  {
-       proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations);
+       proc_create("slabinfo", SLABINFO_RIGHTS, NULL,
+                                               &proc_slabinfo_operations);
        return 0;
  }
  module_init(slab_proc_init);
diff --combined mm/slob.c
index eeed4a05a2ef2ffa3f7fc1b3ff1ccada895f3e77,3d73b3b8fb1dcba18cfde8f088e9c6d974ce4508..91bd3f2dd2f02622d6aa32802d2bdcd70ee922bd
+++ b/mm/slob.c
@@@ -122,7 -122,7 +122,7 @@@ static inline void clear_slob_page_free
  }
  
  #define SLOB_UNIT sizeof(slob_t)
- #define SLOB_UNITS(size) (((size) + SLOB_UNIT - 1)/SLOB_UNIT)
+ #define SLOB_UNITS(size) DIV_ROUND_UP(size, SLOB_UNIT)
  
  /*
   * struct slob_rcu is inserted at the tail of allocated slob blocks, which
@@@ -360,7 -360,7 +360,7 @@@ static void slob_free(void *block, int 
                        clear_slob_page_free(sp);
                spin_unlock_irqrestore(&slob_lock, flags);
                __ClearPageSlab(sp);
 -              reset_page_mapcount(sp);
 +              page_mapcount_reset(sp);
                slob_free_pages(b, 0);
                return;
        }
@@@ -554,7 -554,7 +554,7 @@@ void *kmem_cache_alloc_node(struct kmem
                                            flags, node);
        }
  
-       if (c->ctor)
+       if (b && c->ctor)
                c->ctor(b);
  
        kmemleak_alloc_recursive(b, c->size, 1, c->flags, flags);
diff --combined mm/slub.c
index 57707f01bcfb72395fd7414de8059dcb341cbdbd,33f71330e713d2ccb10c0fa2c656b6f5d870bd6b..3b482c863002525c6962e0d5a48182273674ad59
+++ b/mm/slub.c
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/slab.h>
  #include "slab.h"
  #include <linux/proc_fs.h>
 +#include <linux/notifier.h>
  #include <linux/seq_file.h>
  #include <linux/kmemcheck.h>
  #include <linux/cpu.h>
@@@ -123,6 -122,15 +123,15 @@@ static inline int kmem_cache_debug(stru
  #endif
  }
  
+ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s)
+ {
+ #ifdef CONFIG_SLUB_CPU_PARTIAL
+       return !kmem_cache_debug(s);
+ #else
+       return false;
+ #endif
+ }
  /*
   * Issues still to be resolved:
   *
@@@ -563,7 -571,7 +572,7 @@@ static void slab_bug(struct kmem_cache 
        printk(KERN_ERR "----------------------------------------"
                        "-------------------------------------\n\n");
  
 -      add_taint(TAINT_BAD_PAGE);
 +      add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
  }
  
  static void slab_fix(struct kmem_cache *s, char *fmt, ...)
@@@ -1409,7 -1417,7 +1418,7 @@@ static void __free_slab(struct kmem_cac
        __ClearPageSlab(page);
  
        memcg_release_pages(s, order);
 -      reset_page_mapcount(page);
 +      page_mapcount_reset(page);
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += pages;
        __free_memcg_kmem_pages(page, order);
@@@ -1573,7 -1581,8 +1582,8 @@@ static void *get_partial_node(struct km
                        put_cpu_partial(s, page, 0);
                        stat(s, CPU_PARTIAL_NODE);
                }
-               if (kmem_cache_debug(s) || available > s->cpu_partial / 2)
+               if (!kmem_cache_has_cpu_partial(s)
+                       || available > s->cpu_partial / 2)
                        break;
  
        }
@@@ -1884,6 -1893,7 +1894,7 @@@ redo
  static void unfreeze_partials(struct kmem_cache *s,
                struct kmem_cache_cpu *c)
  {
+ #ifdef CONFIG_SLUB_CPU_PARTIAL
        struct kmem_cache_node *n = NULL, *n2 = NULL;
        struct page *page, *discard_page = NULL;
  
                discard_slab(s, page);
                stat(s, FREE_SLAB);
        }
+ #endif
  }
  
  /*
   */
  static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
  {
+ #ifdef CONFIG_SLUB_CPU_PARTIAL
        struct page *oldpage;
        int pages;
        int pobjects;
  
+       if (!s->cpu_partial)
+               return;
        do {
                pages = 0;
                pobjects = 0;
                page->next = oldpage;
  
        } while (this_cpu_cmpxchg(s->cpu_slab->partial, oldpage, page) != oldpage);
+ #endif
  }
  
  static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
@@@ -2358,7 -2374,7 +2375,7 @@@ redo
  
        object = c->freelist;
        page = c->page;
-       if (unlikely(!object || !node_match(page, node)))
+       if (unlikely(!object || !page || !node_match(page, node)))
                object = __slab_alloc(s, gfpflags, node, addr, c);
  
        else {
@@@ -2495,7 -2511,7 +2512,7 @@@ static void __slab_free(struct kmem_cac
                new.inuse--;
                if ((!new.inuse || !prior) && !was_frozen) {
  
-                       if (!kmem_cache_debug(s) && !prior)
+                       if (kmem_cache_has_cpu_partial(s) && !prior)
  
                                /*
                                 * Slab was on no list before and will be partially empty
         * Objects left in the slab. If it was not on the partial list before
         * then add it.
         */
-       if (kmem_cache_debug(s) && unlikely(!prior)) {
-               remove_full(s, page);
+       if (!kmem_cache_has_cpu_partial(s) && unlikely(!prior)) {
+               if (kmem_cache_debug(s))
+                       remove_full(s, page);
                add_partial(n, page, DEACTIVATE_TO_TAIL);
                stat(s, FREE_ADD_PARTIAL);
        }
@@@ -3059,7 -3076,7 +3077,7 @@@ static int kmem_cache_open(struct kmem_
         *    per node list when we run out of per cpu objects. We only fetch 50%
         *    to keep some capacity around for frees.
         */
-       if (kmem_cache_debug(s))
+       if (!kmem_cache_has_cpu_partial(s))
                s->cpu_partial = 0;
        else if (s->size >= PAGE_SIZE)
                s->cpu_partial = 2;
@@@ -3426,6 -3443,7 +3444,6 @@@ int kmem_cache_shrink(struct kmem_cach
  }
  EXPORT_SYMBOL(kmem_cache_shrink);
  
 -#if defined(CONFIG_MEMORY_HOTPLUG)
  static int slab_mem_going_offline_callback(void *arg)
  {
        struct kmem_cache *s;
@@@ -3540,10 -3558,7 +3558,10 @@@ static int slab_memory_callback(struct 
        return ret;
  }
  
 -#endif /* CONFIG_MEMORY_HOTPLUG */
 +static struct notifier_block slab_memory_callback_nb = {
 +      .notifier_call = slab_memory_callback,
 +      .priority = SLAB_CALLBACK_PRI,
 +};
  
  /********************************************************************
   *                    Basic setup of slabs
@@@ -3600,7 -3615,7 +3618,7 @@@ void __init kmem_cache_init(void
        create_boot_cache(kmem_cache_node, "kmem_cache_node",
                sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN);
  
 -      hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI);
 +      register_hotmemory_notifier(&slab_memory_callback_nb);
  
        /* Able to allocate the per node structures */
        slab_state = PARTIAL;
@@@ -4456,7 -4471,7 +4474,7 @@@ static ssize_t cpu_partial_store(struc
        err = strict_strtoul(buf, 10, &objects);
        if (err)
                return err;
-       if (objects && kmem_cache_debug(s))
+       if (objects && !kmem_cache_has_cpu_partial(s))
                return -EINVAL;
  
        s->cpu_partial = objects;
@@@ -5269,7 -5284,6 +5287,6 @@@ __initcall(slab_sysfs_init)
  #ifdef CONFIG_SLABINFO
  void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo)
  {
-       unsigned long nr_partials = 0;
        unsigned long nr_slabs = 0;
        unsigned long nr_objs = 0;
        unsigned long nr_free = 0;
                if (!n)
                        continue;
  
-               nr_partials += n->nr_partial;
-               nr_slabs += atomic_long_read(&n->nr_slabs);
-               nr_objs += atomic_long_read(&n->total_objects);
+               nr_slabs += node_nr_slabs(n);
+               nr_objs += node_nr_objs(n);
                nr_free += count_partial(n, count_free);
        }