Linux kernel source tree
Go to file
Frederic Weisbecker d716ea059c entry/rcu: Check TIF_RESCHED _after_ delayed RCU wake-up
[ Upstream commit b416514054 ]

RCU sometimes needs to perform a delayed wake up for specific kthreads
handling offloaded callbacks (RCU_NOCB).  These wakeups are performed
by timers and upon entry to idle (also to guest and to user on nohz_full).

However the delayed wake-up on kernel exit is actually performed after
the thread flags are fetched towards the fast path check for work to
do on exit to user. As a result, and if there is no other pending work
to do upon that kernel exit, the current task will resume to userspace
with TIF_RESCHED set and the pending wake up ignored.

Fix this with fetching the thread flags _after_ the delayed RCU-nocb
kthread wake-up.

Fixes: 47b8ff194c ("entry: Explicitly flush pending rcuog wakeup before last rescheduling point")
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230315194349.10798-3-joel@joelfernandes.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-30 12:49:13 +02:00
arch perf/x86/amd/core: Always clear status for idx 2023-03-30 12:49:13 +02:00
block
certs
crypto
Documentation
drivers platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl 2023-03-30 12:49:12 +02:00
fs ksmbd: fix possible refcount leak in smb2_open() 2023-03-30 12:49:10 +02:00
include entry: Fix noinstr warning in __enter_from_user_mode() 2023-03-30 12:49:13 +02:00
init
io_uring
ipc
kernel entry/rcu: Check TIF_RESCHED _after_ delayed RCU wake-up 2023-03-30 12:49:13 +02:00
lib
LICENSES
mm
net Bluetooth: HCI: Fix global-out-of-bounds 2023-03-30 12:49:12 +02:00
rust
samples
scripts
security keys: Do not cache key in task struct if key is requested from kernel thread 2023-03-30 12:49:07 +02:00
sound
tools bootconfig: Fix testcase to increase max node 2023-03-30 12:49:07 +02:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.