Skip to content
  1. Feb 01, 2014
  2. Jan 31, 2014
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · e7651b81
      Linus Torvalds authored
      Pull btrfs updates from Chris Mason:
       "This is a pretty big pull, and most of these changes have been
        floating in btrfs-next for a long time.  Filipe's properties work is a
        cool building block for inheriting attributes like compression down on
        a per inode basis.
      
        Jeff Mahoney kicked in code to export filesystem info into sysfs.
      
        Otherwise, lots of performance improvements, cleanups and bug fixes.
      
        Looks like there are still a few other small pending incrementals, but
        I wanted to get the bulk of this in first"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (149 commits)
        Btrfs: fix spin_unlock in check_ref_cleanup
        Btrfs: setup inode location during btrfs_init_inode_locked
        Btrfs: don't use ram_bytes for uncompressed inline items
        Btrfs: fix btrfs_search_slot_for_read backwards iteration
        Btrfs: do not export ulist functions
        Btrfs: rework ulist with list+rb_tree
        Btrfs: fix memory leaks on walking backrefs failure
        Btrfs: fix send file hole detection leading to data corruption
        Btrfs: add a reschedule point in btrfs_find_all_roots()
        Btrfs: make send's file extent item search more efficient
        Btrfs: fix to catch all errors when resolving indirect ref
        Btrfs: fix protection between walking backrefs and root deletion
        btrfs: fix warning while merging two adjacent extents
        Btrfs: fix infinite path build loops in incremental send
        btrfs: undo sysfs when open_ctree() fails
        Btrfs: fix snprintf usage by send's gen_unique_name
        btrfs: fix defrag 32-bit integer overflow
        btrfs: sysfs: list the NO_HOLES feature
        btrfs: sysfs: don't show reserved incompat feature
        btrfs: call permission checks earlier in ioctls and return EPERM
        ...
      e7651b81
    • Linus Torvalds's avatar
      Merge tag 'upstream-3.14-rc1' of git://git.infradead.org/linux-ubifs · 060e8e3b
      Linus Torvalds authored
      Pull ubifs updates from Artem Bityutskiy:
      
       - Improve the NOR erasure quirk - now it tries to do as little writes
         as possible, because the eraseblock may be in an "unstable" state and
         write operation sometimes causes NOR chip lock-ups.
      
       - Both UBI and UBIFS changes are now maintainer in one single tree,
         because the amount of changes dropped significantly.
      
      * tag 'upstream-3.14-rc1' of git://git.infradead.org/linux-ubifs:
        UBI: avoid program operation on NOR flash after erasure interrupted
        MAINTAINERS: keep UBI and UBIFS stuff in the same tree
        UBI: fix error return code
      060e8e3b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 271bf66d
      Linus Torvalds authored
      Pull some further ceph acl cleanups from Sage Weil:
       "I do have a couple patches on top of what's in your tree, though, that
        clean up a couple duplicated lines in your fix and apply Christoph's
        cleanup"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        ceph: simplify ceph_{get,init}_acl
        ceph: remove duplicate declaration of ceph_setattr
      271bf66d
    • Christoph Hellwig's avatar
      ceph: simplify ceph_{get,init}_acl · 75858236
      Christoph Hellwig authored
      
      
       - ->get_acl only gets called after we checked for a cached ACL, so no
         need to call get_cached_acl again.
       - no need to check IS_POSIXACL in ->get_acl, without that it should
         never get set as all the callers that set it already have the check.
       - you should be able to use the full posix_acl_create in CEPH
      
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      75858236
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew Morton) · aa2e7100
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "A few hotfixes and various leftovers which were awaiting other merges.
      
        Mainly movement of zram into mm/"
      
      * emailed patches fron Andrew Morton <akpm@linux-foundation.org>: (25 commits)
        memcg: fix mutex not unlocked on memcg_create_kmem_cache fail path
        Documentation/filesystems/vfs.txt: update file_operations documentation
        mm, oom: base root bonus on current usage
        mm: don't lose the SOFT_DIRTY flag on mprotect
        mm/slub.c: fix page->_count corruption (again)
        mm/mempolicy.c: fix mempolicy printing in numa_maps
        zram: remove zram->lock in read path and change it with mutex
        zram: remove workqueue for freeing removed pending slot
        zram: introduce zram->tb_lock
        zram: use atomic operation for stat
        zram: remove unnecessary free
        zram: delay pending free request in read path
        zram: fix race between reset and flushing pending work
        zsmalloc: add maintainers
        zram: add zram maintainers
        zsmalloc: add copyright
        zram: add copyright
        zram: remove old private project comment
        zram: promote zram from staging
        zsmalloc: move it under mm
        ...
      aa2e7100
    • PaX Team's avatar
      x86, x32: Correct invalid use of user timespec in the kernel · 2def2ef2
      PaX Team authored
      
      
      The x32 case for the recvmsg() timout handling is broken:
      
        asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
                                            unsigned int vlen, unsigned int flags,
                                            struct compat_timespec __user *timeout)
        {
                int datagrams;
                struct timespec ktspec;
      
                if (flags & MSG_CMSG_COMPAT)
                        return -EINVAL;
      
                if (COMPAT_USE_64BIT_TIME)
                        return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                              flags | MSG_CMSG_COMPAT,
                                              (struct timespec *) timeout);
                ...
      
      The timeout pointer parameter is provided by userland (hence the __user
      annotation) but for x32 syscalls it's simply cast to a kernel pointer
      and is passed to __sys_recvmmsg which will eventually directly
      dereference it for both reading and writing.  Other callers to
      __sys_recvmmsg properly copy from userland to the kernel first.
      
      The bug was introduced by commit ee4fa23c ("compat: Use
      COMPAT_USE_64BIT_TIME in net/compat.c") and should affect all kernels
      since 3.4 (and perhaps vendor kernels if they backported x32 support
      along with this code).
      
      Note that CONFIG_X86_X32_ABI gets enabled at build time and only if
      CONFIG_X86_X32 is enabled and ld can build x32 executables.
      
      Other uses of COMPAT_USE_64BIT_TIME seem fine.
      
      This addresses CVE-2014-0038.
      
      Signed-off-by: default avatarPaX Team <pageexec@freemail.hu>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v3.4+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2def2ef2
    • Linus Torvalds's avatar
      Merge branch 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 12f2bbd6
      Linus Torvalds authored
      Pull x86 asmlinkage (LTO) changes from Peter Anvin:
       "This patchset adds more infrastructure for link time optimization
        (LTO).
      
        This patchset was pulled into my tree late because of a
        miscommunication (part of the patchset was picked up by other
        maintainers).  However, the patchset is strictly build-related and
        seems to be okay in testing"
      
      * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, asmlinkage, xen: Fix type of NMI
        x86, asmlinkage, xen, kvm: Make {xen,kvm}_lock_spinning global and visible
        x86: Use inline assembler instead of global register variable to get sp
        x86, asmlinkage, paravirt: Make paravirt thunks global
        x86, asmlinkage, paravirt: Don't rely on local assembler labels
        x86, asmlinkage, lguest: Fix C functions used by inline assembler
      12f2bbd6
    • Linus Torvalds's avatar
      Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 10ffe3db
      Linus Torvalds authored
      Pull x86 build bits from Peter Anvin:
       "Various build-related minor bits.
      
        Most of this is work by David Woodhouse to be able to compile the
        early boot code with clang/llvm; we have also managed to push an
        actual -m16 option into gcc 4.9 so this makes us use that option if
        available instead of hacking it.
      
        The balance is a patch from Michael Davidson to the relocs program to
        help manual debugging.
      
        None of these should change the actual compiled binary with currently
        released compilers"
      
      * 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, build: Build 16-bit code with -m16 where possible
        x86, boot: Fix word-size assumptions in has_eflag() inline asm
        x86, boot: Use __attribute__((used)) to ensure videocard structs are emitted
        x86: Remove duplication of 16-bit CFLAGS
        x86, relocs: Add manual debug mode
      10ffe3db
    • Linus Torvalds's avatar
      Merge tag 'late-dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · f8a504c4
      Linus Torvalds authored
      Pull ARM SoC late changes from Kevin Hilman:
       "These are changes that arrived a little late but were considered
        self-contained enough to still go in for v3.14.
      
        They are all device tree updtes this time around, and mainly for
        Broadcom SoCs"
      
      * tag 'late-dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: moxart: move fixed rate clock child node to board level dts
        clk: bcm281xx: define kona clock binding
        ARM: dts: add usb udc support to bcm281xx
        ARM: dts: Specify clocks for timer on bcm11351
        Documentation: dt: kona-timer: Add clocks property
        ARM: dts: Specify clocks for SDHCIs on bcm11351
        Documentation: dt: kona-sdhci: Add clocks property
        ARM: dts: Specify clocks for UARTs on bcm11351
        ARM: dts: bcm281xx: Add i2c busses
        ARM: dts: Declare clocks as fixed on bcm11351
        ARM: dts: bcm28155-ap: Enable all the i2c busses
      f8a504c4
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · cdfc8307
      Linus Torvalds authored
      Pull MIPS updates from Ralf Baechle:
       "The most notable new addition inside this pull request is the support
        for MIPS's latest and greatest core called "inter/proAptiv".  The
        patch series describes this core as follows.
      
          "The interAptiv is a power-efficient multi-core microprocessor
           for use in system-on-chip (SoC) applications. The interAptiv combines
           a multi-threading pipeline with a coherence manager to deliver improved
           computational throughput and power efficiency. The interAptiv can
           contain one to four MIPS32R3 interAptiv cores, system level
           coherence manager with L2 cache, optional coherent I/O port,
           and optional floating point unit."
      
        The platform specific patches touch all 3 Broadcom families.  It adds
        support for the new Broadcom/Netlogix XLP9xx Soc, building a common
        BCM63XX SMP kernel for all BCM63XX SoCs regardless of core type/count
        and full gpio button/led descriptions for BCM47xx.
      
        The rest of the series are cleanups and bug fixes that are MIPS
        generic and consist largely of changes that Imgtec/MIPS had published
        in their linux-mti-3.10.git stable tree.  Random other cleanups and
        patches preparing code to be merged in 3.15"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (139 commits)
        mips: select ARCH_MIGHT_HAVE_PC_SERIO
        mips: delete non-required instances of include <linux/init.h>
        MIPS: KVM: remove shadow_tlb code
        MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI
        mips/ide: flush dcache also if icache does not snoop dcache
        MIPS: BCM47XX: fix position of cpu_wait disabling
        MIPS: BCM63XX: select correct MIPS_L1_CACHE_SHIFT value
        MIPS: update MIPS_L1_CACHE_SHIFT based on MIPS_L1_CACHE_SHIFT_<N>
        MIPS: introduce MIPS_L1_CACHE_SHIFT_<N>
        MIPS: ZBOOT: gather string functions into string.c
        arch/mips/pci: don't check resource with devm_ioremap_resource
        arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource
        bcma: gpio: don't cast u32 to unsigned long
        ssb: gpio: add own IRQ domain
        MIPS: BCM47XX: fix sparse warnings in board.c
        MIPS: BCM47XX: add board detection for Linksys WRT54GS V1
        MIPS: BCM47XX: fix detection for some boards
        MIPS: BCM47XX: Enable buttons support on SSB
        MIPS: BCM47XX: Convert WNDR4500 to new syntax
        MIPS: BCM47XX: Use "timer" trigger for status LEDs
        ...
      cdfc8307
    • Linus Torvalds's avatar
      Merge tag 'for-3.14' of git://openrisc.net/~jonas/linux · 04a24ae4
      Linus Torvalds authored
      Pull OpenRISC updates from Jonas Bonn:
       "The interesting change here is a rework of the OpenRISC signal
        handling to make it more like other architectures in the hopes that
        this makes it easier for others to comment on and understand.  This
        rework fixes some real bugs, like the fact that syscall restart did
        not work reliably"
      
      * tag 'for-3.14' of git://openrisc.net/~jonas/linux:
        openrisc: Use get_signal() signal_setup_done()
        openrisc: Rework signal handling
      04a24ae4
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 4bcec913
      Linus Torvalds authored
      Pull more powerpc bits from Ben Herrenschmidt:
       "Here are a few more powerpc bits for this merge window.  The bulk is
        made of two pull requests from Scott and Anatolij that I had missed
        previously (they arrived while I was away).  Since both their branches
        are in -next independently, and the content has been around for a
        little while, they can still go in.
      
        The rest is mostly bug and regression fixes, a small series of
        cleanups to our pseries cpuidle code (including moving it to the right
        place), and one new cpuidle bakend for the powernv platform.  I also
        wired up the new sched_attr syscalls"
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (37 commits)
        powerpc: Wire up sched_setattr and sched_getattr syscalls
        powerpc/hugetlb: Replace __get_cpu_var with get_cpu_var
        powerpc: Make sure "cache" directory is removed when offlining cpu
        powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space
        powerpc/powernv/cpuidle: Back-end cpuidle driver for powernv platform.
        powerpc/pseries/cpuidle: smt-snooze-delay cleanup.
        powerpc/pseries/cpuidle: Remove MAX_IDLE_STATE macro.
        powerpc/pseries/cpuidle: Make cpuidle-pseries backend driver a non-module.
        powerpc/pseries/cpuidle: Use cpuidle_register() for initialisation.
        powerpc/pseries/cpuidle: Move processor_idle.c to drivers/cpuidle.
        powerpc: Fix 32-bit frames for signals delivered when transactional
        powerpc/iommu: Fix initialisation of DART iommu table
        powerpc/numa: Fix decimal permissions
        powerpc/mm: Fix compile error of pgtable-ppc64.h
        powerpc: Fix hw breakpoints on !HAVE_HW_BREAKPOINT configurations
        clk: corenet: Adds the clock binding
        powerpc/booke64: Guard e6500 tlb handler with CONFIG_PPC_FSL_BOOK3E
        powerpc/512x: dts: add MPC5125 clock specs
        powerpc/512x: clk: support MPC5121/5123/5125 SoC variants
        powerpc/512x: clk: enforce even SDHC divider values
        ...
      4bcec913
    • Linus Torvalds's avatar
      Merge branch 'drop-time' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · 03c7287d
      Linus Torvalds authored
      Pull __TIME__/__DATE__ removal from Michal Marek:
       "This series by Josh finishes the removal of __DATE__ and __TIME__ from
        the kernel.  The last patch adds -Werror=date-time to KBUILD_CFLAGS to
        stop these from reappearing.
      
        Part of the series went through Greg's trees during this merge window,
        which is why this pull request is not based on v3.13-rc1"
      
      * 'drop-time' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        Makefile: Build with -Werror=date-time if the compiler supports it
        x86: math-emu: Drop already-disabled print of build date
        net: wireless: brcm80211: Drop debug version with build date/time
        mtd: denali: Drop print of build date/time
      03c7287d
    • Linus Torvalds's avatar
      Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · 597690cd
      Linus Torvalds authored
      Pull kbuild changes from Michal Marek:
       - fix make -s detection with make-4.0
       - fix for scripts/setlocalversion when the kernel repository is a
         submodule
       - do not hardcode ';' in macros that expand to assembler code, as some
         architectures' assemblers use a different character for newline
       - Fix passing --gdwarf-2 to the assembler
      
      * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        frv: Remove redundant debugging info flag
        mn10300: Remove redundant debugging info flag
        kbuild: Fix debugging info generation for .S files
        arch: use ASM_NL instead of ';' for assembler new line character in the macro
        kbuild: Fix silent builds with make-4
        Fix detectition of kernel git repository in setlocalversion script [take #2]
      597690cd
    • Vladimir Davydov's avatar
      memcg: fix mutex not unlocked on memcg_create_kmem_cache fail path · 7c094fd6
      Vladimir Davydov authored
      
      
      Commit 842e2873 ("memcg: get rid of kmem_cache_dup()") introduced a
      mutex for memcg_create_kmem_cache() to protect the tmp_name buffer that
      holds the memcg name.  It failed to unlock the mutex if this buffer
      could not be allocated.
      
      This patch fixes the issue by appropriately unlocking the mutex if the
      allocation fails.
      
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Glauber Costa <glommer@parallels.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7c094fd6
    • Richard Yao's avatar
      Documentation/filesystems/vfs.txt: update file_operations documentation · 46bf16c4
      Richard Yao authored
      
      
      ->readv, ->writev and ->sendfile have been removed while ->show_fdinfo
      has been added. The documentation should reflect this.
      
      Signed-off-by: default avatarRichard Yao <ryao@gentoo.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      46bf16c4
    • David Rientjes's avatar
      mm, oom: base root bonus on current usage · 778c14af
      David Rientjes authored
      
      
      A 3% of system memory bonus is sometimes too excessive in comparison to
      other processes.
      
      With commit a63d83f4 ("oom: badness heuristic rewrite"), the OOM
      killer tries to avoid killing privileged tasks by subtracting 3% of
      overall memory (system or cgroup) from their per-task consumption.  But
      as a result, all root tasks that consume less than 3% of overall memory
      are considered equal, and so it only takes 33+ privileged tasks pushing
      the system out of memory for the OOM killer to do something stupid and
      kill dhclient or other root-owned processes.  For example, on a 32G
      machine it can't tell the difference between the 1M agetty and the 10G
      fork bomb member.
      
      The changelog describes this 3% boost as the equivalent to the global
      overcommit limit being 3% higher for privileged tasks, but this is not
      the same as discounting 3% of overall memory from _every privileged task
      individually_ during OOM selection.
      
      Replace the 3% of system memory bonus with a 3% of current memory usage
      bonus.
      
      By giving root tasks a bonus that is proportional to their actual size,
      they remain comparable even when relatively small.  In the example
      above, the OOM killer will discount the 1M agetty's 256 badness points
      down to 179, and the 10G fork bomb's 262144 points down to 183500 points
      and make the right choice, instead of discounting both to 0 and killing
      agetty because it's first in the task list.
      
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Reported-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      778c14af
    • Andrey Vagin's avatar
      mm: don't lose the SOFT_DIRTY flag on mprotect · 24f91eba
      Andrey Vagin authored
      
      
      The SOFT_DIRTY bit shows that the content of memory was changed after a
      defined point in the past.  mprotect() doesn't change the content of
      memory, so it must not change the SOFT_DIRTY bit.
      
      This bug causes a malfunction: on the first iteration all pages are
      dumped.  On other iterations only pages with the SOFT_DIRTY bit are
      dumped.  So if the SOFT_DIRTY bit is cleared from a page by mistake, the
      page is not dumped and its content will be restored incorrectly.
      
      This patch does nothing with _PAGE_SWP_SOFT_DIRTY, becase pte_modify()
      is called only for present pages.
      
      Fixes commit 0f8975ec ("mm: soft-dirty bits for user memory changes
      tracking").
      
      Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
      Acked-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Wen Congyang <wency@cn.fujitsu.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      24f91eba
    • Dave Hansen's avatar
      mm/slub.c: fix page->_count corruption (again) · a0320865
      Dave Hansen authored
      
      
      Commit abca7c49 ("mm: fix slab->page _count corruption when using
      slub") notes that we can not _set_ a page->counters directly, except
      when using a real double-cmpxchg.  Doing so can lose updates to
      ->_count.
      
      That is an absolute rule:
      
              You may not *set* page->counters except via a cmpxchg.
      
      Commit abca7c49 fixed this for the folks who have the slub
      cmpxchg_double code turned off at compile time, but it left the bad case
      alone.  It can still be reached, and the same bug triggered in two
      cases:
      
      1. Turning on slub debugging at runtime, which is available on
         the distro kernels that I looked at.
      2. On 64-bit CPUs with no CMPXCHG16B (some early AMD x86-64
         cpus, evidently)
      
      There are at least 3 ways we could fix this:
      
      1. Take all of the exising calls to cmpxchg_double_slab() and
         __cmpxchg_double_slab() and convert them to take an old, new
         and target 'struct page'.
      2. Do (1), but with the newly-introduced 'slub_data'.
      3. Do some magic inside the two cmpxchg...slab() functions to
         pull the counters out of new_counters and only set those
         fields in page->{inuse,frozen,objects}.
      
      I've done (2) as well, but it's a bunch more code.  This patch is an
      attempt at (3).  This was the most straightforward and foolproof way
      that I could think to do this.
      
      This would also technically allow us to get rid of the ugly
      
      #if defined(CONFIG_HAVE_CMPXCHG_DOUBLE) && \
             defined(CONFIG_HAVE_ALIGNED_STRUCT_PAGE)
      
      in 'struct page', but leaving it alone has the added benefit that
      'counters' stays 'unsigned' instead of 'unsigned long', so all the
      copies that the slub code does stay a bit smaller.
      
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a0320865
    • David Rientjes's avatar
      mm/mempolicy.c: fix mempolicy printing in numa_maps · 8790c71a
      David Rientjes authored
      
      
      As a result of commit 5606e387 ("mm: numa: Migrate on reference
      policy"), /proc/<pid>/numa_maps prints the mempolicy for any <pid> as
      "prefer:N" for the local node, N, of the process reading the file.
      
      This should only be printed when the mempolicy of <pid> is
      MPOL_PREFERRED for node N.
      
      If the process is actually only using the default mempolicy for local
      node allocation, make sure "default" is printed as expected.
      
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Reported-by: default avatarRobert Lippert <rlippert@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>	[3.7+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8790c71a
    • Minchan Kim's avatar
      zram: remove zram->lock in read path and change it with mutex · e46e3315
      Minchan Kim authored
      
      
      Finally, we separated zram->lock dependency from 32bit stat/ table
      handling so there is no reason to use rw_semaphore between read and
      write path so this patch removes the lock from read path totally and
      changes rw_semaphore with mutex.  So, we could do
      
      old:
      
        read-read: OK
        read-write: NO
        write-write: NO
      
      Now:
      
        read-read: OK
        read-write: OK
        write-write: NO
      
      The below data proves mixed workload performs well 11 times and there is
      also enhance on write-write path because current rw-semaphore doesn't
      support SPIN_ON_OWNER.  It's side effect but anyway good thing for us.
      
      Write-related tests perform better (from 61% to 1058%) but read path has
      good/bad(from -2.22% to 1.45%) but they are all marginal within stddev.
      
        CPU 12
        iozone -t -T -l 12 -u 12 -r 16K -s 60M -I +Z -V 0
      
        ==Initial write                ==Initial write
        records: 10                    records: 10
        avg:  516189.16                avg:  839907.96
        std:   22486.53 (4.36%)        std:   47902.17 (5.70%)
        max:  546970.60                max:  909910.35
        min:  481131.54                min:  751148.38
        ==Rewrite                      ==Rewrite
        records: 10                    records: 10
        avg:  509527.98                avg: 1050156.37
        std:   45799.94 (8.99%)        std:   40695.44 (3.88%)
        max:  611574.27                max: 1111929.26
        min:  443679.95                min:  980409.62
        ==Read                         ==Read
        records: 10                    records: 10
        avg: 4408624.17                avg: 4472546.76
        std:  281152.61 (6.38%)        std:  163662.78 (3.66%)
        max: 4867888.66                max: 4727351.03
        min: 4058347.69                min: 4126520.88
        ==Re-read                      ==Re-read
        records: 10                    records: 10
        avg: 4462147.53                avg: 4363257.75
        std:  283546.11 (6.35%)        std:  247292.63 (5.67%)
        max: 4912894.44                max: 4677241.75
        min: 4131386.50                min: 4035235.84
        ==Reverse Read                 ==Reverse Read
        records: 10                    records: 10
        avg: 4565865.97                avg: 4485818.08
        std:  313395.63 (6.86%)        std:  248470.10 (5.54%)
        max: 5232749.16                max: 4789749.94
        min: 4185809.62                min: 3963081.34
        ==Stride read                  ==Stride read
        records: 10                    records: 10
        avg: 4515981.80                avg: 4418806.01
        std:  211192.32 (4.68%)        std:  212837.97 (4.82%)
        max: 4889287.28                max: 4686967.22
        min: 4210362.00                min: 4083041.84
        ==Random read                  ==Random read
        records: 10                    records: 10
        avg: 4410525.23                avg: 4387093.18
        std:  236693.22 (5.37%)        std:  235285.23 (5.36%)
        max: 4713698.47                max: 4669760.62
        min: 4057163.62                min: 3952002.16
        ==Mixed workload               ==Mixed workload
        records: 10                    records: 10
        avg:  243234.25                avg: 2818677.27
        std:   28505.07 (11.72%)       std:  195569.70 (6.94%)
        max:  288905.23                max: 3126478.11
        min:  212473.16                min: 2484150.69
        ==Random write                 ==Random write
        records: 10                    records: 10
        avg:  555887.07                avg: 1053057.79
        std:   70841.98 (12.74%)       std:   35195.36 (3.34%)
        max:  683188.28                max: 1096125.73
        min:  437299.57                min:  992481.93
        ==Pwrite                       ==Pwrite
        records: 10                    records: 10
        avg:  501745.93                avg:  810363.09
        std:   16373.54 (3.26%)        std:   19245.01 (2.37%)
        max:  518724.52                max:  833359.70
        min:  464208.73                min:  765501.87
        ==Pread                        ==Pread
        records: 10                    records: 10
        avg: 4539894.60                avg: 4457680.58
        std:  197094.66 (4.34%)        std:  188965.60 (4.24%)
        max: 4877170.38                max: 4689905.53
        min: 4226326.03                min: 4095739.72
      
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e46e3315
    • Minchan Kim's avatar
      zram: remove workqueue for freeing removed pending slot · f614a9f4
      Minchan Kim authored
      
      
      Commit a0c516cb ("zram: don't grab mutex in zram_slot_free_noity")
      introduced free request pending code to avoid scheduling by mutex under
      spinlock and it was a mess which made code lenghty and increased
      overhead.
      
      Now, we don't need zram->lock any more to free slot so this patch
      reverts it and then, tb_lock should protect it.
      
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f614a9f4