Skip to content
Permalink
Ming-Lei/block…
Switch branches/tags

Commits on Sep 15, 2021

  1. block: hold ->invalidate_lock in blkdev_fallocate

    When running ->fallocate(), blkdev_fallocate() should hold
    mapping->invalidate_lock to prevent page cache from being
    accessed, otherwise stale data may be read in page cache.
    
    Without this patch, blktests block/009 fails sometimes. With
    this patch, block/009 can pass always.
    
    Cc: Jan Kara <jack@suse.cz>
    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and intel-lab-lkp committed Sep 15, 2021

Commits on Aug 22, 2021

  1. Linux 5.14-rc7

    torvalds committed Aug 22, 2021
  2. Merge tag 'powerpc-5.14-6' of git://git.kernel.org/pub/scm/linux/kern…

    …el/git/powerpc/linux
    
    Pull powerpc fixes from Michael Ellerman:
    
     - Fix random crashes on some 32-bit CPUs by adding isync() after
       locking/unlocking KUEP
    
     - Fix intermittent crashes when loading modules with strict module RWX
    
     - Fix a section mismatch introduce by a previous fix.
    
    Thanks to Christophe Leroy, Fabiano Rosas, Laurent Vivier, Murilo
    Opsfelder Araújo, Nathan Chancellor, and Stan Johnson.
    
    h# -----BEGIN PGP SIGNATURE-----
    
    * tag 'powerpc-5.14-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
      powerpc/mm: Fix set_memory_*() against concurrent accesses
      powerpc/32s: Fix random crashes by adding isync() after locking/unlocking KUEP
      powerpc/xive: Do not mark xive_request_ipi() as __init
    torvalds committed Aug 22, 2021

Commits on Aug 21, 2021

  1. Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux…

    …/kernel/git/clk/linux
    
    Pull clk driver fixes from Stephen Boyd:
    
     - Make the regulator state match the GDSC power domain state at boot on
       Qualcomm SoCs so that the regulator isn't turned off inadvertently.
    
     - Fix earlycon on i.MX6Q SoCs
    
    * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
      clk: qcom: gdsc: Ensure regulator init state matches GDSC state
      clk: imx6q: fix uart earlycon unwork
    torvalds committed Aug 21, 2021
  2. Merge tag 'char-misc-5.14-rc7' of git://git.kernel.org/pub/scm/linux/…

    …kernel/git/gregkh/char-misc
    
    Pull char/misc driver fixes from Greg KH:
     "Here are some small driver fixes for 5.14-rc7.
    
      They consist of:
    
       - revert for an interconnect patch that was found to have problems
    
       - ipack tpci200 driver fixes for reported problems
    
       - slimbus messaging and ngd fixes for reported problems
    
      All are small and have been in linux-next for a while with no reported
      issues"
    
    * tag 'char-misc-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
      ipack: tpci200: fix memory leak in the tpci200_register
      ipack: tpci200: fix many double free issues in tpci200_pci_probe
      slimbus: ngd: reset dma setup during runtime pm
      slimbus: ngd: set correct device for pm
      slimbus: messaging: check for valid transaction id
      slimbus: messaging: start transaction ids from 1 instead of zero
      Revert "interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate"
    torvalds committed Aug 21, 2021
  3. Merge tag 'usb-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/gregkh/usb
    
    Pull USB fix from Greg KH:
     "Here is a single USB typec tcpm fix for a reported problem for
      5.14-rc7. It showed up in 5.13 and resolves an issue that Hans found.
      It has been in linux-next this week with no reported problems"
    
    * tag 'usb-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
      usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers
    torvalds committed Aug 21, 2021
  4. Merge tag 'riscv-for-linus-5.14-rc7' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/riscv/linux
    
    Pull RISC-V fixes from Palmer Dabbelt:
    
     - fix the sifive-l2-cache device tree bindings for json-schema
       compatibility. This does not change the intended behavior of the
       binding.
    
     - avoid improperly freeing necessary resources during early boot.
    
    * tag 'riscv-for-linus-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
      riscv: Fix a number of free'd resources in init_resources()
      dt-bindings: sifive-l2-cache: Fix 'select' matching
    torvalds committed Aug 21, 2021
  5. Merge tag 's390-5.14-5' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/s390/linux
    
    Pull s390 fix from Vasily Gorbik:
    
     - fix use after free of zpci_dev in pci code
    
    * tag 's390-5.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
      s390/pci: fix use after free of zpci_dev
    torvalds committed Aug 21, 2021
  6. Merge tag 'locks-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/jlayton/linux
    
    Pull mandatory file locking deprecation warning from Jeff Layton:
     "As discussed on the list, this patch just adds a new warning for folks
      who still have mandatory locking enabled and actually mount with '-o
      mand'. I'd like to get this in for v5.14 so we can push this out into
      stable kernels and hopefully reach folks who have mounts with -o mand.
    
      For now, I'm operating under the assumption that we'll fully remove
      this support in v5.15, but we can move that out if any legitimate
      users of this facility speak up between now and then"
    
    * tag 'locks-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
      fs: warn about impending deprecation of mandatory locks
    torvalds committed Aug 21, 2021
  7. Merge tag 'block-5.14-2021-08-20' of git://git.kernel.dk/linux-block

    Pull block fixes from Jens Axboe:
     "Three fixes from Ming Lei that should go into 5.14:
    
       - Fix for a kernel panic when iterating over tags for some cases
         where a flush request is present, a regression in this cycle.
    
       - Request timeout fix
    
       - Fix flush request checking"
    
    * tag 'block-5.14-2021-08-20' of git://git.kernel.dk/linux-block:
      blk-mq: fix is_flush_rq
      blk-mq: fix kernel panic during iterating over flush request
      blk-mq: don't grab rq's refcount in blk_mq_check_expired()
    torvalds committed Aug 21, 2021
  8. Merge tag 'io_uring-5.14-2021-08-20' of git://git.kernel.dk/linux-block

    Pull io_uring fixes from Jens Axboe:
     "A few small fixes that should go into this release:
    
       - Fix never re-assigning an initial error value for io_uring_enter()
         for SQPOLL, if asked to do nothing
    
       - Fix xa_alloc_cycle() return value checking, for cases where we have
         wrapped around
    
       - Fix for a ctx pin issue introduced in this cycle (Pavel)"
    
    * tag 'io_uring-5.14-2021-08-20' of git://git.kernel.dk/linux-block:
      io_uring: fix xa_alloc_cycle() error return value check
      io_uring: pin ctx on fallback execution
      io_uring: only assign io_uring_enter() SQPOLL error in actual error case
    torvalds committed Aug 21, 2021
  9. fs: warn about impending deprecation of mandatory locks

    We've had CONFIG_MANDATORY_FILE_LOCKING since 2015 and a lot of distros
    have disabled it. Warn the stragglers that still use "-o mand" that
    we'll be dropping support for that mount option.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeff Layton <jlayton@kernel.org>
    jtlayton committed Aug 21, 2021

Commits on Aug 20, 2021

  1. io_uring: fix xa_alloc_cycle() error return value check

    We currently check for ret != 0 to indicate error, but '1' is a valid
    return and just indicates that the allocation succeeded with a wrap.
    Correct the check to be for < 0, like it was before the xarray
    conversion.
    
    Cc: stable@vger.kernel.org
    Fixes: 61cf937 ("io_uring: Convert personality_idr to XArray")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    axboe committed Aug 20, 2021
  2. Merge tag 'acpi-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kerne…

    …l/git/rafael/linux-pm
    
    Pull ACPI fixes from Rafael Wysocki:
     "These fix two mistakes in new code.
    
      Specifics:
    
       - Prevent confusing messages from being printed if the PRMT table is
         not present or there are no PRM modules (Aubrey Li).
    
       - Fix the handling of suspend-to-idle entry and exit in the case when
         the Microsoft UUID is used with the Low-Power S0 Idle _DSM
         interface (Mario Limonciello)"
    
    * tag 'acpi-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
      ACPI: PM: s2idle: Invert Microsoft UUID entry and exit
      ACPI: PRM: Deal with table not present or no module found
    torvalds committed Aug 20, 2021
  3. Merge tag 'pm-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/rafael/linux-pm
    
    Pull power management fixes from Rafael Wysocki:
     "These fix some issues in the ARM cpufreq drivers and in the operating
      performance points (OPP) framework.
    
      Specifics:
    
       - Fix useless WARN() in the OPP core and prevent a noisy warning
         from being printed by OPP _put functions (Dmitry Osipenko).
    
       - Fix error path when allocation failed in the arm_scmi cpufreq
         driver (Lukasz Luba).
    
       - Blacklist Qualcomm sc8180x and Qualcomm sm8150 in
         cpufreq-dt-platdev (Bjorn Andersson, Thara Gopinath).
    
       - Forbid cpufreq for 1.2 GHz variant in the armada-37xx cpufreq
         driver (Marek Behún)"
    
    * tag 'pm-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
      opp: Drop empty-table checks from _put functions
      cpufreq: armada-37xx: forbid cpufreq for 1.2 GHz variant
      cpufreq: blocklist Qualcomm sm8150 in cpufreq-dt-platdev
      cpufreq: arm_scmi: Fix error path when allocation failed
      opp: remove WARN when no valid OPPs remain
      cpufreq: blacklist Qualcomm sc8180x in cpufreq-dt-platdev
    torvalds committed Aug 20, 2021
  4. Merge branch 'akpm' (patches from Andrew)

    Merge misc fixes from Andrew Morton:
     "10 patches.
    
      Subsystems affected by this patch series: MAINTAINERS and mm (shmem,
      pagealloc, tracing, memcg, memory-failure, vmscan, kfence, and
      hugetlb)"
    
    * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
      hugetlb: don't pass page cache pages to restore_reserve_on_error
      kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
      mm: vmscan: fix missing psi annotation for node_reclaim()
      mm/hwpoison: retry with shake_page() for unhandlable pages
      mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim
      MAINTAINERS: update ClangBuiltLinux IRC chat
      mmflags.h: add missing __GFP_ZEROTAGS and __GFP_SKIP_KASAN_POISON names
      mm/page_alloc: don't corrupt pcppage_migratetype
      Revert "mm: swap: check if swap backing device is congested or not"
      Revert "mm/shmem: fix shmem_swapin() race with swapoff"
    torvalds committed Aug 20, 2021
  5. Merge tag 'drm-fixes-2021-08-20-3' of git://anongit.freedesktop.org/d…

    …rm/drm
    
    Pull drm fixes from Dave Airlie:
     "Regularly scheduled fixes. The ttm one solves a problem of GPU drivers
      failing to load if debugfs is off in Kconfig, otherwise the i915 and
      mediatek, and amdgpu fixes all fairly normal.
    
      Nouveau has a couple of display fixes, but it has a fix for a
      longstanding race condition in it's memory manager code, and the fix
      mostly removes some code that wasn't working properly and has no
      userspace users. This fix makes the diffstat kinda larger but in a
      good (negative line-count) way.
    
      core:
       - fix drm_wait_vblank uapi copying bug
    
      ttm:
       - fix debugfs init when debugfs is off
    
      amdgpu:
       - vega10 SMU workload fix
       - DCN VM fix
       - DCN 3.01 watermark fix
    
      amdkfd:
       - SVM fix
    
      nouveau:
       - ampere display fixes
       - remove MM misfeature to fix a longstanding race condition
    
      i915:
       - tweaked display workaround for all PCHs
       - eDP MSO pipe sanity for ADL-P fix
       - remove unused symbol export
    
      mediatek:
       - AAL output size setting
       - Delete component in remove function"
    
    * tag 'drm-fixes-2021-08-20-3' of git://anongit.freedesktop.org/drm/drm:
      drm/amd/display: Use DCN30 watermark calc for DCN301
      drm/i915/dp: remove superfluous EXPORT_SYMBOL()
      drm/i915/edp: fix eDP MSO pipe sanity checks for ADL-P
      drm/i915: Tweaked Wa_14010685332 for all PCHs
      drm/nouveau: rip out nvkm_client.super
      drm/nouveau: block a bunch of classes from userspace
      drm/nouveau/fifo/nv50-: rip out dma channels
      drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences
      drm/nouveau/disp: power down unused DP links during init
      drm/nouveau: recognise GA107
      drm: Copy drm_wait_vblank to user before returning
      drm/amd/display: Ensure DCN save after VM setup
      drm/amdkfd: fix random KFDSVMRangeTest.SetGetAttributesTest test failure
      drm/amd/pm: change the workload type for some cards
      Revert "drm/amd/pm: fix workload mismatch on vega10"
      drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
      drm/mediatek: Add component_del in OVL and COLOR remove function
      drm/mediatek: Add AAL output size configuration
    torvalds committed Aug 20, 2021
  6. Merge tag 'pci-v5.14-fixes-2' of git://git.kernel.org/pub/scm/linux/k…

    …ernel/git/helgaas/pci
    
    Pull PCI fixes from Bjorn Helgaas:
    
     - Add Rahul Tanwar as Intel LGM Gateway PCIe maintainer (Rahul Tanwar)
    
     - Add Jim Quinlan et al as Broadcom STB PCIe maintainers (Jim Quinlan)
    
     - Increase D3hot-to-D0 delay for AMD Renoir/Cezanne XHCI (Marcin
       Bachry)
    
     - Correct iomem_get_mapping() usage for legacy_mem sysfs (Krzysztof
       Wilczyński)
    
    * tag 'pci-v5.14-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
      PCI/sysfs: Use correct variable for the legacy_mem sysfs object
      PCI: Increase D3 delay for AMD Renoir/Cezanne XHCI
      MAINTAINERS: Add Jim Quinlan et al as Broadcom STB PCIe maintainers
      MAINTAINERS: Add Rahul Tanwar as Intel LGM Gateway PCIe maintainer
    torvalds committed Aug 20, 2021
  7. Merge tag 'mmc-v5.14-rc4' of git://git.kernel.org/pub/scm/linux/kerne…

    …l/git/ulfh/mmc
    
    Pull MMC host fixes from Ulf Hansson:
    
     - dw_mmc: Fix hang on data CRC error
    
     - mmci: Fix voltage switch procedure for the stm32 variant
    
     - sdhci-iproc: Fix some clock issues for BCM2711
    
     - sdhci-msm: Fixup software timeout value
    
    * tag 'mmc-v5.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
      mmc: sdhci-iproc: Set SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN on BCM2711
      mmc: sdhci-iproc: Cap min clock frequency on BCM2711
      mmc: sdhci-msm: Update the software timeout value for sdhc
      mmc: mmci: stm32: Check when the voltage switch procedure should be done
      mmc: dw_mmc: Fix hang on data CRC error
    torvalds committed Aug 20, 2021
  8. Merge tag 'sound-5.14-rc7-2' of git://git.kernel.org/pub/scm/linux/ke…

    …rnel/git/tiwai/sound
    
    Pull more sound fixes from Takashi Iwai:
     "This is a quick follow up for 5.14: a fix for a very recently
      introduced regression on ASoC Intel Atom driver, and another trivial
      HD-audio quirk for HP laptops"
    
    * tag 'sound-5.14-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
      ASoC: intel: atom: Fix breakage for PCM buffer address setup
      ALSA: hda/realtek: Limit mic boost on HP ProBook 445 G8
    torvalds committed Aug 20, 2021
  9. Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/arm64/linux
    
    Pull arm64 fixes from Will Deacon:
    
     - Fix cleaning of vDSO directories
    
     - Ensure CNTHCTL_EL2 is fully initialised when booting at EL2
    
    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
      arm64: initialize all of CNTHCTL_EL2
      arm64: clean vdso & vdso32 files
    torvalds committed Aug 20, 2021
  10. Merge branch 'acpi-pm'

    * acpi-pm:
      ACPI: PM: s2idle: Invert Microsoft UUID entry and exit
    rafaeljw committed Aug 20, 2021
  11. Merge tag 'iommu-fixes-v5.14-rc6' of git://git.kernel.org/pub/scm/lin…

    …ux/kernel/git/joro/iommu
    
    Pull iommu fixes from Joerg Roedel:
    
     - Fix for a potential NULL-ptr dereference in IOMMU core code
    
     - Two resource leak fixes
    
     - Cache flush fix in the Intel VT-d driver
    
    * tag 'iommu-fixes-v5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
      iommu/vt-d: Fix incomplete cache flush in intel_pasid_tear_down_entry()
      iommu/vt-d: Fix PASID reference leak
      iommu: Check if group is NULL before remove device
      iommu/dma: Fix leak in non-contiguous API
    torvalds committed Aug 20, 2021
  12. Merge branch 'pm-opp'

    * pm-opp:
      opp: Drop empty-table checks from _put functions
      opp: remove WARN when no valid OPPs remain
    rafaeljw committed Aug 20, 2021
  13. hugetlb: don't pass page cache pages to restore_reserve_on_error

    syzbot hit kernel BUG at fs/hugetlbfs/inode.c:532 as described in [1].
    This BUG triggers if the HPageRestoreReserve flag is set on a page in
    the page cache.  It should never be set, as the routine
    huge_add_to_page_cache explicitly clears the flag after adding a page to
    the cache.
    
    The only code other than huge page allocation which sets the flag is
    restore_reserve_on_error.  It will potentially set the flag in rare out
    of memory conditions.  syzbot was injecting errors to cause memory
    allocation errors which exercised this specific path.
    
    The code in restore_reserve_on_error is doing the right thing.  However,
    there are instances where pages in the page cache were being passed to
    restore_reserve_on_error.  This is incorrect, as once a page goes into
    the cache reservation information will not be modified for the page
    until it is removed from the cache.  Error paths do not remove pages
    from the cache, so even in the case of error, the page will remain in
    the cache and no reservation adjustment is needed.
    
    Modify routines that potentially call restore_reserve_on_error with a
    page cache page to no longer do so.
    
    Note on fixes tag: Prior to commit 846be08 ("mm/hugetlb: expand
    restore_reserve_on_error functionality") the routine would not process
    page cache pages because the HPageRestoreReserve flag is not set on such
    pages.  Therefore, this issue could not be trigggered.  The code added
    by commit 846be08 ("mm/hugetlb: expand restore_reserve_on_error
    functionality") is needed and correct.  It exposed incorrect calls to
    restore_reserve_on_error which is the root cause addressed by this
    commit.
    
    [1] https://lore.kernel.org/linux-mm/00000000000050776d05c9b7c7f0@google.com/
    
    Link: https://lkml.kernel.org/r/20210818213304.37038-1-mike.kravetz@oracle.com
    Fixes: 846be08 ("mm/hugetlb: expand restore_reserve_on_error functionality")
    Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
    Reported-by: <syzbot+67654e51e54455f1c585@syzkaller.appspotmail.com>
    Cc: Mina Almasry <almasrymina@google.com>
    Cc: Axel Rasmussen <axelrasmussen@google.com>
    Cc: Peter Xu <peterx@redhat.com>
    Cc: Muchun Song <songmuchun@bytedance.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    mjkravetz authored and torvalds committed Aug 20, 2021
  14. kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE

    Originally the addr != NULL check was meant to take care of the case
    where __kfence_pool == NULL (KFENCE is disabled).  However, this does
    not work for addresses where addr > 0 && addr < KFENCE_POOL_SIZE.
    
    This can be the case on NULL-deref where addr > 0 && addr < PAGE_SIZE or
    any other faulting access with addr < KFENCE_POOL_SIZE.  While the
    kernel would likely crash, the stack traces and report might be
    confusing due to double faults upon KFENCE's attempt to unprotect such
    an address.
    
    Fix it by just checking that __kfence_pool != NULL instead.
    
    Link: https://lkml.kernel.org/r/20210818130300.2482437-1-elver@google.com
    Fixes: 0ce20dd ("mm: add Kernel Electric-Fence infrastructure")
    Signed-off-by: Marco Elver <elver@google.com>
    Reported-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
    Acked-by: Alexander Potapenko <glider@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: <stable@vger.kernel.org>    [5.12+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    melver authored and torvalds committed Aug 20, 2021
  15. mm: vmscan: fix missing psi annotation for node_reclaim()

    In a debugging session the other day, Rik noticed that node_reclaim()
    was missing memstall annotations.  This means we'll miss pressure and
    lost productivity resulting from reclaim on an overloaded local NUMA
    node when vm.zone_reclaim_mode is enabled.
    
    There haven't been any reports, but that's likely because
    vm.zone_reclaim_mode hasn't been a commonly used feature recently, and
    the intersection between such setups and psi users is probably nil.
    
    But secondary memory such as CXL-connected DIMMS, persistent memory etc,
    and the page demotion patches that handle them
    (https://lore.kernel.org/lkml/20210401183216.443C4443@viggo.jf.intel.com/)
    could soon make this a more common codepath again.
    
    Link: https://lkml.kernel.org/r/20210818152457.35846-1-hannes@cmpxchg.org
    Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
    Reported-by: Rik van Riel <riel@surriel.com>
    Reviewed-by: Shakeel Butt <shakeelb@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    hnaz authored and torvalds committed Aug 20, 2021
  16. mm/hwpoison: retry with shake_page() for unhandlable pages

    HWPoisonHandlable() sometimes returns false for typical user pages due
    to races with average memory events like transfers over LRU lists.  This
    causes failures in hwpoison handling.
    
    There's retry code for such a case but does not work because the retry
    loop reaches the retry limit too quickly before the page settles down to
    handlable state.  Let get_any_page() call shake_page() to fix it.
    
    [naoya.horiguchi@nec.com: get_any_page(): return -EIO when retry limit reached]
      Link: https://lkml.kernel.org/r/20210819001958.2365157-1-naoya.horiguchi@linux.dev
    
    Link: https://lkml.kernel.org/r/20210817053703.2267588-1-naoya.horiguchi@linux.dev
    Fixes: 25182f0 ("mm,hwpoison: fix race with hugetlb page allocation")
    Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
    Reported-by: Tony Luck <tony.luck@intel.com>
    Reviewed-by: Yang Shi <shy828301@gmail.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Muchun Song <songmuchun@bytedance.com>
    Cc: Mike Kravetz <mike.kravetz@oracle.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: <stable@vger.kernel.org>		[5.13+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    nhoriguchi authored and torvalds committed Aug 20, 2021
  17. mm: memcontrol: fix occasional OOMs due to proportional memory.low re…

    …claim
    
    We've noticed occasional OOM killing when memory.low settings are in
    effect for cgroups.  This is unexpected and undesirable as memory.low is
    supposed to express non-OOMing memory priorities between cgroups.
    
    The reason for this is proportional memory.low reclaim.  When cgroups
    are below their memory.low threshold, reclaim passes them over in the
    first round, and then retries if it couldn't find pages anywhere else.
    But when cgroups are slightly above their memory.low setting, page scan
    force is scaled down and diminished in proportion to the overage, to the
    point where it can cause reclaim to fail as well - only in that case we
    currently don't retry, and instead trigger OOM.
    
    To fix this, hook proportional reclaim into the same retry logic we have
    in place for when cgroups are skipped entirely.  This way if reclaim
    fails and some cgroups were scanned with diminished pressure, we'll try
    another full-force cycle before giving up and OOMing.
    
    [akpm@linux-foundation.org: coding-style fixes]
    
    Link: https://lkml.kernel.org/r/20210817180506.220056-1-hannes@cmpxchg.org
    Fixes: 9783aa9 ("mm, memcg: proportional memory.{low,min} reclaim")
    Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
    Reported-by: Leon Yang <lnyng@fb.com>
    Reviewed-by: Rik van Riel <riel@surriel.com>
    Reviewed-by: Shakeel Butt <shakeelb@google.com>
    Acked-by: Roman Gushchin <guro@fb.com>
    Acked-by: Chris Down <chris@chrisdown.name>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Cc: <stable@vger.kernel.org>		[5.4+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    hnaz authored and torvalds committed Aug 20, 2021
  18. MAINTAINERS: update ClangBuiltLinux IRC chat

    Everyone has moved from Freenode to Libera so updated the channel entry
    for MAINTAINERS.
    
    Link: ClangBuiltLinux#1402
    Link: https://lkml.kernel.org/r/20210818022339.3863058-1-nathan@kernel.org
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Kees Cook <keescook@chromium.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    nathanchance authored and torvalds committed Aug 20, 2021
  19. mmflags.h: add missing __GFP_ZEROTAGS and __GFP_SKIP_KASAN_POISON names

    printk("%pGg") outputs these two flags as hexadecimal number, rather
    than as a string, e.g:
    
    	GFP_KERNEL|0x1800000
    
    Fix this by adding missing names of __GFP_ZEROTAGS and
    __GFP_SKIP_KASAN_POISON flags to __def_gfpflag_names.
    
    Link: https://lkml.kernel.org/r/20210816133502.590-1-rppt@kernel.org
    Fixes: 013bb59 ("arm64: mte: handle tags zeroing at page allocation time")
    Fixes: c275c5c ("kasan: disable freed user page poisoning with HW tags")
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Peter Collingbourne <pcc@google.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    rppt authored and torvalds committed Aug 20, 2021
  20. mm/page_alloc: don't corrupt pcppage_migratetype

    When placing pages on a pcp list, migratetype values over
    MIGRATE_PCPTYPES get added to the MIGRATE_MOVABLE pcp list.
    
    However, the actual migratetype is preserved in the page and should
    not be changed to MIGRATE_MOVABLE or the page may end up on the wrong
    free_list.
    
    The impact is that HIGHATOMIC or CMA pages getting bulk freed from the
    PCP lists could potentially end up on the wrong buddy list.  There are
    various consequences but minimally NR_FREE_CMA_PAGES accounting could
    get screwed up.
    
    [mgorman@techsingularity.net: changelog update]
    
    Link: https://lkml.kernel.org/r/20210811182917.2607994-1-opendmb@gmail.com
    Fixes: df1acc8 ("mm/page_alloc: avoid conflating IRQs disabled with zone->lock")
    Signed-off-by: Doug Berger <opendmb@gmail.com>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Acked-by: Mel Gorman <mgorman@techsingularity.net>
    Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Doug Berger authored and torvalds committed Aug 20, 2021
  21. Revert "mm: swap: check if swap backing device is congested or not"

    Due to the change about how block layer detects congestion the
    justification of commit 8fd2e0b ("mm: swap: check if swap backing
    device is congested or not") doesn't stand anymore, so the commit could
    be just reverted in order to solve the race reported by commit
    2efa33f ("mm/shmem: fix shmem_swapin() race with swapoff").  The
    fix was reverted by the previous patch.
    
    Link: https://lkml.kernel.org/r/20210810202936.2672-3-shy828301@gmail.com
    Signed-off-by: Yang Shi <shy828301@gmail.com>
    Suggested-by: Hugh Dickins <hughd@google.com>
    Acked-by: Hugh Dickins <hughd@google.com>
    Cc: "Huang, Ying" <ying.huang@intel.com>
    Cc: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: David Hildenbrand <david@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    yang-shi authored and torvalds committed Aug 20, 2021
  22. Revert "mm/shmem: fix shmem_swapin() race with swapoff"

    Due to the change about how block layer detects congestion the
    justification of commit 8fd2e0b ("mm: swap: check if swap backing
    device is congested or not") doesn't stand anymore, so the commit could
    be just reverted in order to solve the race reported by commit
    2efa33f ("mm/shmem: fix shmem_swapin() race with swapoff"), so the
    fix commit could be just reverted as well.
    
    And that fix is also kind of buggy as discussed by [1] and [2].
    
    [1] https://lore.kernel.org/linux-mm/24187e5e-069-9f3f-cefe-39ac70783753@google.com/
    [2] https://lore.kernel.org/linux-mm/e82380b9-3ad4-4a52-be50-6d45c7f2b5da@google.com/
    
    Link: https://lkml.kernel.org/r/20210810202936.2672-2-shy828301@gmail.com
    Signed-off-by: Yang Shi <shy828301@gmail.com>
    Suggested-by: Hugh Dickins <hughd@google.com>
    Acked-by: Hugh Dickins <hughd@google.com>
    Cc: "Huang, Ying" <ying.huang@intel.com>
    Cc: Miaohe Lin <linmiaohe@huawei.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    yang-shi authored and torvalds committed Aug 20, 2021
  23. riscv: Fix a number of free'd resources in init_resources()

    Function init_resources() allocates a boot memory block to hold an array of
    resources which it adds to iomem_resource. The array is filled in from its
    end and the function then attempts to free any unused memory at the
    beginning. The problem is that size of the unused memory is incorrectly
    calculated and this can result in releasing memory which is in use by
    active resources. Their data then gets corrupted later when the memory is
    reused by a different part of the system.
    
    Fix the size of the released memory to correctly match the number of unused
    resource entries.
    
    Fixes: ffe0e52 ("RISC-V: Improve init_resources()")
    Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
    Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
    Acked-by: Nick Kossifidis <mick@ics.forth.gr>
    Tested-by: Sunil V L <sunilvl@ventanamicro.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
    petrpavlu authored and palmer-dabbelt committed Aug 20, 2021
Older