freebsd-nq/sys/arm
Kyle Evans 589aed00e3 sched: separate out schedinit_ap()
schedinit_ap() sets up an AP for a later call to sched_throw(NULL).

Currently, ULE sets up some pcpu bits and fixes the idlethread lock with
a call to sched_throw(NULL); this results in a window where curthread is
setup in platforms' init_secondary(), but it has the wrong td_lock.
Typical platform AP startup procedure looks something like:

- Setup curthread
- ... other stuff, including cpu_initclocks_ap()
- Signal smp_started
- sched_throw(NULL) to enter the scheduler

cpu_initclocks_ap() may have callouts to process (e.g., nvme) and
attempt to sched_add() for this AP, but this attempt fails because
of the noted violated assumption leading to locking heartburn in
sched_setpreempt().

Interrupts are still disabled until cpu_throw() so we're not really at
risk of being preempted -- just let the scheduler in on it a little
earlier as part of setting up curthread.

Reviewed by:	alfredo, kib, markj
Triage help from:	andrew, markj
Smoke-tested by:	alfredo (ppc), kevans (arm64, x86), mhorne (arm)
Differential Revision:	https://reviews.freebsd.org/D32797
2021-11-03 15:54:59 -05:00
..
allwinner mmc: switch mmc_helper to device_ api 2021-09-20 17:18:02 +02:00
altera/socfpga
annapurna/alpine Remove versatile support 2021-04-12 06:16:31 +00:00
arm sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
broadcom/bcm2835 bcm2835_sdhci: don't use DMA for kernel dumps 2021-09-21 10:08:39 -03:00
conf ipq4018: add initial IPQ4018/IPQ4019 support 2021-10-18 19:19:06 +00:00
freescale Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
include arm: Remove unused items 2021-11-03 13:54:36 -06:00
linux linux(4): Regen for clone syscall. 2021-08-12 11:47:31 +03:00
mv arm/mv: Don't rely on firmware MSI mapping in ICU 2021-07-20 23:24:42 +02:00
nvidia arm: fix a typo in nvidia/drm2/tegra_bo.c 2021-10-25 18:42:10 +00:00
qemu
qualcomm ipq4018: add initial IPQ4018/IPQ4019 support 2021-10-18 19:19:00 +00:00
rockchip Add support for RK3288 SoC. 2020-12-04 16:24:44 +00:00
ti ti(4): Fix a typo in an error message 2021-10-02 10:51:29 +02:00
xilinx