freebsd-skq/sys
Attilio Rao 248bb9379f Fix a deadlock in the shutdown code:
When performing a smp_rendezvous() or more likely, on amd64 and i386,
a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx
spinlock held, busy-waiting for other CPUs to acknowledge the operation.
As long as CPUs are suspended (via cpu_reset()) between the active mask
read and IPI sending there can be a deadlock where the caller will wait
forever for a dead CPU to acknowledge the operation.
Please note that on CPU0 that is going to be someway heavier because of
the spinlocks being disabled earlier than quitting the machine.

Fix this bug by calling cpu_reset() with the smp_ipi_mtx held.
Note that it is very likely that a saner offline/online CPUs mechanism
will help heavilly in fixing similar cases as it is likely more bugs
of this type may arise in the future.

Reported by:	rwatson
Discussed with:	jhb
Tested by:	rnoland, Giovanni Trematerra
		<giovanni dot trematerra at gmail dot com>
MFC:		2 weeks

Special deciation to:	anyone who made possible to have 16-ways machines
			in Netperf
2010-04-19 23:27:54 +00:00
..
amd64 Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. 2010-04-14 20:45:33 +00:00
arm Add BUS_SPACE_UNRESTRICTED and define it to be ~0, just like all the 2010-04-08 19:34:55 +00:00
boot Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. 2010-04-14 20:45:33 +00:00
bsm
cam scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and 2010-04-15 08:29:14 +00:00
cddl Partially MFp4 #176265 by pjd@: 2010-04-19 09:03:36 +00:00
compat Linux puts a blank line between each CPU. 2010-04-14 13:44:22 +00:00
conf Remove unused file. 2010-04-19 07:51:57 +00:00
contrib We don't need the definition for in_cksum repeated here since we get 2010-04-14 20:50:07 +00:00
crypto
ddb Move two copies of the same definition to a common include file. 2010-04-14 23:06:07 +00:00
dev With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify 2010-04-19 22:10:40 +00:00
fs Avoid extraneous recovery cycles in the experimental NFS client 2010-04-18 22:21:23 +00:00
gdb
geom Fix ddb(4) "show geom addr" command when INVARIANTS is enabled. Don't 2010-04-19 20:07:35 +00:00
gnu Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summer 2010-01-14 14:30:54 +00:00
i386 Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. 2010-04-14 20:45:33 +00:00
ia64 Populate the sysctl tree with any MCA records we collected. 2010-04-13 22:20:12 +00:00
isa Introduce the new kernel sub-tree x86 which should contain all the code 2010-02-25 14:13:39 +00:00
kern Fix a deadlock in the shutdown code: 2010-04-19 23:27:54 +00:00
kgssapi
libkern Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
mips Fix MALTA64 build. 2010-04-19 09:03:34 +00:00
modules Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. 2010-04-14 20:45:33 +00:00
net Move two copies of the same definition to a common include file. 2010-04-14 23:06:07 +00:00
net80211 Make this code a little more portable by wrapping the mtx calls into 2010-04-14 18:29:40 +00:00
netatalk
netgraph Start copyright notice with /*- 2010-04-07 16:29:10 +00:00
netinet whitespace fixes (trailing whitespace, bad indentation 2010-04-19 16:17:30 +00:00
netinet6 Plug reference leaks in the link-layer code ("new-arp") that previously 2010-04-11 16:04:08 +00:00
netipsec Locks SPTREE when setting some SP entries to state DEAD. 2010-04-15 12:40:33 +00:00
netipx
netnatm
netncp Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
netsmb Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
nfs Factor out the code shared between NFS client and server into its own 2010-02-16 20:00:21 +00:00
nfsclient Simplify code a bit. 2010-02-18 22:10:55 +00:00
nfsserver Patch the regular NFS server so that it returns ESTALE to the client 2010-03-26 01:19:29 +00:00
nlm
opencrypto Add comments trying to explain what bad things happen here, i.e. 2010-01-09 15:43:47 +00:00
pc98 Default the machdep.lapic_allclocks to be enabled in order to cope with 2010-04-09 14:22:09 +00:00
pci Consistently use capital letters. 2010-04-09 23:00:24 +00:00
powerpc With r205496 in place we should ensure that nargs and nreturns are always 2010-04-02 21:48:27 +00:00
rpc When the regular NFS server replied to a UDP client out of the replay 2010-03-23 23:03:30 +00:00
security Update device-labeling logic for Biba, LOMAC, and MLS to recognize new-style 2010-03-02 15:05:48 +00:00
sparc64 Update for UltraSPARC-IV{,+} and SPARC64 V, VI, VII and VIIIfx CPUs. 2010-04-11 15:35:17 +00:00
sun4v Change the arguments of exec_setregs() so that it receives a pointer 2010-03-25 14:24:00 +00:00
sys Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
teken Just use <stdint.h> instead of <inttypes.h>. We don't need it here. 2010-04-03 17:22:28 +00:00
tools
ufs ffs_mount: remove redundant assignment of geom consumer to devvp.v_bufobj 2010-04-03 08:25:04 +00:00
vm vm_thread_swapout() can safely dirty the page before rather than after 2010-04-19 00:18:14 +00:00
x86 Default the machdep.lapic_allclocks to be enabled in order to cope with 2010-04-09 14:22:09 +00:00
xdr
xen don't hold spin lock across free 2010-02-21 01:12:18 +00:00
Makefile