freebsd-nq/sys
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
..
amd64 amd64: Deduplicate routines for expanding KASAN/KMSAN shadow maps 2021-11-03 12:36:02 -04:00
arm sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
arm64 sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
bsm
cam scsi_cd: Improve TOC access validation 2021-11-03 15:09:17 -04:00
cddl Allow ddb and dtrace use the DMAP region on arm64 2021-10-01 11:27:33 +01:00
compat linprocfs: Fix formatting of Uid and Gid lines 2021-11-03 08:40:55 +00:00
conf kasan: Disable validation of function parameters passed by value 2021-11-03 12:36:02 -04:00
contrib Merge commit 'ce929fe84f9c453263af379f3b255ff8eca01d48' 2021-10-29 19:18:03 +02:00
crypto crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. 2021-10-06 14:08:49 -07:00
ddb Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
dev ocs_fs: Fix two typos in source code comments 2021-11-03 17:17:51 +01:00
dts ipq4018: add a device tree file for the ASUS rt-ac58u router 2021-10-18 19:18:46 +00:00
fs nfscl: Fix forced dismount when "nconnect" is specified 2021-11-03 13:26:38 -07:00
gdb
geom gjournal(8): Fix a typo in a source code comment 2021-11-03 17:14:00 +01:00
gnu
i386 linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c 2021-11-03 08:50:17 +00:00
isa
kern sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
kgssapi
libkern
mips sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
modules linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c 2021-11-03 08:50:17 +00:00
net epair: remove "All rights reserved" 2021-11-02 16:50:26 +00:00
net80211 net80211: add a driver-private pointer to struct ieee80211_node 2021-10-31 19:08:28 +00:00
netgraph ng_pptpgre(4): Fix a typo in a source code comment 2021-11-03 17:15:59 +01:00
netinet blackhole(4): disable for locally originated TCP/UDP packets 2021-11-03 13:02:44 -07:00
netinet6 blackhole(4): disable for locally originated TCP/UDP packets 2021-11-03 13:02:44 -07:00
netipsec ipsec: add a lock encompassing SPI allocation 2021-11-03 19:51:40 +00:00
netpfil pf: remove the flags argument from pf_unlink_state 2021-11-01 20:59:14 +01:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed socket: De-duplicate SBLOCKWAIT() definitions 2021-09-14 09:01:32 -04:00
opencrypto crypto: Cleanup mtx_init() calls. 2021-11-02 12:18:05 -07:00
powerpc sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
riscv sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
rpc rpc: Convert an SOLISTENING check to an assertion 2021-09-17 14:19:05 -04:00
security
sys sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
teken
tests
tools ipq4018: add TCSR definitions from Linux. 2021-10-18 19:18:01 +00:00
ufs ufs: remove write-only variables 2021-10-21 21:40:46 +03:00
vm Fix a common typo in syctl descriptions 2021-11-03 20:49:24 +01:00
x86 sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
xdr
xen
Makefile