1. Mar 27, 2021
    • Sahitya Tummala's avatar
      f2fs: allow to change discard policy based on cached discard cmds · d6d2b491
      Sahitya Tummala authored
      
      
      With the default DPOLICY_BG discard thread is ioaware, which prevents
      the discard thread from issuing the discard commands. On low RAM setups,
      it is observed that these discard commands in the cache are consuming
      high memory. This patch aims to relax the memory pressure on the system
      due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE
      based on the nm_i->ram_thresh configured.
      
      Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      d6d2b491
    • Chao Yu's avatar
      f2fs: fix to avoid touching checkpointed data in get_victim() · 61461fc9
      Chao Yu authored
      In CP disabling mode, there are two issues when using LFS or SSR | AT_SSR
      mode to select victim:
      
      1. LFS is set to find source section during GC, the victim should have
      no checkpointed data, since after GC, section could not be set free for
      reuse.
      
      Previously, we only check valid chpt blocks in current segment rather
      than section, fix it.
      
      2. SSR | AT_SSR are set to find target segment for writes which can be
      fully filled by checkpointed and newly written blocks, we should never
      select such segment, otherwise it can cause panic or data corruption
      during allocation, potential case is described as below:
      
       a) target segment has 'n' (n < 512) ckpt valid blocks
       b) GC migrates 'n' valid blocks to other segment (segment is still
          in dirty list)
       c) GC migrates '512 - n' blocks to target segment (segment has 'n'
          cp_vblocks and '512 - n' vblocks)
       d) If GC selects target segment via {AT,}SSR allocator, however there
          is no free space in targe segment.
      
      Fixes: 4354994f ("f2fs: checkpoint disabling")
      Fixes: 093749e2
      
       ("f2fs: support age threshold based garbage collection")
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      61461fc9
  2. Mar 26, 2021
  3. Mar 24, 2021
    • Chao Yu's avatar
      f2fs: fix to align to section for fallocate() on pinned file · e1175f02
      Chao Yu authored
      
      
      Now, fallocate() on a pinned file only allocates blocks which aligns
      to segment rather than section, so GC may try to migrate pinned file's
      block, and after several times of failure, pinned file's block could
      be migrated to other place, however user won't be aware of such
      condition, and then old obsolete block address may be readed/written
      incorrectly.
      
      To avoid such condition, let's try to allocate pinned file's blocks
      with section alignment.
      
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      e1175f02
  4. Mar 13, 2021
  5. Mar 12, 2021
    • Bob Peterson's avatar
      gfs2: bypass log flush if the journal is not live · 0efc4976
      Bob Peterson authored
      Patch fe3e3976 ("gfs2: Rework the log space allocation logic")
      changed gfs2_log_flush to reserve a set of journal blocks in case no
      transaction is active.  However, gfs2_log_flush also gets called in
      cases where we don't have an active journal, for example, for spectator
      mounts.  In that case, trying to reserve blocks would sleep forever, but
      we want gfs2_log_flush to be a no-op instead.
      
      Fixes: fe3e3976
      
       ("gfs2: Rework the log space allocation logic")
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      0efc4976
    • Bob Peterson's avatar
      gfs2: bypass signal_our_withdraw if no journal · d5bf630f
      Bob Peterson authored
      
      
      Before this patch, function signal_our_withdraw referenced the journal
      inode immediately. But corrupt file systems may have some invalid
      journals, in which case our attempt to read it in will withdraw and the
      resulting signal_our_withdraw would dereference the NULL value.
      
      This patch adds a check to signal_our_withdraw so that if the journal
      has not yet been initialized, it simply returns and does the old-style
      withdraw.
      
      Thanks, Andy Price, for his analysis.
      
      Reported-by: default avatar <syzbot+50a8a9cf8127f2c6f5df@syzkaller.appspotmail.com>
      Fixes: 601ef0d5
      
       ("gfs2: Force withdraw to replay journals and wait for it to finish")
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      d5bf630f
    • Wei Yongjun's avatar
      perf/arm_dmc620_pmu: Fix error return code in dmc620_pmu_device_probe() · c8e38668
      Wei Yongjun authored
      Fix to return negative error code -ENOMEM from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: 53c218da
      
       ("driver/perf: Add PMU driver for the ARM DMC-620 memory controller")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Link: https://lore.kernel.org/r/20210312080421.277562-1-weiyongjun1@huawei.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      c8e38668
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-03-12-1' of git://anongit.freedesktop.org/drm/drm · f78d76e7
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular fixes for rc3. The i915 pull was based on the rc1 tag so I
        just cherry-picked the single fix from there to avoid it. The misc and
        amd trees seem to be on okay bases.
      
        It's a bunch of fixes across the tree, amdgpu has most of them a few
        ttm fixes around qxl, and nouveau.
      
        core:
         - Clear holes when converting compat ioctl's between 32-bits and
           64-bits.
      
        docs:
         - Use gitlab for drm bugzilla now.
      
        ttm:
         - Fix ttm page pool accounting.
      
        fbdev:
         - Fix oops in drm_fbdev_cleanup()
      
        shmem:
         - Assorted fixes for shmem helpers.
      
        qxl:
         - unpin qxl bos created as pinned when freeing them, and make ttm
           only warn once on this behavior.
         - Zero head.surface_id correctly in qxl.
      
        atyfb:
         - Use LCD management for atyfb on PPC_MAC.
      
        meson:
         - Shutdown kms poll helper in meson correctly.
      
        nouveau:
         - fix regression in bo syncing
      
        i915:
         - Wedge the GPU if command parser setup fails
      
        amdgpu:
         - Fix aux backlight control
         - Add a backlight override parameter
         - Various display fixes
         - PCIe DPM fix for vega
         - Polaris watermark fixes
         - Additional S0ix fix
      
        radeon:
         - Fix GEM regression
         - Fix AGP dependency handling"
      
      * tag 'drm-fixes-2021-03-12-1' of git://anongit.freedesktop.org/drm/drm: (33 commits)
        drm/nouveau: fix dma syncing for loops (v2)
        drm/i915: Wedge the GPU if command parser setup fails
        drm/compat: Clear bounce structures
        drm/shmem-helpers: vunmap: Don't put pages for dma-buf
        drm: meson_drv add shutdown function
        drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff
        drm/shmem-helper: Check for purged buffers in fault handler
        qxl: Fix uninitialised struct field head.surface_id
        drm/ttm: Fix TTM page pool accounting
        drm/ttm: soften TTM warnings
        drm: Use USB controller's DMA mask when importing dmabufs
        MAINTAINERS: update drm bug reporting URL
        fbdev: atyfb: use LCD management functions for PPC_PMAC also
        fbdev: atyfb: always declare aty_{ld,st}_lcd()
        drm/qxl: fix lockdep issue in qxl_alloc_release_reserved
        drm/qxl: unpin release objects
        drm/fb-helper: only unmap if buffer not null
        drm/amdgpu: fix S0ix handling when the CONFIG_AMD_PMC=m
        drm/radeon: fix AGP dependency
        drm/radeon: also init GEM funcs in radeon_gem_prime_import_sg_table
        ...
      f78d76e7
    • Dave Airlie's avatar
      drm/nouveau: fix dma syncing for loops (v2) · 4042160c
      Dave Airlie authored
      The index variable should only be increased in one place.
      
      Noticed this while trying to track down another oops.
      
      v2: use while loop.
      
      Fixes: f295c8cf
      
       ("drm/nouveau: fix dma syncing warning with debugging on.")
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210311043527.5376-1-airlied@gmail.com
      4042160c