Skip to content

Commit 6a631c0

Browse files
Sebastian Andrzej Siewiorborkmann
authored andcommitted
Documentation/locking/locktypes: Update migrate_disable() bits.
The initial implementation of migrate_disable() for mainline was a wrapper around preempt_disable(). RT kernels substituted this with a real migrate disable implementation. Later on mainline gained true migrate disable support, but the documentation was not updated. Update the documentation, remove the claims about migrate_disable() mapping to preempt_disable() on non-PREEMPT_RT kernels. Fixes: 74d862b ("sched: Make migrate_disable/enable() independent of RT") Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent c0d95d3 commit 6a631c0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Documentation/locking/locktypes.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,9 @@ preemption. The following substitution works on both kernels::
439439
spin_lock(&p->lock);
440440
p->count += this_cpu_read(var2);
441441

442-
On a non-PREEMPT_RT kernel migrate_disable() maps to preempt_disable()
443-
which makes the above code fully equivalent. On a PREEMPT_RT kernel
444442
migrate_disable() ensures that the task is pinned on the current CPU which
445443
in turn guarantees that the per-CPU access to var1 and var2 are staying on
446-
the same CPU.
444+
the same CPU while the task remains preemptible.
447445

448446
The migrate_disable() substitution is not valid for the following
449447
scenario::
@@ -456,9 +454,8 @@ scenario::
456454
p = this_cpu_ptr(&var1);
457455
p->val = func2();
458456

459-
While correct on a non-PREEMPT_RT kernel, this breaks on PREEMPT_RT because
460-
here migrate_disable() does not protect against reentrancy from a
461-
preempting task. A correct substitution for this case is::
457+
This breaks because migrate_disable() does not protect against reentrancy from
458+
a preempting task. A correct substitution for this case is::
462459

463460
func()
464461
{

0 commit comments

Comments
 (0)