Skip to content

Commit 34bc7b4

Browse files
committed
Merge branch 'ctxt.2022.07.05a' into HEAD
ctxt.2022.07.05a: Linux-kernel memory model development branch.
2 parents d38c8fe + 1dcaa3b commit 34bc7b4

60 files changed

Lines changed: 954 additions & 791 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/RCU/Design/Requirements/Requirements.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,10 +1844,10 @@ that meets this requirement.
18441844

18451845
Furthermore, NMI handlers can be interrupted by what appear to RCU to be
18461846
normal interrupts. One way that this can happen is for code that
1847-
directly invokes rcu_irq_enter() and rcu_irq_exit() to be called
1847+
directly invokes ct_irq_enter() and ct_irq_exit() to be called
18481848
from an NMI handler. This astonishing fact of life prompted the current
1849-
code structure, which has rcu_irq_enter() invoking
1850-
rcu_nmi_enter() and rcu_irq_exit() invoking rcu_nmi_exit().
1849+
code structure, which has ct_irq_enter() invoking
1850+
ct_nmi_enter() and ct_irq_exit() invoking ct_nmi_exit().
18511851
And yes, I also learned of this requirement the hard way.
18521852

18531853
Loadable Modules
@@ -2195,7 +2195,7 @@ scheduling-clock interrupt be enabled when RCU needs it to be:
21952195
sections, and RCU believes this CPU to be idle, no problem. This
21962196
sort of thing is used by some architectures for light-weight
21972197
exception handlers, which can then avoid the overhead of
2198-
rcu_irq_enter() and rcu_irq_exit() at exception entry and
2198+
ct_irq_enter() and ct_irq_exit() at exception entry and
21992199
exit, respectively. Some go further and avoid the entireties of
22002200
irq_enter() and irq_exit().
22012201
Just make very sure you are running some of your tests with
@@ -2226,7 +2226,7 @@ scheduling-clock interrupt be enabled when RCU needs it to be:
22262226
+-----------------------------------------------------------------------+
22272227
| **Answer**: |
22282228
+-----------------------------------------------------------------------+
2229-
| One approach is to do ``rcu_irq_exit();rcu_irq_enter();`` every so |
2229+
| One approach is to do ``ct_irq_exit();ct_irq_enter();`` every so |
22302230
| often. But given that long-running interrupt handlers can cause other |
22312231
| problems, not least for response time, shouldn't you work to keep |
22322232
| your interrupt handler's runtime within reasonable bounds? |

Documentation/RCU/stallwarn.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ warnings:
9797
which will include additional debugging information.
9898

9999
- A low-level kernel issue that either fails to invoke one of the
100-
variants of rcu_user_enter(), rcu_user_exit(), rcu_idle_enter(),
101-
rcu_idle_exit(), rcu_irq_enter(), or rcu_irq_exit() on the one
100+
variants of rcu_eqs_enter(true), rcu_eqs_exit(true), ct_idle_enter(),
101+
ct_idle_exit(), ct_irq_enter(), or ct_irq_exit() on the one
102102
hand, or that invokes one of them too many times on the other.
103103
Historically, the most frequent issue has been an omission
104104
of either irq_enter() or irq_exit(), which in turn invoke
105-
rcu_irq_enter() or rcu_irq_exit(), respectively. Building your
105+
ct_irq_enter() or ct_irq_exit(), respectively. Building your
106106
kernel with CONFIG_RCU_EQS_DEBUG=y can help track down these types
107107
of issues, which sometimes arise in architecture-specific code.
108108

Documentation/features/time/context-tracking/arch-support.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# Feature name: context-tracking
3-
# Kconfig: HAVE_CONTEXT_TRACKING
4-
# description: arch supports context tracking for NO_HZ_FULL
2+
# Feature name: user-context-tracking
3+
# Kconfig: HAVE_CONTEXT_TRACKING_USER
4+
# description: arch supports user context tracking for NO_HZ_FULL
55
#
66
-----------------------
77
| arch |status|

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5039,6 +5039,7 @@ F: include/linux/console*
50395039

50405040
CONTEXT TRACKING
50415041
M: Frederic Weisbecker <frederic@kernel.org>
5042+
M: "Paul E. McKenney" <paulmck@kernel.org>
50425043
S: Maintained
50435044
F: kernel/context_tracking.c
50445045
F: include/linux/context_tracking*

arch/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,18 +774,18 @@ config HAVE_ARCH_WITHIN_STACK_FRAMES
774774
and similar) by implementing an inline arch_within_stack_frames(),
775775
which is used by CONFIG_HARDENED_USERCOPY.
776776

777-
config HAVE_CONTEXT_TRACKING
777+
config HAVE_CONTEXT_TRACKING_USER
778778
bool
779779
help
780780
Provide kernel/user boundaries probes necessary for subsystems
781781
that need it, such as userspace RCU extended quiescent state.
782782
Syscalls need to be wrapped inside user_exit()-user_enter(), either
783783
optimized behind static key or through the slow path using TIF_NOHZ
784784
flag. Exceptions handlers must be wrapped as well. Irqs are already
785-
protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
785+
protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
786786
handling on irq exit still need to be protected.
787787

788-
config HAVE_CONTEXT_TRACKING_OFFSTACK
788+
config HAVE_CONTEXT_TRACKING_USER_OFFSTACK
789789
bool
790790
help
791791
Architecture neither relies on exception_enter()/exception_exit()
@@ -797,7 +797,7 @@ config HAVE_CONTEXT_TRACKING_OFFSTACK
797797

798798
- Critical entry code isn't preemptible (or better yet:
799799
not interruptible).
800-
- No use of RCU read side critical sections, unless rcu_nmi_enter()
800+
- No use of RCU read side critical sections, unless ct_nmi_enter()
801801
got called.
802802
- No use of instrumentation, unless instrumentation_begin() got
803803
called.

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ config ARM
8484
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE
8585
select HAVE_ARM_SMCCC if CPU_V7
8686
select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
87-
select HAVE_CONTEXT_TRACKING
87+
select HAVE_CONTEXT_TRACKING_USER
8888
select HAVE_C_RECORDMCOUNT
8989
select HAVE_BUILDTIME_MCOUNT_SORT
9090
select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL

arch/arm/kernel/entry-common.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "entry-header.S"
2929

3030
saved_psr .req r8
31-
#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING)
31+
#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING_USER)
3232
saved_pc .req r9
3333
#define TRACE(x...) x
3434
#else
@@ -38,7 +38,7 @@ saved_pc .req lr
3838

3939
.section .entry.text,"ax",%progbits
4040
.align 5
41-
#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING) || \
41+
#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING_USER) || \
4242
IS_ENABLED(CONFIG_DEBUG_RSEQ))
4343
/*
4444
* This is the fast syscall return path. We do as little as possible here,

arch/arm/kernel/entry-header.S

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,25 +366,25 @@ ALT_UP_B(.L1_\@)
366366
* between user and kernel mode.
367367
*/
368368
.macro ct_user_exit, save = 1
369-
#ifdef CONFIG_CONTEXT_TRACKING
369+
#ifdef CONFIG_CONTEXT_TRACKING_USER
370370
.if \save
371371
stmdb sp!, {r0-r3, ip, lr}
372-
bl context_tracking_user_exit
372+
bl user_exit_callable
373373
ldmia sp!, {r0-r3, ip, lr}
374374
.else
375-
bl context_tracking_user_exit
375+
bl user_exit_callable
376376
.endif
377377
#endif
378378
.endm
379379

380380
.macro ct_user_enter, save = 1
381-
#ifdef CONFIG_CONTEXT_TRACKING
381+
#ifdef CONFIG_CONTEXT_TRACKING_USER
382382
.if \save
383383
stmdb sp!, {r0-r3, ip, lr}
384-
bl context_tracking_user_enter
384+
bl user_enter_callable
385385
ldmia sp!, {r0-r3, ip, lr}
386386
.else
387-
bl context_tracking_user_enter
387+
bl user_enter_callable
388388
.endif
389389
#endif
390390
.endm

arch/arm/mach-imx/cpuidle-imx6q.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (C) 2012 Freescale Semiconductor, Inc.
44
*/
55

6+
#include <linux/context_tracking.h>
67
#include <linux/cpuidle.h>
78
#include <linux/module.h>
89
#include <asm/cpuidle.h>
@@ -24,9 +25,9 @@ static int imx6q_enter_wait(struct cpuidle_device *dev,
2425
imx6_set_lpm(WAIT_UNCLOCKED);
2526
raw_spin_unlock(&cpuidle_lock);
2627

27-
rcu_idle_enter();
28+
ct_idle_enter();
2829
cpu_do_idle();
29-
rcu_idle_exit();
30+
ct_idle_exit();
3031

3132
raw_spin_lock(&cpuidle_lock);
3233
if (num_idle_cpus-- == num_online_cpus())

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ config ARM64
174174
select HAVE_C_RECORDMCOUNT
175175
select HAVE_CMPXCHG_DOUBLE
176176
select HAVE_CMPXCHG_LOCAL
177-
select HAVE_CONTEXT_TRACKING
177+
select HAVE_CONTEXT_TRACKING_USER
178178
select HAVE_DEBUG_KMEMLEAK
179179
select HAVE_DMA_CONTIGUOUS
180180
select HAVE_DYNAMIC_FTRACE

0 commit comments

Comments
 (0)