1. 03 Mar, 2022 1 commit
    • Christoph Hellwig's avatar
      dma-mapping: remove CONFIG_DMA_REMAP · f5ff79fd
      Christoph Hellwig authored
      CONFIG_DMA_REMAP is used to build a few helpers around the core
      vmalloc code, and to use them in case there is a highmem page in
      dma-direct, and to make dma coherent allocations be able to use
      non-contiguous pages allocations for DMA allocations in the dma-iommu
      layer.
      
      Right now it needs to be explicitly selected by architectures, and
      is only done so by architectures that require remapping to deal
      with devices that are not DMA coherent.  Make it unconditional for
      builds with CONFIG_MMU as it is very little extra code, but makes
      it much more likely that large DMA allocations succeed on x86.
      
      This fixes hot plugging a NVMe thunderbolt SSD for me, which tries
      to allocate a 1MB buffer that is otherwise hard to obtain due to
      memory fragmentation on a heavily used laptop.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      f5ff79fd
  2. 25 Feb, 2022 5 commits
  3. 10 Feb, 2022 1 commit
  4. 26 Jan, 2022 4 commits
  5. 25 Jan, 2022 4 commits
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs · 0280e3c5
      Linus Torvalds authored
      Pull NFS client updates from Anna Schumaker:
       "New Features:
      
         - Basic handling for case insensitive filesystems
      
         - Initial support for fs_locations and server trunking
      
        Bugfixes and Cleanups:
      
         - Cleanups to how the "struct cred *" is handled for the
           nfs_access_entry
      
         - Ensure the server has an up to date ctimes before hardlinking or
           renaming
      
         - Update 'blocks used' after writeback, fallocate, and clone
      
         - nfs_atomic_open() fixes
      
         - Improvements to sunrpc tracing
      
         - Various null check & indenting related cleanups
      
         - Some improvements to the sunrpc sysfs code:
            - Use default_groups in kobj_type
            - Fix some potential races and reference leaks
      
         - A few tracepoint cleanups in xprtrdma"
      
      [ This should have gone in during the merge window, but didn't. The
        original pull request - sent during the merge window - had gotten
        marked as spam and discarded due missing DKIM headers in the email
        from Anna.   - Linus ]
      
      * tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (35 commits)
        SUNRPC: Don't dereference xprt->snd_task if it's a cookie
        xprtrdma: Remove definitions of RPCDBG_FACILITY
        xprtrdma: Remove final dprintk call sites from xprtrdma
        sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change()
        net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change
        NFSv4.1 test and add 4.1 trunking transport
        SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt
        NFSv4 handle port presence in fs_location server string
        NFSv4 expose nfs_parse_server_name function
        NFSv4.1 query for fs_location attr on a new file system
        NFSv4 store server support for fs_location attribute
        NFSv4 remove zero number of fs_locations entries error check
        NFSv4: nfs_atomic_open() can race when looking up a non-regular file
        NFSv4: Handle case where the lookup of a directory fails
        NFSv42: Fallocate and clone should also request 'blocks used'
        NFSv4: Allow writebacks to request 'blocks used'
        SUNRPC: use default_groups in kobj_type
        NFS: use default_groups in kobj_type
        NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open()
        NFS: Add a helper to remove case-insensitive aliases
        ...
      0280e3c5
    • Tvrtko Ursulin's avatar
      drm/i915: Flush TLBs before releasing backing store · 7938d615
      Tvrtko Ursulin authored
      We need to flush TLBs before releasing backing store otherwise userspace
      is able to encounter stale entries if a) it is not declaring access to
      certain buffers and b) it races with the backing store release from a
      such undeclared execution already executing on the GPU in parallel.
      
      The approach taken is to mark any buffer objects which were ever bound
      to the GPU and to trigger a serialized TLB flush when their backing
      store is released.
      
      Alternatively the flushing could be done on VMA unbind, at which point
      we would be able to ascertain whether there is potential a parallel GPU
      execution (which could race), but essentially it boils down to paying
      the cost of TLB flushes potentially needlessly at VMA unbind time (when
      the backing store is not known to be going away so not needed for
      safety), versus potentially needlessly at backing store relase time
      (since we at that point cannot tell whether there is anything executing
      on the GPU which uses that object).
      
      Thereforce simplicity of implementation has been chosen for now with
      scope to benchmark and refine later as required.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reported-by: default avatarSushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarDave Airlie <airlied@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jon Bloomfield <jon.bloomfield@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7938d615
    • Linus Torvalds's avatar
      Merge tag 'for-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 49d766f3
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "Several fixes for defragmentation that got broken in 5.16 after
        refactoring and added subpage support. The observed bugs are excessive
        IO or uninterruptible ioctl.
      
        All stable material"
      
      * tag 'for-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: update writeback index when starting defrag
        btrfs: add back missing dirty page rate limiting to defrag
        btrfs: fix deadlock when reserving space during defrag
        btrfs: defrag: properly update range->start for autodefrag
        btrfs: defrag: fix wrong number of defragged sectors
        btrfs: allow defrag to be interruptible
        btrfs: fix too long loop when defragging a 1 byte file
      49d766f3
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · a08b41ab
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
      
       - Fix panic whe both KASAN and KPROBEs are enabled
      
       - Avoid alignment faults in copy_*_kernel_nofault()
      
       - Align SMP alternatives in modules
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently
        ARM: 9179/1: uaccess: avoid alignment faults in copy_[from|to]_kernel_nofault
        ARM: 9170/1: fix panic when kasan and kprobe are enabled
      a08b41ab
  6. 24 Jan, 2022 3 commits
    • Filipe Manana's avatar
      btrfs: update writeback index when starting defrag · 27cdfde1
      Filipe Manana authored
      When starting a defrag, we should update the writeback index of the
      inode's mapping in case it currently has a value beyond the start of the
      range we are defragging. This can help performance and often result in
      getting less extents after writeback - for e.g., if the current value
      of the writeback index sits somewhere in the middle of a range that
      gets dirty by the defrag, then after writeback we can get two smaller
      extents instead of a single, larger extent.
      
      We used to have this before the refactoring in 5.16, but it was removed
      without any reason to do so. Originally it was added in kernel 3.1, by
      commit 2a0f7f57 ("Btrfs: fix recursive auto-defrag"), in order to
      fix a loop with autodefrag resulting in dirtying and writing pages over
      and over, but some testing on current code did not show that happening,
      at least with the test described in that commit.
      
      So add back the behaviour, as at the very least it is a nice to have
      optimization.
      
      Fixes: 7b508037 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()")
      CC: stable@vger.kernel.org # 5.16
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      27cdfde1
    • Filipe Manana's avatar
      btrfs: add back missing dirty page rate limiting to defrag · 3c9d31c7
      Filipe Manana authored
      A defrag operation can dirty a lot of pages, specially if operating on
      the entire file or a large file range. Any task dirtying pages should
      periodically call balance_dirty_pages_ratelimited(), as stated in that
      function's comments, otherwise they can leave too many dirty pages in
      the system. This is what we did before the refactoring in 5.16, and
      it should have remained, just like in the buffered write path and
      relocation. So restore that behaviour.
      
      Fixes: 7b508037 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()")
      CC: stable@vger.kernel.org # 5.16
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      3c9d31c7
    • Filipe Manana's avatar
      btrfs: fix deadlock when reserving space during defrag · 0cb5950f
      Filipe Manana authored
      When defragging we can end up collecting a range for defrag that has
      already pages under delalloc (dirty), as long as the respective extent
      map for their range is not mapped to a hole, a prealloc extent or
      the extent map is from an old generation.
      
      Most of the time that is harmless from a functional perspective at
      least, however it can result in a deadlock:
      
      1) At defrag_collect_targets() we find an extent map that meets all
         requirements but there's delalloc for the range it covers, and we add
         its range to list of ranges to defrag;
      
      2) The defrag_collect_targets() function is called at defrag_one_range(),
         after it locked a range that overlaps the range of the extent map;
      
      3) At defrag_one_range(), while the range is still locked, we call
         defrag_one_locked_target() for the range associated to the extent
         map we collected at step 1);
      
      4) Then finally at defrag_one_locked_target() we do a call to
         btrfs_delalloc_reserve_space(), which will reserve data and metadata
         space. If the space reservations can not be satisfied right away, the
         flusher might be kicked in and start flushing delalloc and wait for
         the respective ordered extents to complete. If this happens we will
         deadlock, because both flushing delalloc and finishing an ordered
         extent, requires locking the range in the inode's io tree, which was
         already locked at defrag_collect_targets().
      
      So fix this by skipping extent maps for which there's already delalloc.
      
      Fixes: eb793cf8 ("btrfs: defrag: introduce helper to collect target file extents")
      CC: stable@vger.kernel.org # 5.16
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      0cb5950f
  7. 23 Jan, 2022 10 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · dd81e1c7
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - A series of bpf fixes, including an oops fix and some codegen fixes.
      
       - Fix a regression in syscall_get_arch() for compat processes.
      
       - Fix boot failure on some 32-bit systems with KASAN enabled.
      
       - A couple of other build/minor fixes.
      
      Thanks to Athira Rajeev, Christophe Leroy, Dmitry V. Levin, Jiri Olsa,
      Johan Almbladh, Maxime Bizon, Naveen N. Rao, and Nicholas Piggin.
      
      * tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: Mask SRR0 before checking against the masked NIP
        powerpc/perf: Only define power_pmu_wants_prompt_pmi() for CONFIG_PPC64
        powerpc/32s: Fix kasan_init_region() for KASAN
        powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32
        powerpc/audit: Fix syscall_get_arch()
        powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06
        tools/bpf: Rename 'struct event' to avoid naming conflict
        powerpc/bpf: Update ldimm64 instructions during extra pass
        powerpc32/bpf: Fix codegen for bpf-to-bpf calls
        bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()
      dd81e1c7
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ac5a9bb6
      Linus Torvalds authored
      Pull irq fix from Borislav Petkov:
       "A single use-after-free fix in the PCI MSI irq domain allocation path"
      
      * tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        PCI/MSI: Prevent UAF in error path
      ac5a9bb6
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 10c64a0f
      Linus Torvalds authored
      Pull scheduler fixes from Borislav Petkov:
       "A bunch of fixes: forced idle time accounting, utilization values
        propagation in the sched hierarchies and other minor cleanups and
        improvements"
      
      * tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        kernel/sched: Remove dl_boosted flag comment
        sched: Avoid double preemption in __cond_resched_*lock*()
        sched/fair: Fix all kernel-doc warnings
        sched/core: Accounting forceidle time for all tasks except idle task
        sched/pelt: Relax the sync of load_sum with load_avg
        sched/pelt: Relax the sync of runnable_sum with runnable_avg
        sched/pelt: Continue to relax the sync of util_sum with util_avg
        sched/pelt: Relax the sync of util_sum with util_avg
        psi: Fix uaf issue when psi trigger is destroyed while being polled
      10c64a0f
    • Linus Torvalds's avatar
      Merge tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0f9e0422
      Linus Torvalds authored
      Pull perf fixes from Borislav Petkov:
      
       - Add support for accessing the general purpose counters on Alder Lake
         via MMIO
      
       - Add new LBR format v7 support which is v5 modulo TSX
      
       - Fix counter enumeration on Alder Lake hybrids
      
       - Overhaul how context time updates are done and get rid of
         perf_event::shadow_ctx_time.
      
       - The usual amount of fixes: event mask correction, supported event
         types reporting, etc.
      
      * tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/perf: Avoid warning for Arch LBR without XSAVE
        perf/x86/intel/uncore: Add IMC uncore support for ADL
        perf/x86/intel/lbr: Add static_branch for LBR INFO flags
        perf/x86/intel/lbr: Support LBR format V7
        perf/x86/rapl: fix AMD event handling
        perf/x86/intel/uncore: Fix CAS_COUNT_WRITE issue for ICX
        perf/x86/intel: Add a quirk for the calculation of the number of counters on Alder Lake
        perf: Fix perf_event_read_local() time
      0f9e0422
    • Linus Torvalds's avatar
      Linux 5.17-rc1 · e783362e
      Linus Torvalds authored
      e783362e
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of... · 40c84321
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Fix printing 'phys_addr' in 'perf script'.
      
       - Fix failure to add events with 'perf probe' in ppc64 due to not
         removing leading dot (ppc64 ABIv1).
      
       - Fix cpu_map__item() python binding building.
      
       - Support event alias in form foo-bar-baz, add pmu-events and
         parse-event tests for it.
      
       - No need to setup affinities when starting a workload or attaching to
         a pid.
      
       - Use path__join() to compose a path instead of ad-hoc snprintf()
         equivalent.
      
       - Override attr->sample_period for non-libpfm4 events.
      
       - Use libperf cpumap APIs instead of accessing the internal state
         directly.
      
       - Sync x86 arch prctl headers and files changed by the new
         set_mempolicy_home_node syscall with the kernel sources.
      
       - Remove duplicate include in cpumap.h.
      
       - Remove redundant err variable.
      
      * tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf tools: Remove redundant err variable
        perf test: Add parse-events test for aliases with hyphens
        perf test: Add pmu-events test for aliases with hyphens
        perf parse-events: Support event alias in form foo-bar-baz
        perf evsel: Override attr->sample_period for non-libpfm4 events
        perf cpumap: Remove duplicate include in cpumap.h
        perf cpumap: Migrate to libperf cpumap api
        perf python: Fix cpu_map__item() building
        perf script: Fix printing 'phys_addr' failure issue
        tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall
        tools headers UAPI: Sync x86 arch prctl headers with the kernel sources
        perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)
        perf evlist: No need to setup affinities when disabling events for pid targets
        perf evlist: No need to setup affinities when enabling events for pid targets
        perf stat: No need to setup affinities when starting a workload
        perf affinity: Allow passing a NULL arg to affinity__cleanup()
        perf probe: Fix ppc64 'perf probe add events failed' case
      40c84321
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 67bfce0e
      Linus Torvalds authored
      Pull ftrace fix from Steven Rostedt:
       "Fix s390 breakage from sorting mcount tables.
      
        The latest merge of the tracing tree sorts the mcount table at build
        time. But s390 appears to do things differently (like always) and
        replaces the sorted table back to the original unsorted one. As the
        ftrace algorithm depends on it being sorted, bad things happen when it
        is not, and s390 experienced those bad things.
      
        Add a new config to tell the boot if the mcount table is sorted or
        not, and allow s390 to opt out of it"
      
      * tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Fix assuming build time sort works for s390
      67bfce0e
    • Steven Rostedt (Google)'s avatar
      ftrace: Fix assuming build time sort works for s390 · 6b9b6413
      Steven Rostedt (Google) authored
      To speed up the boot process, as mcount_loc needs to be sorted for ftrace
      to work properly, sorting it at build time is more efficient than boot up
      and can save milliseconds of time. Unfortunately, this change broke s390
      as it will modify the mcount_loc location after the sorting takes place
      and will put back the unsorted locations. Since the sorting is skipped at
      boot up if it is believed that it was sorted at run time, ftrace can crash
      as its algorithms are dependent on the list being sorted.
      
      Add a new config BUILDTIME_MCOUNT_SORT that is set when
      BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
      if sorting should take place at boot up.
      
      Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
      
      Fixes: 72b3942a ("scripts: ftrace - move the sort-processing in ftrace_init")
      Reported-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Tested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      6b9b6413
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.17' of... · 473aec0e
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage
      
       - Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH
      
       - Fix build errors in certs/Makefile
      
      * tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI
        Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH"
        usr/include/Makefile: add linux/nfc.h to the compile-test coverage
      473aec0e
    • Linus Torvalds's avatar
      Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux · 3689f9f8
      Linus Torvalds authored
      Pull bitmap updates from Yury Norov:
      
       - introduce for_each_set_bitrange()
      
       - use find_first_*_bit() instead of find_next_*_bit() where possible
      
       - unify for_each_bit() macros
      
      * tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
        vsprintf: rework bitmap_list_string
        lib: bitmap: add performance test for bitmap_print_to_pagebuf
        bitmap: unify find_bit operations
        mm/percpu: micro-optimize pcpu_is_populated()
        Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
        find: micro-optimize for_each_{set,clear}_bit()
        include/linux: move for_each_bit() macros from bitops.h to find.h
        cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
        tools: sync tools/bitmap with mother linux
        all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
        cpumask: use find_first_and_bit()
        lib: add find_first_and_bit()
        arch: remove GENERIC_FIND_FIRST_BIT entirely
        include: move find.h from asm_generic to linux
        bitops: move find_bit_*_le functions from le.h to find.h
        bitops: protect find_first_{,zero}_bit properly
      3689f9f8
  8. 22 Jan, 2022 12 commits