Skip to content

Commit c3dcf11

Browse files
committed
Merge: Sched: Post 6.12 updates and fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/88 JIRA: https://issues.redhat.com/browse/RHEL-70901 Several fixes have landed post-v6.12. Pull them in for 10.0 GA to prevent hitting issues later. Signed-off-by: Phil Auld <pauld@redhat.com> Approved-by: Juri Lelli <juri.lelli@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Lenny Szubowicz <lszubowi@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents d284201 + 2e990ea commit c3dcf11

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

arch/x86/kernel/cpu/topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ void __init topology_apply_cmdline_limits_early(void)
428428
{
429429
unsigned int possible = nr_cpu_ids;
430430

431-
/* 'maxcpus=0' 'nosmp' 'nolapic' 'disableapic' 'noapic' */
432-
if (!setup_max_cpus || ioapic_is_disabled || apic_is_disabled)
431+
/* 'maxcpus=0' 'nosmp' 'nolapic' 'disableapic' */
432+
if (!setup_max_cpus || apic_is_disabled)
433433
possible = 1;
434434

435435
/* 'possible_cpus=N' */
@@ -443,7 +443,7 @@ void __init topology_apply_cmdline_limits_early(void)
443443

444444
static __init bool restrict_to_up(void)
445445
{
446-
if (!smp_found_config || ioapic_is_disabled)
446+
if (!smp_found_config)
447447
return true;
448448
/*
449449
* XEN PV is special as it does not advertise the local APIC

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,9 @@ static void nohz_csd_func(void *info)
12881288
WARN_ON(!(flags & NOHZ_KICK_MASK));
12891289

12901290
rq->idle_balance = idle_cpu(cpu);
1291-
if (rq->idle_balance && !need_resched()) {
1291+
if (rq->idle_balance) {
12921292
rq->nohz_idle_balance = flags;
1293-
raise_softirq_irqoff(SCHED_SOFTIRQ);
1293+
__raise_softirq_irqoff(SCHED_SOFTIRQ);
12941294
}
12951295
}
12961296

kernel/sched/deadline.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ static inline void replenish_dl_new_period(struct sched_dl_entity *dl_se,
781781
* If it is a deferred reservation, and the server
782782
* is not handling an starvation case, defer it.
783783
*/
784-
if (dl_se->dl_defer & !dl_se->dl_defer_running) {
784+
if (dl_se->dl_defer && !dl_se->dl_defer_running) {
785785
dl_se->dl_throttled = 1;
786786
dl_se->dl_defer_armed = 1;
787787
}
@@ -2042,6 +2042,7 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se, int flags)
20422042
} else if (flags & ENQUEUE_REPLENISH) {
20432043
replenish_dl_entity(dl_se);
20442044
} else if ((flags & ENQUEUE_RESTORE) &&
2045+
!is_dl_boosted(dl_se) &&
20452046
dl_time_before(dl_se->deadline, rq_clock(rq_of_dl_se(dl_se)))) {
20462047
setup_new_dl_entity(dl_se);
20472048
}

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12574,7 +12574,7 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags)
1257412574
* work being done for other CPUs. Next load
1257512575
* balancing owner will pick it up.
1257612576
*/
12577-
if (need_resched()) {
12577+
if (!idle_cpu(this_cpu) && need_resched()) {
1257812578
if (flags & NOHZ_STATS_KICK)
1257912579
has_blocked_load = true;
1258012580
if (flags & NOHZ_NEXT_KICK)

kernel/sched/syscalls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ int __sched_setaffinity(struct task_struct *p, struct affinity_context *ctx)
12381238
bool empty = !cpumask_and(new_mask, new_mask,
12391239
ctx->user_mask);
12401240

1241-
if (WARN_ON_ONCE(empty))
1241+
if (empty)
12421242
cpumask_copy(new_mask, cpus_allowed);
12431243
}
12441244
__set_cpus_allowed_ptr(p, ctx);

kernel/softirq.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,24 @@ static inline void invoke_softirq(void)
280280
wakeup_softirqd();
281281
}
282282

283+
#define SCHED_SOFTIRQ_MASK BIT(SCHED_SOFTIRQ)
284+
283285
/*
284286
* flush_smp_call_function_queue() can raise a soft interrupt in a function
285-
* call. On RT kernels this is undesired and the only known functionality
286-
* in the block layer which does this is disabled on RT. If soft interrupts
287-
* get raised which haven't been raised before the flush, warn so it can be
287+
* call. On RT kernels this is undesired and the only known functionalities
288+
* are in the block layer which is disabled on RT, and in the scheduler for
289+
* idle load balancing. If soft interrupts get raised which haven't been
290+
* raised before the flush, warn if it is not a SCHED_SOFTIRQ so it can be
288291
* investigated.
289292
*/
290293
void do_softirq_post_smp_call_flush(unsigned int was_pending)
291294
{
292-
if (WARN_ON_ONCE(was_pending != local_softirq_pending()))
295+
unsigned int is_pending = local_softirq_pending();
296+
297+
if (unlikely(was_pending != is_pending)) {
298+
WARN_ON_ONCE(was_pending != (is_pending & ~SCHED_SOFTIRQ_MASK));
293299
invoke_softirq();
300+
}
294301
}
295302

296303
#else /* CONFIG_PREEMPT_RT */

0 commit comments

Comments
 (0)