Skip to content
Permalink
Nikolay-Boriso…

Commits on Jun 27, 2017

  1. btrfs: Optimise layout of btrfs_block_group_cache

    With this patch applied pahole stats look like:
    
    /* size: 840, cachelines: 14, members: 40 */
    /* sum members: 833, holes: 1, sum holes: 7 */
    /* bit holes: 1, sum bit holes: 28 bits */
    /* last cacheline: 8 bytes */
    
    No functional changes.
    
    Signed-off-by: Nikolay Borisov <nborisov@suse.com>
    Nikolay Borisov authored and fengguang committed Jun 27, 2017
  2. btrfs: remove unused sectorsize member

    The sectorsize member of btrfs_block_group_cache is unused. So remove it, this
    reduces the number of holes in the struct.
    
    With patch:
    /* size: 856, cachelines: 14, members: 40 */
    /* sum members: 837, holes: 4, sum holes: 19 */
    /* bit holes: 1, sum bit holes: 29 bits */
    /* last cacheline: 24 bytes */
    
    Without patch:
    /* size: 864, cachelines: 14, members: 41 */
    /* sum members: 841, holes: 5, sum holes: 23 */
    /* bit holes: 1, sum bit holes: 29 bits */
    /* last cacheline: 32 bytes */
    
    Signed-off-by: Nikolay Borisov <nborisov@suse.com>
    Nikolay Borisov authored and fengguang committed Jun 27, 2017

Commits on Jun 19, 2017

  1. Linux 4.12-rc6

    torvalds committed Jun 19, 2017
  2. mm: larger stack guard gap, between vmas

    Stack guard page is a useful feature to reduce a risk of stack smashing
    into a different mapping. We have been using a single page gap which
    is sufficient to prevent having stack adjacent to a different mapping.
    But this seems to be insufficient in the light of the stack usage in
    userspace. E.g. glibc uses as large as 64kB alloca() in many commonly
    used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX]
    which is 256kB or stack strings with MAX_ARG_STRLEN.
    
    This will become especially dangerous for suid binaries and the default
    no limit for the stack size limit because those applications can be
    tricked to consume a large portion of the stack and a single glibc call
    could jump over the guard page. These attacks are not theoretical,
    unfortunatelly.
    
    Make those attacks less probable by increasing the stack guard gap
    to 1MB (on systems with 4k pages; but make it depend on the page size
    because systems with larger base pages might cap stack allocations in
    the PAGE_SIZE units) which should cover larger alloca() and VLA stack
    allocations. It is obviously not a full fix because the problem is
    somehow inherent, but it should reduce attack space a lot.
    
    One could argue that the gap size should be configurable from userspace,
    but that can be done later when somebody finds that the new 1MB is wrong
    for some special case applications.  For now, add a kernel command line
    option (stack_guard_gap) to specify the stack gap size (in page units).
    
    Implementation wise, first delete all the old code for stack guard page:
    because although we could get away with accounting one extra page in a
    stack vma, accounting a larger gap can break userspace - case in point,
    a program run with "ulimit -S -v 20000" failed when the 1MB gap was
    counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK
    and strict non-overcommit mode.
    
    Instead of keeping gap inside the stack vma, maintain the stack guard
    gap as a gap between vmas: using vm_start_gap() in place of vm_start
    (or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few
    places which need to respect the gap - mainly arch_get_unmapped_area(),
    and and the vma tree's subtree_gap support for that.
    
    Original-patch-by: Oleg Nesterov <oleg@redhat.com>
    Original-patch-by: Michal Hocko <mhocko@suse.com>
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Tested-by: Helge Deller <deller@gmx.de> # parisc
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Hugh Dickins authored and torvalds committed Jun 19, 2017
  3. Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/arm/arm-soc
    
    Pull ARM SoC fixes from Olof Johansson:
     "Stream of fixes has slowed down, only a few this week:
    
       - Some DT fixes for Allwinner platforms, and addition of a clock to
         the R_CCU clock controller that had been missed.
    
       - A couple of small DT fixes for am335x-sl50"
    
    * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
      arm64: allwinner: a64: Add PLL_PERIPH0 clock to the R_CCU
      ARM: sunxi: h3-h5: Add PLL_PERIPH0 clock to the R_CCU
      ARM: dts: am335x-sl50: Fix cannot claim requested pins for spi0
      ARM: dts: am335x-sl50: Fix card detect pin for mmc1
      arm64: allwinner: h5: Remove syslink to shared DTSI
      ARM: sunxi: h3/h5: fix the compatible of R_CCU
    torvalds committed Jun 19, 2017
  4. Merge tag 'sunxi-fixes-for-4.12' of https://git.kernel.org/pub/scm/li…

    …nux/kernel/git/sunxi/linux into fixes
    
    Allwinner fixes for 4.12
    
    A few fixes around the PRCM support that got in 4.12 with a wrong
    compatible, and a missing clock in the binding.
    
    * tag 'sunxi-fixes-for-4.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
      arm64: allwinner: a64: Add PLL_PERIPH0 clock to the R_CCU
      ARM: sunxi: h3-h5: Add PLL_PERIPH0 clock to the R_CCU
      arm64: allwinner: h5: Remove syslink to shared DTSI
      ARM: sunxi: h3/h5: fix the compatible of R_CCU
    
    Signed-off-by: Olof Johansson <olof@lixom.net>
    olofj committed Jun 19, 2017
  5. Merge tag 'omap-for-v4.12/fixes-sl50' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/tmlind/linux-omap into fixes
    
    Two fixes for am335x-sl50 to fix a boot time error
    for claiming SPI pins, and to fix a SDIO card detect
    pin for production version of the device.
    
    * tag 'omap-for-v4.12/fixes-sl50' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
      ARM: dts: am335x-sl50: Fix cannot claim requested pins for spi0
      ARM: dts: am335x-sl50: Fix card detect pin for mmc1
    
    Signed-off-by: Olof Johansson <olof@lixom.net>
    olofj committed Jun 19, 2017
  6. Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/gi…

    …t/mst/vhost
    
    Pull virtio bugfix from Michael Tsirkin:
     "It turns out balloon does not handle IOMMUs correctly. We should fix
      that at some point, for now let's just disable this configuration"
    
    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
      virtio_balloon: disable VIOMMU support
    torvalds committed Jun 19, 2017
  7. Merge branch 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/wsa/linux
    
    Pull i2c fixes from Wolfram Sang:
     "Two driver bugfixes"
    
    * 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
      i2c: ismt: fix wrong device address when unmap the data buffer
      i2c: rcar: use correct length when unmapping DMA
    torvalds committed Jun 19, 2017
  8. Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…

    …ream-linus
    
    Pull MIPS fixes from Ralf Baechle:
    
     - Three highmem fixes:
        + Fixed mapping initialization
        + Adjust the pkmap location
        + Ensure we use at most one page for PTEs
    
     - Fix makefile dependencies for .its targets to depend on vmlinux
    
     - Fix reversed condition in BNEZC and JIALC software branch emulation
    
     - Only flush initialized flush_insn_slot to avoid NULL pointer
       dereference
    
     - perf: Remove incorrect odd/even counter handling for I6400
    
     - ftrace: Fix init functions tracing
    
    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
      MIPS: .its targets depend on vmlinux
      MIPS: Fix bnezc/jialc return address calculation
      MIPS: kprobes: flush_insn_slot should flush only if probe initialised
      MIPS: ftrace: fix init functions tracing
      MIPS: mm: adjust PKMAP location
      MIPS: highmem: ensure that we don't use more than one page for PTEs
      MIPS: mm: fixed mappings: correct initialisation
      MIPS: perf: Remove incorrect odd/even counter handling for I6400
    torvalds committed Jun 19, 2017

Commits on Jun 18, 2017

  1. virtio_balloon: disable VIOMMU support

    virtio balloon bypasses the DMA API entirely so does not support the
    VIOMMU right now.  It's not clear we need that support, for now let's
    just make sure we don't pretend to support it.
    
    Cc: stable@vger.kernel.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Fixes: 1a93769 ("virtio: new feature to detect IOMMU device quirk")
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    mstsirkin committed Jun 18, 2017
  2. Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…

    …inux/kernel/git/tip/tip
    
    Pull x86 fixes from Thomas Gleixner:
     "Two fixlets for x86:
    
       - Handle WARN_ONs proper with the new UD based WARN implementation
    
       - Disable 1G mappings when 2M mappings are disabled by kmemleak or
         debug_pagealloc. Otherwise 1G mappings might still be used,
         confusing the debug mechanisms"
    
    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      x86/mm: Disable 1GB direct mappings when disabling 2MB mappings
      x86/debug: Handle early WARN_ONs proper
    torvalds committed Jun 18, 2017
  3. Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…

    …m/linux/kernel/git/tip/tip
    
    Pull timer fixes from Thomas Gleixner:
     "Three fixlets for timers:
    
       - Two hot-fixes for the alarmtimer based posix timers, which prevent
         a nasty DOS by self rescheduling timers. The proper cleanup of that
         mess is queued for 4.13
    
       - Make a function static"
    
    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      tick/broadcast: Make tick_broadcast_setup_oneshot() static
      alarmtimer: Rate limit periodic intervals
      alarmtimer: Prevent overflow of relative timers
    torvalds committed Jun 18, 2017
  4. Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/tip/tip
    
    Pull scheduler fixes from Thomas Gleixner:
     "Two small fixes for the schedulre core:
    
       - Use the proper switch_mm() variant in idle_task_exit() because that
         code is not called with interrupts disabled.
    
       - Fix a confusing typo in a printk"
    
    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off()
      sched/fair: Fix typo in printk message
    torvalds committed Jun 18, 2017
  5. Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull perf fixes from Thomas Gleixner:
     "Three fixes for the perf user space side:
    
       - Fix the probing of precise_ip level, which got broken recently for
         x86.
    
       - Unbreak the ARCH=x86_64 build
    
       - Report module before trying to unwind into the module code, which
         avoids broken stack frames displayed"
    
    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      perf unwind: Report module before querying isactivation in dwfl unwind
      perf tools: Fix build with ARCH=x86_64
      perf evsel: Fix probing of precise_ip level for default cycles event
    torvalds committed Jun 18, 2017
  6. Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/l…

    …inux/kernel/git/tip/tip
    
    Pull irq fix from Thomas Gleixner:
     "Add a missing resource release to an error path"
    
    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      genirq: Release resources in __setup_irq() error path
    torvalds committed Jun 18, 2017
  7. Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull objtool fix from Thomas Gleixner:
     "A single fix which adds fortify_panic to the list of no return
      functions"
    
    * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      objtool: Add fortify_panic as __noreturn function
    torvalds committed Jun 18, 2017

Commits on Jun 17, 2017

  1. Merge tag 'led_fixes_for_4.12-rc6' of git://git.kernel.org/pub/scm/li…

    …nux/kernel/git/j.anaszewski/linux-leds
    
    Pull LED fixes from Jacek Anaszewski:
     "Two LED fixes:
    
       - fix signal source assignment for leds-bcm6328
    
       - revert patch that intended to fix LED behavior on suspend but it
         had a side effect preventing suspend at all due to uevent being
         sent on trigger removal"
    
    * tag 'led_fixes_for_4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
      Revert "leds: handle suspend/resume in heartbeat trigger"
      leds: bcm6328: fix signal source assignment for leds 4 to 7
    torvalds committed Jun 17, 2017
  2. Merge tag 'usb-4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/gregkh/usb
    
    Pull USB fixes from Greg KH:
     "Here are some small gadget and xhci USB fixes for 4.12-rc6.
    
      Nothing major, but one of the gadget patches does fix a reported oops,
      and the xhci ones resolve reported problems. All have been in
      linux-next with no reported issues"
    
    * tag 'usb-4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
      USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks
      usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk
      usb: xhci: Fix USB 3.1 supported protocol parsing
      USB: gadget: fix GPF in gadgetfs
      usb: gadget: composite: make sure to reactivate function on unbind
    torvalds committed Jun 17, 2017
  3. Merge tag 'staging-4.12-rc6' of git://git.kernel.org/pub/scm/linux/ke…

    …rnel/git/gregkh/staging
    
    Pull staging and IIO fixes from Greg KH:
     "Here are some small staging and IIO driver fixes for 4.12-rc6.
    
      Nothing huge, just a few small driver fixes for reported issues. All
      have been in linux-next with no reported issues"
    
    * tag 'staging-4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
      Staging: rtl8723bs: fix an error code in isFileReadable()
      iio: buffer-dmaengine: Add missing header buffer_impl.h
      iio: buffer-dma: Add missing header buffer_impl.h
      iio: adc: meson-saradc: fix potential crash in meson_sar_adc_clear_fifo
      iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe()
      iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500
      staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()
    torvalds committed Jun 17, 2017
  4. Merge tag 'ceph-for-4.12-rc6' of git://github.com/ceph/ceph-client

    Pull ceph fixes from Ilya Dryomov:
     "A fix for an old ceph ->fh_to_* bug from Luis and two timestamp fixups
      from Zheng, prompted by the ongoing y2038 work"
    
    * tag 'ceph-for-4.12-rc6' of git://github.com/ceph/ceph-client:
      ceph: unify inode i_ctime update
      ceph: use current_kernel_time() to get request time stamp
      ceph: check i_nlink while converting a file handle to dentry
    torvalds committed Jun 17, 2017
  5. Merge tag 'xfs-4.12-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/x…

    …fs-linux
    
    Pull xfs fix from Darrick Wong:
     "One more bugfix for you for 4.12-rc6 to fix something that came up in
      an earlier rc:
    
       - Fix some bogus ASSERT failures on CONFIG_SMP=n and CONFIG_XFS_DEBUG=y"
    
    * tag 'xfs-4.12-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
      xfs: fix spurious spin_is_locked() assert failures on non-smp kernels
    torvalds committed Jun 17, 2017
  6. Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/viro/vfs
    
    Pull ufs fixes from Al Viro:
     "Fix assorted ufs bugs: a couple of deadlocks, fs corruption in
      truncate(), oopsen on tail unpacking and truncate when racing with
      vmscan, mild fs corruption (free blocks stats summary buggered, *BSD
      fsck would complain and fix), several instances of broken logics
      around reserved blocks (starting with "check almost never triggers
      when it should" and then there are issues with sufficiently large
      UFS2)"
    
    [ Note: ufs hasn't gotten any loving in a long time, because nobody
      really seems to use it. These ufs fixes are triggered by people
      actually caring now, not some sudden influx of new bugs.  - Linus ]
    
    * 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
      ufs_truncate_blocks(): fix the case when size is in the last direct block
      ufs: more deadlock prevention on tail unpacking
      ufs: avoid grabbing ->truncate_mutex if possible
      ufs_get_locked_page(): make sure we have buffer_heads
      ufs: fix s_size/s_dsize users
      ufs: fix reserved blocks check
      ufs: make ufs_freespace() return signed
      ufs: fix logics in "ufs: make fsck -f happy"
    torvalds committed Jun 17, 2017
  7. Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/viro/vfs
    
    Pull vfs fixes from Al Viro:
     "A couple of fixes; a leak in mntns_install() caught by Andrei (this
      cycle regression) + d_invalidate() softlockup fix - that had been
      reported by a bunch of people lately, but the problem is pretty old"
    
    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
      fs: don't forget to put old mntns in mntns_install
      Hang/soft lockup in d_invalidate with simultaneous calls
    torvalds committed Jun 17, 2017

Commits on Jun 16, 2017

  1. Merge tag 'pci-v4.12-fixes-2' of git://git.kernel.org/pub/scm/linux/k…

    …ernel/git/helgaas/pci
    
    Pull PCI fixes from Bjorn Helgaas:
    
     - fix another PCI_ENDPOINT build error (merged for v4.12)
    
     - fix error codes added to config accessors for v4.12
    
    * tag 'pci-v4.12-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
      PCI: endpoint: Select CRC32 to fix test build error
      PCI: Make error code types consistent in pci_{read,write}_config_*
    torvalds committed Jun 16, 2017
  2. Merge tag 'fbdev-v4.12-rc6' of git://github.com/bzolnier/linux

    Pull fbdev fixes from Bartlomiej Zolnierkiewicz:
    
     - fix udlfb driver to stop spamming logs (Mike Gerow)
    
     - add missing endianness conversions in smscufx & udlfb drivers (Johan
       Hovold)
    
     - fix few gcc warnings/errors (Arnd Bergmann)
    
    * tag 'fbdev-v4.12-rc6' of git://github.com/bzolnier/linux:
      video: fbdev: udlfb: drop log level for blanking
      video: fbdev: via: remove possibly unused variables
      video: fbdev: add missing USB-descriptor endianness conversions
      video: fbdev: avoid int-in-bool-context warning
    torvalds committed Jun 16, 2017
  3. Merge branch 'akpm' (patches from Andrew)

    Merge misc fixes from Andrew Morton:
     "5 fixes"
    
    * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
      mm: correct the comment when reclaimed pages exceed the scanned pages
      userfaultfd: shmem: handle coredumping in handle_userfault()
      mm: numa: avoid waiting on freed migrated pages
      swap: cond_resched in swap_cgroup_prepare()
      mm/memory-failure.c: use compound_head() flags for huge pages
    torvalds committed Jun 16, 2017
  4. mm: correct the comment when reclaimed pages exceed the scanned pages

    Commit e1587a4 ("mm: vmpressure: fix sending wrong events on
    underflow") declared that reclaimed pages exceed the scanned pages due
    to the thp reclaim.
    
    That is incorrect because THP will be spilt to normal page and loop
    again, which will result in the scanned pages increment.
    
    [akpm@linux-foundation.org: tweak comment text]
    Link: http://lkml.kernel.org/r/1496824266-25235-1-git-send-email-zhongjiang@huawei.com
    Signed-off-by: zhongjiang <zhongjiang@huawei.com>
    Acked-by: Minchan Kim <minchan@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    xiongzhongjiang authored and torvalds committed Jun 16, 2017
  5. userfaultfd: shmem: handle coredumping in handle_userfault()

    Anon and hugetlbfs handle FOLL_DUMP set by get_dump_page() internally to
    __get_user_pages().
    
    shmem as opposed has no special FOLL_DUMP handling there so
    handle_mm_fault() is invoked without mmap_sem and ends up calling
    handle_userfault() that isn't expecting to be invoked without mmap_sem
    held.
    
    This makes handle_userfault() fail immediately if invoked through
    shmem_vm_ops->fault during coredumping and solves the problem.
    
    The side effect is a BUG_ON with no lock held triggered by the
    coredumping process which exits.  Only 4.11 is affected, pre-4.11 anon
    memory holes are skipped in __get_user_pages by checking FOLL_DUMP
    explicitly against empty pagetables (mm/gup.c:no_page_table()).
    
    It's zero cost as we already had a check for current->flags to prevent
    futex to trigger userfaults during exit (PF_EXITING).
    
    Link: http://lkml.kernel.org/r/20170615214838.27429-1-aarcange@redhat.com
    Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
    Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Cc: <stable@vger.kernel.org>	[4.11+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    aagit authored and torvalds committed Jun 16, 2017
  6. mm: numa: avoid waiting on freed migrated pages

    In do_huge_pmd_numa_page(), we attempt to handle a migrating thp pmd by
    waiting until the pmd is unlocked before we return and retry.  However,
    we can race with migrate_misplaced_transhuge_page():
    
        // do_huge_pmd_numa_page                // migrate_misplaced_transhuge_page()
        // Holds 0 refs on page                 // Holds 2 refs on page
    
        vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd);
        /* ... */
        if (pmd_trans_migrating(*vmf->pmd)) {
                page = pmd_page(*vmf->pmd);
                spin_unlock(vmf->ptl);
                                                ptl = pmd_lock(mm, pmd);
                                                if (page_count(page) != 2)) {
                                                        /* roll back */
                                                }
                                                /* ... */
                                                mlock_migrate_page(new_page, page);
                                                /* ... */
                                                spin_unlock(ptl);
                                                put_page(page);
                                                put_page(page); // page freed here
                wait_on_page_locked(page);
                goto out;
        }
    
    This can result in the freed page having its waiters flag set
    unexpectedly, which trips the PAGE_FLAGS_CHECK_AT_PREP checks in the
    page alloc/free functions.  This has been observed on arm64 KVM guests.
    
    We can avoid this by having do_huge_pmd_numa_page() take a reference on
    the page before dropping the pmd lock, mirroring what we do in
    __migration_entry_wait().
    
    When we hit the race, migrate_misplaced_transhuge_page() will see the
    reference and abort the migration, as it may do today in other cases.
    
    Fixes: b891663 ("mm: Prevent parallel splits during THP migration")
    Link: http://lkml.kernel.org/r/1497349722-6731-2-git-send-email-will.deacon@arm.com
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Acked-by: Steve Capper <steve.capper@arm.com>
    Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Mark Rutland authored and torvalds committed Jun 16, 2017
  7. swap: cond_resched in swap_cgroup_prepare()

    I saw need_resched() warnings when swapping on large swapfile (TBs)
    because continuously allocating many pages in swap_cgroup_prepare() took
    too long.
    
    We already cond_resched when freeing page in swap_cgroup_swapoff().  Do
    the same for the page allocation.
    
    Link: http://lkml.kernel.org/r/20170604200109.17606-1-yuzhao@google.com
    Signed-off-by: Yu Zhao <yuzhao@google.com>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Yu Zhao authored and torvalds committed Jun 16, 2017
  8. mm/memory-failure.c: use compound_head() flags for huge pages

    memory_failure() chooses a recovery action function based on the page
    flags.  For huge pages it uses the tail page flags which don't have
    anything interesting set, resulting in:
    
    > Memory failure: 0x9be3b4: Unknown page state
    > Memory failure: 0x9be3b4: recovery action for unknown page: Failed
    
    Instead, save a copy of the head page's flags if this is a huge page,
    this means if there are no relevant flags for this tail page, we use the
    head pages flags instead.  This results in the me_huge_page() recovery
    action being called:
    
    > Memory failure: 0x9b7969: recovery action for huge page: Delayed
    
    For hugepages that have not yet been allocated, this allows the hugepage
    to be dequeued.
    
    Fixes: 524fca1 ("HWPOISON: fix misjudgement of page_action() for errors on mlocked pages")
    Link: http://lkml.kernel.org/r/20170524130204.21845-1-james.morse@arm.com
    Signed-off-by: James Morse <james.morse@arm.com>
    Tested-by: Punit Agrawal <punit.agrawal@arm.com>
    Acked-by: Punit Agrawal <punit.agrawal@arm.com>
    Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    James Morse authored and torvalds committed Jun 16, 2017
  9. Merge tag 'powerpc-4.12-6' of git://git.kernel.org/pub/scm/linux/kern…

    …el/git/powerpc/linux
    
    Pull powerpc fixes from Michael Ellerman:
     "Three small fixes for recently merged code:
    
       - remove a spurious WARN_ON when a PCI device has no of_node, it's
         allowed in some circumstances for there to be no of_node.
    
       - fix the offset for store EOI MMIOs in the XIVE interrupt
         controller.
    
       - fix non-const WARN_ONs which were becoming BUGs due to them losing
         BUGFLAG_WARNING in a recent cleanup patch.
    
      Thanks to: Alexey Kardashevskiy, Alistair Popple, Benjamin
      Herrenschmidt"
    
    * tag 'powerpc-4.12-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
      powerpc/debug: Add missing warn flag to WARN_ON's non-builtin path
      powerpc/xive: Fix offset for store EOI MMIOs
      powerpc/npu-dma: Remove spurious WARN_ON when a PCI device has no of_node
    torvalds committed Jun 16, 2017
  10. Merge tag 'perf-urgent-for-mingo-4.12-20170616' of git://git.kernel.o…

    …rg/pub/scm/linux/kernel/git/acme/linux into perf/urgent
    
    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
    
    - Fix probing of precise_ip level for default cycles event, that
      got broken recently on x86_64 when its arch code started
      considering invalid requesting precise samples when not sampling
      (i.e. when attr.sample_period == 0).
    
      This also fixes another problem in s/390 where the precision
      probing with sample_period == 0 returned precise_ip > 0, that
      then, when setting up the real cycles event (not probing) would
      return EOPNOTSUPP for precise_ip > 0 (as determined previously
      by probing) and sample_period > 0.
    
      These problems resulted in attr_precise not being set to the
      highest precision available on x86.64 when no event was specified,
      i.e. the canonical:
    
    	perf record ./workload
    
      would end up using attr.precise_ip = 0. As a workaround this would
      need to be done:
    
    	perf record -e cycles:P ./workload
    
      And on s/390 it would plain not work, requiring using:
    
            perf record -e cycles ./workload
    
      as a workaround.  (Arnaldo Carvalho de Melo)
    
    - Fix perf build with ARCH=x86_64, when ARCH should be transformed
      into ARCH=x86, just like with the main kernel Makefile and
      tools/objtool's, i.e. use SRCARCH. (Jiada Wang)
    
    - Avoid accessing uninitialized data structures when unwinding with
      elfutils's libdw, making it more closely mimic libunwind's unwinder.
      (Milian Wolff)
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Ingo Molnar
    Ingo Molnar committed Jun 16, 2017
  11. perf unwind: Report module before querying isactivation in dwfl unwind

    The PC returned by dwfl_frame_pc() may map into a not-yet-reported
    module. We have to report it before we continue unwinding. But when we
    query for the isactivation flag in dwfl_frame_pc, libdw will actually do
    one more unwinding step internally which can then break and lead to
    missed frames or broken stacks.
    
    With libunwind we get e.g.:
    
    ~~~~~
      heaptrack_gui  2228 135073.400474:     613969 cycles:
    	          108c8e [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1093bc [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          109e7b QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
    	          1470ff [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          147f67 QSystemLocale::query (/usr/lib/libQt5Core.so.5.8.0)
    	          109fbf QLocalePrivate::updateSystemPrivate (/usr/lib/libQt5Core.so.5.8.0)
    	          10aa27 QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
    	          1e02c3 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          2113bb [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          211505 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1b5df0 QFileInfo::exists (/usr/lib/libQt5Core.so.5.8.0)
    	           92eb2 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	           93423 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	           93d2a QLibraryInfo::location (/usr/lib/libQt5Core.so.5.8.0)
    	          2170af [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          297c53 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
    	           f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
    	          1589e8 QApplicationPrivate::init (/usr/lib/libQt5Widgets.so.5.8.0)
    	           78622 main (/home/milian/projects/compiled/other/bin/heaptrack_gui)
    	           20439 __libc_start_main (/usr/lib/libc-2.25.so)
    	           78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
    
      heaptrack_gui  2228 135073.401156:     569521 cycles:
    	          131633 QString::endsWith (/usr/lib/libQt5Core.so.5.8.0)
    	          1a0701 QDir::cleanPath (/usr/lib/libQt5Core.so.5.8.0)
    	          21b82d [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1b3727 QFileInfo::canonicalFilePath (/usr/lib/libQt5Core.so.5.8.0)
    	          2780c7 QFactoryLoader::update (/usr/lib/libQt5Core.so.5.8.0)
    	          279525 QFactoryLoader::QFactoryLoader (/usr/lib/libQt5Core.so.5.8.0)
    	           e5bd0 QPlatformIntegrationFactory::create (/usr/lib/libQt5Gui.so.5.8.0)
    	           f5a1c QGuiApplicationPrivate::createPlatformIntegration (/usr/lib/libQt5Gui.so.5.8.0)
    	           f650c QGuiApplicationPrivate::createEventDispatcher (/usr/lib/libQt5Gui.so.5.8.0)
    	          298524 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
    	           f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
    	          1589e8 QApplicationPrivate::init (/usr/lib/libQt5Widgets.so.5.8.0)
    	           78622 main (/home/milian/projects/compiled/other/bin/heaptrack_gui)
    	           20439 __libc_start_main (/usr/lib/libc-2.25.so)
    	           78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
    ~~~~~
    
    Note the two frames 1589e8 and 78622 in the first sample. These are
    missing when unwinding with libdw. The second sample's breakage is
    more obvious:
    
    ~~~~~
      heaptrack_gui  2228 135073.400474:     613969 cycles:
    	          108c8e [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1093bc [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          109e7b QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
    	          1470ff [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          147f67 QSystemLocale::query (/usr/lib/libQt5Core.so.5.8.0)
    	          109fbf QLocalePrivate::updateSystemPrivate (/usr/lib/libQt5Core.so.5.8.0)
    	          10aa27 QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
    	          1e02c3 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          2113bb [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          211505 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1b5df0 QFileInfo::exists (/usr/lib/libQt5Core.so.5.8.0)
    	           92eb2 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	           93423 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	           93d2a QLibraryInfo::location (/usr/lib/libQt5Core.so.5.8.0)
    	          2170af [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          297c53 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
    	           f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
    	           20439 __libc_start_main (/usr/lib/libc-2.25.so)
    	           78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
    
    heaptrack_gui  2228 135073.401156:     569521 cycles:
    	          131633 QString::endsWith (/usr/lib/libQt5Core.so.5.8.0)
    	          1a0701 QDir::cleanPath (/usr/lib/libQt5Core.so.5.8.0)
    	          21b82d [unknown] (/usr/lib/libQt5Core.so.5.8.0)
    	          1b3727 QFileInfo::canonicalFilePath (/usr/lib/libQt5Core.so.5.8.0)
    	          2780c7 QFactoryLoader::update (/usr/lib/libQt5Core.so.5.8.0)
    	          279525 QFactoryLoader::QFactoryLoader (/usr/lib/libQt5Core.so.5.8.0)
    	           e5bd0 QPlatformIntegrationFactory::create (/usr/lib/libQt5Gui.so.5.8.0)
    	          723dbf [unknown] ([unknown])
    ~~~~~
    
    This patch fixes this issue and the libdw unwinder mimicks the libunwind
    behavior more closely.
    
    Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
    Acked-by: Jan Kratochvil <jan.kratochvil@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: http://lkml.kernel.org/r/20170602143753.16907-2-milian.wolff@kdab.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    milianw authored and Arnaldo Carvalho de Melo committed Jun 16, 2017
Older
You can’t perform that action at this time.