18 Aug, 2017

3 commits

  • The code to add and remove items to and from the revmap occurs several
    times.

    In preparation for the follow on patches that add more uses of this
    code, factor this out in to separate static functions.

    Signed-off-by: David Daney
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Marc Zyngier
    Cc: Mark Rutland
    Cc: Alexandre Courbot
    Cc: Linus Walleij
    Cc: linux-gpio@vger.kernel.org
    Link: http://lkml.kernel.org/r/1503017616-3252-4-git-send-email-david.daney@cavium.com

    David Daney
     
  • Follow-on patch for gpio-thunderx uses a irqdomain hierarchy which
    requires slightly different flow handlers, add them to chip.c which
    contains most of the other flow handlers. Make these conditionally
    compiled based on CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS.

    Signed-off-by: David Daney
    Signed-off-by: Thomas Gleixner
    Cc: Mark Rutland
    Cc: Alexandre Courbot
    Cc: Marc Zyngier
    Cc: Linus Walleij
    Cc: linux-gpio@vger.kernel.org
    Link: http://lkml.kernel.org/r/1503017616-3252-3-git-send-email-david.daney@cavium.com

    David Daney
     
  • Many of the family of functions including irq_chip_mask_parent(),
    irq_chip_unmask_parent() are exported, but not all.

    Add EXPORT_SYMBOL_GPL to irq_chip_enable_parent,
    irq_chip_disable_parent and irq_chip_set_affinity_parent, so they
    likewise are usable from modules.

    Signed-off-by: David Daney
    Signed-off-by: Thomas Gleixner
    Cc: Mark Rutland
    Cc: Alexandre Courbot
    Cc: Marc Zyngier
    Cc: Linus Walleij
    Cc: linux-gpio@vger.kernel.org
    Link: http://lkml.kernel.org/r/1503017616-3252-2-git-send-email-david.daney@cavium.com

    David Daney
     

16 Aug, 2017

2 commits

  • Add a resource managed version of irq_sim_init(). This can be
    conveniently used in device drivers.

    Signed-off-by: Bartosz Golaszewski
    Acked-by: Jonathan Cameron
    Cc: Lars-Peter Clausen
    Cc: Jonathan Corbet
    Cc: Marc Zyngier
    Cc: Linus Walleij
    Cc: linux-doc@vger.kernel.org
    Cc: linux-gpio@vger.kernel.org
    Cc: Bamvor Jian Zhang
    Cc: Jonathan Cameron
    Link: http://lkml.kernel.org/r/20170814145318.6495-3-brgl@bgdev.pl
    Signed-off-by: Thomas Gleixner

    Bartosz Golaszewski
     
  • Implement a simple, irq_work-based framework for simulating
    interrupts. Currently the API exposes routines for initializing and
    deinitializing the simulator object, enqueueing the interrupts and
    retrieving the allocated interrupt numbers based on the offset of the
    dummy interrupt in the simulator struct.

    Signed-off-by: Bartosz Golaszewski
    Reviewed-by: Jonathan Cameron
    Cc: Lars-Peter Clausen
    Cc: Jonathan Corbet
    Cc: Marc Zyngier
    Cc: Linus Walleij
    Cc: linux-doc@vger.kernel.org
    Cc: linux-gpio@vger.kernel.org
    Cc: Bamvor Jian Zhang
    Cc: Jonathan Cameron
    Link: http://lkml.kernel.org/r/20170814145318.6495-2-brgl@bgdev.pl
    Signed-off-by: Thomas Gleixner

    Bartosz Golaszewski
     

14 Aug, 2017

7 commits

  • Linus Torvalds
     
  • Pull MIPS fixes from Ralf Baechle:
    "Another round of MIPS fixes:

    - compressed boot: Ignore a generated .c file

    - VDSO: Fix a register clobber list

    - DECstation: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression

    - Octeon: Fix recent cleanups that cleaned away a bit too much thus
    breaking the arch side of the EDAC and USB drivers.

    - uasm: Fix duplicate const in "const struct foo const bar[]" which
    GCC 7.1 no longer accepts.

    - Fix race on setting and getting cpu_online_mask

    - Fix preemption issue. To do so cleanly introduce macro to get the
    size of L3 cache line.

    - Revert include cleanup that sometimes results in build error

    - MicroMIPS uses bit 0 of the PC to indicate microMIPS mode. Make
    sure this bit is set for kernel entry as well.

    - Prevent configuring the kernel for both microMIPS and MT. There are
    no such CPUs currently and thus the combination is unsupported and
    results in build errors.

    This has been sitting in linux-next for a few days and has survived
    automated testing by Imagination's test farm. No known regressions
    pending except a number of issues that crept up due to lots of people
    switching to GCC 7.1"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
    MIPS: Set ISA bit in entry-y for microMIPS kernels
    MIPS: Prevent building MT support for microMIPS kernels
    MIPS: PCI: Fix smp_processor_id() in preemptible
    MIPS: Introduce cpu_tcache_line_size
    MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression
    MIPS: VDSO: Fix clobber lists in fallback code paths
    Revert "MIPS: Don't unnecessarily include kmalloc.h into ."
    MIPS: OCTEON: Fix USB platform code breakage.
    MIPS: Octeon: Fix broken EDAC driver.
    MIPS: gitignore: ignore generated .c files
    MIPS: Fix race on setting and getting cpu_online_mask
    MIPS: mm: remove duplicate "const" qualifier on insn_table

    Linus Torvalds
     
  • Pull driver core fixes from Greg KH:
    "Here are three firmware core fixes for 4.13-rc5.

    All three of these fix reported issues and have been floating around
    for a few weeks. They have been in linux-next with no reported
    problems"

    * tag 'driver-core-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    firmware: avoid invalid fallback aborts by using killable wait
    firmware: fix batched requests - send wake up on failure on direct lookups
    firmware: fix batched requests - wake all waiters

    Linus Torvalds
     
  • Pull char/misc fixes from Greg KH:
    "Here are two patches for 4.13-rc5.

    One is a fix for a reported thunderbolt issue, and the other a fix for
    an MEI driver issue. Both have been in linux-next with no reported
    issues"

    * tag 'char-misc-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    thunderbolt: Do not enumerate more ports from DROM than the controller has
    mei: exclude device from suspend direct complete optimization

    Linus Torvalds
     
  • Pull tty/serial fixes from Greg KH:
    "Here are two tty serial driver fixes for 4.13-rc5. One is a revert of
    a -rc1 patch that turned out to not be a good idea, and the other is a
    fix for the pl011 serial driver.

    Both have been in linux-next with no reported issues"

    * tag 'tty-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    Revert "serial: Delete dead code for CIR serial ports"
    tty: pl011: fix initialization order of QDF2400 E44

    Linus Torvalds
     
  • Pull staging/iio fixes from Greg KH:
    "Here are some Staging and IIO driver fixes for 4.13-rc5.

    Nothing major, just a number of small fixes for reported issues. All
    of these have been in linux-next for a while now with no reported
    issues. Full details are in the shortlog"

    * tag 'staging-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNING
    iio: aspeed-adc: wait for initial sequence.
    iio: accel: bmc150: Always restore device to normal mode after suspend-resume
    staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
    iio: adc: axp288: Fix the GPADC pin reading often wrongly returning 0
    iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits
    iio: accel: st_accel: add SPI-3wire support
    iio: adc: Revert "axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications"
    iio: adc: sun4i-gpadc-iio: fix unbalanced irq enable/disable
    iio: pressure: st_pressure_core: disable multiread by default for LPS22HB
    iio: light: tsl2563: use correct event code

    Linus Torvalds
     
  • Pull USB fixes from Greg KH:
    "Here are a number of small USB driver fixes and new device ids for
    4.13-rc5. There is the usual gadget driver fixes, some new quirks for
    "messy" hardware, and some new device ids.

    All have been in linux-next with no reported issues"

    * tag 'usb-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    USB: serial: pl2303: add new ATEN device id
    usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter
    USB: Check for dropped connection before switching to full speed
    usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume
    usb: renesas_usbhs: gadget: fix unused-but-set-variable warning
    usb: renesas_usbhs: Fix UGCTRL2 value for R-Car Gen3
    usb: phy: phy-msm-usb: Fix usage of devm_regulator_bulk_get()
    usb: gadget: udc: renesas_usb3: Fix usb_gadget_giveback_request() calling
    usb: dwc3: gadget: Correct ISOC DATA PIDs for short packets
    USB: serial: option: add D-Link DWM-222 device ID
    usb: musb: fix tx fifo flush handling again
    usb: core: unlink urbs from the tail of the endpoint's urb_list
    usb-storage: fix deadlock involving host lock and scsi_done
    uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069
    USB: hcd: Mark secondary HCD as dead if the primary one died
    USB: serial: cp210x: add support for Qivicon USB ZigBee dongle

    Linus Torvalds
     

13 Aug, 2017

4 commits

  • Pull another MTD fix from Brian Norris:
    "An mtdblock regression occurred in -rc1 (all writes were broken!), in
    the process of some block subsystem refactoring. Noticed and fixed
    last week, but I'm a little slow on the uptake"

    * tag 'for-linus-20170812' of git://git.infradead.org/linux-mtd:
    mtd: blkdevs: Fix mtd block write failure

    Linus Torvalds
     
  • All the MTD block write requests are failing with
    following error messages

    mkfs.ext4 /dev/mtdblock0

    print_req_error: I/O error, dev mtdblock0, sector 0
    Buffer I/O error on dev mtdblock0, logical block 0,
    lost async page write

    The control is going to default case after block write request
    because of missing return.

    Fixes: commit 2a842acab109 ("block: introduce new block status code type")
    Signed-off-by: Abhishek Sahu
    Signed-off-by: Brian Norris

    Abhishek Sahu
     
  • Pull SCSI target fixes from Nicholas Bellinger:
    "The highlights include:

    - Fix iscsi-target payload memory leak during
    ISCSI_FLAG_TEXT_CONTINUE (Varun Prakash)

    - Fix tcm_qla2xxx incorrect use of tcm_qla2xxx_free_cmd during ABORT
    (Pascal de Bruijn + Himanshu Madhani + nab)

    - Fix iscsi-target long-standing issue with parallel delete of a
    single network portal across multiple target instances (Gary Guo +
    nab)

    - Fix target dynamic se_node GPF during uncached shutdown regression
    (Justin Maggard + nab)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
    target: Fix node_acl demo-mode + uncached dynamic shutdown regression
    iscsi-target: Fix iscsi_np reset hung task during parallel delete
    qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2)
    cxgbit: fix sg_nents calculation
    iscsi-target: fix invalid flags in text response
    iscsi-target: fix memory leak in iscsit_setup_text_cmd()
    cxgbit: add missing __kfree_skb()
    tcmu: free old string on reconfig
    tcmu: Fix possible to/from address overflow when doing the memcpy

    Linus Torvalds
     
  • Pull xen fixes from Juergen Gross:
    "Some fixes for Xen:

    - a fix for a regression introduced in 4.13 for a Xen HVM-guest
    configured with KASLR

    - a fix for a possible deadlock in the xenbus driver when booting the
    system

    - a fix for lost interrupts in Xen guests"

    * tag 'for-linus-4.13b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen/events: Fix interrupt lost during irq_disable and irq_enable
    xen: avoid deadlock in xenbus
    xen: fix hvm guest with kaslr enabled
    xen: split up xen_hvm_init_shared_info()
    x86: provide an init_mem_mapping hypervisor hook

    Linus Torvalds
     

12 Aug, 2017

7 commits

  • Pull NFS client fixes from Anna Schumaker:
    "A few more NFS client bugfixes from me for rc5.

    Dros has a stable fix for flexfiles to prevent leaking the
    nfs4_ff_ds_version arrays when freeing a layout, Trond fixed a
    potential recovery loop situation with the TEST_STATEID operation, and
    Christoph fixed up the pNFS blocklayout Kconfig options to prevent
    unsafe use with kernels that don't have large block device support.
    Summary:

    Stable fix:
    - fix leaking nfs4_ff_ds_version array

    Other fixes:
    - improve TEST_STATEID OLD_STATEID handling to prevent recovery loop

    - require 64-bit sector_t for pNFS blocklayout to prevent 32-bit
    compile errors"

    * tag 'nfs-for-4.13-5' of git://git.linux-nfs.org/projects/anna/linux-nfs:
    pnfs/blocklayout: require 64-bit sector_t
    NFSv4: Ignore NFS4ERR_OLD_STATEID in nfs41_check_open_stateid()
    nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays

    Linus Torvalds
     
  • Pull block fixes from Jens Axboe:
    "A set of fixes that should go into this series. This contains:

    - Fix from Bart for blk-mq requeue queue running, preventing a
    continued loop of run/restart.

    - Fix for a bio/blk-integrity issue, in two parts. One from
    Christoph, fixing where verification happens, and one from Milan,
    for a NULL profile.

    - NVMe pull request, most of the changes being for nvme-fc, but also
    a few trivial core/pci fixes"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    nvme: fix directive command numd calculation
    nvme: fix nvme reset command timeout handling
    nvme-pci: fix CMB sysfs file removal in reset path
    lpfc: support nvmet_fc defer_rcv callback
    nvmet_fc: add defer_req callback for deferment of cmd buffer return
    nvme: strip trailing 0-bytes in wwid_show
    block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time
    bio-integrity: only verify integrity on the lowest stacked driver
    bio-integrity: Fix regression if profile verify_fn is NULL

    Linus Torvalds
     
  • Pull MMC fixes from Ulf Hansson:
    "MMC core:

    - fix lockdep splat when removing mmc_block module

    - fix the logic for setting eMMC HS400ES signal voltage

    MMC host:

    - omap_hsmmc: add CMD23 capability to fix -EIO errors"

    * tag 'mmc-v4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
    mmc: block: fix lockdep splat when removing mmc_block module
    mmc: mmc: correct the logic for setting HS400ES signal voltage
    mmc: host: omap_hsmmc: Add CMD23 capability to omap_hsmmc driver

    Linus Torvalds
     
  • Pull fbdev fixes from Bartlomiej Zolnierkiewicz:

    - allow user to disable write combined mapping in efifb driver (Dave
    Airlie)

    - fix use after free bugs on driver removal in imxfb driver (Dan
    Carpenter)

    - fix unused variable warning in omapfb driver (Arnd Bergmann)

    * tag 'fbdev-v4.13-rc5' of git://github.com/bzolnier/linux:
    efifb: allow user to disable write combined mapping.
    fbdev: omapfb: remove unused variable
    video: fbdev: imxfb: use after free in imxfb_remove()

    Linus Torvalds
     
  • Pull fuse fixes from Miklos Szeredi:
    "Fix a few bugs in fuse"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: set mapping error in writepage_locked when it fails
    fuse: Dont call set_page_dirty_lock() for ITER_BVEC pages for async_dio
    fuse: initialize the flock flag in fuse_file on allocation

    Linus Torvalds
     
  • Pull IOMMU fix from Joerg Roedel:
    "Fix a NULL-pointer dereference in arm_smmu_add_device"

    * tag 'iommu-fixes-v4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
    iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

    Linus Torvalds
     
  • The blocklayout code does not compile cleanly for a 32-bit sector_t,
    and also has no reliable checks for devices sizes, which makes it
    unsafe to use with a kernel that doesn't support large block devices.

    Signed-off-by: Christoph Hellwig
    Reported-by: Arnd Bergmann
    Fixes: 5c83746a0cf2 ("pnfs/blocklayout: in-kernel GETDEVICEINFO XDR parsing")
    Signed-off-by: Anna Schumaker

    Christoph Hellwig
     

11 Aug, 2017

17 commits

  • Pull powerpc fixes from Michael Ellerman:
    "All fixes for code that went in this cycle.

    - a revert of an optimisation to the syscall exit path, which could
    lead to an oops on either older machines or machines with > 1TB of
    memory

    - disable some deep idle states if the firmware configuration for
    them fails

    - re-enable HARD/SOFT lockup detectors in defconfigs after a Kconfig
    change

    - six fairly small patches fixing bugs in our new watchdog code

    Thanks to: Gautham R Shenoy, Nicholas Piggin"

    * tag 'powerpc-4.13-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc/watchdog: add locking around init/exit functions
    powerpc/watchdog: Fix marking of stuck CPUs
    powerpc/watchdog: Fix final-check recovered case
    powerpc/watchdog: Moderate touch_nmi_watchdog overhead
    powerpc/watchdog: Improve watchdog lock primitive
    powerpc: NMI IPI improve lock primitive
    powerpc/configs: Re-enable HARD/SOFT lockup detectors
    powerpc/powernv/idle: Disable LOSE_FULL_CONTEXT states when stop-api fails
    Revert "powerpc/64: Avoid restore_math call if possible in syscall exit"

    Linus Torvalds
     
  • Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device"
    removed fwspec assignment in legacy_binding path as redundant which is
    wrong. It needs to be updated after fwspec initialisation in
    arm_smmu_register_legacy_master() as it is dereferenced later. Without
    this there is a NULL-pointer dereference panic during boot on some hosts.

    Signed-off-by: Artem Savkov
    Reviewed-by: Robin Murphy
    Acked-by: Will Deacon
    Signed-off-by: Joerg Roedel

    Artem Savkov
     
  • Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt
    during driver irq_disable/irq_enable. Here is the scenario,
    1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
    2. dev interrupt raised by HW and Xen mark its evtchn as pending
    3. irq_enable -> startup_pirq -> eoi_pirq ->
    clear_evtchn(channel of irq) -> clear pending status
    4. consume_one_event process the irq event without pending bit assert
    which result in interrupt lost once
    5. No HW interrupt raising anymore.

    Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove
    eoi_pirq when irq_enable.

    Signed-off-by: Liu Shuo
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Liu Shuo
     
  • When starting the xenwatch thread a theoretical deadlock situation is
    possible:

    xs_init() contains:

    task = kthread_run(xenwatch_thread, NULL, "xenwatch");
    if (IS_ERR(task))
    return PTR_ERR(task);
    xenwatch_pid = task->pid;

    And xenwatch_thread() does:

    mutex_lock(&xenwatch_mutex);
    ...
    event->handle->callback();
    ...
    mutex_unlock(&xenwatch_mutex);

    The callback could call unregister_xenbus_watch() which does:

    ...
    if (current->pid != xenwatch_pid)
    mutex_lock(&xenwatch_mutex);
    ...

    In case a watch is firing before xenwatch_pid could be set and the
    callback of that watch unregisters a watch, then a self-deadlock would
    occur.

    Avoid this by setting xenwatch_pid in xenwatch_thread().

    Signed-off-by: Juergen Gross
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Juergen Gross
     
  • Pull NVMe fixes from Christoph:

    "A few more small fixes - the fc/lpfc update is the biggest by far."

    Jens Axboe
     
  • A Xen HVM guest running with KASLR enabled will die rather soon today
    because the shared info page mapping is using va() too early. This was
    introduced by commit a5d5f328b0e2baa5ee7c119fd66324eb79eeeb66 ("xen:
    allocate page for shared info page from low memory").

    In order to fix this use early_memremap() to get a temporary virtual
    address for shared info until va() can be used safely.

    Signed-off-by: Juergen Gross
    Reviewed-by: Boris Ostrovsky
    Acked-by: Ingo Molnar
    Signed-off-by: Juergen Gross

    Juergen Gross
     
  • Instead of calling xen_hvm_init_shared_info() on boot and resume split
    it up into a boot time function searching for the pfn to use and a
    mapping function doing the hypervisor mapping call.

    Signed-off-by: Juergen Gross
    Reviewed-by: Boris Ostrovsky
    Acked-by: Ingo Molnar
    Signed-off-by: Juergen Gross

    Juergen Gross
     
  • Provide a hook in hypervisor_x86 called after setting up initial
    memory mapping.

    This is needed e.g. by Xen HVM guests to map the hypervisor shared
    info page.

    Signed-off-by: Juergen Gross
    Reviewed-by: Boris Ostrovsky
    Acked-by: Ingo Molnar
    Signed-off-by: Juergen Gross

    Juergen Gross
     
  • This ensures that we see errors on fsync when writeback fails.

    Signed-off-by: Jeff Layton
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Jan Kara
    Signed-off-by: Miklos Szeredi

    Jeff Layton
     
  • Pull drm fixes from Dave Airlie:
    "Nothing too earth shattering here, it just seems like lots of little
    things all over the place.

    msm has probably the larger amount of changes, but they all seem fine,
    otherwise, some rockchip, i915, etnaviv and exynos fixes, along with
    one nouveau regression fix for some older GPUs"

    * tag 'drm-fixes-for-v4.13-rc5' of git://people.freedesktop.org/~airlied/linux: (35 commits)
    drm/nouveau/disp/nv04: avoid creation of output paths
    drm: make DRM_STM default n
    drm/exynos: forbid creating framebuffers from too small GEM buffers
    drm/etnaviv: Fix off-by-one error in reloc checking
    drm/i915: fix backlight invert for non-zero minimum brightness
    drm/i915/shrinker: Wrap need_resched() inside preempt-disable
    drm/i915/perf: fix flex eu registers programming
    drm/i915: Fix out-of-bounds array access in bdw_load_gamma_lut
    drm/i915/gvt: Change the max length of mmio_reg_rw from 4 to 8
    drm/i915/gvt: Initialize MMIO Block with HW state
    drm/rockchip: vop: report error when check resource error
    drm/rockchip: vop: round_up pitches to word align
    drm/rockchip: vop: fix NV12 video display error
    drm/rockchip: vop: fix iommu page fault when resume
    drm/i915/gvt: clean workload queue if error happened
    drm/i915/gvt: change resetting to resetting_eng
    drm/msm: gpu: don't abuse dma_alloc for non-DMA allocations
    drm/msm: gpu: call qcom_mdt interfaces only for ARCH_QCOM
    drm/msm/adreno: Prevent unclocked access when retrieving timestamps
    drm/msm: Remove __user from __u64 data types
    ...

    Linus Torvalds
     
  • Merge misc fixes from Andrew Morton:
    "21 fixes"

    * emailed patches from Andrew Morton : (21 commits)
    userfaultfd: replace ENOSPC with ESRCH in case mm has gone during copy/zeropage
    zram: rework copy of compressor name in comp_algorithm_store()
    rmap: do not call mmu_notifier_invalidate_page() under ptl
    mm: fix list corruptions on shmem shrinklist
    mm/balloon_compaction.c: don't zero ballooned pages
    MAINTAINERS: copy virtio on balloon_compaction.c
    mm: fix KSM data corruption
    mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem
    mm: make tlb_flush_pending global
    mm: refactor TLB gathering API
    Revert "mm: numa: defer TLB flush for THP migration as long as possible"
    mm: migrate: fix barriers around tlb_flush_pending
    mm: migrate: prevent racy access to tlb_flush_pending
    fault-inject: fix wrong should_fail() decision in task context
    test_kmod: fix small memory leak on filesystem tests
    test_kmod: fix the lock in register_test_dev_kmod()
    test_kmod: fix bug which allows negative values on two config options
    test_kmod: fix spelling mistake: "EMTPY" -> "EMPTY"
    userfaultfd: hugetlbfs: remove superfluous page unlock in VM_SHARED case
    mm: ratelimit PFNs busy info message
    ...

    Linus Torvalds
     
  • When the process exit races with outstanding mcopy_atomic, it would be
    better to return ESRCH error. When such race occurs the process and
    it's mm are going away and returning "no such process" to the uffd
    monitor seems better fit than ENOSPC.

    Link: http://lkml.kernel.org/r/1502111545-32305-1-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Suggested-by: Michal Hocko
    Acked-by: Michal Hocko
    Cc: Andrea Arcangeli
    Cc: "Dr. David Alan Gilbert"
    Cc: Pavel Emelyanov
    Cc: Mike Kravetz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • comp_algorithm_store() passes the size of the source buffer to strlcpy()
    instead of the destination buffer size. Make it explicit that the two
    buffers have the same size and use strcpy() instead of strlcpy(). The
    latter can be done safely since the function ensures that the string in
    the source buffer is terminated.

    Link: http://lkml.kernel.org/r/20170803163350.45245-1-mka@chromium.org
    Signed-off-by: Matthias Kaehlcke
    Reviewed-by: Douglas Anderson
    Reviewed-by: Sergey Senozhatsky
    Acked-by: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Kaehlcke
     
  • MMU notifiers can sleep, but in page_mkclean_one() we call
    mmu_notifier_invalidate_page() under page table lock.

    Let's instead use mmu_notifier_invalidate_range() outside
    page_vma_mapped_walk() loop.

    [jglisse@redhat.com: try_to_unmap_one() do not call mmu_notifier under ptl]
    Link: http://lkml.kernel.org/r/20170809204333.27485-1-jglisse@redhat.com
    Link: http://lkml.kernel.org/r/20170804134928.l4klfcnqatni7vsc@black.fi.intel.com
    Fixes: c7ab0d2fdc84 ("mm: convert try_to_unmap_one() to use page_vma_mapped_walk()")
    Signed-off-by: Kirill A. Shutemov
    Signed-off-by: Jérôme Glisse
    Reported-by: axie
    Cc: Alex Deucher
    Cc: "Writer, Tim"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • We saw many list corruption warnings on shmem shrinklist:

    WARNING: CPU: 18 PID: 177 at lib/list_debug.c:59 __list_del_entry+0x9e/0xc0
    list_del corruption. prev->next should be ffff9ae5694b82d8, but was ffff9ae5699ba960
    Modules linked in: intel_rapl sb_edac edac_core x86_pkg_temp_thermal coretemp iTCO_wdt iTCO_vendor_support crct10dif_pclmul crc32_pclmul ghash_clmulni_intel raid0 dcdbas shpchp wmi hed i2c_i801 ioatdma lpc_ich i2c_smbus acpi_cpufreq tcp_diag inet_diag sch_fq_codel ipmi_si ipmi_devintf ipmi_msghandler igb ptp crc32c_intel pps_core i2c_algo_bit i2c_core dca ipv6 crc_ccitt
    CPU: 18 PID: 177 Comm: kswapd1 Not tainted 4.9.34-t3.el7.twitter.x86_64 #1
    Hardware name: Dell Inc. PowerEdge C6220/0W6W6G, BIOS 2.2.3 11/07/2013
    Call Trace:
    dump_stack+0x4d/0x66
    __warn+0xcb/0xf0
    warn_slowpath_fmt+0x4f/0x60
    __list_del_entry+0x9e/0xc0
    shmem_unused_huge_shrink+0xfa/0x2e0
    shmem_unused_huge_scan+0x20/0x30
    super_cache_scan+0x193/0x1a0
    shrink_slab.part.41+0x1e3/0x3f0
    shrink_slab+0x29/0x30
    shrink_node+0xf9/0x2f0
    kswapd+0x2d8/0x6c0
    kthread+0xd7/0xf0
    ret_from_fork+0x22/0x30

    WARNING: CPU: 23 PID: 639 at lib/list_debug.c:33 __list_add+0x89/0xb0
    list_add corruption. prev->next should be next (ffff9ae5699ba960), but was ffff9ae5694b82d8. (prev=ffff9ae5694b82d8).
    Modules linked in: intel_rapl sb_edac edac_core x86_pkg_temp_thermal coretemp iTCO_wdt iTCO_vendor_support crct10dif_pclmul crc32_pclmul ghash_clmulni_intel raid0 dcdbas shpchp wmi hed i2c_i801 ioatdma lpc_ich i2c_smbus acpi_cpufreq tcp_diag inet_diag sch_fq_codel ipmi_si ipmi_devintf ipmi_msghandler igb ptp crc32c_intel pps_core i2c_algo_bit i2c_core dca ipv6 crc_ccitt
    CPU: 23 PID: 639 Comm: systemd-udevd Tainted: G W 4.9.34-t3.el7.twitter.x86_64 #1
    Hardware name: Dell Inc. PowerEdge C6220/0W6W6G, BIOS 2.2.3 11/07/2013
    Call Trace:
    dump_stack+0x4d/0x66
    __warn+0xcb/0xf0
    warn_slowpath_fmt+0x4f/0x60
    __list_add+0x89/0xb0
    shmem_setattr+0x204/0x230
    notify_change+0x2ef/0x440
    do_truncate+0x5d/0x90
    path_openat+0x331/0x1190
    do_filp_open+0x7e/0xe0
    do_sys_open+0x123/0x200
    SyS_open+0x1e/0x20
    do_syscall_64+0x61/0x170
    entry_SYSCALL64_slow_path+0x25/0x25

    The problem is that shmem_unused_huge_shrink() moves entries from the
    global sbinfo->shrinklist to its local lists and then releases the
    spinlock. However, a parallel shmem_setattr() could access one of these
    entries directly and add it back to the global shrinklist if it is
    removed, with the spinlock held.

    The logic itself looks solid since an entry could be either in a local
    list or the global list, otherwise it is removed from one of them by
    list_del_init(). So probably the race condition is that, one CPU is in
    the middle of INIT_LIST_HEAD() but the other CPU calls list_empty()
    which returns true too early then the following list_add_tail() sees a
    corrupted entry.

    list_empty_careful() is designed to fix this situation.

    [akpm@linux-foundation.org: add comments]
    Link: http://lkml.kernel.org/r/20170803054630.18775-1-xiyou.wangcong@gmail.com
    Fixes: 779750d20b93 ("shmem: split huge pages beyond i_size under memory pressure")
    Signed-off-by: Cong Wang
    Acked-by: Linus Torvalds
    Acked-by: Kirill A. Shutemov
    Cc: Hugh Dickins
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cong Wang
     
  • Revert commit bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page
    to balloon device")'

    Zeroing ballon pages is rather time consuming, especially when a lot of
    pages are in flight. E.g. 7GB worth of ballooned memory takes 2.8s with
    __GFP_ZERO while it takes ~491ms without it.

    The original commit argued that zeroing will help ksmd to merge these
    pages on the host but this argument is assuming that the host actually
    marks balloon pages for ksm which is not universally true. So we pay
    performance penalty for something that even might not be used in the end
    which is wrong. The host can zero out pages on its own when there is a
    need.

    [mhocko@kernel.org: new changelog text]
    Link: http://lkml.kernel.org/r/1501761557-9758-1-git-send-email-wei.w.wang@intel.com
    Fixes: bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")
    Signed-off-by: Wei Wang
    Acked-by: Michael S. Tsirkin
    Acked-by: Michal Hocko
    Cc: zhenwei.pi
    Cc: David Hildenbrand
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wei Wang
     
  • Changes to mm/balloon_compaction.c can easily break virtio, and virtio
    is the only user of that interface. Add a line to MAINTAINERS so
    whoever changes that file remembers to copy us.

    Link: http://lkml.kernel.org/r/1501764010-24456-1-git-send-email-mst@redhat.com
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Rafael Aquini
    Acked-by: Wei Wang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael S. Tsirkin