1. Mar 25, 2022
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 2dacc1e5
      Linus Torvalds authored
      Pull rdma updates from Jason Gunthorpe:
      
       - Minor bug fixes in mlx5, mthca, pvrdma, rtrs, mlx4, hfi1, hns
      
       - Minor cleanups: coding style, useless includes and documentation
      
       - Reorganize how multicast processing works in rxe
      
       - Replace a red/black tree with xarray in rxe which improves performance
      
       - DSCP support and HW address handle re-use in irdma
      
       - Simplify the mailbox command handling in hns
      
       - Simplify iser now that FMR is eliminated
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (93 commits)
        RDMA/nldev: Prevent underflow in nldev_stat_set_counter_dynamic_doit()
        IB/iser: Fix error flow in case of registration failure
        IB/iser: Generalize map/unmap dma tasks
        IB/iser: Use iser_fr_desc as registration context
        IB/iser: Remove iser_reg_data_sg helper function
        RDMA/rxe: Use standard names for ref counting
        RDMA/rxe: Replace red-black trees by xarrays
        RDMA/rxe: Shorten pool names in rxe_pool.c
        RDMA/rxe: Move max_elem into rxe_type_info
        RDMA/rxe: Replace obj by elem in declaration
        RDMA/rxe: Delete _locked() APIs for pool objects
        RDMA/rxe: Reverse the sense of RXE_POOL_NO_ALLOC
        RDMA/rxe: Replace mr by rkey in responder resources
        RDMA/rxe: Fix ref error in rxe_av.c
        RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT
        RDMA/irdma: Add support for address handle re-use
        RDMA/qib: Fix typos in comments
        RDMA/mlx5: Fix memory leak in error flow for subscribe event routine
        Revert "RDMA/core: Fix ib_qp_usecnt_dec() called when error"
        RDMA/rxe: Remove useless argument for update_state()
        ...
      2dacc1e5
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.18-rc1' of https://github.com/ceph/ceph-client · 85c7000f
      Linus Torvalds authored
      Pull ceph updates from Ilya Dryomov:
       "The highlights are:
      
         - several changes to how snap context and snap realms are tracked
           (Xiubo Li). In particular, this should resolve a long-standing
           issue of high kworker CPU usage and various stalls caused by
           needless iteration over all inodes in the snap realm.
      
         - async create fixes to address hangs in some edge cases (Jeff
           Layton)
      
         - support for getvxattr MDS op for querying server-side xattrs, such
           as file/directory layouts and ephemeral pins (Milind Changire)
      
         - average latency is now maintained for all metrics (Venky Shankar)
      
         - some tweaks around handling inline data to make it fit better with
           netfs helper library (David Howells)
      
        Also a couple of memory leaks got plugged along with a few assorted
        fixups. Last but not least, Xiubo has stepped up to serve as a CephFS
        co-maintainer"
      
      * tag 'ceph-for-5.18-rc1' of https://github.com/ceph/ceph-client: (27 commits)
        ceph: fix memory leak in ceph_readdir when note_last_dentry returns error
        ceph: uninitialized variable in debug output
        ceph: use tracked average r/w/m latencies to display metrics in debugfs
        ceph: include average/stdev r/w/m latency in mds metrics
        ceph: track average r/w/m latency
        ceph: use ktime_to_timespec64() rather than jiffies_to_timespec64()
        ceph: assign the ci only when the inode isn't NULL
        ceph: fix inode reference leakage in ceph_get_snapdir()
        ceph: misc fix for code style and logs
        ceph: allocate capsnap memory outside of ceph_queue_cap_snap()
        ceph: do not release the global snaprealm until unmounting
        ceph: remove incorrect and unused CEPH_INO_DOTDOT macro
        MAINTAINERS: add Xiubo Li as cephfs co-maintainer
        ceph: eliminate the recursion when rebuilding the snap context
        ceph: do not update snapshot context when there is no new snapshot
        ceph: zero the dir_entries memory when allocating it
        ceph: move to a dedicated slabcache for ceph_cap_snap
        ceph: add getvxattr op
        libceph: drop else branches in prepare_read_data{,_cont}
        ceph: fix comments mentioning i_mutex
        ...
      85c7000f
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.18-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · b1b07ba3
      Linus Torvalds authored
      Pull xfs updates from Darrick Wong:
       "The biggest change this cycle is bringing XFS' inode attribute setting
        code back towards alignment with what the VFS does. IOWs, setgid bit
        handling should be a closer match with ext4 and btrfs behavior.
      
        The rest of the branch is bug fixes around the filesystem -- patching
        gaps in quota enforcement, removing bogus selinux audit messages, and
        fixing log corruption and problems with log recovery. There will be a
        second pull request later on in the merge window with more bug fixes.
      
        Dave Chinner will be taking over as XFS maintainer for one release
        cycle, starting from the day 5.18-rc1 drops until 5.19-rc1 is tagged
        so that I can focus on starting a massive design review for the
        (feature complete after five years) online repair feature.
      
        Summary:
      
         - Fix some incorrect mapping state being passed to iomap during COW
      
         - Don't create bogus selinux audit messages when deciding to degrade
           gracefully due to lack of privilege
      
         - Fix setattr implementation to use VFS helpers so that we drop
           setgid consistently with the other filesystems
      
         - Fix link/unlink/rename to check quota limits
      
         - Constify xfs_name_dotdot to prevent abuse of in-kernel symbols
      
         - Fix log livelock between the AIL and inodegc threads during
           recovery
      
         - Fix a log stall when the AIL races with pushers
      
         - Fix stalls in CIL flushes due to pinned inode cluster buffers
           during recovery
      
         - Fix log corruption due to incorrect usage of xfs_is_shutdown vs
           xlog_is_shutdown because during an induced fs shutdown, AIL
           writeback must continue until the log is shut down, even if the
           filesystem has already shut down"
      
      * tag 'xfs-5.18-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: xfs_is_shutdown vs xlog_is_shutdown cage fight
        xfs: AIL should be log centric
        xfs: log items should have a xlog pointer, not a mount
        xfs: async CIL flushes need pending pushes to be made stable
        xfs: xfs_ail_push_all_sync() stalls when racing with updates
        xfs: check buffer pin state after locking in delwri_submit
        xfs: log worker needs to start before intent/unlink recovery
        xfs: constify xfs_name_dotdot
        xfs: constify the name argument to various directory functions
        xfs: reserve quota for target dir expansion when renaming files
        xfs: reserve quota for dir expansion when linking/unlinking files
        xfs: refactor user/group quota chown in xfs_setattr_nonsize
        xfs: use setattr_copy to set vfs inode attributes
        xfs: don't generate selinux audit messages for capability testing
        xfs: add missing cmap->br_state = XFS_EXT_NORM update
      b1b07ba3
    • Linus Torvalds's avatar
      Merge tag 'dax-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · f0614eef
      Linus Torvalds authored
      Pull DAX updates from Dan Williams:
       "Andrew has been shepherding major dax features that touch the core -mm
        through his tree, but I still collect the dax updates that are core-mm
        independent.
      
         - Fix a crash due to a missing rcu_barrier() in dax_fs_exit()
      
         - Fix two miscellaneous doc issues"
      
      * tag 'dax-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        dax: Fix missing kdoc for dax_device
        dax: make sure inodes are flushed before destroy cache
        fsdax: fix function description
      f0614eef
    • Linus Torvalds's avatar
      Merge tag 'cxl-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl · b9132c32
      Linus Torvalds authored
      Pull CXL (Compute Express Link) updates from Dan Williams:
       "This development cycle extends the subsystem to discover CXL resources
        throughout a CXL/PCIe switch topology and respond to hot add/remove
        events anywhere in that topology.
      
        This is more foundational infrastructure in preparation for dynamic
        memory region provisioning support. Recall that CXL memory regions, as
        the new "Theory of Operation" section of
        Documentation/driver-api/cxl/memory-devices.rst describes, bring
        storage volume striping semantics to memory.
      
        The hot add/remove behavior is validated with extensions to the
        cxl_test unit test environment and this test in the cxl-cli test
        suite:
      
            https://github.com/pmem/ndctl/blob/djbw/for-74/cxl/test/cxl-topology.sh
      
        Summary:
      
         - Add a driver for 'struct cxl_memdev' objects responsible for
           CXL.mem operation as distinct from 'cxl_pci' mailbox operations.
      
           Its primary responsibility is enumerating an endpoint 'struct
           cxl_port' and all the 'struct cxl_port' instances between an
           endpoint and the CXL platform root.
      
         - Add a driver for 'struct cxl_port' objects responsible for
           enumerating and operating all Host-managed Device Memory (HDM)
           decoder resources between the platform-level CXL memory
           description, all intervening host bridges / switches, and the HDM
           resources in endpoints.
      
         - Update the cxl_pci driver to validate CXL.mem operation precursors
           to HDM decoder operation like ready-polling, and legacy CXL 1.1
           DVSEC based CXL.mem configuration.
      
         - Add basic lockdep coverage for usage of device_lock() on CXL
           subsystem objects similar to what exists for LIBNVDIMM. Include a
           compile-time switch for which subsystem to validate at run-time.
      
         - Update cxl_test to emulate a one level switch topology.
      
         - Document a "Theory of Operation" for the subsystem.
      
         - Add 'numa_node' and 'serial' attributes to cxl_memdev sysfs
      
         - Include miscellaneous fixes for spec / QEMU CXL emulation
           compatibility and static analysis reports"
      
      * tag 'cxl-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (48 commits)
        cxl/core/port: Fix NULL but dereferenced coccicheck error
        cxl/port: Hold port reference until decoder release
        cxl/port: Fix endpoint refcount leak
        cxl/core: Fix cxl_device_lock() class detection
        cxl/core/port: Fix unregister_port() lock assertion
        cxl/regs: Fix size of CXL Capability Header Register
        cxl/core/port: Handle invalid decoders
        cxl/core/port: Fix / relax decoder target enumeration
        tools/testing/cxl: Add a physical_node link
        tools/testing/cxl: Enumerate mock decoders
        tools/testing/cxl: Mock one level of switches
        tools/testing/cxl: Fix root port to host bridge assignment
        tools/testing/cxl: Mock dvsec_ranges()
        cxl/core/port: Add endpoint decoders
        cxl/core: Move target_list out of base decoder attributes
        cxl/mem: Add the cxl_mem driver
        cxl/core/port: Add switch port enumeration
        cxl/memdev: Add numa_node attribute
        cxl/pci: Emit device serial number
        cxl/pci: Implement wait for media active
        ...
      b9132c32
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2022-03-24' of git://anongit.freedesktop.org/drm/drm · b14ffae3
      Linus Torvalds authored
      Pull drm updates from Dave Airlie:
       "Lots of work all over, Intel improving DG2 support, amdkfd CRIU
        support, msm new hw support, and faster fbdev support.
      
        dma-buf:
         - rename dma-buf-map to iosys-map
      
        core:
         - move buddy allocator to core
         - add pci/platform init macros
         - improve EDID parser deep color handling
         - EDID timing type 7 support
         - add GPD Win Max quirk
         - add yes/no helpers to string_helpers
         - flatten syncobj chains
         - add nomodeset support to lots of drivers
         - improve fb-helper clipping support
         - add default property value interface
      
        fbdev:
         - improve fbdev ops speed
      
        ttm:
         - add a backpointer from ttm bo->ttm resource
      
        dp:
         - move displayport headers
         - add a dp helper module
      
        bridge:
         - anx7625 atomic support, HDCP support
      
        panel:
         - split out panel-lvds and lvds bindings
         - find panels in OF subnodes
      
        privacy:
         - add chromeos privacy screen support
      
        fb:
       ...
      b14ffae3
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 52deda95
      Linus Torvalds authored
      Merge more updates from Andrew Morton:
       "Various misc subsystems, before getting into the post-linux-next
        material.
      
        41 patches.
      
        Subsystems affected by this patch series: procfs, misc, core-kernel,
        lib, checkpatch, init, pipe, minix, fat, cgroups, kexec, kdump,
        taskstats, panic, kcov, resource, and ubsan"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (41 commits)
        Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang"
        kernel/resource: fix kfree() of bootmem memory again
        kcov: properly handle subsequent mmap calls
        kcov: split ioctl handling into locked and unlocked parts
        panic: move panic_print before kmsg dumpers
        panic: add option to dump all CPUs backtraces in panic_print
        docs: sysctl/kernel: add missing bit to panic_print
        taskstats: remove unneeded dead assignment
        kasan: no need to unset panic_on_warn in end_report()
        ubsan: no need to unset panic_on_warn in ubsan_epilogue()
        panic: unset panic_on_warn inside panic()
        docs: kdump: add scp example to write out the dump file
        docs: kdump: update description about sysfs file system support
        arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
        x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
        riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
        kexec: make crashk_res, crashk_low_res and crash_notes symbols always visible
        cgroup: use irqsave in cgroup_rstat_flush_locked().
        fat: use pointer to simple type in put_user()
        minix: fix bug when opening a file with O_DIRECT
        ...
      52deda95
    • Linus Torvalds's avatar
      Merge tag 'net-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next · 169e7776
      Linus Torvalds authored
      Pull networking updates from Jakub Kicinski:
       "The sprinkling of SPI drivers is because we added a new one and Mark
        sent us a SPI driver interface conversion pull request.
      
        Core
        ----
      
         - Introduce XDP multi-buffer support, allowing the use of XDP with
           jumbo frame MTUs and combination with Rx coalescing offloads (LRO).
      
         - Speed up netns dismantling (5x) and lower the memory cost a little.
           Remove unnecessary per-netns sockets. Scope some lists to a netns.
           Cut down RCU syncing. Use batch methods. Allow netdev registration
           to complete out of order.
      
         - Support distinguishing timestamp types (ingress vs egress) and
           maintaining them across packet scrubbing points (e.g. redirect).
      
         - Continue the work of annotating packet drop reasons throughout the
           stack.
      
         - Switch netdev error counters from an atomic to dynamically
           allocated per-CPU counters.
      
         - Rework a few preemp...
      169e7776
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.18-rc1' of https://github.com/awilliam/linux-vfio · 7403e6d8
      Linus Torvalds authored
      Pull VFIO updates from Alex Williamson:
      
       - Introduce new device migration uAPI and implement device specific
         mlx5 vfio-pci variant driver supporting new protocol (Jason
         Gunthorpe, Yishai Hadas, Leon Romanovsky)
      
       - New HiSilicon acc vfio-pci variant driver, also supporting migration
         interface (Shameer Kolothum, Longfang Liu)
      
       - D3hot fixes for vfio-pci-core (Abhishek Sahu)
      
       - Document new vfio-pci variant driver acceptance criteria
         (Alex Williamson)
      
       - Fix UML build unresolved ioport_{un}map() functions
         (Alex Williamson)
      
       - Fix MAINTAINERS due to header movement (Lukas Bulwahn)
      
      * tag 'vfio-v5.18-rc1' of https://github.com/awilliam/linux-vfio: (31 commits)
        vfio-pci: Provide reviewers and acceptance criteria for variant drivers
        MAINTAINERS: adjust entry for header movement in hisilicon qm driver
        hisi_acc_vfio_pci: Use its own PCI reset_done error handler
        hisi_acc_vfio_pci: Add support for VFIO live migration
        crypto: hisilicon/qm: Set the VF QM state register
        hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver
        hisi_acc_vfio_pci: Restrict access to VF dev BAR2 migration region
        hisi_acc_vfio_pci: add new vfio_pci driver for HiSilicon ACC devices
        hisi_acc_qm: Move VF PCI device IDs to common header
        crypto: hisilicon/qm: Move few definitions to common header
        crypto: hisilicon/qm: Move the QM header to include/linux
        vfio/mlx5: Fix to not use 0 as NULL pointer
        PCI/IOV: Fix wrong kernel-doc identifier
        vfio/mlx5: Use its own PCI reset_done error handler
        vfio/pci: Expose vfio_pci_core_aer_err_detected()
        vfio/mlx5: Implement vfio_pci driver for mlx5 devices
        vfio/mlx5: Expose migration commands over mlx5 device
        vfio: Remove migration protocol v1 documentation
        vfio: Extend the device migration protocol with RUNNING_P2P
        vfio: Define device migration protocol v2
        ...
      7403e6d8
    • Linus Torvalds's avatar
      Merge tag 'hyperv-next-signed-20220322' of... · 66711cfe
      Linus Torvalds authored
      Merge tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv updates from Wei Liu:
       "Minor patches from various people"
      
      * tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        x86/hyperv: Output host build info as normal Windows version number
        hv_balloon: rate-limit "Unhandled message" warning
        drivers: hv: log when enabling crash_kexec_post_notifiers
        hv_utils: Add comment about max VMbus packet size in VSS driver
        Drivers: hv: Compare cpumasks and not their weights in init_vp_index()
        Drivers: hv: Rename 'alloced' to 'allocated'
        Drivers: hv: vmbus: Use struct_size() helper in kmalloc()
      66711cfe
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 1ebdbeb0
      Linus Torvalds authored
      Pull kvm updates from Paolo Bonzini:
       "ARM:
         - Proper emulation of the OSLock feature of the debug architecture
      
         - Scalibility improvements for the MMU lock when dirty logging is on
      
         - New VMID allocator, which will eventually help with SVA in VMs
      
         - Better support for PMUs in heterogenous systems
      
         - PSCI 1.1 support, enabling support for SYSTEM_RESET2
      
         - Implement CONFIG_DEBUG_LIST at EL2
      
         - Make CONFIG_ARM64_ERRATUM_2077057 default y
      
         - Reduce the overhead of VM exit when no interrupt is pending
      
         - Remove traces of 32bit ARM host support from the documentation
      
         - Updated vgic selftests
      
         - Various cleanups, doc updates and spelling fixes
      
        RISC-V:
         - Prevent KVM_COMPAT from being selected
      
         - Optimize __kvm_riscv_switch_to() implementation
      
         - RISC-V SBI v0.3 support
      
        s390:
         - memop selftest
      
         - fix SCK locking
      
         - adapter interruptions virtualization for secure guests
      
         - add Claudio Imbrenda as maintainer
      
         - first step to do proper storage key checking
      
        x86:
         - Continue switching kvm_x86_ops to static_call(); introduce
           static_call_cond() and __static_call_ret0 when applicable.
      
         - Cleanup unused arguments in several functions
      
         - Synthesize AMD 0x80000021 leaf
      
         - Fixes and optimization for Hyper-V sparse-bank hypercalls
      
         - Implement Hyper-V's enlightened MSR bitmap for nested SVM
      
         - Remove MMU auditing
      
         - Eager splitting of page tables (new aka "TDP" MMU only) when dirty
           page tracking is enabled
      
         - Cleanup the implementation of the guest PGD cache
      
         - Preparation for the implementation of Intel IPI virtualization
      
         - Fix some segment descriptor checks in the emulator
      
         - Allow AMD AVIC support on systems with physical APIC ID above 255
      
         - Better API to disable virtualization quirks
      
         - Fixes and optimizations for the zapping of page tables:
      
            - Zap roots in two passes, avoiding RCU read-side critical
              sections that last too long for very large guests backed by 4
              KiB SPTEs.
      
            - Zap invalid and defunct roots asynchronously via
              concurrency-managed work queue.
      
            - Allowing yielding when zapping TDP MMU roots in response to the
              root's last reference being put.
      
            - Batch more TLB flushes with an RCU trick. Whoever frees the
              paging structure now holds RCU as a proxy for all vCPUs running
              in the guest, i.e. to prolongs the grace period on their behalf.
              It then kicks the the vCPUs out of guest mode before doing
              rcu_read_unlock().
      
        Generic:
         - Introduce __vcalloc and use it for very large allocations that need
           memcg accounting"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (246 commits)
        KVM: use kvcalloc for array allocations
        KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2
        kvm: x86: Require const tsc for RT
        KVM: x86: synthesize CPUID leaf 0x80000021h if useful
        KVM: x86: add support for CPUID leaf 0x80000021
        KVM: x86: do not use KVM_X86_OP_OPTIONAL_RET0 for get_mt_mask
        Revert "KVM: x86/mmu: Zap only TDP MMU leafs in kvm_zap_gfn_range()"
        kvm: x86/mmu: Flush TLB before zap_gfn_range releases RCU
        KVM: arm64: fix typos in comments
        KVM: arm64: Generalise VM features into a set of flags
        KVM: s390: selftests: Add error memop tests
        KVM: s390: selftests: Add more copy memop tests
        KVM: s390: selftests: Add named stages for memop test
        KVM: s390: selftests: Add macro as abstraction for MEM_OP
        KVM: s390: selftests: Split memop tests
        KVM: s390x: fix SCK locking
        RISC-V: KVM: Implement SBI HSM suspend call
        RISC-V: KVM: Add common kvm_riscv_vcpu_wfi() function
        RISC-V: Add SBI HSM suspend related defines
        RISC-V: KVM: Implement SBI v0.3 SRST extension
        ...
      1ebdbeb0
    • Linus Torvalds's avatar
      Merge tag 'tomoyo-pr-20220322' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1 · efee6c79
      Linus Torvalds authored
      Pull tomoyo update from Tetsuo Handa:
       "Avoid unnecessarily leaking kernel command line arguments"
      
      * tag 'tomoyo-pr-20220322' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1:
        TOMOYO: fix __setup handlers return values
      efee6c79
    • Linus Torvalds's avatar
      Merge tag 'flexible-array-transformations-5.18-rc1' of... · 3ce62cf4
      Linus Torvalds authored
      Merge tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
      
      Pull flexible-array transformations from Gustavo Silva:
       "Treewide patch that replaces zero-length arrays with flexible-array
        members.
      
        This has been baking in linux-next for a whole development cycle"
      
      * tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
        treewide: Replace zero-length arrays with flexible-array members
      3ce62cf4
    • Linus Torvalds's avatar
      Merge tag 'prlimit-tasklist_lock-for-v5.18' of... · cd4699c5
      Linus Torvalds authored
      Merge tag 'prlimit-tasklist_lock-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull tasklist_lock optimizations from Eric Biederman:
       "prlimit and getpriority tasklist_lock optimizations
      
        The tasklist_lock popped up as a scalability bottleneck on some
        testing workloads. The readlocks in do_prlimit and set/getpriority are
        not necessary in all cases.
      
        Based on a cycles profile, it looked like ~87% of the time was spent
        in the kernel, ~42% of which was just trying to get *some* spinlock
        (queued_spin_lock_slowpath, not necessarily the tasklist_lock).
      
        The big offenders (with rough percentages in cycles of the overall
        trace):
         - do_wait 11%
         - setpriority 8% (done previously in commit 7f8ca0ed)
         - kill 8%
         - do_exit 5%
         - clone 3%
         - prlimit64 2%   (this patchset)
         - getrlimit 1%   (this patchset)
      
        I can't easily test this patchset on the original workload for various
        reasons. Instead, I used the microbenchmark below to at least verify
        there was some improvement. This patchset had a 28% speedup (12% from
        baseline to set/getprio, then another 14% for prlimit).
      
        This series used to do the setpriority case, but an almost identical
        change was merged as commit 7f8ca0ed ("kernel/sys.c: only take
        tasklist_lock for get/setpriority(PRIO_PGRP)") so that has been
        dropped from here.
      
        One interesting thing is that my libc's getrlimit() was calling
        prlimit64, so hoisting the read_lock(tasklist_lock) into sys_prlimit64
        had no effect - it essentially optimized the older syscalls only. I
        didn't do that in this patchset, but figured I'd mention it since it
        was an option from the previous patch's discussion"
      
      micobenchmark.c:
      ---------------
      	int main(int argc, char **argv)
      	{
      		pid_t child;
      		struct rlimit rlim[1];
      
      		fork(); fork(); fork(); fork(); fork(); fork();
      
      		for (int i = 0; i < 5000; i++) {
      			child = fork();
      			if (child < 0)
      				exit(1);
      			if (child > 0) {
      				usleep(1000);
      				kill(child, SIGTERM);
      				waitpid(child, NULL, 0);
      			} else {
      				for (;;) {
      					setpriority(PRIO_PROCESS, 0,
      						    getpriority(PRIO_PROCESS, 0));
      					getrlimit(RLIMIT_CPU, rlim);
      				}
      			}
      		}
      
      		return 0;
      	}
      
      Link: https://lore.kernel.org/lkml/20211213220401.1039578-1-brho@google.com/ [v1]
      Link: https://lore.kernel.org/lkml/20220105212828.197013-1-brho@google.com/ [v2]
      Link: https://lore.kernel.org/lkml/20220106172041.522167-1-brho@google.com/ [v3]
      
      * tag 'prlimit-tasklist_lock-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        prlimit: do not grab the tasklist_lock
        prlimit: make do_prlimit() static
      cd4699c5
    • Linus Torvalds's avatar
      Merge tag 'fs.rt.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · 2e2d4650
      Linus Torvalds authored
      Pull mount attributes PREEMPT_RT update from Christian Brauner:
       "This contains Sebastian's fix to make changing mount
        attributes/getting write access compatible with CONFIG_PREEMPT_RT.
      
        The change only applies when users explicitly opt-in to real-time via
        CONFIG_PREEMPT_RT otherwise things are exactly as before. We've waited
        quite a long time with this to make sure folks could take a good look"
      
      * tag 'fs.rt.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        fs/namespace: Boost the mount_lock.lock owner instead of spinning on PREEMPT_RT.
      2e2d4650
    • Linus Torvalds's avatar
      Merge tag 'fs.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · 15f2e3d6
      Linus Torvalds authored
      Pull mount_setattr updates from Christian Brauner:
       "This contains a few more patches to massage the mount_setattr()
        codepaths and one minor fix to reuse a helper we added some time back.
      
        The final two patches do similar cleanups in different ways. One patch
        is mine and the other is Al's who was nice enough to give me a branch
        for it.
      
        Since his came in later and my branch had been sitting in -next for
        quite some time we just put his on top instead of swap them"
      
      * tag 'fs.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        mount_setattr(): clean the control flow and calling conventions
        fs: clean up mount_setattr control flow
        fs: don't open-code mnt_hold_writers()
        fs: simplify check in mount_setattr_commit()
        fs: add mnt_allow_writers() and simplify mount_setattr_prepare()
      15f2e3d6
  2. Mar 24, 2022