Skip to content

Commit afe586a

Browse files
Liang Chenrkhuangtao
authored andcommitted
Merge tag 'v5.10.65-rt53'
Linux 5.10.65-rt53 * tag 'v5.10.65-rt53': (303 commits) Linux 5.10.65-rt53 Linux 5.10.59-rt52 locking/rwsem-rt: Remove might_sleep() in __up_read() Linux 5.10.59-rt51 Linux 5.10.58-rt50 Linux 5.10.56-rt49 printk: Enhance the condition check of msleep in pr_flush() Linux 5.10.56-rt48 Linux 5.10.52-rt47 Linux 5.10.47-rt46 sched: Don't defer CPU pick to migration_cpu_stop() sched: Simplify set_affinity_pending refcounts sched: Fix affine_move_task() self-concurrency sched: Optimize migration_cpu_stop() sched: Collate affine_move_task() stoppers sched: Simplify migration_cpu_stop() sched: Fix migration_cpu_stop() requeueing Linux 5.10.47-rt45 Linux 5.10.44-rt44 Linux 5.10.42-rt43 ... Conflicts: arch/x86/Kconfig block/blk-mq.c drivers/tty/serial/8250/8250.h drivers/tty/serial/8250/8250_port.c fs/proc/base.c include/linux/sched.h include/net/netns/xfrm.h kernel/cgroup/cpuset.c kernel/locking/rtmutex.c kernel/printk/printk.c kernel/sched/core.c kernel/sched/cpupri.c kernel/sched/sched.h kernel/softirq.c mm/page_alloc.c mm/slub.c mm/zsmalloc.c Change-Id: I53f01b9f8f32aef1b2d639840bf50acc82b85320
2 parents c231756 + 3e2c5af commit afe586a

File tree

422 files changed

+9256
-5258
lines changed

Some content is hidden

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

422 files changed

+9256
-5258
lines changed

Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sections.
3838
RCU-preempt Expedited Grace Periods
3939
===================================
4040

41-
``CONFIG_PREEMPT=y`` kernels implement RCU-preempt.
41+
``CONFIG_PREEMPTION=y`` kernels implement RCU-preempt.
4242
The overall flow of the handling of a given CPU by an RCU-preempt
4343
expedited grace period is shown in the following diagram:
4444

@@ -112,7 +112,7 @@ things.
112112
RCU-sched Expedited Grace Periods
113113
---------------------------------
114114

115-
``CONFIG_PREEMPT=n`` kernels implement RCU-sched. The overall flow of
115+
``CONFIG_PREEMPTION=n`` kernels implement RCU-sched. The overall flow of
116116
the handling of a given CPU by an RCU-sched expedited grace period is
117117
shown in the following diagram:
118118

Documentation/RCU/Design/Requirements/Requirements.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RCU treats a nested set as one big RCU read-side critical section.
7878
Production-quality implementations of ``rcu_read_lock()`` and
7979
``rcu_read_unlock()`` are extremely lightweight, and in fact have
8080
exactly zero overhead in Linux kernels built for production use with
81-
``CONFIG_PREEMPT=n``.
81+
``CONFIG_PREEMPTION=n``.
8282

8383
This guarantee allows ordering to be enforced with extremely low
8484
overhead to readers, for example:
@@ -1182,7 +1182,7 @@ and has become decreasingly so as memory sizes have expanded and memory
11821182
costs have plummeted. However, as I learned from Matt Mackall's
11831183
`bloatwatch <http://elinux.org/Linux_Tiny-FAQ>`__ efforts, memory
11841184
footprint is critically important on single-CPU systems with
1185-
non-preemptible (``CONFIG_PREEMPT=n``) kernels, and thus `tiny
1185+
non-preemptible (``CONFIG_PREEMPTION=n``) kernels, and thus `tiny
11861186
RCU <https://lkml.kernel.org/g/[email protected]>`__
11871187
was born. Josh Triplett has since taken over the small-memory banner
11881188
with his `Linux kernel tinification <https://tiny.wiki.kernel.org/>`__
@@ -1498,7 +1498,7 @@ limitations.
14981498

14991499
Implementations of RCU for which ``rcu_read_lock()`` and
15001500
``rcu_read_unlock()`` generate no code, such as Linux-kernel RCU when
1501-
``CONFIG_PREEMPT=n``, can be nested arbitrarily deeply. After all, there
1501+
``CONFIG_PREEMPTION=n``, can be nested arbitrarily deeply. After all, there
15021502
is no overhead. Except that if all these instances of
15031503
``rcu_read_lock()`` and ``rcu_read_unlock()`` are visible to the
15041504
compiler, compilation will eventually fail due to exhausting memory,
@@ -1771,7 +1771,7 @@ implementation can be a no-op.
17711771

17721772
However, once the scheduler has spawned its first kthread, this early
17731773
boot trick fails for ``synchronize_rcu()`` (as well as for
1774-
``synchronize_rcu_expedited()``) in ``CONFIG_PREEMPT=y`` kernels. The
1774+
``synchronize_rcu_expedited()``) in ``CONFIG_PREEMPTION=y`` kernels. The
17751775
reason is that an RCU read-side critical section might be preempted,
17761776
which means that a subsequent ``synchronize_rcu()`` really does have to
17771777
wait for something, as opposed to simply returning immediately.
@@ -2010,7 +2010,7 @@ the following:
20102010
5 rcu_read_unlock();
20112011
6 do_something_with(v, user_v);
20122012

2013-
If the compiler did make this transformation in a ``CONFIG_PREEMPT=n`` kernel
2013+
If the compiler did make this transformation in a ``CONFIG_PREEMPTION=n`` kernel
20142014
build, and if ``get_user()`` did page fault, the result would be a quiescent
20152015
state in the middle of an RCU read-side critical section. This misplaced
20162016
quiescent state could result in line 4 being a use-after-free access,
@@ -2289,10 +2289,10 @@ decides to throw at it.
22892289

22902290
The Linux kernel is used for real-time workloads, especially in
22912291
conjunction with the `-rt
2292-
patchset <https://rt.wiki.kernel.org/index.php/Main_Page>`__. The
2292+
patchset <https://wiki.linuxfoundation.org/realtime/>`__. The
22932293
real-time-latency response requirements are such that the traditional
22942294
approach of disabling preemption across RCU read-side critical sections
2295-
is inappropriate. Kernels built with ``CONFIG_PREEMPT=y`` therefore use
2295+
is inappropriate. Kernels built with ``CONFIG_PREEMPTION=y`` therefore use
22962296
an RCU implementation that allows RCU read-side critical sections to be
22972297
preempted. This requirement made its presence known after users made it
22982298
clear that an earlier `real-time
@@ -2414,7 +2414,7 @@ includes ``rcu_read_lock_bh()``, ``rcu_read_unlock_bh()``,
24142414
``call_rcu_bh()``, ``rcu_barrier_bh()``, and
24152415
``rcu_read_lock_bh_held()``. However, the update-side APIs are now
24162416
simple wrappers for other RCU flavors, namely RCU-sched in
2417-
CONFIG_PREEMPT=n kernels and RCU-preempt otherwise.
2417+
CONFIG_PREEMPTION=n kernels and RCU-preempt otherwise.
24182418

24192419
Sched Flavor (Historical)
24202420
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2432,11 +2432,11 @@ not have this property, given that any point in the code outside of an
24322432
RCU read-side critical section can be a quiescent state. Therefore,
24332433
*RCU-sched* was created, which follows “classic” RCU in that an
24342434
RCU-sched grace period waits for pre-existing interrupt and NMI
2435-
handlers. In kernels built with ``CONFIG_PREEMPT=n``, the RCU and
2435+
handlers. In kernels built with ``CONFIG_PREEMPTION=n``, the RCU and
24362436
RCU-sched APIs have identical implementations, while kernels built with
2437-
``CONFIG_PREEMPT=y`` provide a separate implementation for each.
2437+
``CONFIG_PREEMPTION=y`` provide a separate implementation for each.
24382438

2439-
Note well that in ``CONFIG_PREEMPT=y`` kernels,
2439+
Note well that in ``CONFIG_PREEMPTION=y`` kernels,
24402440
``rcu_read_lock_sched()`` and ``rcu_read_unlock_sched()`` disable and
24412441
re-enable preemption, respectively. This means that if there was a
24422442
preemption attempt during the RCU-sched read-side critical section,
@@ -2599,10 +2599,10 @@ userspace execution also delimit tasks-RCU read-side critical sections.
25992599

26002600
The tasks-RCU API is quite compact, consisting only of
26012601
``call_rcu_tasks()``, ``synchronize_rcu_tasks()``, and
2602-
``rcu_barrier_tasks()``. In ``CONFIG_PREEMPT=n`` kernels, trampolines
2602+
``rcu_barrier_tasks()``. In ``CONFIG_PREEMPTION=n`` kernels, trampolines
26032603
cannot be preempted, so these APIs map to ``call_rcu()``,
26042604
``synchronize_rcu()``, and ``rcu_barrier()``, respectively. In
2605-
``CONFIG_PREEMPT=y`` kernels, trampolines can be preempted, and these
2605+
``CONFIG_PREEMPTION=y`` kernels, trampolines can be preempted, and these
26062606
three APIs are therefore implemented by separate functions that check
26072607
for voluntary context switches.
26082608

Documentation/RCU/checklist.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ over a rather long period of time, but improvements are always welcome!
214214
the rest of the system.
215215

216216
7. As of v4.20, a given kernel implements only one RCU flavor,
217-
which is RCU-sched for PREEMPT=n and RCU-preempt for PREEMPT=y.
217+
which is RCU-sched for PREEMPTION=n and RCU-preempt for PREEMPTION=y.
218218
If the updater uses call_rcu() or synchronize_rcu(),
219219
then the corresponding readers my use rcu_read_lock() and
220220
rcu_read_unlock(), rcu_read_lock_bh() and rcu_read_unlock_bh(),

Documentation/RCU/rcubarrier.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RCU (read-copy update) is a synchronization mechanism that can be thought
99
of as a replacement for read-writer locking (among other things), but with
1010
very low-overhead readers that are immune to deadlock, priority inversion,
1111
and unbounded latency. RCU read-side critical sections are delimited
12-
by rcu_read_lock() and rcu_read_unlock(), which, in non-CONFIG_PREEMPT
12+
by rcu_read_lock() and rcu_read_unlock(), which, in non-CONFIG_PREEMPTION
1313
kernels, generate no code whatsoever.
1414

1515
This means that RCU writers are unaware of the presence of concurrent
@@ -329,10 +329,10 @@ Answer: This cannot happen. The reason is that on_each_cpu() has its last
329329
to smp_call_function() and further to smp_call_function_on_cpu(),
330330
causing this latter to spin until the cross-CPU invocation of
331331
rcu_barrier_func() has completed. This by itself would prevent
332-
a grace period from completing on non-CONFIG_PREEMPT kernels,
332+
a grace period from completing on non-CONFIG_PREEMPTION kernels,
333333
since each CPU must undergo a context switch (or other quiescent
334334
state) before the grace period can complete. However, this is
335-
of no use in CONFIG_PREEMPT kernels.
335+
of no use in CONFIG_PREEMPTION kernels.
336336

337337
Therefore, on_each_cpu() disables preemption across its call
338338
to smp_call_function() and also across the local call to

Documentation/RCU/stallwarn.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ warnings:
2525

2626
- A CPU looping with bottom halves disabled.
2727

28-
- For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel
28+
- For !CONFIG_PREEMPTION kernels, a CPU looping anywhere in the kernel
2929
without invoking schedule(). If the looping in the kernel is
3030
really expected and desirable behavior, you might need to add
3131
some calls to cond_resched().
@@ -44,7 +44,7 @@ warnings:
4444
result in the ``rcu_.*kthread starved for`` console-log message,
4545
which will include additional debugging information.
4646

47-
- A CPU-bound real-time task in a CONFIG_PREEMPT kernel, which might
47+
- A CPU-bound real-time task in a CONFIG_PREEMPTION kernel, which might
4848
happen to preempt a low-priority task in the middle of an RCU
4949
read-side critical section. This is especially damaging if
5050
that low-priority task is not permitted to run on any other CPU,

Documentation/RCU/whatisRCU.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ Quick Quiz #1:
684684
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
685685
This section presents a "toy" RCU implementation that is based on
686686
"classic RCU". It is also short on performance (but only for updates) and
687-
on features such as hotplug CPU and the ability to run in CONFIG_PREEMPT
687+
on features such as hotplug CPU and the ability to run in CONFIG_PREEMPTION
688688
kernels. The definitions of rcu_dereference() and rcu_assign_pointer()
689689
are the same as those shown in the preceding section, so they are omitted.
690690
::
@@ -740,7 +740,7 @@ Quick Quiz #2:
740740
Quick Quiz #3:
741741
If it is illegal to block in an RCU read-side
742742
critical section, what the heck do you do in
743-
PREEMPT_RT, where normal spinlocks can block???
743+
CONFIG_PREEMPT_RT, where normal spinlocks can block???
744744

745745
:ref:`Answers to Quick Quiz <8_whatisRCU>`
746746

@@ -1094,7 +1094,7 @@ Quick Quiz #2:
10941094
overhead is **negative**.
10951095

10961096
Answer:
1097-
Imagine a single-CPU system with a non-CONFIG_PREEMPT
1097+
Imagine a single-CPU system with a non-CONFIG_PREEMPTION
10981098
kernel where a routing table is used by process-context
10991099
code, but can be updated by irq-context code (for example,
11001100
by an "ICMP REDIRECT" packet). The usual way of handling
@@ -1121,10 +1121,10 @@ Answer:
11211121
Quick Quiz #3:
11221122
If it is illegal to block in an RCU read-side
11231123
critical section, what the heck do you do in
1124-
PREEMPT_RT, where normal spinlocks can block???
1124+
CONFIG_PREEMPT_RT, where normal spinlocks can block???
11251125

11261126
Answer:
1127-
Just as PREEMPT_RT permits preemption of spinlock
1127+
Just as CONFIG_PREEMPT_RT permits preemption of spinlock
11281128
critical sections, it permits preemption of RCU
11291129
read-side critical sections. It also permits
11301130
spinlocks blocking while in RCU read-side critical

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4182,6 +4182,10 @@
41824182
value, meaning that RCU_SOFTIRQ is used by default.
41834183
Specify rcutree.use_softirq=0 to use rcuc kthreads.
41844184

4185+
But note that CONFIG_PREEMPT_RT=y kernels disable
4186+
this kernel boot parameter, forcibly setting it
4187+
to zero.
4188+
41854189
rcutree.rcu_fanout_exact= [KNL]
41864190
Disable autobalancing of the rcu_node combining
41874191
tree. This is used by rcutorture, and might
@@ -4560,6 +4564,13 @@
45604564
only normal grace-period primitives. No effect
45614565
on CONFIG_TINY_RCU kernels.
45624566

4567+
But note that CONFIG_PREEMPT_RT=y kernels enables
4568+
this kernel boot parameter, forcibly setting
4569+
it to the value one, that is, converting any
4570+
post-boot attempt at an expedited RCU grace
4571+
period to instead use normal non-expedited
4572+
grace-period processing.
4573+
45634574
rcupdate.rcu_task_ipi_delay= [KNL]
45644575
Set time in jiffies during which RCU tasks will
45654576
avoid sending IPIs, starting with the beginning

Documentation/driver-api/io-mapping.rst

Lines changed: 39 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,78 +20,64 @@ A mapping object is created during driver initialization using::
2020
mappable, while 'size' indicates how large a mapping region to
2121
enable. Both are in bytes.
2222

23-
This _wc variant provides a mapping which may only be used
24-
with the io_mapping_map_atomic_wc or io_mapping_map_wc.
23+
This _wc variant provides a mapping which may only be used with
24+
io_mapping_map_local_wc() or io_mapping_map_wc().
2525

26-
With this mapping object, individual pages can be mapped either atomically
27-
or not, depending on the necessary scheduling environment. Of course, atomic
28-
maps are more efficient::
26+
With this mapping object, individual pages can be mapped either temporarily
27+
or long term, depending on the requirements. Of course, temporary maps are
28+
more efficient.
2929

30-
void *io_mapping_map_atomic_wc(struct io_mapping *mapping,
31-
unsigned long offset)
30+
void *io_mapping_map_local_wc(struct io_mapping *mapping,
31+
unsigned long offset)
3232
33-
'offset' is the offset within the defined mapping region.
34-
Accessing addresses beyond the region specified in the
35-
creation function yields undefined results. Using an offset
36-
which is not page aligned yields an undefined result. The
37-
return value points to a single page in CPU address space.
33+
'offset' is the offset within the defined mapping region. Accessing
34+
addresses beyond the region specified in the creation function yields
35+
undefined results. Using an offset which is not page aligned yields an
36+
undefined result. The return value points to a single page in CPU address
37+
space.
3838

39-
This _wc variant returns a write-combining map to the
40-
page and may only be used with mappings created by
41-
io_mapping_create_wc
39+
This _wc variant returns a write-combining map to the page and may only be
40+
used with mappings created by io_mapping_create_wc()
4241

43-
Note that the task may not sleep while holding this page
44-
mapped.
42+
Temporary mappings are only valid in the context of the caller. The mapping
43+
is not guaranteed to be globaly visible.
4544

46-
::
45+
io_mapping_map_local_wc() has a side effect on X86 32bit as it disables
46+
migration to make the mapping code work. No caller can rely on this side
47+
effect.
4748

48-
void io_mapping_unmap_atomic(void *vaddr)
49+
Nested mappings need to be undone in reverse order because the mapping
50+
code uses a stack for keeping track of them::
4951

50-
'vaddr' must be the value returned by the last
51-
io_mapping_map_atomic_wc call. This unmaps the specified
52-
page and allows the task to sleep once again.
52+
addr1 = io_mapping_map_local_wc(map1, offset1);
53+
addr2 = io_mapping_map_local_wc(map2, offset2);
54+
...
55+
io_mapping_unmap_local(addr2);
56+
io_mapping_unmap_local(addr1);
5357

54-
If you need to sleep while holding the lock, you can use the non-atomic
55-
variant, although they may be significantly slower.
58+
The mappings are released with::
5659

57-
::
60+
void io_mapping_unmap_local(void *vaddr)
61+
62+
'vaddr' must be the value returned by the last io_mapping_map_local_wc()
63+
call. This unmaps the specified mapping and undoes eventual side effects of
64+
the mapping function.
65+
66+
If you need to sleep while holding a mapping, you can use the regular
67+
variant, although this may be significantly slower::
5868

5969
void *io_mapping_map_wc(struct io_mapping *mapping,
6070
unsigned long offset)
6171

62-
This works like io_mapping_map_atomic_wc except it allows
63-
the task to sleep while holding the page mapped.
72+
This works like io_mapping_map_local_wc() except it has no side effects and
73+
the pointer is globaly visible.
6474

65-
66-
::
75+
The mappings are released with::
6776

6877
void io_mapping_unmap(void *vaddr)
6978

70-
This works like io_mapping_unmap_atomic, except it is used
71-
for pages mapped with io_mapping_map_wc.
79+
Use for pages mapped with io_mapping_map_wc().
7280

7381
At driver close time, the io_mapping object must be freed::
7482

7583
void io_mapping_free(struct io_mapping *mapping)
76-
77-
Current Implementation
78-
======================
79-
80-
The initial implementation of these functions uses existing mapping
81-
mechanisms and so provides only an abstraction layer and no new
82-
functionality.
83-
84-
On 64-bit processors, io_mapping_create_wc calls ioremap_wc for the whole
85-
range, creating a permanent kernel-visible mapping to the resource. The
86-
map_atomic and map functions add the requested offset to the base of the
87-
virtual address returned by ioremap_wc.
88-
89-
On 32-bit processors with HIGHMEM defined, io_mapping_map_atomic_wc uses
90-
kmap_atomic_pfn to map the specified page in an atomic fashion;
91-
kmap_atomic_pfn isn't really supposed to be used with device pages, but it
92-
provides an efficient mapping for this usage.
93-
94-
On 32-bit processors without HIGHMEM defined, io_mapping_map_atomic_wc and
95-
io_mapping_map_wc both use ioremap_wc, a terribly inefficient function which
96-
performs an IPI to inform all processors about the new mapping. This results
97-
in a significant performance penalty.

arch/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ config OPROFILE
3737
tristate "OProfile system profiling"
3838
depends on PROFILING
3939
depends on HAVE_OPROFILE
40+
depends on !PREEMPT_RT
4041
select RING_BUFFER
4142
select RING_BUFFER_ALLOW_SWAP
4243
help
@@ -756,6 +757,12 @@ config HAVE_TIF_NOHZ
756757
config HAVE_VIRT_CPU_ACCOUNTING
757758
bool
758759

760+
config HAVE_VIRT_CPU_ACCOUNTING_IDLE
761+
bool
762+
help
763+
Architecture has its own way to account idle CPU time and therefore
764+
doesn't implement vtime_account_idle().
765+
759766
config ARCH_HAS_SCALED_CPUTIME
760767
bool
761768

@@ -770,7 +777,6 @@ config HAVE_VIRT_CPU_ACCOUNTING_GEN
770777
some 32-bit arches may require multiple accesses, so proper
771778
locking is needed to protect against concurrent accesses.
772779

773-
774780
config HAVE_IRQ_TIME_ACCOUNTING
775781
bool
776782
help

arch/alpha/include/asm/kmap_types.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)