Linux/linux 03242d6 — kernel/sched wait.c

sched/wait: kill leftover bookmark logic in __wake_up_common()

The manual list head check and list_for_each_entry_safe_from() in
__wake_up_common() are leftovers from commit 2554db916586 ("sched/wait:
Break up long wake list walk").

This logic was later removed by commit 37acade0ce89 ("sched: remove
wait bookmarks") but the now-unnecessary list hacks were left behind.

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+1-6kernel/sched/wait.c
+1-61 files

Linux/linux 6bba0ff — fs eventpoll.c, fs/orangefs orangefs-bufmap.c

sched/wait: remove the __add_wait_queue_*exclusive() helpers

Each has one or two special-case users.  Open-code them there: set
WQ_FLAG_EXCLUSIVE and queue the entry directly, with a note on why the
caller doesn't use add_wait_queue_exclusive().

I think all cases (eventpoll, orangefs and ubifs) are unnecessary and
could just use the regular ordering, but I'll leave that to those
maintainers to sort out.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Cc: Alexander Viro <viro at zeniv.linux.org.uk>    # eventpoll
Cc: Christian Brauner <brauner at kernel.org>      # eventpoll
Cc: Jan Kara <jack at suse.cz>                     # eventpoll
Cc: Mike Marshall <hubcap at omnibond.com>         # orangefs

    [2 lines not shown]
DeltaFile
+0-17include/linux/wait.h
+5-2fs/orangefs/orangefs-bufmap.c
+5-2fs/eventpoll.c
+3-1fs/ubifs/journal.c
+13-224 files

Linux/linux c792598 — block blk-iocost.c, drivers/gpu/drm/i915 i915_sw_fence.c

sched/wait: remove __add_wait_queue_entry_tail()

__add_wait_queue() and __add_wait_queue_entry_tail() are now the same.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+4-4kernel/sched/wait.c
+1-6include/linux/wait.h
+3-3mm/filemap.c
+1-1fs/orangefs/orangefs-bufmap.c
+1-1drivers/gpu/drm/i915/i915_sw_fence.c
+1-1block/blk-iocost.c
+11-161 files not shown
+12-177 files

Linux/linux eb58eb6 — include/linux wait.h, kernel/sched wait.c

sched/wait: always queue new waiters at the tail

Non-exclusive waiters have been added at the head and exclusive ones at
the tail, so that an exclusive wakeup stopping early still woke every
non-exclusive waiter.

That only matters for waiters that mix both kinds on one queue like
read() and poll() on a pipe - and even then it doesn't actually buy
anything but complexity and fragility of the code.

An exclusive reader consumes the event, the poller had nothing to see,
so there's no real point in keeping the two ordered.

The pointless ordering results in a special rule for everybody adding
themselves to the wait queue, and that rule has not been consistently
followed anyway (see for example do_wait_intr() and do_wait_intr_irq())

So just queue everyone in FIFO order.  LIFO might be better for
throughput, but every time we've ever tried that optimization in real

    [22 lines not shown]
DeltaFile
+21-13kernel/sched/wait.c
+3-11include/linux/wait.h
+24-242 files

Linux/linux ebb7a8d — arch/arm64/boot/dts/st stm32mp2xxx-dhcos-som.dtsi stm32mp25xx-dhcos-som.dtsi, drivers/firmware/arm_scmi bus.c

Merge tag 'soc-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC fixes from Arnd Bergmann:
 "There are once more lots of individual device driver fixes across
  several subsystems, and most of them look like they were found with
  the help of LLM services looking more closely at corner cases that
  had been missed before:

   - Multiple SCMI firmware fixes for probing device nodes and mailboxes

   - Notifications on Arm FFA firmware with hash conflicts

   - Out-of-bounds access to i.MX SCMI firmware data from userspace

   - Several error handling and probe fixes for reset controllers, along
     with a circular locking problem and one NULL pointer dereference

   - Multiple error handling fixes for memory controller drivers


    [42 lines not shown]
DeltaFile
+66-44drivers/firmware/arm_scmi/bus.c
+66-40drivers/memory/fsl_ifc.c
+64-10arch/arm64/boot/dts/st/stm32mp23xx-dhcos-som.dtsi
+54-17drivers/reset/core.c
+47-0arch/arm64/boot/dts/st/stm32mp25xx-dhcos-som.dtsi
+0-45arch/arm64/boot/dts/st/stm32mp2xxx-dhcos-som.dtsi
+297-15631 files not shown
+457-21837 files

Linux/linux f441d24 — kernel/sched/ext ext.c, tools/testing/selftests/sched_ext unlocked_kfunc_fail_init_cids.bpf.c unlocked_kfunc_fail_dump.bpf.c

Merge tag 'sched_ext-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext

Pull sched_ext fixes from Tejun Heo:

 - Scheduler enable and disable could race with tasks changing class: on
   enable, a task could switch to sched_ext before the scheduler core
   started picking sched_ext tasks and be left runnable while its CPU
   went idle. On disable, an RT task could starve the tasks falling back
   to the fair class and stall the disable itself.

 - BPF schedulers failed to load on architectures whose BPF JIT doesn't
   support private stacks, such as riscv64. Only sub-schedulers need
   them and are now refused there instead.

 - The debug dump and CPU ID layout callbacks could call kfuncs that
   move tasks around. They are now rejected at load time.

 - Smaller fixes: a task's first enqueue after fork didn't tell the BPF
   scheduler that CPU selection had already run, and two kfuncs raised a

    [10 lines not shown]
DeltaFile
+55-24kernel/sched/ext/ext.c
+73-0tools/testing/selftests/sched_ext/unlocked_kfunc.c
+69-0tools/testing/selftests/sched_ext/unlocked_kfunc.bpf.c
+67-0tools/testing/selftests/sched_ext/unlocked_kfunc_cid.bpf.c
+26-0tools/testing/selftests/sched_ext/unlocked_kfunc_fail_dump.bpf.c
+22-0tools/testing/selftests/sched_ext/unlocked_kfunc_fail_init_cids.bpf.c
+312-243 files not shown
+323-259 files

Linux/linux 9569562 — include/linux/sched isolation.h, kernel/cgroup rstat.c

Merge tag 'cgroup-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:

 - A BPF program could queue a cgroup stat update with preemption
   enabled, tripping a lockdep assertion

 - When nohz_full= included the boot CPU, the tick code took the CPU
   back out of the nohz_full set but the housekeeping cpumask still
   excluded it. The fix is in the CPU isolation code. It comes through
   cgroup with Frederic's review as further cpuset changes build on it

* tag 'cgroup-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup/rstat: disable preemption in css_rstat_updated()
  tick/sched: Make tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask consistent
DeltaFile
+11-0kernel/sched/isolation.c
+6-0kernel/time/tick-sched.c
+2-0include/linux/sched/isolation.h
+1-0kernel/cgroup/rstat.c
+20-04 files

Linux/linux e1faf0e — kernel workqueue.c

Merge tag 'wq-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue fixes from Tejun Heo:

 - Draining a workqueue could return while a work item queued by another
   work item was still pending, making workqueue destruction warn and
   leak the workqueue

 - CPU bringup during boot repeated unbound workqueue setup that can't
   change that early, at a cost quadratic in the CPU count

* tag 'wq-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: Skip redundant unbound updates during CPU bringup
  workqueue: Fix drain_workqueue() missing work items chained across pwqs
DeltaFile
+49-11kernel/workqueue.c
+49-111 files

Linux/linux da1833a — fs eventpoll.c

eventpoll: don't claim real exclusivity for EPOLLEXCLUSIVE

An EPOLLEXCLUSIVE entry that wakes an epoll_wait()er returns 1, and
because it was queued as an exclusive waiter that stops the wakeup walk.

But nothing makes the epoll user consume the event: it may be killed,
time out, pick another ready fd, or just not read.  Anything queued
behind the entry - a blocked pipe reader, an accept()er, a recv()er -
then sleeps with the event pending.

Queue it with WQ_FLAG_POLL_EXCLUSIVE instead: still only one epoll
instance is woken per wakeup, but real waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Reviewed-by: Oleg Nesterov <oleg at redhat.com>
Cc: Christian Brauner <brauner at kernel.org>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>

    [2 lines not shown]
DeltaFile
+2-3fs/eventpoll.c
+2-31 files

Linux/linux 704b065 — io_uring poll.c

io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE

Same problem as epoll: an EPOLLEXCLUSIVE poll request returns 1 from
io_poll_wake() (even when it lost the ownership race and does nothing),
which stops the wakeup walk, but posting a CQE doesn't consume the
event.

Waiters queued behind it can sleep with the event pending.

Use WQ_FLAG_POLL_EXCLUSIVE, so only one io_uring entry is woken but real
waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Jens Axboe <axboe at kernel.dk>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+3-5io_uring/poll.c
+3-51 files

Linux/linux c1a6d9b — include/linux wait.h, kernel/sched wait.c

sched/wait: add WQ_FLAG_POLL_EXCLUSIVE for user space waiters

An exclusive waiter whose wake function returns a positive return value
to indicate that it has successfully been woken up stops the wakeup
walk, on the understanding that it will handle the event.

However, user space consumers - like eventpoll or io_uring - want to be
woken up, and want to avoid the thundering herd issue.  So they used an
exclusive wait - but without any actual guarantee that they will then
meaningfully handle the event.

So the wakeup could be lost, and real waiters would be left pending.

Add a separate flag for these kind of "exclusive poll" cases, which is
effectively what these user space waiters are.  Only the first such
entry that accepts a wakeup is woken, as now, but they don't count
against nr_exclusive and it doesn't stop the walk.

Wake-all (nr_exclusive == 0, including POLLFREE) still calls every entry.

    [9 lines not shown]
DeltaFile
+13-1kernel/sched/wait.c
+1-0include/linux/wait.h
+14-12 files

Linux/linux 3f3a9d4 — net/sctp socket.c

sctp: don't let a blocked reader take write-space wakeups

sctp_wait_for_packet() waits exclusively on sk_sleep() with the default
autoremove wake function, so it accepts any wakeup and consumes it.

Then __sctp_write_space() sends EPOLLOUT with a wake-one wakeup:
sctp_wait_for_packet() wakes up, finds no data, goes back to sleep, and
the walk stops.

End result: anybody else queued behind it that was waiting for EPOLLOUT
will never see it.

Filter on EPOLLIN | EPOLLERR like receiver_wake_function() in
net/core/datagram.c.  State changes (using sock_def_wakeup()) use an
unkeyed wake-all and still get through and will ignore the exclusive
nature of sctp_wait_for_packet().

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner at gmail.com>

    [5 lines not shown]
DeltaFile
+10-1net/sctp/socket.c
+10-11 files

Linux/linux b312ada — . MAINTAINERS, fs/hugetlbfs inode.c

Merge tag 'mm-hotfixes-stable-2026-11-24-22-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull MM fixes from Andrew Morton:

 - "mm: fix swapcache writeout and cluster table races" (Nhat Pham):

   Let reclaim write dirty swapcache folios without anon mappings.
   Publish swap cluster tables under the allocator locks and keep stale
   reclaimers from relocating clusters being populated.

 - "mm/hugetlb: various fixes" (David Hildenbrand):

   Prevent fallocate() overflow from consuming and leaking huge pages.
   Serialize mremap() with migration before flushing stale TLB entries,
   and avoid corrupting private hugetlb VMA state during unmapping.

 - "MAINTAINERS: remove my reviewerships, add CREDITS entry for THP"
   (Lorenzo Stoakes):


    [71 lines not shown]
DeltaFile
+97-41mm/swapfile.c
+16-46MAINTAINERS
+31-10mm/list_lru.c
+20-1mm/hugetlb.c
+15-3fs/hugetlbfs/inode.c
+11-4mm/vmscan.c
+190-1058 files not shown
+230-11714 files

Linux/linux 3d4ed0e — include/linux bootconfig.h, init main.c

Merge tag 'bootconfig-fixes-v7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull bootconfig fixes from Masami Hiramatsu:

 - bootconfig: Exclude alignment padding from bootconfig max size

   Separate the padded trailer size limit from XBC_DATA_MAX and strip up
   to three trailing NUL alignment bytes before xbc_init() so valid
   max-size configs are not rejected depending on initrd alignment

 - bootconfig: Free the initrd memory used by bootconfig

   Save the original initrd_end before trimming the bootconfig and restore
   it when freeing initrd memory so pages previously occupied by bootconfig
   data are not leaked

 - bootconfig: Parser fixes and tests according to LEAN check

     - Fix xbc_verify_tree() to check subkeys of valued keys

    [46 lines not shown]
DeltaFile
+48-2tools/bootconfig/test-bootconfig.sh
+25-13tools/bootconfig/main.c
+25-12init/main.c
+24-0include/linux/bootconfig.h
+16-5tools/bootconfig/scripts/bconf2ftrace.sh
+9-8lib/bootconfig.c
+147-404 files not shown
+166-4610 files

Linux/linux 97e1c7d — kernel/sched/ext ext.c

sched_ext: Attach fair_server before tasks fall back to fair on disable

In full mode, the enable path detaches fair_server, since no task runs
in the fair class. scx_root_disable() attaches it again only at the end,
in the dl_server_swap_bw() loop. But tasks fall back to fair well before
that. New forks and sched_setscheduler() calls do so once
scx_switching_all is cleared, and the switch loop moves all other tasks.
Until the swap, fair_server can't start, so an RT task that keeps a CPU
starves the fair tasks there.

Meanwhile, the disable path waits for RCU grace periods in
percpu_down_write() of scx_fork_rwsem and scx_cgroup_ops_rwsem. A grace
period can wait for a starved task, so the disable doesn't finish until
the RT task stops. The starved task can be a reader preempted under
PREEMPT_RCU, or the grace-period kthread itself. While the disable waits
in the scx_cgroup_lock() after the switch loop, scx_fork_rwsem and
cgroup_mutex are held, so forks wait too.

To reproduce, load scx_simple, pin SCHED_NORMAL tasks (/proc walkers,

    [19 lines not shown]
DeltaFile
+17-2kernel/sched/ext/ext.c
+17-21 files

Linux/linux 56bb11f — tools/bootconfig main.c

tools/bootconfig: Report initrd append failures

The signed return value of write() is compared against a size_t.
A negative return becomes an unsigned value and bypasses the error
path, so applying a bootconfig can claim success without appending
it. Check for a negative return before comparing the byte count.

Link: https://lore.kernel.org/all/20261120061917.98169-1-zhujun2@cmss.chinamobile.com/

Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
Cc: stable at vger.kernel.org
Signed-off-by: Zhu Jun <zhujun2 at cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat at kernel.org>
DeltaFile
+9-7tools/bootconfig/main.c
+9-71 files

Linux/linux a33ffa8 — tools/bootconfig main.c

tools/bootconfig: Reject short reads of configuration data

load_xbc_fd() places the terminator at the requested size even when
read() returns less. Its initrd caller then computes a checksum over
bytes that were never read, while the plain file callers can parse a
partial configuration. Reject a short read and release the allocated
buffer on both read failure paths.

Link: https://lore.kernel.org/all/20261120061912.98156-1-zhujun2@cmss.chinamobile.com/

Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Cc: stable at vger.kernel.org
Signed-off-by: Zhu Jun <zhujun2 at cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat at kernel.org>
DeltaFile
+6-2tools/bootconfig/main.c
+6-21 files

Linux/linux 94ff2d2 — kernel workqueue.c

workqueue: Fix drain_workqueue() missing work items chained across pwqs

drain_workqueue() flushes the workqueue, then checks each pwq under its
pool's lock and returns once a pass finds every pwq empty. Only chained
queueing is allowed meanwhile, and a chained work item can land on a pwq
other than the one the queueing work item is executing on. The pass misses
it when:

1. The pass finds pwq A empty.
2. A work item executing on pwq B queues a work item on pwq A.
3. The work item on pwq B finishes.
4. The pass finds pwq B empty.

drain_workqueue() returns with the work item on pwq A pending, and
destroy_workqueue() can then trip WARN_ON(pwq_busy()) and leak the
workqueue.

Add pwq->nr_started, which counts the work items a pwq has started
executing, and check the pwqs twice after each flush. The drain is complete

    [14 lines not shown]
DeltaFile
+40-11kernel/workqueue.c
+40-111 files

Linux/linux edf1066 — kernel workqueue.c

workqueue: Skip redundant unbound updates during CPU bringup

Before workqueue_init_topology(), all CPUs share the SYSTEM pod,
which contains every possible CPU. The effective cpumask and the
per-pod cpumask of an unbound workqueue are therefore identical,
regardless of which CPUs are online.

During this stage, workqueue_online_cpu() walks every possible CPU for
every unbound workqueue each time a secondary CPU comes online. The
pwq mappings cannot change yet, so this repeats redundant work that
scales quadratically with CPU count.

On a 640-vCPU Hyper-V VM, each of the 639 secondary CPU-online
callbacks walks all 640 possible CPUs for each of the 8 unbound
workqueues, giving 3,271,680 unbound_wq_update_pwq() calls that took
about 975 ms in total.

Skip these updates until workqueue_init_topology(). The pwq mappings
already match the effective cpumask, and wq_update_node_max_active()

    [16 lines not shown]
DeltaFile
+9-0kernel/workqueue.c
+9-01 files

Linux/linux 4dce97c — fs/ext4 orphan-test.c balloc-test.c

Merge tag 'ext4_for_linus-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 updates from Ted Ts'o:
 "The bulk of the new lines was caused by adding KUnit tests, which
  makes it safer to validate AI generated patches.

  Three minor performance provements:

   - Spread the inodes of files in sibling directories over the block
     groups of a flex group. This avoids contention on the inode table
     buffer locks and significantly speeds up parallel file creation

   - Move the orphan list tracking fields in ext4_sb_info off the cache
     line shared with the journal state, which improves unlink
     performance on file systems without the orphan_file feature

   - Speed up fast commit replay for sparse files by skipping holes when
     shrinking the extent tree.


    [83 lines not shown]
DeltaFile
+3,504-4fs/ext4/inode-test.c
+2,731-0fs/ext4/ialloc-test.c
+2,714-0fs/ext4/fast_commit-test.c
+2,563-72fs/ext4/extents-test.c
+2,403-0fs/ext4/balloc-test.c
+2,372-0fs/ext4/orphan-test.c
+16,287-7662 files not shown
+41,204-62168 files

Linux/linux ed42314 — tools/testing/selftests/sched_ext Makefile unlocked_kfunc_fail_init_cids.bpf.c

selftests/sched_ext: Add unlocked_kfunc test

Add the unlocked_kfunc test to verify verifier-time restrictions on the
SCX_KF_ALLOW_UNLOCKED kfuncs.

The valid cpu-form and cid-form schedulers verify that ops.init() and
ops.exit() can call scx_bpf_create_dsq(), scx_bpf_dsq_move(),
scx_bpf_dsq_reenq_task(), and scx_bpf_select_cpu_dfl(). They also verify
that ops.dump() can call scx_bpf_dump() and that ops.init_cids() can
call scx_bpf_cid_override().

The two negative schedulers verify that the verifier rejects
scx_bpf_dsq_move() from ops.dump() and scx_bpf_create_dsq() from
ops.init_cids() with -EACCES.

Signed-off-by: Kuba Piecuch <jpiecuch at google.com>
Signed-off-by: Tejun Heo <tj at kernel.org>
DeltaFile
+73-0tools/testing/selftests/sched_ext/unlocked_kfunc.c
+69-0tools/testing/selftests/sched_ext/unlocked_kfunc.bpf.c
+67-0tools/testing/selftests/sched_ext/unlocked_kfunc_cid.bpf.c
+26-0tools/testing/selftests/sched_ext/unlocked_kfunc_fail_dump.bpf.c
+22-0tools/testing/selftests/sched_ext/unlocked_kfunc_fail_init_cids.bpf.c
+1-0tools/testing/selftests/sched_ext/Makefile
+258-06 files

Linux/linux 4fec59c — kernel/sched/ext ext.c

sched_ext: Don't allow unlocked kfuncs from ops.dump() and ops.init_cids()

scx_kf_allow_flags[] grants SCX_KF_ALLOW_UNLOCKED to ops.dump(). This
allows ops.dump() to call scx_bpf_dsq_move*(), scx_bpf_dsq_reenq_task(),
and scx_bpf_select_cpu_*(). When no rq is locked, these kfuncs acquire
rq, DSQ, and pi locks and may invoke nested SCX ops such as
ops.dequeue().

scx_dump_state() runs ops.dump() with IRQs disabled under scx_dump_lock.
Callers include the hardirq disable irq_work and SysRq-D. With
SCX_KF_ALLOW_UNLOCKED, a debug dump can migrate tasks and run nested
scheduler callbacks instead of only inspecting state. ops.dump_cpu() and
ops.dump_task() already deny these kfuncs. Remove SCX_KF_ALLOW_UNLOCKED
from ops.dump().

ops.init_cids() runs before the cid tables are published and before the
arena pool and pshards are set up. Its only job is to finalize the cid
layout. SCX_KF_ALLOW_UNLOCKED also gave it scx_bpf_create_dsq(),
scx_bpf_dsq_move*(), and scx_bpf_dsq_reenq_task(). Restrict

    [9 lines not shown]
DeltaFile
+6-2kernel/sched/ext/ext.c
+6-21 files

Linux/linux 4ca7b0f — scripts Makefile.warn Makefile.autofdo

Merge tag 'kbuild-fixes-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux

Pull Kbuild fixes from Nathan Chancellor:

 - Move GCC 17's implementation of -Wconstant-logical-operand to W=2
   to fix builds with -Werror

 - Disable LLVM's flow-based profile inference algorithm (Profi) for
   AutoFDO, which can degrade runtime performance and cause pathological
   compilation time issues

* tag 'kbuild-fixes-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
  kbuild: AutoFDO: Disable Profi (-fno-sample-profile-use-profi)
  kbuild: move gcc's -Wconstant-logical-operand to W=2
DeltaFile
+3-0scripts/Makefile.autofdo
+3-0scripts/Kconfig.toolchain
+1-0scripts/Makefile.warn
+7-03 files

Linux/linux 8bdd5fa — fs eventpoll.c, fs/orangefs orangefs-bufmap.c

sched/wait: remove the __add_wait_queue_*exclusive() helpers

Each has one or two special-case users.  Open-code them there: set
WQ_FLAG_EXCLUSIVE and queue the entry directly, with a note on why the
caller doesn't use add_wait_queue_exclusive().

I think all cases (eventpoll, orangefs and ubifs) are unnecessary and
could just use the regular ordering, but I'll leave that to those
maintainers to sort out.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Cc: Alexander Viro <viro at zeniv.linux.org.uk>    # eventpoll
Cc: Christian Brauner <brauner at kernel.org>      # eventpoll
Cc: Jan Kara <jack at suse.cz>                     # eventpoll
Cc: Mike Marshall <hubcap at omnibond.com>         # orangefs

    [2 lines not shown]
DeltaFile
+0-17include/linux/wait.h
+5-2fs/orangefs/orangefs-bufmap.c
+5-2fs/eventpoll.c
+3-1fs/ubifs/journal.c
+13-224 files

Linux/linux 4705d36 — block blk-iocost.c, drivers/gpu/drm/i915 i915_sw_fence.c

sched/wait: remove __add_wait_queue_entry_tail()

__add_wait_queue() and __add_wait_queue_entry_tail() are now the same.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+4-4kernel/sched/wait.c
+1-6include/linux/wait.h
+3-3mm/filemap.c
+1-1fs/orangefs/orangefs-bufmap.c
+1-1drivers/gpu/drm/i915/i915_sw_fence.c
+1-1block/blk-iocost.c
+11-161 files not shown
+12-177 files

Linux/linux 8ac5525 — include/linux wait.h, kernel/sched wait.c

sched/wait: always queue new waiters at the tail

Non-exclusive waiters have been added at the head and exclusive ones at
the tail, so that an exclusive wakeup stopping early still woke every
non-exclusive waiter.

That only matters for waiters that mix both kinds on one queue like
read() and poll() on a pipe - and even then it doesn't actually buy
anything but complexity and fragility of the code.

An exclusive reader consumes the event, the poller had nothing to see,
so there's no real point in keeping the two ordered.

The pointless ordering results in a special rule for everybody adding
themselves to the wait queue, and that rule has not been consistently
followed anyway (see for example do_wait_intr() and do_wait_intr_irq())

So just queue everyone in FIFO order.  LIFO might be better for
throughput, but every time we've ever tried that optimization in real

    [22 lines not shown]
DeltaFile
+16-13kernel/sched/wait.c
+3-11include/linux/wait.h
+19-242 files

Linux/linux 8307892 — io_uring poll.c

io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE

Same problem as epoll: an EPOLLEXCLUSIVE poll request returns 1 from
io_poll_wake() (even when it lost the ownership race and does nothing),
which stops the wakeup walk, but posting a CQE doesn't consume the
event.

Waiters queued behind it can sleep with the event pending.

Use WQ_FLAG_POLL_EXCLUSIVE, so only one io_uring entry is woken but real
waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Jens Axboe <axboe at kernel.dk>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+3-5io_uring/poll.c
+3-51 files

Linux/linux 79b6fbd — fs eventpoll.c

eventpoll: don't claim real exclusivity for EPOLLEXCLUSIVE

An EPOLLEXCLUSIVE entry that wakes an epoll_wait()er returns 1, and
because it was queued as an exclusive waiter that stops the wakeup walk.

But nothing makes the epoll user consume the event: it may be killed,
time out, pick another ready fd, or just not read.  Anything queued
behind the entry - a blocked pipe reader, an accept()er, a recv()er -
then sleeps with the event pending.

Queue it with WQ_FLAG_POLL_EXCLUSIVE instead: still only one epoll
instance is woken per wakeup, but real waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Christian Brauner <brauner at kernel.org>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>

    [2 lines not shown]
DeltaFile
+2-3fs/eventpoll.c
+2-31 files

Linux/linux fc9b031 — include/linux wait.h, kernel/sched wait.c

sched/wait: add WQ_FLAG_POLL_EXCLUSIVE for user space waiters

An exclusive waiter whose wake function returns a positive return value
to indicate that it has successfully been woken up stops the wakeup
walk, on the understanding that it will handle the event.

However, user space consumers - like eventpoll or io_uring - want to be
woken up, and want to avoid the thundering herd issue.  So they used an
exclusive wait - but without any actual guarantee that they will then
meaningfully handle the event.

So the wakeup could be lost, and real waiters would be left pending.

Add a separate flag for these kind of "exclusive poll" cases, which is
effectively what these user space waiters are.  Only the first such
entry that accepts a wakeup is woken, as now, but they don't count
against nr_exclusive and it doesn't stop the walk.

Wake-all (nr_exclusive == 0, including POLLFREE) still calls every entry.

    [9 lines not shown]
DeltaFile
+13-1kernel/sched/wait.c
+1-0include/linux/wait.h
+14-12 files

Linux/linux 303e403 — net/sctp socket.c

sctp: don't let a blocked reader take write-space wakeups

sctp_wait_for_packet() waits exclusively on sk_sleep() with the default
autoremove wake function, so it accepts any wakeup and consumes it.

Then __sctp_write_space() sends EPOLLOUT with a wake-one wakeup:
sctp_wait_for_packet() wakes up, finds no data, goes back to sleep, and
the walk stops.

End result: anybody else queued behind it that was waiting for EPOLLOUT
will never see it.

Filter on EPOLLIN | EPOLLERR like receiver_wake_function() in
net/core/datagram.c.  State changes (using sock_def_wakeup()) use an
unkeyed wake-all and still get through and will ignore the exclusive
nature of sctp_wait_for_packet().

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner at gmail.com>

    [5 lines not shown]
DeltaFile
+10-1net/sctp/socket.c
+10-11 files