1. 05 Jul, 2014 9 commits
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 75bf757e
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "This week's arm-soc fixes:
      
         - A set of of OMAP patches that we had missed Tony's pull request of:
           * Reset fix for am43xx
           * Proper OPP table for omap5
           * Fix for SoC detection of one of the DRA7 SoCs
           * hwmod updates to get SATA and OCP to work on omap5 (drivers
             merged in 3.16)
           * ... plus a handful of smaller fixes
         - sunxi needed to re-add machine specific restart code that was
           removed in anticipation of a watchdog driver being merged for 3.16,
           and it didn't make it in.
         - Marvell fixes for PCIe on SMP and a big-endian fix.
         - A trivial defconfig update to make my capri test board boot with
           bcm_defconfig again.
      
        ... and a couple of MAINTAINERS updates, one to claim new Keystone
        drivers that have been merged, and one to merge MXS and i.MX (both
        Freescale platforms).
      
        The largest diffs come from the hwmod code for omap5 and the re-add of
        the restart code on sunxi.  The hwmod stuff is quite late at this
        point but it slipped through cracks repeatedly while coming up the
        maintainer chain and only affects the one SoC so risk is low"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        MAINTAINERS: Add few more Keystone drivers
        MAINTAINERS: merge MXS entry into IMX one
        ARM: sunxi: Reintroduce the restart code for A10/A20 SoCs
        ARM: mvebu: fix cpuidle implementation to work on big-endian systems
        ARM: mvebu: update L2/PCIe deadlock workaround after L2CC cleanup
        ARM: mvebu: move Armada 375 external abort logic as a quirk
        ARM: bcm: Fix bcm and multi_v7 defconfigs
        ARM: dts: dra7-evm: remove interrupt binding
        ARM: OMAP2+: Fix parser-bug in platform muxing code
        ARM: DTS: dra7/dra7xx-clocks: ATL related changes
        ARM: OMAP2+: drop unused function
        ARM: dts: am43x-epos-evm: Add Missing cpsw-phy-sel for am43x-epos-evm
        ARM: dts: omap5: Update CPU OPP table as per final production Manual
        ARM: DRA722: add detection of SoC information
        ARM: dts: Enable twl4030 off-idle configuration for selected omaps
        ARM: OMAP5: hwmod: Add ocp2scp3 and sata hwmods
        ARM: OMAP2+: hwmod: Change hardreset soc_ops for AM43XX
      75bf757e
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 549f11c9
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A few minor fixlets in ARM SoC irq drivers and a fix for a memory leak
        which I introduced in the last round of cleanups :("
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Fix memory leak when calling irq_free_hwirqs()
        irqchip: spear_shirq: Fix interrupt offset
        irqchip: brcmstb-l2: Level-2 interrupts are edge sensitive
        irqchip: armada-370-xp: Mask all interrupts during initialization.
      549f11c9
    • Keith Busch's avatar
      genirq: Fix memory leak when calling irq_free_hwirqs() · 8844aad8
      Keith Busch authored
      irq_free_hwirqs() always calls irq_free_descs() with a cnt == 0
      which makes it a no-op since the interrupt count to free is
      decremented in itself.
      
      Fixes: 7b6ef126Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Link: http://lkml.kernel.org/r/1404167084-8070-1-git-send-email-keith.busch@intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8844aad8
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · e1a08b85
      Linus Torvalds authored
      Pull ARM64 fixes from Catalin Marinas:
       - Exception level check at boot time (for completeness, not triggering
         any bug before)
       - I/D-cache synchronisation logic for huge pages
       - Config symbol typo
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: fix el2_setup check of CurrentEL
        arm64: mm: Make icache synchronisation logic huge page aware
        arm64: mm: Fix horrendous config typo
      e1a08b85
    • Santosh Shilimkar's avatar
      MAINTAINERS: Add few more Keystone drivers · bc6aa566
      Santosh Shilimkar authored
      Update MAINTAINERS file for recently added reset controller, AEMIF
      and clocksource driver for Keystone SOCs.
      
      The EMIF memory controller driver is also added along with AEMIF.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Kevin Hilman <khilman@linaro.org>
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      bc6aa566
    • Shawn Guo's avatar
      MAINTAINERS: merge MXS entry into IMX one · ce515a6b
      Shawn Guo authored
      The mach-mxs platform is actually co-maintained by myself and
      pengutronix folks.  Also it's hosted in the same kernel tree as IMX.
      So let's merge the entry into IMX one.
      Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
      Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      ce515a6b
    • Olof Johansson's avatar
      Merge tag 'mvebu-fixes-3.16-2' of git://git.infradead.org/linux-mvebu into fixes · 25d11631
      Olof Johansson authored
      mvebu fixes for v3.16 (round #2)
      
       - mvebu
          - Fix PCIe deadlock now that SMP is enabled
          - Fix cpuidle for big-endian systems
      
      * tag 'mvebu-fixes-3.16-2' of git://git.infradead.org/linux-mvebu:
        ARM: mvebu: fix cpuidle implementation to work on big-endian systems
        ARM: mvebu: update L2/PCIe deadlock workaround after L2CC cleanup
        ARM: mvebu: move Armada 375 external abort logic as a quirk
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      25d11631
    • Maxime Ripard's avatar
      ARM: sunxi: Reintroduce the restart code for A10/A20 SoCs · d767af5e
      Maxime Ripard authored
      This partly reverts commits 55360050 (ARM: sunxi: Remove reset code from
      the platform) and 5e669ec5 (ARM: sunxi: Remove init_machine callback) for
      the sun4i, sun5i and sun7i families.
      
      This is needed because the watchdog counterpart of these commits was dropped,
      and didn't make it into 3.16. In order to still be able to reboot the board, we
      need to reintroduce that code. Of course, the long term view is still to get
      rid of that code in mach-sunxi.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      d767af5e
    • Olof Johansson's avatar
      Merge tag 'omap-for-v3.16/fixes-against-rc1' of... · 5acd78c5
      Olof Johansson authored
      Merge tag 'omap-for-v3.16/fixes-against-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
      
      Merge OMAP fixes from Tony Lindgren:
      
      Fixes for omaps for issues discovered during the merge window and
      enabling of a few features that had to wait for the driver
      dependencies to clear.
      
      The fixes included are:
      
      - Fix am43xx hard reset flags
      - Fix SoC detection for DRA722
      - Fix CPU OPP table for omap5
      - Fix legacy mux parser bug if requested muxname is a prefix of
        multiple mux entries
      - Fix qspi interrupt binding that relies on the irq crossbar
        that has not yet been enabled
      - Add missing phy_sel for am43x-epos-evm
      - Drop unused gic_init_irq() that is no longer needed
      
      And the enabling of features that had driver dependencies are:
      
      - Change dra7 to use Audio Tracking Logic clock instead of a fixed
        clock now that the clock driver for it has been merged
      
      - Enable off idle configuration for selected omaps as all the kernel
        dependencies for device tree based booting are finally merged as
        this is needed to get the automated PM tests working finally with
        device tree based booting
      
      - Add hwmod entry for ocp2scp3 for omap5 to get sata working as
        all the driver dependencies are now in the kernel and this patch
        fell through the cracks during the merge window
      
      * tag 'omap-for-v3.16/fixes-against-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
        ARM: dts: dra7-evm: remove interrupt binding
        ARM: OMAP2+: Fix parser-bug in platform muxing code
        ARM: DTS: dra7/dra7xx-clocks: ATL related changes
        ARM: OMAP2+: drop unused function
        ARM: dts: am43x-epos-evm: Add Missing cpsw-phy-sel for am43x-epos-evm
        ARM: dts: omap5: Update CPU OPP table as per final production Manual
        ARM: DRA722: add detection of SoC information
        ARM: dts: Enable twl4030 off-idle configuration for selected omaps
        ARM: OMAP5: hwmod: Add ocp2scp3 and sata hwmods
        ARM: OMAP2+: hwmod: Change hardreset soc_ops for AM43XX
      5acd78c5
  2. 04 Jul, 2014 15 commits
  3. 03 Jul, 2014 16 commits
    • Greg Kroah-Hartman's avatar
      lz4: add overrun checks to lz4_uncompress_unknownoutputsize() · 4a3a9904
      Greg Kroah-Hartman authored
      Jan points out that I forgot to make the needed fixes to the
      lz4_uncompress_unknownoutputsize() function to mirror the changes done
      in lz4_decompress() with regards to potential pointer overflows.
      
      The only in-kernel user of this function is the zram code, which only
      takes data from a valid compressed buffer that it made itself, so it's
      not a big issue.  But due to external kernel modules using this
      function, it's better to be safe here.
      Reported-by: default avatarJan Beulich <JBeulich@suse.com>
      Cc: "Don A. Bailey" <donb@securitymouse.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a3a9904
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew Morton) · 5170a3b2
      Linus Torvalds authored
      Merge fixes from Andrew Morton:
       "14 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        shmem: fix init_page_accessed use to stop !PageLRU bug
        kernel/printk/printk.c: revert "printk: enable interrupts before calling console_trylock_for_printk()"
        tools/testing/selftests/ipc/msgque.c: improve error handling when not running as root
        fs/seq_file: fallback to vmalloc allocation
        /proc/stat: convert to single_open_size()
        hwpoison: fix the handling path of the victimized page frame that belong to non-LRU
        mm:vmscan: update the trace-vmscan-postprocess.pl for event vmscan/mm_vmscan_lru_isolate
        msync: fix incorrect fstart calculation
        zram: revalidate disk after capacity change
        tools: memory-hotplug fix unexpected operator error
        tools: cpu-hotplug fix unexpected operator error
        autofs4: fix false positive compile error
        slub: fix off by one in number of slab tests
        mm: page_alloc: fix CMA area initialisation when pageblock > MAX_ORDER
      5170a3b2
    • Hugh Dickins's avatar
      shmem: fix init_page_accessed use to stop !PageLRU bug · 66d2f4d2
      Hugh Dickins authored
      Under shmem swapping load, I sometimes hit the VM_BUG_ON_PAGE(!PageLRU)
      in isolate_lru_pages() at mm/vmscan.c:1281!
      
      Commit 2457aec6 ("mm: non-atomically mark page accessed during page
      cache allocation where possible") looks like interrupted work-in-progress.
      
      mm/filemap.c's call to init_page_accessed() is fine, but not mm/shmem.c's
      - shmem_write_begin() is clearly wrong to use it after shmem_getpage(),
      when the page is always visible in radix_tree, and often already on LRU.
      
      Revert change to shmem_write_begin(), and use init_page_accessed() or
      mark_page_accessed() appropriately for SGP_WRITE in shmem_getpage_gfp().
      
      SGP_WRITE also covers shmem_symlink(), which did not mark_page_accessed()
      before; but since many other filesystems use [__]page_symlink(), which did
      and does mark the page accessed, consider this as rectifying an oversight.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      66d2f4d2
    • Andrew Morton's avatar
      kernel/printk/printk.c: revert "printk: enable interrupts before calling... · d18bbc21
      Andrew Morton authored
      kernel/printk/printk.c: revert "printk: enable interrupts before calling console_trylock_for_printk()"
      
      Revert commit 939f04be ("printk: enable interrupts before calling
      console_trylock_for_printk()").
      
      Andreas reported:
      
      : None of the post 3.15 kernel boot for me. They all hang at the GRUB
      : screen telling me it loaded and started the kernel, but the kernel
      : itself stops before it prints anything (or even replaces the GRUB
      : background graphics).
      
      939f04be is modest latency reduction.  Revert it until we understand
      the reason for these failures.
      Reported-by: default avatarAndreas Bombe <aeb@debian.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d18bbc21
    • Shuah Khan's avatar
      tools/testing/selftests/ipc/msgque.c: improve error handling when not running as root · e84f1ab3
      Shuah Khan authored
      The test fails in the middle when it is not run as root while accessing
      /proc/sys/kernel/msg_next_id.  Changed it to check for root at the
      beginning of the test and exit if not root.
      Signed-off-by: default avatarShuah Khan <shuah.kh@samsung.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Davidlohr Bueso <davidlohr@hp.com>
      Cc: Colin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e84f1ab3
    • Heiko Carstens's avatar
      fs/seq_file: fallback to vmalloc allocation · 058504ed
      Heiko Carstens authored
      There are a couple of seq_files which use the single_open() interface.
      This interface requires that the whole output must fit into a single
      buffer.
      
      E.g.  for /proc/stat allocation failures have been observed because an
      order-4 memory allocation failed due to memory fragmentation.  In such
      situations reading /proc/stat is not possible anymore.
      
      Therefore change the seq_file code to fallback to vmalloc allocations
      which will usually result in a couple of order-0 allocations and hence
      also work if memory is fragmented.
      
      For reference a call trace where reading from /proc/stat failed:
      
        sadc: page allocation failure: order:4, mode:0x1040d0
        CPU: 1 PID: 192063 Comm: sadc Not tainted 3.10.0-123.el7.s390x #1
        [...]
        Call Trace:
          show_stack+0x6c/0xe8
          warn_alloc_failed+0xd6/0x138
          __alloc_pages_nodemask+0x9da/0xb68
          __get_free_pages+0x2e/0x58
          kmalloc_order_trace+0x44/0xc0
          stat_open+0x5a/0xd8
          proc_reg_open+0x8a/0x140
          do_dentry_open+0x1bc/0x2c8
          finish_open+0x46/0x60
          do_last+0x382/0x10d0
          path_openat+0xc8/0x4f8
          do_filp_open+0x46/0xa8
          do_sys_open+0x114/0x1f0
          sysc_tracego+0x14/0x1a
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Tested-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Ian Kent <raven@themaw.net>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thorsten Diehl <thorsten.diehl@de.ibm.com>
      Cc: Andrea Righi <andrea@betterlinux.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Stefan Bader <stefan.bader@canonical.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>
      058504ed
    • Heiko Carstens's avatar
      /proc/stat: convert to single_open_size() · f74373a5
      Heiko Carstens authored
      These two patches are supposed to "fix" failed order-4 memory
      allocations which have been observed when reading /proc/stat.  The
      problem has been observed on s390 as well as on x86.
      
      To address the problem change the seq_file memory allocations to
      fallback to use vmalloc, so that allocations also work if memory is
      fragmented.
      
      This approach seems to be simpler and less intrusive than changing
      /proc/stat to use an interator.  Also it "fixes" other users as well,
      which use seq_file's single_open() interface.
      
      This patch (of 2):
      
      Use seq_file's single_open_size() to preallocate a buffer that is large
      enough to hold the whole output, instead of open coding it.  Also
      calculate the requested size using the number of online cpus instead of
      possible cpus, since the size of the output only depends on the number
      of online cpus.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Ian Kent <raven@themaw.net>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thorsten Diehl <thorsten.diehl@de.ibm.com>
      Cc: Andrea Righi <andrea@betterlinux.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Stefan Bader <stefan.bader@canonical.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>
      f74373a5
    • Chen Yucong's avatar
      hwpoison: fix the handling path of the victimized page frame that belong to non-LRU · 0bc1f8b0
      Chen Yucong authored
      Until now, the kernel has the same policy to handle victimized page
      frames that belong to kernel-space(reserved/slab-subsystem) or
      non-LRU(unknown page state).  In other word, the result of handling
      either of these victimized page frames is (IGNORED | FAILED), and the
      return value of memory_failure() is -EBUSY.
      
      This patch is to avoid that memory_failure() returns very soon due to
      the "true" value of (!PageLRU(p)), and it also ensures that
      action_result() can report more precise information("reserved kernel",
      "kernel slab", and "unknown page state") instead of "non LRU",
      especially for memory errors which are detected by memory-scrubbing.
      
      Andi said:
      
      : While running the mcelog test suite on 3.14 I hit the following VM_BUG_ON:
      :
      : soft_offline: 0x56d4: unknown non LRU page type 3ffff800008000
      : page:ffffea000015b400 count:3 mapcount:2097169 mapping:          (null) index:0xffff8800056d7000
      : page flags: 0x3ffff800004081(locked|slab|head)
      : ------------[ cut here ]------------
      : kernel BUG at mm/rmap.c:1495!
      :
      : I think what happened is that a LRU page turned into a slab page in
      : parallel with offlining.  memory_failure initially tests for this case,
      : but doesn't retest later after the page has been locked.
      :
      : ...
      :
      : I ran this patch in a loop over night with some stress plus
      : the mcelog test suite running in a loop. I cannot guarantee it hit it,
      : but it should have given it a good beating.
      :
      : The kernel survived with no messages, although the mcelog test suite
      : got killed at some point because it couldn't fork anymore. Probably
      : some unrelated problem.
      :
      : So the patch is ok for me for .16.
      Signed-off-by: default avatarChen Yucong <slaoub@gmail.com>
      Acked-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Reported-by: default avatarAndi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0bc1f8b0
    • Chen Yucong's avatar
      mm:vmscan: update the trace-vmscan-postprocess.pl for event vmscan/mm_vmscan_lru_isolate · b27ebf77
      Chen Yucong authored
      When using trace-vmscan-postprocess.pl for checking the file/anon rate
      of scanning, we can find that it can not be performed.  At the same
      time, the following message will be reported:
      
        WARNING: Format not as expected for event vmscan/mm_vmscan_lru_isolate
        'file' != 'contig_taken' Fewer fields than expected in format at
        ./trace-vmscan-postprocess.pl line 171, <FORMAT> line 76.
      
      In trace-vmscan-postprocess.pl, (contig_taken, contig_dirty, and
      contig_failed) are be associated respectively to (nr_lumpy_taken,
      nr_lumpy_dirty, and nr_lumpy_failed) for lumpy reclaim.  Via commit
      c53919ad ("mm: vmscan: remove lumpy reclaim"), lumpy reclaim had
      already been removed by Mel, but the update for
      trace-vmscan-postprocess.pl was missed.
      Signed-off-by: default avatarChen Yucong <slaoub@gmail.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b27ebf77
    • Namjae Jeon's avatar
      msync: fix incorrect fstart calculation · 496a8e68
      Namjae Jeon authored
      Fix a regression caused by 7fc34a62 ("mm/msync.c: sync only the
      requested range in msync()").
      
      xfstests generic/075 fail occured on ext4 data=journal mode because the
      intended range was not syncing due to wrong fstart calculation.
      Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: default avatarAshish Sangwan <a.sangwan@samsung.com>
      Reported-by: default avatarEric Whitney <enwlinux@gmail.com>
      Tested-by: default avatarEric Whitney <enwlinux@gmail.com>
      Acked-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
      Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
      Tested-by: default avatarLukas Czerner <lczerner@redhat.com>
      Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      496a8e68
    • Minchan Kim's avatar
      zram: revalidate disk after capacity change · 2e32baea
      Minchan Kim authored
      Alexander reported mkswap on /dev/zram0 is failed if other process is
      opening the block device file.
      
      Step is as follows,
      
      0. Reset the unused zram device.
      1. Use a program that opens /dev/zram0 with O_RDWR and sleeps
         until killed.
      2. While that program sleeps, echo the correct value to
         /sys/block/zram0/disksize.
      3. Verify (e.g. in /proc/partitions) that the disk size is applied
         correctly. It is.
      4. While that program still sleeps, attempt to mkswap /dev/zram0.
         This fails: mkswap: error: swap area needs to be at least 40 KiB
      
      When I investigated, the size get by ioctl(fd, BLKGETSIZE64, xxx) on
      mkswap to get a size of blockdev was zero although zram0 has right size by
      2.
      
      The reason is zram didn't revalidate disk after changing capacity so that
      size of blockdev's inode is not uptodate until all of file is close.
      
      This patch should fix the BUG.
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Reported-by: default avatarAlexander E. Patrakov <patrakov@gmail.com>
      Tested-by: default avatarAlexander E. Patrakov <patrakov@gmail.com>
      Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarJerome Marchand <jmarchan@redhat.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>
      2e32baea
    • Shuah Khan's avatar
      tools: memory-hotplug fix unexpected operator error · e98f7762
      Shuah Khan authored
      on-off-test uses "$UID != 0" to test for root, but $UID is a construct
      specific to bash.  Using /bin/sh that isn't bash results in the
      following error (due to the "$UID" part expanding to nothing):
      
        ./on-off-test.sh: 9: [: !=: unexpected operator
      
      Change Makefile to use bash instead.
      Signed-off-by: default avatarShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e98f7762
    • Shuah Khan's avatar
      tools: cpu-hotplug fix unexpected operator error · 1bd702e6
      Shuah Khan authored
      on-off-test uses "$UID != 0" to test for root, but $UID is a construct
      specific to bash.  Using /bin/sh that isn't bash results in the
      following error (due to the "$UID" part expanding to nothing):
      
        ./on-off-test.sh: 9: [: !=: unexpected operator
      
      Change Makefile to use bash instead.
      Signed-off-by: default avatarShuah Khan <shuah.kh@samsung.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1bd702e6
    • Ian Kent's avatar
      autofs4: fix false positive compile error · 571ff473
      Ian Kent authored
      On strict build environments we can see:
      
        fs/autofs4/inode.c: In function 'autofs4_fill_super':
        fs/autofs4/inode.c:312: error: 'pgrp' may be used uninitialized in this function
        make[2]: *** [fs/autofs4/inode.o] Error 1
        make[1]: *** [fs/autofs4] Error 2
        make: *** [fs] Error 2
        make: *** Waiting for unfinished jobs....
      
      This is due to the use of pgrp_set being used to indicate pgrp has has
      been set rather than initializing pgrp itself.
      Signed-off-by: default avatarIan Kent <raven@themaw.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      571ff473
    • Joonsoo Kim's avatar
      slub: fix off by one in number of slab tests · 8a5b20ae
      Joonsoo Kim authored
      min_partial means minimum number of slab cached in node partial list.
      So, if nr_partial is less than it, we keep newly empty slab on node
      partial list rather than freeing it.  But if nr_partial is equal or
      greater than it, it means that we have enough partial slabs so should
      free newly empty slab.  Current implementation missed the equal case so
      if we set min_partial is 0, then, at least one slab could be cached.
      This is critical problem to kmemcg destroying logic because it doesn't
      works properly if some slabs is cached.  This patch fixes this problem.
      
      Fixes 91cb69620284 ("slub: make dead memcg caches discard free slabs
      immediately").
      Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      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>
      8a5b20ae
    • Michal Nazarewicz's avatar
      mm: page_alloc: fix CMA area initialisation when pageblock > MAX_ORDER · dc78327c
      Michal Nazarewicz authored
      With a kernel configured with ARM64_64K_PAGES && !TRANSPARENT_HUGEPAGE,
      the following is triggered at early boot:
      
        SMP: Total of 8 processors activated.
        devtmpfs: initialized
        Unable to handle kernel NULL pointer dereference at virtual address 00000008
        pgd = fffffe0000050000
        [00000008] *pgd=00000043fba00003, *pmd=00000043fba00003, *pte=00e0000078010407
        Internal error: Oops: 96000006 [#1] SMP
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc864k+ #44
        task: fffffe03bc040000 ti: fffffe03bc080000 task.ti: fffffe03bc080000
        PC is at __list_add+0x10/0xd4
        LR is at free_one_page+0x270/0x638
        ...
        Call trace:
          __list_add+0x10/0xd4
          free_one_page+0x26c/0x638
          __free_pages_ok.part.52+0x84/0xbc
          __free_pages+0x74/0xbc
          init_cma_reserved_pageblock+0xe8/0x104
          cma_init_reserved_areas+0x190/0x1e4
          do_one_initcall+0xc4/0x154
          kernel_init_freeable+0x204/0x2a8
          kernel_init+0xc/0xd4
      
      This happens because init_cma_reserved_pageblock() calls
      __free_one_page() with pageblock_order as page order but it is bigger
      than MAX_ORDER.  This in turn causes accesses past zone->free_list[].
      
      Fix the problem by changing init_cma_reserved_pageblock() such that it
      splits pageblock into individual MAX_ORDER pages if pageblock is bigger
      than a MAX_ORDER page.
      
      In cases where !CONFIG_HUGETLB_PAGE_SIZE_VARIABLE, which is all
      architectures expect for ia64, powerpc and tile at the moment, the
      “pageblock_order > MAX_ORDER” condition will be optimised out since both
      sides of the operator are constants.  In cases where pageblock size is
      variable, the performance degradation should not be significant anyway
      since init_cma_reserved_pageblock() is called only at boot time at most
      MAX_CMA_AREAS times which by default is eight.
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Reported-by: default avatarMark Salter <msalter@redhat.com>
      Tested-by: default avatarMark Salter <msalter@redhat.com>
      Tested-by: default avatarChristopher Covington <cov@codeaurora.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: <stable@vger.kernel.org>	[3.5+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dc78327c