Skip to content

Commit f3be65c

Browse files
author
CKI KWF Bot
committed
Merge: sched: Late fixes for 10.1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1024 JIRA: https://issues.redhat.com/browse/RHEL-92921 Several fixes from upstream need to be included in 10.1 to prevent hitting issues in the field. Signed-off-by: Phil Auld <pauld@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Juri Lelli <juri.lelli@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 1f119c7 + 3cbe8b8 commit f3be65c

File tree

23 files changed

+397
-176
lines changed

23 files changed

+397
-176
lines changed

arch/arm64/kernel/traps.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,14 @@ static void dump_kernel_instr(const char *lvl, struct pt_regs *regs)
172172
printk("%sCode: %s\n", lvl, str);
173173
}
174174

175-
#ifdef CONFIG_PREEMPT
176-
#define S_PREEMPT " PREEMPT"
177-
#elif defined(CONFIG_PREEMPT_RT)
178-
#define S_PREEMPT " PREEMPT_RT"
179-
#else
180-
#define S_PREEMPT ""
181-
#endif
182-
183175
#define S_SMP " SMP"
184176

185177
static int __die(const char *str, long err, struct pt_regs *regs)
186178
{
187179
static int die_counter;
188180
int ret;
189181

190-
pr_emerg("Internal error: %s: %016lx [#%d]" S_PREEMPT S_SMP "\n",
182+
pr_emerg("Internal error: %s: %016lx [#%d] " S_SMP "\n",
191183
str, err, ++die_counter);
192184

193185
/* trap and error numbers are mostly meaningless on ARM */

arch/powerpc/kernel/traps.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,11 @@ static char *get_mmu_str(void)
261261

262262
static int __die(const char *str, struct pt_regs *regs, long err)
263263
{
264-
const char *pr = "";
265-
266264
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
267265

268-
if (IS_ENABLED(CONFIG_PREEMPTION))
269-
pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT";
270-
271-
printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n",
266+
printk("%s PAGE_SIZE=%luK%s %s%s%s%s %s\n",
272267
IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
273268
PAGE_SIZE / 1024, get_mmu_str(),
274-
pr,
275269
IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
276270
IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
277271
debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",

arch/s390/kernel/dumpstack.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,8 @@ void __noreturn die(struct pt_regs *regs, const char *str)
198198
console_verbose();
199199
spin_lock_irq(&die_lock);
200200
bust_spinlocks(1);
201-
printk("%s: %04x ilc:%d [#%d] ", str, regs->int_code & 0xffff,
201+
printk("%s: %04x ilc:%d [#%d]", str, regs->int_code & 0xffff,
202202
regs->int_code >> 17, ++die_counter);
203-
#ifdef CONFIG_PREEMPT
204-
pr_cont("PREEMPT ");
205-
#elif defined(CONFIG_PREEMPT_RT)
206-
pr_cont("PREEMPT_RT ");
207-
#endif
208203
pr_cont("SMP ");
209204
if (debug_pagealloc_enabled())
210205
pr_cont("DEBUG_PAGEALLOC");

arch/x86/kernel/dumpstack.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,18 +395,13 @@ NOKPROBE_SYMBOL(oops_end);
395395

396396
static void __die_header(const char *str, struct pt_regs *regs, long err)
397397
{
398-
const char *pr = "";
399-
400398
/* Save the regs of the first oops for the executive summary later. */
401399
if (!die_counter)
402400
exec_summary_regs = *regs;
403401

404-
if (IS_ENABLED(CONFIG_PREEMPTION))
405-
pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT";
406-
407402
printk(KERN_DEFAULT
408-
"Oops: %s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff,
409-
++die_counter, pr,
403+
"Oops: %s: %04lx [#%d]%s%s%s%s\n", str, err & 0xffff,
404+
++die_counter,
410405
IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
411406
debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
412407
IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",

include/linux/cpuset.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ static inline int cpuset_do_page_mem_spread(void)
125125

126126
extern bool current_cpuset_is_being_rebound(void);
127127

128+
extern void dl_rebuild_rd_accounting(void);
128129
extern void rebuild_sched_domains(void);
129130

130131
extern void cpuset_print_current_mems_allowed(void);
132+
extern void cpuset_reset_sched_domains(void);
131133

132134
/*
133135
* read_mems_allowed_begin is required when making decisions involving
@@ -259,11 +261,20 @@ static inline bool current_cpuset_is_being_rebound(void)
259261
return false;
260262
}
261263

264+
static inline void dl_rebuild_rd_accounting(void)
265+
{
266+
}
267+
262268
static inline void rebuild_sched_domains(void)
263269
{
264270
partition_sched_domains(1, NULL, NULL);
265271
}
266272

273+
static inline void cpuset_reset_sched_domains(void)
274+
{
275+
partition_sched_domains(1, NULL, NULL);
276+
}
277+
267278
static inline void cpuset_print_current_mems_allowed(void)
268279
{
269280
}

include/linux/preempt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ static inline bool preempt_model_rt(void)
515515
return IS_ENABLED(CONFIG_PREEMPT_RT);
516516
}
517517

518+
extern const char *preempt_model_str(void);
519+
518520
/*
519521
* Does the preemption model allow non-cooperative preemption?
520522
*

include/linux/sched.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ enum uclamp_id {
399399
#ifdef CONFIG_SMP
400400
extern struct root_domain def_root_domain;
401401
extern struct mutex sched_domains_mutex;
402+
extern void sched_domains_mutex_lock(void);
403+
extern void sched_domains_mutex_unlock(void);
404+
#else
405+
static inline void sched_domains_mutex_lock(void) { }
406+
static inline void sched_domains_mutex_unlock(void) { }
402407
#endif
403408

404409
struct sched_param {
@@ -1398,6 +1403,15 @@ struct task_struct {
13981403
* with respect to preemption.
13991404
*/
14001405
unsigned long rseq_event_mask;
1406+
# ifdef CONFIG_DEBUG_RSEQ
1407+
/*
1408+
* This is a place holder to save a copy of the rseq fields for
1409+
* validation of read-only fields. The struct rseq has a
1410+
* variable-length array at the end, so it cannot be used
1411+
* directly. Reserve a size large enough for the known fields.
1412+
*/
1413+
char rseq_fields[sizeof(struct rseq)];
1414+
# endif
14011415
#endif
14021416

14031417
#ifdef CONFIG_SCHED_MM_CID
@@ -1660,8 +1674,9 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
16601674
* We're lying here, but rather than expose a completely new task state
16611675
* to userspace, we can make this appear as if the task has gone through
16621676
* a regular rt_mutex_lock() call.
1677+
* Report frozen tasks as uninterruptible.
16631678
*/
1664-
if (tsk_state & TASK_RTLOCK_WAIT)
1679+
if ((tsk_state & TASK_RTLOCK_WAIT) || (tsk_state & TASK_FROZEN))
16651680
state = TASK_UNINTERRUPTIBLE;
16661681

16671682
return fls(state);

include/linux/sched/deadline.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ static inline bool dl_time_before(u64 a, u64 b)
3434
struct root_domain;
3535
extern void dl_add_task_root_domain(struct task_struct *p);
3636
extern void dl_clear_root_domain(struct root_domain *rd);
37+
extern void dl_clear_root_domain_cpu(int cpu);
3738

3839
#endif /* CONFIG_SMP */
3940

41+
extern u64 dl_cookie;
42+
extern bool dl_bw_visited(int cpu, u64 cookie);
43+
4044
#endif /* _LINUX_SCHED_DEADLINE_H */

include/linux/sched/mm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,13 @@ enum {
531531

532532
static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)
533533
{
534+
/*
535+
* The atomic_read() below prevents CSE. The following should
536+
* help the compiler generate more efficient code on architectures
537+
* where sync_core_before_usermode() is a no-op.
538+
*/
539+
if (!IS_ENABLED(CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE))
540+
return;
534541
if (current->mm != mm)
535542
return;
536543
if (likely(!(atomic_read(&mm->membarrier_state) &

include/linux/sched/topology.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
166166
return to_cpumask(sd->span);
167167
}
168168

169-
extern void partition_sched_domains_locked(int ndoms_new,
170-
cpumask_var_t doms_new[],
171-
struct sched_domain_attr *dattr_new);
172-
173169
extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
174170
struct sched_domain_attr *dattr_new);
175171

@@ -210,12 +206,6 @@ extern void __init set_sched_topology(struct sched_domain_topology_level *tl);
210206

211207
struct sched_domain_attr;
212208

213-
static inline void
214-
partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[],
215-
struct sched_domain_attr *dattr_new)
216-
{
217-
}
218-
219209
static inline void
220210
partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
221211
struct sched_domain_attr *dattr_new)

0 commit comments

Comments
 (0)