linux/fs
Thomas Gleixner 39a167560a rseq: Optimize event setting
After removing the various condition bits earlier it turns out that one
extra information is needed to avoid setting event::sched_switch and
TIF_NOTIFY_RESUME unconditionally on every context switch.

The update of the RSEQ user space memory is only required, when either

  the task was interrupted in user space and schedules

or

  the CPU or MM CID changes in schedule() independent of the entry mode

Right now only the interrupt from user information is available.

Add an event flag, which is set when the CPU or MM CID or both change.

Evaluate this event in the scheduler to decide whether the sched_switch
event and the TIF bit need to be set.

It's an extra conditional in context_switch(), but the downside of
unconditionally handling RSEQ after a context switch to user is way more
significant. The utilized boolean logic minimizes this to a single
conditional branch.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027084307.578058898@linutronix.de
2025-11-04 08:34:03 +01:00
..
9p Revert "fs/9p: Refresh metadata in d_revalidate for uncached mode too" 2025-10-22 14:25:27 +09:00
adfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
affs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
afs Simplifying ->d_name audits, easy part. 2025-10-03 11:14:02 -07:00
autofs new helper: set_default_d_op() 2025-06-10 22:21:16 -04:00
befs
bfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
btrfs for-6.18-rc2-tag 2025-10-23 06:44:43 -10:00
cachefiles VFS: unify old_mnt_idmap and new_mnt_idmap in renamedata 2025-09-23 12:37:35 +02:00
ceph Some messenger improvements from Eric and Max, a patch to address the 2025-10-10 11:30:19 -07:00
coda vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
configfs file->f_path constification 2025-10-03 16:32:36 -07:00
cramfs Patch series in this pull request: 2025-10-02 18:44:54 -07:00
crypto fscrypt updates for 6.18 2025-09-29 15:33:50 -07:00
debugfs vfs-6.18-rc1.async 2025-09-29 11:55:15 -07:00
devpts devpts, sunrpc, hostfs: don't bother with ->d_op 2025-06-11 13:40:04 -04:00
dlm dlm for 6.18 2025-09-29 15:24:58 -07:00
ecryptfs mount-related stuff for this cycle 2025-10-03 10:19:44 -07:00
efivarfs vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
efs
erofs erofs: consolidate z_erofs_extent_lookback() 2025-10-22 07:54:31 +08:00
exfat exfat: fix out-of-bounds in exfat_nls_to_ucs2() 2025-10-15 17:53:20 +09:00
exportfs exportfs: use lookup_one_unlocked() 2025-06-11 13:44:15 +02:00
ext2 \n 2025-07-28 16:16:09 -07:00
ext4 Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
f2fs f2fs: fix wrong block mapping for multi-devices 2025-10-13 23:55:44 +00:00
fat vfat: remove unused variable 2025-09-13 17:32:47 -07:00
freevxfs
fuse Revert "fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP" 2025-10-10 13:44:03 +02:00
gfs2 finish_no_open calling conventions change 2025-10-03 10:59:31 -07:00
hfs hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
hfsplus hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
hostfs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
hpfs - Avoid -Wflex-array-member-not-at-end warnings 2025-10-10 14:06:02 -07:00
hugetlbfs hugetlbfs: move lock assertions after early returns in huge_pmd_unshare() 2025-10-21 15:46:17 -07:00
iomap iomap: open code bio_iov_iter_get_bdev_pages 2025-10-07 08:05:44 -06:00
isofs Current exclusion rules for ->d_flags stores are rather unpleasant. 2025-07-28 09:17:57 -07:00
jbd2 jbd2: ensure that all ongoing I/O complete before freeing blocks 2025-10-10 13:10:06 -04:00
jffs2 mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
jfs A few fixes and cleanups for JFS. 2025-10-03 13:54:23 -07:00
kernfs vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
lockd SUNRPC: Move the svc_rpcb_cleanup() call sites 2025-09-23 13:28:19 -04:00
minix minixfs: Verify inode mode when loading from disk 2025-08-19 13:30:46 +02:00
netfs vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
nfs NFS4: Fix state renewals missing after boot 2025-10-13 14:33:00 -04:00
nfs_common NFS/localio: nfs_uuid_put() fix the wake up after unlinking the file 2025-08-05 16:45:40 -07:00
nfsd nfsd-6.18 fixes: 2025-10-28 12:13:20 -07:00
nilfs2 Merge branch 'mm-hotfixes-stable' into mm-stable in order to pick up 2025-09-21 14:19:36 -07:00
nls
notify fs/notify: call exportfs_encode_fid with s_umount 2025-10-06 16:31:52 +02:00
ntfs3 ntfs3: stop using write_cache_pages 2025-09-13 16:55:13 -07:00
ocfs2 ocfs2: clear extent cache after moving/defragmenting extents 2025-10-15 13:24:33 -07:00
omfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
openpromfs
orangefs orangefs: Two cleanups and a bug fix. 2025-10-03 13:59:56 -07:00
overlayfs ovl: remove redundant IOCB_DIO_CALLER_COMP clearing 2025-10-10 14:02:47 +02:00
proc Patch series in this pull request: 2025-10-02 18:44:54 -07:00
pstore pstore update for v6.18-rc1 2025-09-29 18:08:34 -07:00
qnx4
qnx6
quota fs: replace use of system_unbound_wq with system_dfl_wq 2025-09-19 16:15:07 +02:00
ramfs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
resctrl x86,fs/resctrl: Fix NULL pointer dereference with events force-disabled in mbm_event mode 2025-10-20 18:06:31 +02:00
romfs fs: replace mmap hook with .mmap_prepare for simple mappings 2025-06-19 13:56:59 +02:00
smb four smb client fixes 2025-10-31 09:34:21 -07:00
squashfs Patch series in this pull request: 2025-10-02 18:44:54 -07:00
sysfs sysfs: check visibility before changing group attribute ownership 2025-10-17 09:48:34 +02:00
tests
tracefs Massage rpc_pipefs to use saner primitives and clean up the 2025-07-28 09:56:09 -07:00
ubifs Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
udf fs: udf: fix OOB read in lengthAllocDescs handling 2025-09-22 15:33:56 +02:00
ufs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
unicode
vboxsf simplify vboxsf_dir_atomic_open() 2025-09-16 23:59:38 -04:00
verity Optimize fsverity with 2-way interleaved hashing 2025-09-29 15:55:20 -07:00
xfs xfs: document another racy GC case in xfs_zoned_map_extent 2025-10-31 12:06:03 +01:00
zonefs zonefs: correct some spelling mistakes 2025-08-12 11:59:27 +09:00
Kconfig Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
Kconfig.binfmt binfmt_elf: preserve original ELF e_flags for core dumps 2025-09-03 20:49:32 -07:00
Makefile Remove bcachefs core code 2025-09-29 13:43:52 -07:00
aio.c Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
anon_inodes.c module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES 2025-08-11 16:16:36 +02:00
attr.c vfs: add ATTR_CTIME_SET flag 2025-09-21 19:24:50 -04:00
backing-file.c vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
bad_inode.c
binfmt_elf.c rseq: Provide and use rseq_set_ids() 2025-11-04 08:33:33 +01:00
binfmt_elf_fdpic.c execve updates for v6.17 2025-07-28 17:11:40 -07:00
binfmt_flat.c
binfmt_misc.c binfmt_misc: switch to locked_recursive_removal() 2025-07-02 22:36:51 -04:00
binfmt_script.c
bpf_fs_kfuncs.c bpf...d_path(): constify path argument 2025-09-15 21:17:08 -04:00
buffer.c fs/buffer: fix use-after-free when call bh_read() helper 2025-08-19 13:51:28 +02:00
char_dev.c
compat_binfmt_elf.c
coredump.c coredump: fix core_pattern input validation 2025-10-07 13:12:46 +02:00
d_path.c fold fs_struct->{lock,seq} into a seqlock 2025-07-08 10:25:19 +02:00
dax.c dax: skip read lock assertion for read-only filesystems 2025-10-07 12:48:33 +02:00
dcache.c vfs: Don't leak disconnected dentries on umount 2025-10-07 13:09:08 +02:00
direct-io.c Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
drop_caches.c
eventfd.c
eventpoll.c eventpoll: Replace rwlock with spinlock 2025-09-05 15:51:24 +02:00
exec.c rseq: Optimize event setting 2025-11-04 08:34:03 +01:00
fcntl.c fcntl: trim arguments 2025-09-26 10:21:23 +02:00
fhandle.c namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
file.c fs: always return zero on success from replace_fd() 2025-08-11 14:52:25 +02:00
file_attr.c fs: return EOPNOTSUPP from file_setattr/file_getattr syscalls 2025-10-10 13:46:00 +02:00
file_table.c fs: update comment in init_file() 2025-10-07 12:48:33 +02:00
filesystems.c fs/filesystems: Fix potential unsigned integer underflow in fs_name() 2025-04-14 13:05:59 +02:00
fs-writeback.c vfs-6.18-rc1.writeback 2025-09-29 11:34:40 -07:00
fs_context.c change the calling conventions for vfs_parse_fs_string() 2025-09-04 15:20:51 -04:00
fs_parser.c fs/fs_parse: Remove unused and problematic validate_constant_table() 2025-04-21 10:27:59 +02:00
fs_pin.c
fs_struct.c fold fs_struct->{lock,seq} into a seqlock 2025-07-08 10:25:19 +02:00
fs_types.c
fsopen.c fscontext: do not consume log entries when returning -EMSGSIZE 2025-08-11 14:52:41 +02:00
init.c VFS: rename kern_path_locked() and related functions. 2025-09-23 12:37:36 +02:00
inode.c vfs-6.18-rc1.inode 2025-09-29 09:42:30 -07:00
internal.h file->f_path constification 2025-10-03 16:32:36 -07:00
ioctl.c fs: remove vfs_ioctl export 2025-09-01 13:08:01 +02:00
kernel_read_file.c
libfs.c vfs-6.17-rc1.pidfs 2025-07-28 14:10:15 -07:00
locks.c locks: Remove the last reference to EXPORT_OP_ASYNC_LOCK. 2025-08-11 14:52:24 +02:00
mbcache.c
mnt_idmapping.c
mount.h mount-related stuff for this cycle 2025-10-03 10:19:44 -07:00
mpage.c mpage: convert do_mpage_readpage() to return void type 2025-09-21 14:22:16 -07:00
namei.c file->f_path constification 2025-10-03 16:32:36 -07:00
namespace.c vfs_parse_fs_string() stuff 2025-10-03 10:51:44 -07:00
nsfs.c nsfs: handle inode number mismatches gracefully in file handles 2025-10-07 12:48:33 +02:00
open.c file->f_path constification 2025-10-03 16:32:36 -07:00
pidfs.c file->f_path constification 2025-10-03 16:32:36 -07:00
pipe.c Add RWF_NOSIGNAL flag for pwritev2 2025-08-29 15:08:07 +02:00
pnode.c umount_tree(): take all victims out of propagation graph at once 2025-09-15 21:26:44 -04:00
pnode.h umount_tree(): take all victims out of propagation graph at once 2025-09-15 21:26:44 -04:00
posix_acl.c
proc_namespace.c ->mnt_devname is never NULL 2025-05-23 14:20:44 +02:00
read_write.c copy_file_range: limit size if in compat mode 2025-08-15 16:11:47 +02:00
readdir.c readdir: supply dir_context.count as readdir buffer size hint 2025-05-29 12:31:23 +02:00
remap_range.c
select.c select: Convert to scoped user access 2025-11-04 08:28:34 +01:00
seq_file.c
signalfd.c
splice.c netfs: Fix unbuffered write error handling 2025-08-15 15:56:49 +02:00
stack.c docs/vfs: update references to i_mutex to i_rwsem 2025-06-23 12:17:33 +02:00
stat.c constify path argument of vfs_statx_path() 2025-09-15 21:17:07 -04:00
statfs.c
super.c mount-related stuff for this cycle 2025-10-03 10:19:44 -07:00
sync.c
sysctls.c
timerfd.c
userfaultfd.c mm/mremap: use an explicit uffd failure path for mremap 2025-07-24 19:12:29 -07:00
utimes.c
xattr.c vfs-6.17-rc1.misc 2025-07-28 11:22:56 -07:00