Skip to content

Commit da91195

Browse files
committed
Merge: Sched: Upstream fixes for 10.1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/507 JIRA: https://issues.redhat.com/browse/RHEL-78822 Omitted-fix: f6147af ("sched/deadline: Ignore special tasks when rebuilding domains") Omitted-fix: 5620933 ("sched/topology: Wrappers for sched_domains_mutex") Omitted-fix: 45007c6 ("sched/deadline: Generalize unique visiting of root domains") Omitted-fix: 2ff899e ("sched/deadline: Rebuild root domain accounting after every update") The above omitted fixes will be included an a later (as yet unspecified) rhel 10.1 MR. Omitted-fix: b9f2b29 ("sched/clock: Don't define sched_clock_irqtime as static key") This one is here but using the commit hash it got when it moved from tip to master. The tooling is finding both. But I can only include one. Preventative maintenance for core scheduler code. This is a series to pull in fixes and updates through v6.14-rc4. It includes reverts for a few pieces that came in from the rt tree before landing upstream, differently. This will keep the code in line with upstream going forward which will help us maintaining it. Signed-off-by: Phil Auld <pauld@redhat.com> Approved-by: Lenny Szubowicz <lszubowi@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 30fe774 + 207faa9 commit da91195

Some content is hidden

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

46 files changed

+1267
-939
lines changed

Documentation/accounting/delay-accounting.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,29 @@ Get delays, since system boot, for pid 10::
100100
# ./getdelays -d -p 10
101101
(output similar to next case)
102102

103-
Get sum of delays, since system boot, for all pids with tgid 5::
103+
Get sum and peak of delays, since system boot, for all pids with tgid 242::
104104

105-
# ./getdelays -d -t 5
105+
bash-4.4# ./getdelays -d -t 242
106106
print delayacct stats ON
107-
TGID 5
108-
109-
110-
CPU count real total virtual total delay total delay average
111-
8 7000000 6872122 3382277 0.423ms
112-
IO count delay total delay average
113-
0 0 0.000ms
114-
SWAP count delay total delay average
115-
0 0 0.000ms
116-
RECLAIM count delay total delay average
117-
0 0 0.000ms
118-
THRASHING count delay total delay average
119-
0 0 0.000ms
120-
COMPACT count delay total delay average
121-
0 0 0.000ms
122-
WPCOPY count delay total delay average
123-
0 0 0.000ms
124-
IRQ count delay total delay average
125-
0 0 0.000ms
107+
TGID 242
108+
109+
110+
CPU count real total virtual total delay total delay average delay max delay min
111+
39 156000000 156576579 2111069 0.054ms 0.212296ms 0.031307ms
112+
IO count delay total delay average delay max delay min
113+
0 0 0.000ms 0.000000ms 0.000000ms
114+
SWAP count delay total delay average delay max delay min
115+
0 0 0.000ms 0.000000ms 0.000000ms
116+
RECLAIM count delay total delay average delay max delay min
117+
0 0 0.000ms 0.000000ms 0.000000ms
118+
THRASHING count delay total delay average delay max delay min
119+
0 0 0.000ms 0.000000ms 0.000000ms
120+
COMPACT count delay total delay average delay max delay min
121+
0 0 0.000ms 0.000000ms 0.000000ms
122+
WPCOPY count delay total delay average delay max delay min
123+
156 11215873 0.072ms 0.207403ms 0.033913ms
124+
IRQ count delay total delay average delay max delay min
125+
0 0 0.000ms 0.000000ms 0.000000ms
126126

127127
Get IO accounting for pid 1, it works only with -p::
128128

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,9 @@
24242424
specified in the flag list (default: domain):
24252425

24262426
nohz
2427-
Disable the tick when a single task runs.
2427+
Disable the tick when a single task runs as well as
2428+
disabling other kernel noises like having RCU callbacks
2429+
offloaded. This is equivalent to the nohz_full parameter.
24282430

24292431
A residual 1Hz tick is offloaded to workqueues, which you
24302432
need to affine to housekeeping through the global
@@ -4810,6 +4812,11 @@
48104812
can be preempted anytime. Tasks will also yield
48114813
contended spinlocks (if the critical section isn't
48124814
explicitly preempt disabled beyond the lock itself).
4815+
lazy - Scheduler controlled. Similar to full but instead
4816+
of preempting the task immediately, the task gets
4817+
one HZ tick time to yield itself before the
4818+
preemption will be forced. One preemption is when the
4819+
task returns to user space.
48134820

48144821
print-fatal-signals=
48154822
[KNL] debug: print fatal signals

Documentation/trace/ftrace.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,8 @@ explains which is which.
10371037
- 'N' both TIF_NEED_RESCHED and PREEMPT_NEED_RESCHED is set,
10381038
- 'n' only TIF_NEED_RESCHED is set,
10391039
- 'p' only PREEMPT_NEED_RESCHED is set,
1040-
- 'L' borg PREEMPT_NEED_RESCHED and TIF_RESCHED_LAZY is set,
1041-
- 'b' borg TIF_NEED_RESCHED and TIF_RESCHED_LAZY is set,
1040+
- 'L' both PREEMPT_NEED_RESCHED and TIF_RESCHED_LAZY is set,
1041+
- 'b' both TIF_NEED_RESCHED and TIF_RESCHED_LAZY is set,
10421042
- 'l' only TIF_RESCHED_LAZY is set
10431043
- '.' otherwise.
10441044

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ config PPC
145145
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
146146
select ARCH_HAS_PHYS_TO_DMA
147147
select ARCH_HAS_PMEM_API
148+
select ARCH_HAS_PREEMPT_LAZY
148149
select ARCH_HAS_PTE_DEVMAP if PPC_BOOK3S_64
149150
select ARCH_HAS_PTE_SPECIAL
150151
select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64

arch/powerpc/include/asm/thread_info.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void arch_setup_new_exec(void);
103103
#define TIF_PATCH_PENDING 6 /* pending live patching update */
104104
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
105105
#define TIF_SINGLESTEP 8 /* singlestepping active */
106+
#define TIF_NEED_RESCHED_LAZY 9 /* Scheduler driven lazy preemption */
106107
#define TIF_SECCOMP 10 /* secure computing */
107108
#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
108109
#define TIF_NOERROR 12 /* Force successful syscall return */
@@ -122,6 +123,7 @@ void arch_setup_new_exec(void);
122123
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
123124
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
124125
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
126+
#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY)
125127
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
126128
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
127129
#define _TIF_32BIT (1<<TIF_32BIT)
@@ -142,9 +144,10 @@ void arch_setup_new_exec(void);
142144
_TIF_SYSCALL_EMU)
143145

144146
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
145-
_TIF_NOTIFY_RESUME | _TIF_UPROBE | \
146-
_TIF_RESTORE_TM | _TIF_PATCH_PENDING | \
147-
_TIF_NOTIFY_SIGNAL)
147+
_TIF_NEED_RESCHED_LAZY | _TIF_NOTIFY_RESUME | \
148+
_TIF_UPROBE | _TIF_RESTORE_TM | \
149+
_TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL)
150+
148151
#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
149152

150153
/* Bits in local_flags */

arch/powerpc/kernel/interrupt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ interrupt_exit_user_prepare_main(unsigned long ret, struct pt_regs *regs)
185185
ti_flags = read_thread_flags();
186186
while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
187187
local_irq_enable();
188-
if (ti_flags & _TIF_NEED_RESCHED) {
188+
if (ti_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) {
189189
schedule();
190190
} else {
191191
/*
@@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
396396
/* Returning to a kernel context with local irqs enabled. */
397397
WARN_ON_ONCE(!(regs->msr & MSR_EE));
398398
again:
399-
if (IS_ENABLED(CONFIG_PREEMPT)) {
399+
if (IS_ENABLED(CONFIG_PREEMPTION)) {
400400
/* Return to preemptible kernel context */
401401
if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
402402
if (preempt_count() == 0)

arch/powerpc/lib/vmx-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int exit_vmx_usercopy(void)
4545
* set and we are preemptible. The hack here is to schedule a
4646
* decrementer to fire here and reschedule for us if necessary.
4747
*/
48-
if (IS_ENABLED(CONFIG_PREEMPT) && need_resched())
48+
if (IS_ENABLED(CONFIG_PREEMPTION) && need_resched())
4949
set_dec(1);
5050
return 0;
5151
}

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ config S390
8080
select ARCH_HAS_MEMBARRIER_SYNC_CORE
8181
select ARCH_HAS_MEM_ENCRYPT
8282
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
83+
select ARCH_HAS_PREEMPT_LAZY
8384
select ARCH_HAS_PTE_SPECIAL
8485
select ARCH_HAS_SCALED_CPUTIME
8586
select ARCH_HAS_SET_DIRECT_MAP

arch/s390/include/asm/thread_info.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,44 +61,45 @@ void arch_setup_new_exec(void);
6161
/*
6262
* thread information flags bit numbers
6363
*/
64-
/* _TIF_WORK bits */
6564
#define TIF_NOTIFY_RESUME 0 /* callback before returning to user */
6665
#define TIF_SIGPENDING 1 /* signal pending */
6766
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
68-
#define TIF_UPROBE 3 /* breakpointed or single-stepping */
69-
#define TIF_GUARDED_STORAGE 4 /* load guarded storage control block */
67+
#define TIF_NEED_RESCHED_LAZY 3 /* lazy rescheduling needed */
68+
#define TIF_UPROBE 4 /* breakpointed or single-stepping */
7069
#define TIF_PATCH_PENDING 5 /* pending live patching update */
7170
#define TIF_PGSTE 6 /* New mm's will use 4K page tables */
7271
#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
72+
#define TIF_GUARDED_STORAGE 8 /* load guarded storage control block */
7373
#define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */
7474
#define TIF_PER_TRAP 10 /* Need to handle PER trap on exit to usermode */
75-
7675
#define TIF_31BIT 16 /* 32bit process */
7776
#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
7877
#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */
7978
#define TIF_SINGLE_STEP 19 /* This task is single stepped */
8079
#define TIF_BLOCK_STEP 20 /* This task is block stepped */
8180
#define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */
82-
83-
/* _TIF_TRACE bits */
8481
#define TIF_SYSCALL_TRACE 24 /* syscall trace active */
8582
#define TIF_SYSCALL_AUDIT 25 /* syscall auditing active */
8683
#define TIF_SECCOMP 26 /* secure computing */
8784
#define TIF_SYSCALL_TRACEPOINT 27 /* syscall tracepoint instrumentation */
8885

8986
#define _TIF_NOTIFY_RESUME BIT(TIF_NOTIFY_RESUME)
90-
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
9187
#define _TIF_SIGPENDING BIT(TIF_SIGPENDING)
9288
#define _TIF_NEED_RESCHED BIT(TIF_NEED_RESCHED)
89+
#define _TIF_NEED_RESCHED_LAZY BIT(TIF_NEED_RESCHED_LAZY)
9390
#define _TIF_UPROBE BIT(TIF_UPROBE)
94-
#define _TIF_GUARDED_STORAGE BIT(TIF_GUARDED_STORAGE)
9591
#define _TIF_PATCH_PENDING BIT(TIF_PATCH_PENDING)
92+
#define _TIF_PGSTE BIT(TIF_PGSTE)
93+
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
94+
#define _TIF_GUARDED_STORAGE BIT(TIF_GUARDED_STORAGE)
9695
#define _TIF_ISOLATE_BP_GUEST BIT(TIF_ISOLATE_BP_GUEST)
9796
#define _TIF_PER_TRAP BIT(TIF_PER_TRAP)
98-
9997
#define _TIF_31BIT BIT(TIF_31BIT)
98+
#define _TIF_MEMDIE BIT(TIF_MEMDIE)
99+
#define _TIF_RESTORE_SIGMASK BIT(TIF_RESTORE_SIGMASK)
100100
#define _TIF_SINGLE_STEP BIT(TIF_SINGLE_STEP)
101-
101+
#define _TIF_BLOCK_STEP BIT(TIF_BLOCK_STEP)
102+
#define _TIF_UPROBE_SINGLESTEP BIT(TIF_UPROBE_SINGLESTEP)
102103
#define _TIF_SYSCALL_TRACE BIT(TIF_SYSCALL_TRACE)
103104
#define _TIF_SYSCALL_AUDIT BIT(TIF_SYSCALL_AUDIT)
104105
#define _TIF_SECCOMP BIT(TIF_SECCOMP)

arch/x86/include/asm/thread_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct thread_info {
8787
#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
8888
#define TIF_SIGPENDING 2 /* signal pending */
8989
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
90-
#define TIF_NEED_RESCHED_LAZY 4 /* rescheduling necessary */
90+
#define TIF_NEED_RESCHED_LAZY 4 /* Lazy rescheduling needed */
9191
#define TIF_SINGLESTEP 5 /* reenable singlestep on user return*/
9292
#define TIF_SSBD 6 /* Speculative store bypass disable */
9393
#define TIF_SPEC_IB 9 /* Indirect branch speculation mitigation */

0 commit comments

Comments
 (0)