46900 Commits

Author SHA1 Message Date
Stephen Rothwell
620965fc36 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git
# Conflicts:
#	kernel/rcu/tree.c
2025-01-14 13:58:09 +11:00
Stephen Rothwell
7653301148 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git 2025-01-14 13:58:05 +11:00
Stephen Rothwell
5175f6c6ab Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
# Conflicts:
#	include/linux/mm.h
#	include/linux/mm_types.h
#	include/linux/mmap_lock.h
#	kernel/fork.c
#	mm/init-mm.c
#	tools/testing/vma/vma_internal.h
2025-01-14 13:58:01 +11:00
Stephen Rothwell
2f56320cbe Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git 2025-01-14 13:36:38 +11:00
Stephen Rothwell
840c91b1d3 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git 2025-01-14 13:26:49 +11:00
Stephen Rothwell
e8f6787ce4 Merge branch 'for-next' of git://git.kernel.dk/linux-block.git 2025-01-14 13:00:46 +11:00
Stephen Rothwell
33db36712a Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git 2025-01-14 13:00:40 +11:00
Stephen Rothwell
3f4ae5e4fd Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git
# Conflicts:
#	drivers/gpu/drm/display/drm_bridge_connector.c
#	drivers/gpu/drm/i915/display/intel_display_driver.c
#	drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
2025-01-14 12:29:26 +11:00
Stephen Rothwell
5f4ae54f45 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git 2025-01-14 12:16:43 +11:00
Stephen Rothwell
80841f8047 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git 2025-01-14 11:54:23 +11:00
Stephen Rothwell
9e4691b393 Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git 2025-01-14 11:54:20 +11:00
Stephen Rothwell
0a6ef7457a Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 2025-01-14 11:35:18 +11:00
Stephen Rothwell
3d0ae6e771 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git 2025-01-14 11:13:00 +11:00
Stephen Rothwell
8ac851ab74 Merge branch 'fs-next' of linux-next 2025-01-14 10:50:57 +11:00
Stephen Rothwell
ca60d742bd Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git 2025-01-14 10:21:48 +11:00
Stephen Rothwell
86f59b26a1 Merge branch 'mm-everything' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 2025-01-14 09:59:44 +11:00
Stephen Rothwell
17aa0382f1 Merge branch 'mm-nonmm-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 2025-01-14 09:59:43 +11:00
Stephen Rothwell
0b2896dbe0 Merge branch 'vfs.all' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
# Conflicts:
#	fs/nfsd/filecache.c
2025-01-14 09:14:55 +11:00
Stephen Rothwell
8eb728b56b Merge branch 'for_next' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 2025-01-14 09:14:46 +11:00
Ingo Molnar
8e94367b8d Merge branch into tip/master: 'sched/core'
# New commits in sched/core:
    7c8cd569ff66 ("docs: Update Schedstat version to 17")
    011b3a14dc66 ("sched/stats: Print domain name in /proc/schedstat")
    1c055a0f5d3b ("sched: Move sched domain name out of CONFIG_SCHED_DEBUG")
    3b2a793ea70f ("sched: Report the different kinds of imbalances in /proc/schedstat")
    c3856c9ce6b8 ("sched/fair: Cleanup in migrate_degrades_locality() to improve readability")
    a430d99e3490 ("sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat")
    ee8118c1f186 ("sched/fair: Update comments after sched_tick() rename.")
    af98d8a36a96 ("sched/fair: Fix CPU bandwidth limit bypass during CPU hotplug")
    7675361ff9a1 ("sched: deadline: Cleanup goto label in pick_earliest_pushable_dl_task")
    7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
    2a77e4be12cb ("sched/fair: Untangle NEXT_BUDDY and pick_next_task()")
    95d9fed3a2ae ("sched/fair: Mark m*_vruntime() with __maybe_unused")
    0429489e0928 ("sched/fair: Fix variable declaration position")
    61b82dfb6b7e ("sched/fair: Do not try to migrate delayed dequeue task")
    736c55a02c47 ("sched/fair: Rename cfs_rq.nr_running into nr_queued")
    43eef7c3a4a6 ("sched/fair: Remove unused cfs_rq.idle_nr_running")
    31898e7b87dd ("sched/fair: Rename cfs_rq.idle_h_nr_running into h_nr_idle")
    9216582b0bfb ("sched/fair: Removed unsued cfs_rq.h_nr_delayed")
    1a49104496d3 ("sched/fair: Use the new cfs_rq.h_nr_runnable")
    c2a295bffeaf ("sched/fair: Add new cfs_rq.h_nr_runnable")
    7b8a702d9438 ("sched/fair: Rename h_nr_running into h_nr_queued")
    c907cd44a108 ("sched: Unify HK_TYPE_{TIMER|TICK|MISC} to HK_TYPE_KERNEL_NOISE")
    6010d245ddc9 ("sched/isolation: Consolidate housekeeping cpumasks that are always identical")
    1174b9344bc7 ("sched/isolation: Make "isolcpus=nohz" equivalent to "nohz_full"")
    ae5c677729e9 ("sched/core: Remove HK_TYPE_SCHED")
    a76328d44c7a ("sched/fair: Remove CONFIG_CFS_BANDWIDTH=n definition of cfs_bandwidth_used()")
    3a181f20fb4e ("sched/deadline: Consolidate Timer Cancellation")
    53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for hotplug")
    d4742f6ed7ea ("sched/deadline: Correctly account for allocated bandwidth during hotplug")
    41d4200b7103 ("sched/deadline: Restore dl_server bandwidth on non-destructive root domain changes")
    59297e2093ce ("sched: add READ_ONCE to task_on_rq_queued")
    108ad0999085 ("sched: Don't try to catch up excess steal time.")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-01-13 18:13:43 +01:00
Ingo Molnar
b431780cdd Merge branch into tip/master: 'perf/core'
# New commits in perf/core:
    b709eb872e19 ("perf: map pages in advance")
    6d642735cdb6 ("perf/x86/intel/uncore: Support more units on Granite Rapids")
    3f710be02ea6 ("perf/x86/intel/uncore: Clean up func_id")
    0e45818ec189 ("perf/x86/intel: Support RDPMC metrics clear mode")
    02c56362a7d3 ("uprobes: Guard against kmemdup() failing in dup_return_instance()")
    d29e744c7167 ("perf/x86: Relax privilege filter restriction on AMD IBS")
    6057b90ecc84 ("perf/core: Export perf_exclude_event()")
    8622e45b5da1 ("uprobes: Reuse return_instances between multiple uretprobes within task")
    0cf981de7687 ("uprobes: Ensure return_instance is detached from the list before freeing")
    636666a1c733 ("uprobes: Decouple return_instance list traversal and freeing")
    2ff913ab3f47 ("uprobes: Simplify session consumer tracking")
    e0925f2dc4de ("uprobes: add speculative lockless VMA-to-inode-to-uprobe resolution")
    83e3dc9a5d4d ("uprobes: simplify find_active_uprobe_rcu() VMA checks")
    03a001b156d2 ("mm: introduce mmap_lock_speculate_{try_begin|retry}")
    eb449bd96954 ("mm: convert mm_lock_seq to a proper seqcount")
    7528585290a1 ("mm/gup: Use raw_seqcount_try_begin()")
    96450ead1652 ("seqlock: add raw_seqcount_try_begin")
    b4943b8bfc41 ("perf/x86/rapl: Add core energy counter support for AMD CPUs")
    54d2759778c1 ("perf/x86/rapl: Move the cntr_mask to rapl_pmus struct")
    bdc57ec70548 ("perf/x86/rapl: Remove the global variable rapl_msrs")
    abf03d9bd20c ("perf/x86/rapl: Modify the generic variable names to *_pkg*")
    eeca4c6b2529 ("perf/x86/rapl: Add arguments to the init and cleanup functions")
    cd29d83a6d81 ("perf/x86/rapl: Make rapl_model struct global")
    8bf1c86e5ac8 ("perf/x86/rapl: Rename rapl_pmu variables")
    1d5e2f637a94 ("perf/x86/rapl: Remove the cpu_to_rapl_pmu() function")
    e4b444347795 ("x86/topology: Introduce topology_logical_core_id()")
    2f2db347071a ("perf/x86/rapl: Remove the unused get_rapl_pmu_cpumask() function")
    ae55e308bde2 ("perf/x86/intel/ds: Simplify the PEBS records processing for adaptive PEBS")
    3c00ed344cef ("perf/x86/intel/ds: Factor out functions for PEBS records processing")
    7087bfb0adc9 ("perf/x86/intel/ds: Clarify adaptive PEBS processing")
    faac6f105ef1 ("perf/core: Check sample_type in perf_sample_save_brstack")
    f226805bc5f6 ("perf/core: Check sample_type in perf_sample_save_callchain")
    b9c44b91476b ("perf/core: Save raw sample data conditionally based on sample type")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-01-13 18:13:43 +01:00
Ingo Molnar
90df9792d9 Merge branch into tip/master: 'locking/core'
# New commits in locking/core:
    cb4ccc70344c ("MAINTAINERS: Add static_call_inline.c to STATIC BRANCH/CALL")
    a937f384c9da ("cleanup, tags: Create tags for the cleanup primitives")
    abfdccd6af2b ("sched/wake_q: Add helper to call wake_up_q after unlock with preemption disabled")
    fbd7a5a0359b ("rust: sync: Add lock::Backend::assert_is_held()")
    eb5ccb038284 ("rust: sync: Add SpinLockGuard type alias")
    37624dde4768 ("rust: sync: Add MutexGuard type alias")
    daa03fe50ec3 ("rust: sync: Make Guard::new() public")
    15abc88057ee ("rust: sync: Add Lock::from_raw() for Lock<(), B>")
    9793c9bb91f1 ("locking: MAINTAINERS: Start watching Rust locking primitives")
    343060092585 ("lockdep: Move lockdep_assert_locked() under #ifdef CONFIG_PROVE_LOCKING")
    8148fa2e022b ("lockdep: Mark chain_hlock_class_idx() with __maybe_unused")
    bd7b5ae26618 ("lockdep: Document MAX_LOCKDEP_CHAIN_HLOCKS calculation")
    88a79e88a97c ("lockdep: Clarify size for LOCKDEP_*_BITS configs")
    e638072e6172 ("lockdep: Fix upper limit for LOCKDEP_*_BITS configs")
    0d3547df6934 ("locking/ww_mutex/test: Use swap() macro")
    63a48181fbcd ("smp/scf: Evaluate local cond_func() before IPI side-effects")
    d387ceb17149 ("locking/lockdep: Enforce PROVE_RAW_LOCK_NESTING only if ARCH_SUPPORTS_RT")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-01-13 18:13:42 +01:00
Ingo Molnar
7308d9dc81 Merge branch into tip/master: 'irq/core'
# New commits in irq/core:
    b4706d814921 ("genirq/kexec: Prevent redundant IRQ masking by checking state before shutdown")
    bad6722e478f ("kexec: Consolidate machine_kexec_mask_interrupts() implementation")
    429f49ad361c ("genirq: Reuse irq_thread_fn() for forced thread case")
    6f8b79683dfb ("genirq: Move irq_thread_fn() further up in the code")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-01-13 18:13:42 +01:00
Ingo Molnar
e46ca77dd1 Merge branch into tip/master: 'sched/urgent'
# New commits in sched/urgent:
    66951e4860d3 ("sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE")
    6d71a9c61604 ("sched/fair: Fix EEVDF entity placement bug causing scheduling lag")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-01-13 18:13:40 +01:00
Rafael J. Wysocki
5b6756cfa0 Merge branch 'pm-cpufreq' into linux-next
* pm-cpufreq: (24 commits)
  cpufreq/amd-pstate: Refactor max frequency calculation
  cpufreq/amd-pstate: Fix prefcore rankings
  cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
  cpufreq: intel_pstate: Use CPUFREQ_POLICY_UNKNOWN
  cpufreq/amd-pstate: Drop boost_state variable
  cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen
  cpufreq/amd-pstate: Drop ret variable from amd_pstate_set_energy_pref_index()
  cpufreq/amd-pstate: Always write EPP value when updating perf
  cpufreq/amd-pstate: Cache EPP value and use that everywhere
  cpufreq/amd-pstate: Move limit updating code
  cpufreq/amd-pstate: Change amd_pstate_update_perf() to return an int
  cpufreq/amd-pstate: store all values in cpudata struct in khz
  cpufreq/amd-pstate: Only update the cached value in msr_set_epp() on success
  cpufreq/amd-pstate: Use FIELD_PREP and FIELD_GET macros
  cpufreq/amd-pstate: Drop cached epp_policy variable
  cpufreq/amd-pstate: convert mutex use to guard()
  cpufreq/amd-pstate: Add trace event for EPP perf updates
  cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and amd_pstate_epp_offline()
  cpufreq/amd-pstate: Remove the cppc_state check in offline/online functions
  cpufreq/amd-pstate: Refactor amd_pstate_epp_reenable() and amd_pstate_epp_offline()
  ...
2025-01-13 18:11:59 +01:00
Rafael J. Wysocki
2a37653f13 Merge branches 'pm-sleep', 'pm-em' and 'pm-cpuidle' into linux-next
* pm-sleep:
  PM: wakeup: implement devm_device_init_wakeup() helper
  PM: sleep: sysfs: don't include 'pm_wakeup.h' directly
  PM: sleep: autosleep: don't include 'pm_wakeup.h' directly
  PM: sleep: Update stale comment in device_resume()

* pm-em:
  PM: EM: Move sched domains rebuild function from schedutil to EM

* pm-cpuidle:
  intel_idle: add Clearwater Forest SoC support
2025-01-13 18:11:46 +01:00
Steven Rostedt (Google)
a0f5a8426d Merge tools/for-next 2025-01-13 09:47:29 -05:00
Steven Rostedt (Google)
16106d4894 Merge probes/for-next 2025-01-13 09:47:27 -05:00
Steven Rostedt (Google)
7132d8572b Merge ftrace/for-next 2025-01-13 09:47:27 -05:00
Jens Axboe
654081b023 Merge branch 'for-6.14/block' into for-next
* for-6.14/block: (85 commits)
  nvme-pci: use correct size to free the hmb buffer
  nvme: Add error path for xa_store in nvme_init_effects
  nvme-pci: fix comment typo
  Documentation: Document the NVMe PCI endpoint target driver
  nvmet: New NVMe PCI endpoint function target driver
  nvmet: Implement arbitration feature support
  nvmet: Implement interrupt config feature support
  nvmet: Implement interrupt coalescing feature support
  nvmet: Implement host identifier set feature support
  nvmet: Introduce get/set_feature controller operations
  nvmet: Do not require SGL for PCI target controller commands
  nvmet: Add support for I/O queue management admin commands
  nvmet: Introduce nvmet_sq_create() and nvmet_cq_create()
  nvmet: Introduce nvmet_req_transfer_len()
  nvmet: Improve nvmet_alloc_ctrl() interface and implementation
  nvme: Add PCI transport type
  nvmet: Add drvdata field to struct nvmet_ctrl
  nvmet: Introduce nvmet_get_cmd_effects_admin()
  nvmet: Export nvmet_update_cc() and nvmet_cc_xxx() helpers
  nvmet: Add vendor_id and subsys_vendor_id subsystem attributes
  ...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-01-13 07:26:24 -07:00
Peter Zijlstra
66951e4860 sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
Normally dequeue_entities() will continue to dequeue an empty group entity;
except DELAY_DEQUEUE changes things -- it retains empty entities such that they
might continue to compete and burn off some lag.

However, doing this results in update_cfs_group() re-computing the cgroup
weight 'slice' for an empty group, which it (rightly) figures isn't much at
all. This in turn means that the delayed entity is not competing at the
expected weight. Worse, the very low weight causes its lag to be inflated,
which combined with avg_vruntime() using scale_load_down(), leads to artifacts.

As such, don't adjust the weight for empty group entities and let them compete
at their original weight.

Fixes: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250110115720.GA17405@noisy.programming.kicks-ass.net
2025-01-13 13:50:56 +01:00
Thorsten Leemhuis
0217859ce1 module: sign with sha512 instead of sha1 by default
Switch away from using sha1 for module signing by default and use the
more modern sha512 instead, which is what among others Arch, Fedora,
RHEL, and Ubuntu are currently using for their kernels.

Sha1 has not been considered secure against well-funded opponents since
2005[1]; since 2011 the NIST and other organizations furthermore
recommended its replacement[2]. This is why OpenSSL on RHEL9, Fedora
Linux 41+[3], and likely some other current and future distributions
reject the creation of sha1 signatures, which leads to a build error of
allmodconfig configurations:

  80A20474797F0000:error:03000098:digital envelope routines:do_sigver_init:invalid digest:crypto/evp/m_sigver.c:342:
  make[4]: *** [.../certs/Makefile:53: certs/signing_key.pem] Error 1
  make[4]: *** Deleting file 'certs/signing_key.pem'
  make[4]: *** Waiting for unfinished jobs....
  make[3]: *** [.../scripts/Makefile.build:478: certs] Error 2
  make[2]: *** [.../Makefile:1936: .] Error 2
  make[1]: *** [.../Makefile:224: __sub-make] Error 2
  make[1]: Leaving directory '...'
  make: *** [Makefile:224: __sub-make] Error 2

This change makes allmodconfig work again and sets a default that is
more appropriate for current and future users, too.

Link: https://www.schneier.com/blog/archives/2005/02/cryptanalysis_o.html [1]
Link: https://csrc.nist.gov/projects/hash-functions [2]
Link: https://fedoraproject.org/wiki/Changes/OpenSSLDistrustsha1SigVer [3]
Signed-off-by: Thorsten Leemhuis <linux@leemhuis.info>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: kdevops <kdevops@lists.linux.dev> [0]
Link: https://github.com/linux-kdevops/linux-modules-kpd/actions/runs/11420092929/job/31775404330 [0]
Link: https://lore.kernel.org/r/52ee32c0c92afc4d3263cea1f8a1cdc809728aff.1729088288.git.linux@leemhuis.info
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:14 +01:00
Christophe Leroy
9b894ee433 module: Don't fail module loading when setting ro_after_init section RO failed
Once module init has succeded it is too late to cancel loading.
If setting ro_after_init data section to read-only fails, all we
can do is to inform the user through a warning.

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Closes: https://lore.kernel.org/all/20230915082126.4187913-1-ruanjinjie@huawei.com/
Fixes: d1909c022173 ("module: Don't ignore errors from set_memory_XX()")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/d6c81f38da76092de8aacc8c93c4c65cb0fe48b8.1733427536.git.christophe.leroy@csgroup.eu
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:14 +01:00
Christophe Leroy
570f7776db module: Split module_enable_rodata_ro()
module_enable_rodata_ro() is called twice, once before module init
to set rodata sections readonly and once after module init to set
rodata_after_init section readonly.

The second time, only the rodata_after_init section needs to be
set to read-only, no need to re-apply it to already set rodata.

Split module_enable_rodata_ro() in two.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/e3b6ff0df7eac281c58bb02cecaeb377215daff3.1733427536.git.christophe.leroy@csgroup.eu
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:14 +01:00
Thomas Weißschuh
e6ea40687f module: sysfs: Use const 'struct bin_attribute'
The sysfs core is switching to 'const struct bin_attribute's.
Prepare for that.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-6-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
fc15d675bc module: sysfs: Add notes attributes through attribute_group
A kobject is meant to manage the lifecycle of some resource.
However the module sysfs code only creates a kobject to get a
"notes" subdirectory in sysfs.
This can be achieved easier and cheaper by using a sysfs group.
Switch the notes attribute code to such a group, similar to how the
section allocation in the same file already works.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-5-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
75b519abc9 module: sysfs: Simplify section attribute allocation
The existing allocation logic manually stuffs two allocations into one.
This is hard to understand and of limited value, given that all the
section names are allocated on their own anyways.
Une one allocation per datastructure.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-4-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
cd8026d4bd module: sysfs: Drop 'struct module_sect_attr'
This is now an otherwise empty wrapper around a 'struct bin_attribute',
not providing any functionality. Remove it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-3-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
c027a83a03 module: sysfs: Drop member 'module_sect_attr::address'
'struct bin_attribute' already contains the member 'private' to pass
custom data to the attribute handlers.
Use that instead of the custom 'address' member.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-2-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
0dea980a17 module: sysfs: Drop member 'module_sect_attrs::nsections'
The member is only used to iterate over all attributes in
free_sect_attrs(). However the attribute group can already be used for
that. Use the group and drop 'nsections'.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241227-sysfs-const-bin_attr-module-v2-1-e267275f0f37@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
25aa761160 module: Constify 'struct module_attribute'
These structs are never modified, move them to read-only memory.
This makes the API clearer and also prepares for the constification of
'struct attribute' itself.

While at it, also constify 'modinfo_attrs_count'.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-3-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
cb80af8451 module: Handle 'struct module_version_attribute' as const
The structure is always read-only due to its placement in the read-only
section __modver. Reflect this at its usage sites.
Also prepare for the const handling of 'struct module_attribute' itself.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-2-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Thomas Weißschuh
9930261973 params: Prepare for 'const struct module_attribute *'
The 'struct module_attribute' sysfs callbacks are about to change to
receive a 'const struct module_attribute *' parameter.
Prepare for that by avoid casting away the constness through
container_of() and using const pointers to 'struct param_attribute'.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Link: https://lore.kernel.org/r/20241216-sysfs-const-attr-module-v1-1-3790b53e0abf@weissschuh.net
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:13 +01:00
Uwe Kleine-König
0e436d14d0 module: Put known GPL offenders in an array
Instead of repeating the add_taint_module() call for each offender, create
an array and loop over that one. This simplifies adding new entries
considerably.

Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Link: https://lore.kernel.org/r/20241115185253.1299264-2-wse@tuxedocomputers.com
[ppavlu: make the array const]
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2025-01-13 11:53:12 +01:00
Andrew Morton
c4c00fc21f foo 2025-01-12 21:39:53 -08:00
Randy Dunlap
7b9d444073 gcov: clang: use correct function param names
Fix the function parameter names to match the function so that
the kernel-doc warnings disappear.

clang.c:273: warning: Function parameter or struct member 'dst' not described in 'gcov_info_add'
clang.c:273: warning: Function parameter or struct member 'src' not described in 'gcov_info_add'
clang.c:273: warning: Excess function parameter 'dest' description in 'gcov_info_add'
clang.c:273: warning: Excess function parameter 'source' description in 'gcov_info_add'

Link: https://lkml.kernel.org/r/20250111062944.910638-1-rdunlap@infradead.org
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 21:39:50 -08:00
Randy Dunlap
40e229c39e kthread: modify kernel-doc function name to match code
kthread.c:1073: warning: expecting prototype for kthread_create_worker(). Prototype was for kthread_create_worker_on_node() instead

Link: https://lkml.kernel.org/r/20250111063008.910712-1-rdunlap@infradead.org
Fixes: b1e125dcbcea ("kthread: Unify kthread_create_on_cpu() and kthread_create_worker_on_cpu() automatic format")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 21:39:50 -08:00
Randy Dunlap
f2fab682cf latencytop: use correct kernel-doc format for func params
Use a ':' instead of a '-' after function parameters to eliminate
kernel-doc warnings.

kernel/latencytop.c:177: warning: Function parameter or struct member 'tsk' not described in '__account_scheduler_latency'
../kernel/latencytop.c:177: warning: Function parameter or struct member 'usecs' not described in '__account_scheduler_latency'
../kernel/latencytop.c:177: warning: Function parameter or struct member 'inter' not described in '__account_scheduler_latency'

Link: https://lkml.kernel.org/r/20250111063019.910730-1-rdunlap@infradead.org
Fixes: ad0b0fd554df ("sched, latencytop: incorporate review feedback from Andrew Morton")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 21:39:50 -08:00
Guo Weikang
3a53bdf054 mm/memblock: add memblock_alloc_or_panic interface
Before SLUB initialization, various subsystems used memblock_alloc to
allocate memory.  In most cases, when memory allocation fails, an
immediate panic is required.  To simplify this behavior and reduce
repetitive checks, introduce `memblock_alloc_or_panic`.  This function
ensures that memory allocation failures result in a panic automatically,
improving code readability and consistency across subsystems that require
this behavior.

Link: https://lkml.kernel.org/r/20250102072528.650926-1-guoweikang.kernel@gmail.com
Signed-off-by: Guo Weikang <guoweikang.kernel@gmail.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>	[s390]
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 21:39:28 -08:00
Suren Baghdasaryan
19c5a0d3a9 mm: make vma cache SLAB_TYPESAFE_BY_RCU
To enable SLAB_TYPESAFE_BY_RCU for vma cache we need to ensure that object
reuse before RCU grace period is over will be detected by
lock_vma_under_rcu().

Current checks are sufficient as long as vma is detached before it is
freed.  The only place this is not currently happening is in exit_mmap(). 
Add the missing vma_mark_detached() in exit_mmap().

Another issue which might trick lock_vma_under_rcu() during vma reuse is
vm_area_dup(), which copies the entire content of the vma into a new one,
overriding new vma's vm_refcnt and temporarily making it appear as
attached.  This might trick a racing lock_vma_under_rcu() to operate on a
reused vma if it found the vma before it got reused.  To prevent this
situation, we should ensure that vm_refcnt stays at detached state (0)
when it is copied and advances to attached state only after it is added
into the vma tree.  Introduce vm_area_init_from() which preserves new
vma's vm_refcnt and use it in vm_area_dup().  Since all vmas are in
detached state with no current readers when they are freed,
lock_vma_under_rcu() will not be able to take vm_refcnt after vma got
detached even if vma is reused.

Finally, make vm_area_cachep SLAB_TYPESAFE_BY_RCU.  This will facilitate
vm_area_struct reuse and will minimize the number of call_rcu() calls.

Link: https://lkml.kernel.org/r/20250111042604.3230628-17-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Hugh Dickens <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: kernel test robot <oliver.sang@intel.com>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Mattew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Minchan Kim <minchan@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Sourav Panda <souravpanda@google.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 21:39:19 -08:00