1. 31 Oct, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'x86-boot-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2b95bb05
      Linus Torvalds authored
      Pull x86 boot updates from Ingo Molnar:
      
       - Rework PE header generation, primarily to generate a modern, 4k
         aligned kernel image view with narrower W^X permissions.
      
       - Further refine init-lifetime annotations
      
       - Misc cleanups & fixes
      
      * tag 'x86-boot-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
        x86/boot: efistub: Assign global boot_params variable
        x86/boot: Rename conflicting 'boot_params' pointer to 'boot_params_ptr'
        x86/head/64: Move the __head definition to <asm/init.h>
        x86/head/64: Add missing __head annotation to startup_64_load_idt()
        x86/head/64: Mark 'startup_gdt[]' and 'startup_gdt_descr' as __initdata
        x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls
        x86/boot: Fix incorrect startup_gdt_descr.size
        x86/boot: Compile boot code with -std=gnu11 too
        x86/boot: Increase section and file alignment to 4k/512
        x86/boot: Split off PE/COFF .data section
        x86/boot: Drop PE/COFF .reloc section
        x86/boot: Construct PE/COFF .text section from assembler
        x86/boot: Derive file size from _edata symbol
        x86/boot: Define setup size in linker script
        x86/boot: Set EFI handover offset directly in header asm
        x86/boot: Grab kernel_info offset from zoffset header directly
        x86/boot: Drop references to startup_64
        x86/boot: Drop redundant code setting the root device
        x86/boot: Omit compression buffer from PE/COFF image memory footprint
        x86/boot: Remove the 'bugger off' message
        ...
      2b95bb05
    • Linus Torvalds's avatar
      Merge tag 'x86-headers-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3b8b4b4f
      Linus Torvalds authored
      Pull x86 header file cleanup from Ingo Molnar:
       "Replace <asm/export.h> uses with <linux/export.h> and then remove
        <asm/export.h>"
      
      * tag 'x86-headers-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/headers: Remove <asm/export.h>
        x86/headers: Replace #include <asm/export.h> with #include <linux/export.h>
        x86/headers: Remove unnecessary #include <asm/export.h>
      3b8b4b4f
  2. 30 Oct, 2023 22 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bceb7acc
      Linus Torvalds authored
      Pull performance event updates from Ingo Molnar:
       - Add AMD Unified Memory Controller (UMC) events introduced with Zen 4
       - Simplify & clean up the uncore management code
       - Fall back from RDPMC to RDMSR on certain uncore PMUs
       - Improve per-package and cstate event reading
       - Extend the Intel ref-cycles event to GP counters
       - Fix Intel MTL event constraints
       - Improve the Intel hybrid CPU handling code
       - Micro-optimize the RAPL code
       - Optimize perf_cgroup_switch()
       - Improve large AUX area error handling
       - Misc fixes and cleanups
      
      * tag 'perf-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
        perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV
        perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init()
        x86/cpu: Fix the AMD Fam 17h, Fam 19h, Zen2 and Zen4 MSR enumerations
        perf: Optimize perf_cgroup_switch()
        perf/x86/amd/uncore: Add memory controller support
        perf/x86/amd/uncore: Add group exclusivity
        perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable
        perf/x86/amd/uncore: Move discovery and registration
        perf/x86/amd/uncore: Refactor uncore management
        perf/core: Allow reading package events from perf_event_read_local
        perf/x86/cstate: Allow reading the package statistics from local CPU
        perf/x86/intel/pt: Fix kernel-doc comments
        perf/x86/rapl: Annotate 'struct rapl_pmus' with __counted_by
        perf/core: Rename perf_proc_update_handler() -> perf_event_max_sample_rate_handler(), for readability
        perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning
        perf/x86/rapl: Use local64_try_cmpxchg in rapl_event_update()
        perf/x86/rapl: Stop doing cpu_relax() in the local64_cmpxchg() loop in rapl_event_update()
        perf/core: Bail out early if the request AUX area is out of bound
        perf/x86/intel: Extend the ref-cycles event to GP counters
        perf/x86/intel: Fix broken fixed event constraints extension
        ...
      bceb7acc
    • Linus Torvalds's avatar
      Merge tag 'objtool-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cd063c8b
      Linus Torvalds authored
      Pull objtool updates from Ingo Molnar:
       "Misc fixes and cleanups:
      
         - Fix potential MAX_NAME_LEN limit related build failures
      
         - Fix scripts/faddr2line symbol filtering bug
      
         - Fix scripts/faddr2line on LLVM=1
      
         - Fix scripts/faddr2line to accept readelf output with mapping
           symbols
      
         - Minor cleanups"
      
      * tag 'objtool-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        scripts/faddr2line: Skip over mapping symbols in output from readelf
        scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1
        scripts/faddr2line: Don't filter out non-function symbols from readelf
        objtool: Remove max symbol name length limitation
        objtool: Propagate early errors
        objtool: Use 'the fallthrough' pseudo-keyword
        x86/speculation, objtool: Use absolute relocations for annotations
        x86/unwind/orc: Remove redundant initialization of 'mid' pointer in __orc_find()
      cd063c8b
    • Linus Torvalds's avatar
      Merge tag 'sched-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 63ce50ff
      Linus Torvalds authored
      Pull scheduler updates from Ingo Molnar:
       "Fair scheduler (SCHED_OTHER) improvements:
         - Remove the old and now unused SIS_PROP code & option
         - Scan cluster before LLC in the wake-up path
         - Use candidate prev/recent_used CPU if scanning failed for cluster
           wakeup
      
        NUMA scheduling improvements:
         - Improve the VMA access-PID code to better skip/scan VMAs
         - Extend tracing to cover VMA-skipping decisions
         - Improve/fix the recently introduced sched_numa_find_nth_cpu() code
         - Generalize numa_map_to_online_node()
      
        Energy scheduling improvements:
         - Remove the EM_MAX_COMPLEXITY limit
         - Add tracepoints to track energy computation
         - Make the behavior of the 'sched_energy_aware' sysctl more
           consistent
         - Consolidate and clean up access to a CPU's max compute capacity
         - Fix uclamp code corner cases
      
        RT scheduling improvements:
         - Drive dl_rq->overloaded with dl_rq->pushable_dl_tasks updates
         - Drive the ->rto_mask with rt_rq->pushable_tasks updates
      
        Scheduler scalability improvements:
         - Rate-limit updates to tg->load_avg
         - On x86 disable IBRS when CPU is offline to improve single-threaded
           performance
         - Micro-optimize in_task() and in_interrupt()
         - Micro-optimize the PSI code
         - Avoid updating PSI triggers and ->rtpoll_total when there are no
           state changes
      
        Core scheduler infrastructure improvements:
         - Use saved_state to reduce some spurious freezer wakeups
         - Bring in a handful of fast-headers improvements to scheduler
           headers
         - Make the scheduler UAPI headers more widely usable by user-space
         - Simplify the control flow of scheduler syscalls by using lock
           guards
         - Fix sched_setaffinity() vs. CPU hotplug race
      
        Scheduler debuggability improvements:
         - Disallow writing invalid values to sched_rt_period_us
         - Fix a race in the rq-clock debugging code triggering warnings
         - Fix a warning in the bandwidth distribution code
         - Micro-optimize in_atomic_preempt_off() checks
         - Enforce that the tasklist_lock is held in for_each_thread()
         - Print the TGID in sched_show_task()
         - Remove the /proc/sys/kernel/sched_child_runs_first sysctl
      
        ... and misc cleanups & fixes"
      
      * tag 'sched-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (82 commits)
        sched/fair: Remove SIS_PROP
        sched/fair: Use candidate prev/recent_used CPU if scanning failed for cluster wakeup
        sched/fair: Scan cluster before scanning LLC in wake-up path
        sched: Add cpus_share_resources API
        sched/core: Fix RQCF_ACT_SKIP leak
        sched/fair: Remove unused 'curr' argument from pick_next_entity()
        sched/nohz: Update comments about NEWILB_KICK
        sched/fair: Remove duplicate #include
        sched/psi: Update poll => rtpoll in relevant comments
        sched: Make PELT acronym definition searchable
        sched: Fix stop_one_cpu_nowait() vs hotplug
        sched/psi: Bail out early from irq time accounting
        sched/topology: Rename 'DIE' domain to 'PKG'
        sched/psi: Delete the 'update_total' function parameter from update_triggers()
        sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes
        sched/headers: Remove comment referring to rq::cpu_load, since this has been removed
        sched/numa: Complete scanning of inactive VMAs when there is no alternative
        sched/numa: Complete scanning of partial VMAs regardless of PID activity
        sched/numa: Move up the access pid reset logic
        sched/numa: Trace decisions related to skipping VMAs
        ...
      63ce50ff
    • Linus Torvalds's avatar
      Merge tag 'locking-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3cf3fabc
      Linus Torvalds authored
      Pull locking updates from Info Molnar:
       "Futex improvements:
      
         - Add the 'futex2' syscall ABI, which is an attempt to get away from
           the multiplex syscall and adds a little room for extentions, while
           lifting some limitations.
      
         - Fix futex PI recursive rt_mutex waiter state bug
      
         - Fix inter-process shared futexes on no-MMU systems
      
         - Use folios instead of pages
      
        Micro-optimizations of locking primitives:
      
         - Improve arch_spin_value_unlocked() on asm-generic ticket spinlock
           architectures, to improve lockref code generation
      
         - Improve the x86-32 lockref_get_not_zero() main loop by adding
           build-time CMPXCHG8B support detection for the relevant lockref
           code, and by better interfacing the CMPXCHG8B assembly code with
           the compiler
      
         - Introduce arch_sync_try_cmpxchg() on x86 to improve
           sync_try_cmpxchg() code generation. Convert some sync_cmpxchg()
           users to sync_try_cmpxchg().
      
         - Micro-optimize rcuref_put_slowpath()
      
        Locking debuggability improvements:
      
         - Improve CONFIG_DEBUG_RT_MUTEXES=y to have a fast-path as well
      
         - Enforce atomicity of sched_submit_work(), which is de-facto atomic
           but was un-enforced previously.
      
         - Extend <linux/cleanup.h>'s no_free_ptr() with __must_check
           semantics
      
         - Fix ww_mutex self-tests
      
         - Clean up const-propagation in <linux/seqlock.h> and simplify the
           API-instantiation macros a bit
      
        RT locking improvements:
      
         - Provide the rt_mutex_*_schedule() primitives/helpers and use them
           in the rtmutex code to avoid recursion vs. rtlock on the PI state.
      
         - Add nested blocking lockdep asserts to rt_mutex_lock(),
           rtlock_lock() and rwbase_read_lock()
      
        .. plus misc fixes & cleanups"
      
      * tag 'locking-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
        futex: Don't include process MM in futex key on no-MMU
        locking/seqlock: Fix grammar in comment
        alpha: Fix up new futex syscall numbers
        locking/seqlock: Propagate 'const' pointers within read-only methods, remove forced type casts
        locking/lockdep: Fix string sizing bug that triggers a format-truncation compiler-warning
        locking/seqlock: Change __seqprop() to return the function pointer
        locking/seqlock: Simplify SEQCOUNT_LOCKNAME()
        locking/atomics: Use atomic_try_cmpxchg_release() to micro-optimize rcuref_put_slowpath()
        locking/atomic, xen: Use sync_try_cmpxchg() instead of sync_cmpxchg()
        locking/atomic/x86: Introduce arch_sync_try_cmpxchg()
        locking/atomic: Add generic support for sync_try_cmpxchg() and its fallback
        locking/seqlock: Fix typo in comment
        futex/requeue: Remove unnecessary ‘NULL’ initialization from futex_proxy_trylock_atomic()
        locking/local, arch: Rewrite local_add_unless() as a static inline function
        locking/debug: Fix debugfs API return value checks to use IS_ERR()
        locking/ww_mutex/test: Make sure we bail out instead of livelock
        locking/ww_mutex/test: Fix potential workqueue corruption
        locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup
        futex: Add sys_futex_requeue()
        futex: Add flags2 argument to futex_requeue()
        ...
      3cf3fabc
    • Linus Torvalds's avatar
      Merge tag 'x86_fpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9cda4eb0
      Linus Torvalds authored
      Pull x86 fpu fixlet from Borislav Petkov:
      
       - kernel-doc fix
      
      * tag 'x86_fpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/fpu/xstate: Address kernel-doc warning
      9cda4eb0
    • Linus Torvalds's avatar
      Merge tag 'x86_platform_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f155f3b3
      Linus Torvalds authored
      Pull x86 platform updates from Borislav Petkov:
      
       - Make sure PCI function 4 IDs of AMD family 0x19, models 0x60-0x7f are
         actually used in the amd_nb.c enumeration
      
       - Add support for extracting NUMA information from devicetree for
         Hyper-V usages
      
       - Add PCI device IDs for the new AMD MI300 AI accelerators
      
       - Annotate an array in struct uv_rtc_timer_head with the new
         __counted_by attribute
      
       - Rework UV's NMI action parameter handling
      
      * tag 'x86_platform_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs
        x86/numa: Add Devicetree support
        x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init()
        x86/amd_nb: Add AMD Family MI300 PCI IDs
        x86/platform/uv: Annotate struct uv_rtc_timer_head with __counted_by
        x86/platform/uv: Rework NMI "action" modparam handling
      f155f3b3
    • Linus Torvalds's avatar
      Merge tag 'x86_cpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ca2e9c3b
      Linus Torvalds authored
      Pull x86 cpuid updates from Borislav Petkov:
      
       - Make sure the "svm" feature flag is cleared from /proc/cpuinfo when
         virtualization support is disabled in the BIOS on AMD and Hygon
         platforms
      
       - A minor cleanup
      
      * tag 'x86_cpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/amd: Remove redundant 'break' statement
        x86/cpu: Clear SVM feature if disabled by BIOS
      ca2e9c3b
    • Linus Torvalds's avatar
      Merge tag 'x86_cache_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9ab021a1
      Linus Torvalds authored
      Pull x86 resource control updates from Borislav Petkov:
      
       - Add support for non-contiguous capacity bitmasks being added to
         Intel's CAT implementation
      
       - Other improvements to resctrl code: better configuration,
         simplifications, debugging support, fixes
      
      * tag 'x86_cache_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/resctrl: Display RMID of resource group
        x86/resctrl: Add support for the files of MON groups only
        x86/resctrl: Display CLOSID for resource group
        x86/resctrl: Introduce "-o debug" mount option
        x86/resctrl: Move default group file creation to mount
        x86/resctrl: Unwind properly from rdt_enable_ctx()
        x86/resctrl: Rename rftype flags for consistency
        x86/resctrl: Simplify rftype flag definitions
        x86/resctrl: Add multiple tasks to the resctrl group at once
        Documentation/x86: Document resctrl's new sparse_masks
        x86/resctrl: Add sparse_masks file in info
        x86/resctrl: Enable non-contiguous CBMs in Intel CAT
        x86/resctrl: Rename arch_has_sparse_bitmaps
        x86/resctrl: Fix remaining kernel-doc warnings
      9ab021a1
    • Linus Torvalds's avatar
      Merge tag 'x86_bugs_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f84a52ee
      Linus Torvalds authored
      Pull x86 hw mitigation updates from Borislav Petkov:
      
       - A bunch of improvements, cleanups and fixlets to the SRSO mitigation
         machinery and other, general cleanups to the hw mitigations code, by
         Josh Poimboeuf
      
       - Improve the return thunk detection by objtool as it is absolutely
         important that the default return thunk is not used after returns
         have been patched. Future work to detect and report this better is
         pending
      
       - Other misc cleanups and fixes
      
      * tag 'x86_bugs_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
        x86/retpoline: Document some thunk handling aspects
        x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN
        x86/callthunks: Delete unused "struct thunk_desc"
        x86/vdso: Run objtool on vdso32-setup.o
        objtool: Fix return thunk patching in retpolines
        x86/srso: Remove unnecessary semicolon
        x86/pti: Fix kernel warnings for pti= and nopti cmdline options
        x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk()
        x86/nospec: Refactor UNTRAIN_RET[_*]
        x86/rethunk: Use SYM_CODE_START[_LOCAL]_NOALIGN macros
        x86/srso: Disentangle rethunk-dependent options
        x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block
        x86/bugs: Remove default case for fully switched enums
        x86/srso: Remove 'pred_cmd' label
        x86/srso: Unexport untraining functions
        x86/srso: Improve i-cache locality for alias mitigation
        x86/srso: Fix unret validation dependencies
        x86/srso: Fix vulnerability reporting for missing microcode
        x86/srso: Print mitigation for retbleed IBPB case
        x86/srso: Print actual mitigation if requested mitigation isn't possible
        ...
      f84a52ee
    • Linus Torvalds's avatar
      Merge tag 'ras_core_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 01ae815c
      Linus Torvalds authored
      Pull x86 RAS updates from Borislav Petkov:
      
       - Specify what error addresses reported on AMD are actually usable
         memory error addresses for further decoding
      
      * tag 'ras_core_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce: Cleanup mce_usable_address()
        x86/mce: Define amd_mce_usable_address()
        x86/MCE/AMD: Split amd_mce_is_memory_error()
      01ae815c
    • Linus Torvalds's avatar
      Merge tag 'edac_updates_for_v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · 66cc8838
      Linus Torvalds authored
      Pull EDAC updates from Borislav Petkov:
      
       - A new EDAC driver for Xilinx's Versal integrated memory controller
      
      * tag 'edac_updates_for_v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        EDAC/versal: Add a Xilinx Versal memory controller driver
        dt-bindings: memory-controllers: Add support for Xilinx Versal EDAC for DDRMC
      66cc8838
    • Linus Torvalds's avatar
      Merge tag 'bcachefs-2023-10-30' of https://evilpiepirate.org/git/bcachefs · 9e877052
      Linus Torvalds authored
      Pull initial bcachefs updates from Kent Overstreet:
       "Here's the bcachefs filesystem pull request.
      
        One new patch since last week: the exportfs constants ended up
        conflicting with other filesystems that are also getting added to the
        global enum, so switched to new constants picked by Amir.
      
        The only new non fs/bcachefs/ patch is the objtool patch that adds
        bcachefs functions to the list of noreturns. The patch that exports
        osq_lock() has been dropped for now, per Ingo"
      
      * tag 'bcachefs-2023-10-30' of https://evilpiepirate.org/git/bcachefs: (2781 commits)
        exportfs: Change bcachefs fid_type enum to avoid conflicts
        bcachefs: Refactor memcpy into direct assignment
        bcachefs: Fix drop_alloc_keys()
        bcachefs: snapshot_create_lock
        bcachefs: Fix snapshot skiplists during snapshot deletion
        bcachefs: bch2_sb_field_get() refactoring
        bcachefs: KEY_TYPE_error now counts towards i_sectors
        bcachefs: Fix handling of unknown bkey types
        bcachefs: Switch to unsafe_memcpy() in a few places
        bcachefs: Use struct_size()
        bcachefs: Correctly initialize new buckets on device resize
        bcachefs: Fix another smatch complaint
        bcachefs: Use strsep() in split_devs()
        bcachefs: Add iops fields to bch_member
        bcachefs: Rename bch_sb_field_members -> bch_sb_field_members_v1
        bcachefs: New superblock section members_v2
        bcachefs: Add new helper to retrieve bch_member from sb
        bcachefs: bucket_lock() is now a sleepable lock
        bcachefs: fix crc32c checksum merge byte order problem
        bcachefs: Fix bch2_inode_delete_keys()
        ...
      9e877052
    • Linus Torvalds's avatar
      Merge tag 'for-6.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · d5acbc60
      Linus Torvalds authored
      Pull btrfs updates from David Sterba:
       "New features:
      
         - raid-stripe-tree
      
           New tree for logical file extent mapping where the physical mapping
           may not match on multiple devices. This is now used in zoned mode
           to implement RAID0/RAID1* profiles, but can be used in non-zoned
           mode as well. The support for RAID56 is in development and will
           eventually fix the problems with the current implementation. This
           is a backward incompatible feature and has to be enabled at mkfs
           time.
      
         - simple quota accounting (squota)
      
           A simplified mode of qgroup that accounts all space on the initial
           extent owners (a subvolume), the snapshots are then cheap to create
           and delete. The deletion of snapshots in fully accounting qgroups
           is a known CPU/IO performance bottleneck.
      
           The squota is not suitable for the general use case but works well
           for containers where the original subvolume exists for the whole
           time. This is a backward incompatible feature as it needs extending
           some structures, but can be enabled on an existing filesystem.
      
         - temporary filesystem fsid (temp_fsid)
      
           The fsid identifies a filesystem and is hard coded in the
           structures, which disallows mounting the same fsid found on
           different devices.
      
           For a single device filesystem this is not strictly necessary, a
           new temporary fsid can be generated on mount e.g. after a device is
           cloned. This will be used by Steam Deck for root partition A/B
           testing, or can be used for VM root images.
      
        Other user visible changes:
      
         - filesystems with partially finished metadata_uuid conversion cannot
           be mounted anymore and the uuid fixup has to be done by btrfs-progs
           (btrfstune).
      
        Performance improvements:
      
         - reduce reservations for checksum deletions (with enabled free space
           tree by factor of 4), on a sample workload on file with many
           extents the deletion time decreased by 12%
      
         - make extent state merges more efficient during insertions, reduce
           rb-tree iterations (run time of critical functions reduced by 5%)
      
        Core changes:
      
         - the integrity check functionality has been removed, this was a
           debugging feature and removal does not affect other integrity
           checks like checksums or tree-checker
      
         - space reservation changes:
      
            - more efficient delayed ref reservations, this avoids building up
              too much work or overusing or exhausting the global block
              reserve in some situations
      
            - move delayed refs reservation to the transaction start time,
              this prevents some ENOSPC corner cases related to exhaustion of
              global reserve
      
            - improvements in reducing excessive reservations for block group
              items
      
            - adjust overcommit logic in near full situations, account for one
              more chunk to eventually allocate metadata chunk, this is mostly
              relevant for small filesystems (<10GiB)
      
         - single device filesystems are scanned but not registered (except
           seed devices), this allows temp_fsid to work
      
         - qgroup iterations do not need GFP_ATOMIC allocations anymore
      
         - cleanups, refactoring, reduced data structure size, function
           parameter simplifications, error handling fixes"
      
      * tag 'for-6.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (156 commits)
        btrfs: open code timespec64 in struct btrfs_inode
        btrfs: remove redundant log root tree index assignment during log sync
        btrfs: remove redundant initialization of variable dirty in btrfs_update_time()
        btrfs: sysfs: show temp_fsid feature
        btrfs: disable the device add feature for temp-fsid
        btrfs: disable the seed feature for temp-fsid
        btrfs: update comment for temp-fsid, fsid, and metadata_uuid
        btrfs: remove pointless empty log context list check when syncing log
        btrfs: update comment for struct btrfs_inode::lock
        btrfs: remove pointless barrier from btrfs_sync_file()
        btrfs: add and use helpers for reading and writing last_trans_committed
        btrfs: add and use helpers for reading and writing fs_info->generation
        btrfs: add and use helpers for reading and writing log_transid
        btrfs: add and use helpers for reading and writing last_log_commit
        btrfs: support cloned-device mount capability
        btrfs: add helper function find_fsid_by_disk
        btrfs: stop reserving excessive space for block group item insertions
        btrfs: stop reserving excessive space for block group item updates
        btrfs: reorder btrfs_inode to fill gaps
        btrfs: open code btrfs_ordered_inode_tree in btrfs_inode
        ...
      d5acbc60
    • Linus Torvalds's avatar
      Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux · 8829687a
      Linus Torvalds authored
      Pull fscrypt updates from Eric Biggers:
       "This update adds support for configuring the crypto data unit size
        (i.e. the granularity of file contents encryption) to be less than the
        filesystem block size. This can allow users to use inline encryption
        hardware in some cases when it wouldn't otherwise be possible.
      
        In addition, there are two commits that are prerequisites for the
        extent-based encryption support that the btrfs folks are working on"
      
      * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux:
        fscrypt: track master key presence separately from secret
        fscrypt: rename fscrypt_info => fscrypt_inode_info
        fscrypt: support crypto data unit size less than filesystem block size
        fscrypt: replace get_ino_and_lblk_bits with just has_32bit_inodes
        fscrypt: compute max_lblk_bits from s_maxbytes and block size
        fscrypt: make the bounce page pool opt-in instead of opt-out
        fscrypt: make it clearer that key_prefix is deprecated
      8829687a
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · 8b16da68
      Linus Torvalds authored
      Pull nfsd updates from Chuck Lever:
       "This release completes the SunRPC thread scheduler work that was begun
        in v6.6. The scheduler can now find an svc thread to wake in constant
        time and without a list walk. Thanks again to Neil Brown for this
        overhaul.
      
        Lorenzo Bianconi contributed infrastructure for a netlink-based NFSD
        control plane. The long-term plan is to provide the same functionality
        as found in /proc/fs/nfsd, plus some interesting additions, and then
        migrate the NFSD user space utilities to netlink.
      
        A long series to overhaul NFSD's NFSv4 operation encoding was applied
        in this release. The goals are to bring this family of encoding
        functions in line with the matching NFSv4 decoding functions and with
        the NFSv2 and NFSv3 XDR functions, preparing the way for better memory
        safety and maintainability.
      
        A further improvement to NFSD's write delegation support was
        contributed by Dai Ngo. This adds a CB_GETATTR callback, enabling the
        server to retrieve cached size and mtime data from clients holding
        write delegations. If the server can retrieve this information, it
        does not have to recall the delegation in some cases.
      
        The usual panoply of bug fixes and minor improvements round out this
        release. As always I am grateful to all contributors, reviewers, and
        testers"
      
      * tag 'nfsd-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (127 commits)
        svcrdma: Fix tracepoint printk format
        svcrdma: Drop connection after an RDMA Read error
        NFSD: clean up alloc_init_deleg()
        NFSD: Fix frame size warning in svc_export_parse()
        NFSD: Rewrite synopsis of nfsd_percpu_counters_init()
        nfsd: Clean up errors in nfs3proc.c
        nfsd: Clean up errors in nfs4state.c
        NFSD: Clean up errors in stats.c
        NFSD: simplify error paths in nfsd_svc()
        NFSD: Clean up nfsd4_encode_seek()
        NFSD: Clean up nfsd4_encode_offset_status()
        NFSD: Clean up nfsd4_encode_copy_notify()
        NFSD: Clean up nfsd4_encode_copy()
        NFSD: Clean up nfsd4_encode_test_stateid()
        NFSD: Clean up nfsd4_encode_exchange_id()
        NFSD: Clean up nfsd4_do_encode_secinfo()
        NFSD: Clean up nfsd4_encode_access()
        NFSD: Clean up nfsd4_encode_readdir()
        NFSD: Clean up nfsd4_encode_entry4()
        NFSD: Add an nfsd4_encode_nfs_cookie4() helper
        ...
      8b16da68
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.ctime' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · 14ab6d42
      Linus Torvalds authored
      Pull vfs inode time accessor updates from Christian Brauner:
       "This finishes the conversion of all inode time fields to accessor
        functions as discussed on list. Changing timestamps manually as we
        used to do before is error prone. Using accessors function makes this
        robust.
      
        It does not contain the switch of the time fields to discrete 64 bit
        integers to replace struct timespec and free up space in struct inode.
        But after this, the switch can be trivially made and the patch should
        only affect the vfs if we decide to do it"
      
      * tag 'vfs-6.7.ctime' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (86 commits)
        fs: rename inode i_atime and i_mtime fields
        security: convert to new timestamp accessors
        selinux: convert to new timestamp accessors
        apparmor: convert to new timestamp accessors
        sunrpc: convert to new timestamp accessors
        mm: convert to new timestamp accessors
        bpf: convert to new timestamp accessors
        ipc: convert to new timestamp accessors
        linux: convert to new timestamp accessors
        zonefs: convert to new timestamp accessors
        xfs: convert to new timestamp accessors
        vboxsf: convert to new timestamp accessors
        ufs: convert to new timestamp accessors
        udf: convert to new timestamp accessors
        ubifs: convert to new timestamp accessors
        tracefs: convert to new timestamp accessors
        sysv: convert to new timestamp accessors
        squashfs: convert to new timestamp accessors
        server: convert to new timestamp accessors
        client: convert to new timestamp accessors
        ...
      14ab6d42
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · 7352a676
      Linus Torvalds authored
      Pull vfs xattr updates from Christian Brauner:
       "The 's_xattr' field of 'struct super_block' currently requires a
        mutable table of 'struct xattr_handler' entries (although each handler
        itself is const). However, no code in vfs actually modifies the
        tables.
      
        This changes the type of 's_xattr' to allow const tables, and modifies
        existing file systems to move their tables to .rodata. This is
        desirable because these tables contain entries with function pointers
        in them; moving them to .rodata makes it considerably less likely to
        be modified accidentally or maliciously at runtime"
      
      * tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (30 commits)
        const_structs.checkpatch: add xattr_handler
        net: move sockfs_xattr_handlers to .rodata
        shmem: move shmem_xattr_handlers to .rodata
        overlayfs: move xattr tables to .rodata
        xfs: move xfs_xattr_handlers to .rodata
        ubifs: move ubifs_xattr_handlers to .rodata
        squashfs: move squashfs_xattr_handlers to .rodata
        smb: move cifs_xattr_handlers to .rodata
        reiserfs: move reiserfs_xattr_handlers to .rodata
        orangefs: move orangefs_xattr_handlers to .rodata
        ocfs2: move ocfs2_xattr_handlers and ocfs2_xattr_handler_map to .rodata
        ntfs3: move ntfs_xattr_handlers to .rodata
        nfs: move nfs4_xattr_handlers to .rodata
        kernfs: move kernfs_xattr_handlers to .rodata
        jfs: move jfs_xattr_handlers to .rodata
        jffs2: move jffs2_xattr_handlers to .rodata
        hfsplus: move hfsplus_xattr_handlers to .rodata
        hfs: move hfs_xattr_handlers to .rodata
        gfs2: move gfs2_xattr_handlers_max to .rodata
        fuse: move fuse_xattr_handlers to .rodata
        ...
      7352a676
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.iov_iter' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · df9c65b5
      Linus Torvalds authored
      Pull iov_iter updates from Christian Brauner:
       "This contain's David's iov_iter cleanup work to convert the iov_iter
        iteration macros to inline functions:
      
         - Remove last_offset from iov_iter as it was only used by ITER_PIPE
      
         - Add a __user tag on copy_mc_to_user()'s dst argument on x86 to
           match that on powerpc and get rid of a sparse warning
      
         - Convert iter->user_backed to user_backed_iter() in the sound PCM
           driver
      
         - Convert iter->user_backed to user_backed_iter() in a couple of
           infiniband drivers
      
         - Renumber the type enum so that the ITER_* constants match the order
           in iterate_and_advance*()
      
         - Since the preceding patch puts UBUF and IOVEC at 0 and 1, change
           user_backed_iter() to just use the type value and get rid of the
           extra flag
      
         - Convert the iov_iter iteration macros to always-inline functions to
           make the code easier to follow. It uses function pointers, but they
           get optimised away
      
         - Move the check for ->copy_mc to _copy_from_iter() and
           copy_page_from_iter_atomic() rather than in memcpy_from_iter_mc()
           where it gets repeated for every segment. Instead, we check once
           and invoke a side function that can use iterate_bvec() rather than
           iterate_and_advance() and supply a different step function
      
         - Move the copy-and-csum code to net/ where it can be in proximity
           with the code that uses it
      
         - Fold memcpy_and_csum() in to its two users
      
         - Move csum_and_copy_from_iter_full() out of line and merge in
           csum_and_copy_from_iter() since the former is the only caller of
           the latter
      
         - Move hash_and_copy_to_iter() to net/ where it can be with its only
           caller"
      
      * tag 'vfs-6.7.iov_iter' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
        iov_iter, net: Move hash_and_copy_to_iter() to net/
        iov_iter, net: Merge csum_and_copy_from_iter{,_full}() together
        iov_iter, net: Fold in csum_and_memcpy()
        iov_iter, net: Move csum_and_copy_to/from_iter() to net/
        iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()
        iov_iter: Convert iterate*() to inline funcs
        iov_iter: Derive user-backedness from the iterator type
        iov_iter: Renumber ITER_* constants
        infiniband: Use user_backed_iter() to see if iterator is UBUF/IOVEC
        sound: Fix snd_pcm_readv()/writev() to use iov access functions
        iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user()
        iov_iter: Remove last_offset from iov_iter as it was for ITER_PIPE
      df9c65b5
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · 3b3f874c
      Linus Torvalds authored
      Pull misc vfs updates from Christian Brauner:
       "This contains the usual miscellaneous features, cleanups, and fixes
        for vfs and individual fses.
      
        Features:
      
         - Rename and export helpers that get write access to a mount. They
           are used in overlayfs to get write access to the upper mount.
      
         - Print the pretty name of the root device on boot failure. This
           helps in scenarios where we would usually only print
           "unknown-block(1,2)".
      
         - Add an internal SB_I_NOUMASK flag. This is another part in the
           endless POSIX ACL saga in a way.
      
           When POSIX ACLs are enabled via SB_POSIXACL the vfs cannot strip
           the umask because if the relevant inode has POSIX ACLs set it might
           take the umask from there. But if the inode doesn't have any POSIX
           ACLs set then we apply the umask in the filesytem itself. So we end
           up with:
      
            (1) no SB_POSIXACL -> strip umask in vfs
            (2) SB_POSIXACL    -> strip umask in filesystem
      
           The umask semantics associated with SB_POSIXACL allowed filesystems
           that don't even support POSIX ACLs at all to raise SB_POSIXACL
           purely to avoid umask stripping. That specifically means NFS v4 and
           Overlayfs. NFS v4 does it because it delegates this to the server
           and Overlayfs because it needs to delegate umask stripping to the
           upper filesystem, i.e., the filesystem used as the writable layer.
      
           This went so far that SB_POSIXACL is raised eve on kernels that
           don't even have POSIX ACL support at all.
      
           Stop this blatant abuse and add SB_I_NOUMASK which is an internal
           superblock flag that filesystems can raise to opt out of umask
           handling. That should really only be the two mentioned above. It's
           not that we want any filesystems to do this. Ideally we have all
           umask handling always in the vfs.
      
         - Make overlayfs use SB_I_NOUMASK too.
      
         - Now that we have SB_I_NOUMASK, stop checking for SB_POSIXACL in
           IS_POSIXACL() if the kernel doesn't have support for it. This is a
           very old patch but it's only possible to do this now with the wider
           cleanup that was done.
      
         - Follow-up work on fake path handling from last cycle. Citing mostly
           from Amir:
      
           When overlayfs was first merged, overlayfs files of regular files
           and directories, the ones that are installed in file table, had a
           "fake" path, namely, f_path is the overlayfs path and f_inode is
           the "real" inode on the underlying filesystem.
      
           In v6.5, we took another small step by introducing of the
           backing_file container and the file_real_path() helper. This change
           allowed vfs and filesystem code to get the "real" path of an
           overlayfs backing file. With this change, we were able to make
           fsnotify work correctly and report events on the "real" filesystem
           objects that were accessed via overlayfs.
      
           This method works fine, but it still leaves the vfs vulnerable to
           new code that is not aware of files with fake path. A recent
           example is commit db1d1e8b ("IMA: use vfs_getattr_nosec to get
           the i_version"). This commit uses direct referencing to f_path in
           IMA code that otherwise uses file_inode() and file_dentry() to
           reference the filesystem objects that it is measuring.
      
           This contains work to switch things around: instead of having
           filesystem code opt-in to get the "real" path, have generic code
           opt-in for the "fake" path in the few places that it is needed.
      
           Is it far more likely that new filesystems code that does not use
           the file_dentry() and file_real_path() helpers will end up causing
           crashes or averting LSM/audit rules if we keep the "fake" path
           exposed by default.
      
           This change already makes file_dentry() moot, but for now we did
           not change this helper just added a WARN_ON() in ovl_d_real() to
           catch if we have made any wrong assumptions.
      
           After the dust settles on this change, we can make file_dentry() a
           plain accessor and we can drop the inode argument to ->d_real().
      
         - Switch struct file to SLAB_TYPESAFE_BY_RCU. This looks like a small
           change but it really isn't and I would like to see everyone on
           their tippie toes for any possible bugs from this work.
      
           Essentially we've been doing most of what SLAB_TYPESAFE_BY_RCU for
           files since a very long time because of the nasty interactions
           between the SCM_RIGHTS file descriptor garbage collection. So
           extending it makes a lot of sense but it is a subtle change. There
           are almost no places that fiddle with file rcu semantics directly
           and the ones that did mess around with struct file internal under
           rcu have been made to stop doing that because it really was always
           dodgy.
      
           I forgot to put in the link tag for this change and the discussion
           in the commit so adding it into the merge message:
      
             https://lore.kernel.org/r/20230926162228.68666-1-mjguzik@gmail.com
      
        Cleanups:
      
         - Various smaller pipe cleanups including the removal of a spin lock
           that was only used to protect against writes without pipe_lock()
           from O_NOTIFICATION_PIPE aka watch queues. As that was never
           implemented remove the additional locking from pipe_write().
      
         - Annotate struct watch_filter with the new __counted_by attribute.
      
         - Clarify do_unlinkat() cleanup so that it doesn't look like an extra
           iput() is done that would cause issues.
      
         - Simplify file cleanup when the file has never been opened.
      
         - Use module helper instead of open-coding it.
      
         - Predict error unlikely for stale retry.
      
         - Use WRITE_ONCE() for mount expiry field instead of just commenting
           that one hopes the compiler doesn't get smart.
      
        Fixes:
      
         - Fix readahead on block devices.
      
         - Fix writeback when layztime is enabled and inodes whose timestamp
           is the only thing that changed reside on wb->b_dirty_time. This
           caused excessively large zombie memory cgroup when lazytime was
           enabled as such inodes weren't handled fast enough.
      
         - Convert BUG_ON() to WARN_ON_ONCE() in open_last_lookups()"
      
      * tag 'vfs-6.7.misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (26 commits)
        file, i915: fix file reference for mmap_singleton()
        vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups
        writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs
        chardev: Simplify usage of try_module_get()
        ovl: rely on SB_I_NOUMASK
        fs: fix umask on NFS with CONFIG_FS_POSIX_ACL=n
        fs: store real path instead of fake path in backing file f_path
        fs: create helper file_user_path() for user displayed mapped file path
        fs: get mnt_writers count for an open backing file's real path
        vfs: stop counting on gcc not messing with mnt_expiry_mark if not asked
        vfs: predict the error in retry_estale as unlikely
        backing file: free directly
        vfs: fix readahead(2) on block devices
        io_uring: use files_lookup_fd_locked()
        file: convert to SLAB_TYPESAFE_BY_RCU
        vfs: shave work on failed file open
        fs: simplify misleading code to remove ambiguity regarding ihold()/iput()
        watch_queue: Annotate struct watch_filter with __counted_by
        fs/pipe: use spinlock in pipe_read() only if there is a watch_queue
        fs/pipe: remove unnecessary spinlock from pipe_write()
        ...
      3b3f874c
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.autofs' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · 0d63d8b2
      Linus Torvalds authored
      Pull autofs mount api updates from Christian Brauner:
       "This ports autofs to the new mount api. The patchset has existed for
        quite a while but never made it upstream. Ian picked it back up.
      
        This also fixes a bug where fs_param_is_fd() was passed a garbage
        param->dirfd but it expected it to be set to the fd that was used to
        set param->file otherwise result->uint_32 contains nonsense. So make
        sure it's set.
      
        One less filesystem using the old mount api. We're getting there,
        albeit rather slow. The last remaining major filesystem that hasn't
        converted is btrfs. Patches exist - I even wrote them - but so far
        they haven't made it upstream"
      
      * tag 'vfs-6.7.autofs' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
        autofs: fix add autofs_parse_fd()
        fsconfig: ensure that dirfd is set to aux
        autofs: fix protocol sub version setting
        autofs: convert autofs to use the new mount api
        autofs: validate protocol version
        autofs: refactor parse_options()
        autofs: reformat 0pt enum declaration
        autofs: refactor super block info init
        autofs: add autofs_parse_fd()
        autofs: refactor autofs_prepare_pipe()
      0d63d8b2
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.7.super' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · d4e175f2
      Linus Torvalds authored
      Pull vfs superblock updates from Christian Brauner:
       "This contains the work to make block device opening functions return a
        struct bdev_handle instead of just a struct block_device. The same
        struct bdev_handle is then also passed to block device closing
        functions.
      
        This allows us to propagate context from opening to closing a block
        device without having to modify all users everytime.
      
        Sidenote, in the future we might even want to try and have block
        device opening functions return a struct file directly but that's a
        series on top of this.
      
        These are further preparatory changes to be able to count writable
        opens and blocking writes to mounted block devices. That's a separate
        piece of work for next cycle and for that we absolutely need the
        changes to btrfs that have been quietly dropped somehow.
      
        Originally the series contained a patch that removed the old
        blkdev_*() helpers. But since this would've caused needles churn in
        -next for bcachefs we ended up delaying it.
      
        The second piece of work addresses one of the major annoyances about
        the work last cycle, namely that we required dropping s_umount
        whenever we used the superblock and fs_holder_ops for a block device.
      
        The reason for that requirement had been that in some codepaths
        s_umount could've been taken under disk->open_mutex (that's always
        been the case, at least theoretically). For example, on surprise block
        device removal or media change. And opening and closing block devices
        required grabbing disk->open_mutex as well.
      
        So we did the work and went through the block layer and fixed all
        those places so that s_umount is never taken under disk->open_mutex.
        This means no more brittle games where we yield and reacquire s_umount
        during block device opening and closing and no more requirements where
        block devices need to be closed. Filesystems don't need to care about
        this.
      
        There's a bunch of other follow-up work such as moving block device
        freezing and thawing to holder operations which makes it work for all
        block devices and not just the main block device just as we did for
        surprise removal. But that is for next cycle.
      
        Tested with fstests for all major fses, blktests, LTP"
      
      * tag 'vfs-6.7.super' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (37 commits)
        porting: update locking requirements
        fs: assert that open_mutex isn't held over holder ops
        block: assert that we're not holding open_mutex over blk_report_disk_dead
        block: move bdev_mark_dead out of disk_check_media_change
        block: WARN_ON_ONCE() when we remove active partitions
        block: simplify bdev_del_partition()
        fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock
        jfs: fix log->bdev_handle null ptr deref in lbmStartIO
        bcache: Fixup error handling in register_cache()
        xfs: Convert to bdev_open_by_path()
        reiserfs: Convert to bdev_open_by_dev/path()
        ocfs2: Convert to use bdev_open_by_dev()
        nfs/blocklayout: Convert to use bdev_open_by_dev/path()
        jfs: Convert to bdev_open_by_dev()
        f2fs: Convert to bdev_open_by_dev/path()
        ext4: Convert to bdev_open_by_dev()
        erofs: Convert to use bdev_open_by_path()
        btrfs: Convert to bdev_open_by_path()
        fs: Convert to bdev_open_by_dev()
        mm/swap: Convert to use bdev_open_by_dev()
        ...
      d4e175f2
    • Linus Torvalds's avatar
      Linux 6.6 · ffc25326
      Linus Torvalds authored
      ffc25326
  3. 28 Oct, 2023 16 commits