Valentin Schneider
cd1cb33505
sched/topology: Don't try to build empty sched domains
Turns out hotplugging CPUs that are in exclusive cpusets can lead to the
cpuset code feeding empty cpumasks to the sched domain rebuild machinery.
This leads to the following splat:
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 235 Comm: kworker/5:2 Not tainted 5.4.0-rc1-00005-g8d495477d62e #23
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: events cpuset_hotplug_workfn
pstate: 60000005 (nZCv daif -PAN -UAO)
pc : build_sched_domains (./include/linux/arch_topology.h:23 kernel/sched/topology.c:1898 kernel/sched/topology.c:1969)
lr : build_sched_domains (kernel/sched/topology.c:1966)
Call trace:
build_sched_domains (./include/linux/arch_topology.h:23 kernel/sched/topology.c:1898 kernel/sched/topology.c:1969)
partition_sched_domains_locked (kernel/sched/topology.c:2250)
rebuild_sched_domains_locked (./include/linux/bitmap.h:370 ./include/linux/cpumask.h:538 kernel/cgroup/cpuset.c:955 kernel/cgroup/cpuset.c:978 kernel/cgroup/cpuset.c:1019)
rebuild_sched_domains (kernel/cgroup/cpuset.c:1032)
cpuset_hotplug_workfn (kernel/cgroup/cpuset.c:3205 (discriminator 2))
process_one_work (./arch/arm64/include/asm/jump_label.h:21 ./include/linux/jump_label.h:200 ./include/trace/events/workqueue.h:114 kernel/workqueue.c:2274)
worker_thread (./include/linux/compiler.h:199 ./include/linux/list.h:268 kernel/workqueue.c:2416)
kthread (kernel/kthread.c:255)
ret_from_fork (arch/arm64/kernel/entry.S:1167)
Code: f860dae2 912802d6 aa1603e1 12800000 (f8616853)
The faulty line in question is:
cap = arch_scale_cpu_capacity(cpumask_first(cpu_map));
and we're not checking the return value against nr_cpu_ids (we shouldn't
have to!), which leads to the above.
Prevent generate_sched_domains() from returning empty cpumasks, and add
some assertion in build_sched_domains() to scream bloody murder if it
happens again.
The above splat was obtained on my Juno r0 with the following reproducer:
$ cgcreate -g cpuset:asym
$ cgset -r cpuset.cpus=0-3 asym
$ cgset -r cpuset.mems=0 asym
$ cgset -r cpuset.cpu_exclusive=1 asym
$ cgcreate -g cpuset:smp
$ cgset -r cpuset.cpus=4-5 smp
$ cgset -r cpuset.mems=0 smp
$ cgset -r cpuset.cpu_exclusive=1 smp
$ cgset -r cpuset.sched_load_balance=0 .
$ echo 0 > /sys/devices/system/cpu/cpu4/online
$ echo 0 > /sys/devices/system/cpu/cpu5/online
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dietmar.Eggemann@arm.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: hannes@cmpxchg.org
Cc: lizefan@huawei.com
Cc: morten.rasmussen@arm.com
Cc: qperret@google.com
Cc: tj@kernel.org
Cc: vincent.guittot@linaro.org
Fixes: 05484e0984 ("sched/topology: Add SD_ASYM_CPUCAPACITY flag detection")
Link: https://lkml.kernel.org/r/20191023153745.19515-2-valentin.schneider@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
2019-10-29 09:58:45 +01:00 |
| .. |
|
bpf
|
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
|
2019-09-28 17:47:33 -07:00 |
|
cgroup
|
sched/topology: Don't try to build empty sched domains
|
2019-10-29 09:58:45 +01:00 |
|
configs
|
|
|
|
debug
|
kgdb: don't use a notifier to enter kgdb at panic; call directly
|
2019-09-25 17:51:40 -07:00 |
|
dma
|
dma-mapping: fix false positivse warnings in dma_common_free_remap()
|
2019-10-05 10:24:17 +02:00 |
|
events
|
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-10-27 06:59:34 -04:00 |
|
gcov
|
um: Enable CONFIG_CONSTRUCTORS
|
2019-09-15 21:37:13 +02:00 |
|
irq
|
Power management updates for 5.4-rc1
|
2019-09-17 19:15:14 -07:00 |
|
livepatch
|
livepatch: Nullify obj->mod in klp_module_coming()'s error path
|
2019-08-19 13:03:37 +02:00 |
|
locking
|
Revert "locking/pvqspinlock: Don't wait if vCPU is preempted"
|
2019-09-25 10:22:37 +02:00 |
|
power
|
PM: QoS: Introduce frequency QoS
|
2019-10-21 02:05:21 +02:00 |
|
printk
|
Merge branch 'for-5.4' into for-linus
|
2019-09-16 12:54:25 +02:00 |
|
rcu
|
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-09-16 17:25:49 -07:00 |
|
sched
|
sched/topology: Don't try to build empty sched domains
|
2019-10-29 09:58:45 +01:00 |
|
time
|
posix-cpu-timers: Fix two trivial comments
|
2019-10-23 14:48:24 +02:00 |
|
trace
|
tracing: Fix race in perf_trace_buf initialization
|
2019-10-21 19:38:28 -04:00 |
|
.gitignore
|
|
|
|
acct.c
|
|
|
|
async.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
audit.c
|
audit/stable-5.3 PR 20190702
|
2019-07-08 18:55:42 -07:00 |
|
audit.h
|
audit/stable-5.3 PR 20190702
|
2019-07-08 18:55:42 -07:00 |
|
audit_fsnotify.c
|
|
|
|
audit_tree.c
|
|
|
|
audit_watch.c
|
|
|
|
auditfilter.c
|
audit/stable-5.3 PR 20190702
|
2019-07-08 18:55:42 -07:00 |
|
auditsc.c
|
|
|
|
backtracetest.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
bounds.c
|
|
|
|
capability.c
|
|
|
|
compat.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
|
2019-06-19 17:09:55 +02:00 |
|
configs.c
|
kernel/configs: Replace GPL boilerplate code with SPDX identifier
|
2019-07-30 18:34:15 +02:00 |
|
context_tracking.c
|
|
|
|
cpu.c
|
cpu/SMT: create and export cpu_smt_possible()
|
2019-09-24 13:37:28 +02:00 |
|
cpu_pm.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282
|
2019-06-05 17:36:37 +02:00 |
|
crash_core.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230
|
2019-06-19 17:09:06 +02:00 |
|
crash_dump.c
|
|
|
|
cred.c
|
Merge branch 'access-creds'
|
2019-07-25 08:36:29 -07:00 |
|
delayacct.c
|
|
|
|
dma.c
|
|
|
|
elfcore.c
|
kernel/elfcore.c: include proper prototypes
|
2019-09-25 17:51:39 -07:00 |
|
exec_domain.c
|
|
|
|
exit.c
|
tasks, sched/core: With a grace period after finish_task_switch(), remove unnecessary code
|
2019-09-25 17:42:29 +02:00 |
|
extable.c
|
extable: Add function to search only kernel exception table
|
2019-08-21 22:23:48 +10:00 |
|
fail_function.c
|
fail_function: no need to check return value of debugfs_create functions
|
2019-06-03 15:49:06 +02:00 |
|
fork.c
|
kernel/sysctl.c: do not override max_threads provided by userspace
|
2019-10-07 15:47:19 -07:00 |
|
freezer.c
|
Revert "libata, freezer: avoid block device removal while system is frozen"
|
2019-10-06 09:11:37 -06:00 |
|
futex.c
|
hrtimer/treewide: Use hrtimer_sleeper_start_expires()
|
2019-08-01 17:43:16 +02:00 |
|
gen_kheaders.sh
|
kheaders: substituting --sort in archive creation
|
2019-10-17 09:08:19 +09:00 |
|
groups.c
|
|
|
|
hung_task.c
|
|
|
|
iomem.c
|
mm/nvdimm: add is_ioremap_addr and use that to check ioremap address
|
2019-07-12 11:05:40 -07:00 |
|
irq_work.c
|
|
|
|
jump_label.c
|
jump_label: Don't warn on __exit jump entries
|
2019-08-29 15:10:10 +01:00 |
|
kallsyms.c
|
kallsyms: Don't let kallsyms_lookup_size_offset() fail on retrieving the first symbol
|
2019-08-27 16:19:56 +01:00 |
|
kcmp.c
|
|
|
|
Kconfig.freezer
|
|
|
|
Kconfig.hz
|
|
|
|
Kconfig.locks
|
|
|
|
Kconfig.preempt
|
sched/rt, Kconfig: Unbreak def/oldconfig with CONFIG_PREEMPT=y
|
2019-07-22 18:05:11 +02:00 |
|
kcov.c
|
|
|
|
kexec.c
|
kexec_load: Disable at runtime if the kernel is locked down
|
2019-08-19 21:54:15 -07:00 |
|
kexec_core.c
|
kexec: bail out upon SIGKILL when allocating memory.
|
2019-09-25 17:51:40 -07:00 |
|
kexec_elf.c
|
kexec_elf: support 32 bit ELF files
|
2019-09-06 23:58:44 +02:00 |
|
kexec_file.c
|
Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
|
2019-09-28 08:14:15 -07:00 |
|
kexec_internal.h
|
|
|
|
kheaders.c
|
|
|
|
kmod.c
|
|
|
|
kprobes.c
|
Tracing updates:
|
2019-09-20 11:19:48 -07:00 |
|
ksysfs.c
|
|
|
|
kthread.c
|
kthread: make __kthread_queue_delayed_work static
|
2019-10-16 09:20:58 -07:00 |
|
latencytop.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
Makefile
|
Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
|
2019-09-27 19:37:27 -07:00 |
|
module-internal.h
|
|
|
|
module.c
|
Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
|
2019-09-28 08:14:15 -07:00 |
|
module_signature.c
|
MODSIGN: Export module signature definitions
|
2019-08-05 18:39:56 -04:00 |
|
module_signing.c
|
MODSIGN: Export module signature definitions
|
2019-08-05 18:39:56 -04:00 |
|
notifier.c
|
|
|
|
nsproxy.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
padata.c
|
padata: remove cpu_index from the parallel_queue
|
2019-09-13 21:15:41 +10:00 |
|
panic.c
|
panic: ensure preemption is disabled during panic()
|
2019-10-07 15:47:19 -07:00 |
|
params.c
|
lockdown: Lock down module params that specify hardware parameters (eg. ioport)
|
2019-08-19 21:54:16 -07:00 |
|
pid.c
|
kernel/pid.c: convert struct pid count to refcount_t
|
2019-07-16 19:23:24 -07:00 |
|
pid_namespace.c
|
proc/sysctl: add shared variables for range check
|
2019-07-18 17:08:07 -07:00 |
|
profile.c
|
|
|
|
ptrace.c
|
ptrace: add PTRACE_GET_SYSCALL_INFO request
|
2019-07-16 19:23:24 -07:00 |
|
range.c
|
|
|
|
reboot.c
|
|
|
|
relay.c
|
|
|
|
resource.c
|
mm/memory_hotplug.c: use PFN_UP / PFN_DOWN in walk_system_ram_range()
|
2019-09-24 15:54:09 -07:00 |
|
rseq.c
|
|
|
|
seccomp.c
|
|
|
|
signal.c
|
core-process-v5.4
|
2019-09-16 09:28:19 -07:00 |
|
smp.c
|
smp: Warn on function calls from softirq context
|
2019-07-20 11:27:16 +02:00 |
|
smpboot.c
|
|
|
|
smpboot.h
|
|
|
|
softirq.c
|
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-07-08 11:01:13 -07:00 |
|
stackleak.c
|
|
|
|
stacktrace.c
|
stacktrace: Constify 'entries' arguments
|
2019-07-25 15:43:26 +02:00 |
|
stop_machine.c
|
stop_machine: Avoid potential race behaviour
|
2019-10-17 12:47:12 +02:00 |
|
sys.c
|
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-09-17 12:35:15 -07:00 |
|
sys_ni.c
|
arch: handle arches who do not yet define clone3
|
2019-06-21 01:54:53 +02:00 |
|
sysctl.c
|
parisc: sysctl.c: Use CONFIG_PARISC instead of __hppa_ define
|
2019-10-14 21:43:54 +02:00 |
|
sysctl_binary.c
|
|
|
|
task_work.c
|
|
|
|
taskstats.c
|
|
|
|
test_kprobes.c
|
|
|
|
torture.c
|
torture: Remove exporting of internal functions
|
2019-08-01 14:30:22 -07:00 |
|
tracepoint.c
|
The main changes in this release include:
|
2019-07-18 11:51:00 -07:00 |
|
tsacct.c
|
|
|
|
ucount.c
|
proc/sysctl: add shared variables for range check
|
2019-07-18 17:08:07 -07:00 |
|
uid16.c
|
|
|
|
uid16.h
|
|
|
|
umh.c
|
|
|
|
up.c
|
smp: Remove smp_call_function() and on_each_cpu() return values
|
2019-06-23 14:26:26 +02:00 |
|
user-return-notifier.c
|
|
|
|
user.c
|
Keyrings namespacing
|
2019-07-08 19:36:47 -07:00 |
|
user_namespace.c
|
Keyrings namespacing
|
2019-07-08 19:36:47 -07:00 |
|
utsname.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
utsname_sysctl.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
watchdog.c
|
watchdog: Mark watchdog_hrtimer to expire in hard interrupt context
|
2019-08-01 20:51:20 +02:00 |
|
watchdog_hld.c
|
|
|
|
workqueue.c
|
workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs
|
2019-09-13 21:15:40 +10:00 |
|
workqueue_internal.h
|
|
|