1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/sys
Andriy Gapon 58f61ce4eb opensolaris cyclic: fix deadlock and make a little bit closer to upstream
The dealock was caused in the following way:
- thread T1 on CPU C1 holds a spin mutex, IPIs CPU C2 and waits for the
  IPI to be handled
- C2 executes timer interrupt filter, thus has interrupts disabled, and
  gets blocked on the spin mutex held by T1
The problem seems to have been introduced by simplifications made to
OpenSolaris code during porting.
The problem is fixed by reorganizing the code to more closely resemble
the upstream version.  Interrupt filter (cyclic_fire) now doesn't
acquire any locks, all per-CPU data accesses are performed on a
target CPU with preemption and interrupts disabled thus precluding
concurrent access to the data.
cyp_mtx spin mutex is used to disable preemtion and interrupts; it's not
used for classical mutual exclusion, because xcall already serializes
calls to a CPU.  It's an emulation of OpenSolaris
cyb_set_level(CY_HIGH_LEVEL) call, the spin mutexes could probably be
reduced to just a spinlock_enter()/_exit() pair.

Diff with upstream version is now reduced by ~500 lines, however it still
remains quite large - many things that are not needed (at the moment) or
are irrelevant on FreeBSD were simply ripped out during porting.
Examples of such things:
- support for CPU onlining/offlining
- support for suspend/resume
- support for running callouts at soft interrupt levels
- support for callout rebinding from CPU to CPU
- support for CPU partitions

Tested by:	Artem Belevich <fbsdlist@src.cx>
MFC after:	3 weeks
X-MFC with:	r216252
2010-12-07 12:25:26 +00:00
..
amd64 Retire write-only PCB_FULLCTX pcb flag on amd64. 2010-12-07 12:17:43 +00:00
arm Fix double ;; 2010-12-06 10:24:06 +00:00
boot Give a bit of a hint of the failure (read != expected) but don't make 2010-11-25 03:16:31 +00:00
bsm
cam Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00
cddl opensolaris cyclic: fix deadlock and make a little bit closer to upstream 2010-12-07 12:25:26 +00:00
compat Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in 2010-12-06 20:54:53 +00:00
conf Add an abstraction layer to the 64-bit AIM MMU's page table manipulation 2010-12-04 02:42:52 +00:00
contrib Merge Cavium Octeon SDK 2.0 Simple Executive; this brings some fixes and new 2010-11-28 08:18:16 +00:00
crypto Remove DEBUG sections. 2010-11-27 15:41:44 +00:00
ddb
dev Re-add a status check which sneaked out during r214804. 2010-12-07 08:20:20 +00:00
fs Replace pointer to "struct uidinfo" with pointer to "struct ucred" 2010-12-02 17:37:16 +00:00
gdb there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order 2010-09-30 17:05:23 +00:00
geom Add a note about the magic number 20. Actually, 22.75 entries fit in 2010-12-02 19:47:27 +00:00
gnu Remove prtactive variable and related printf()s in the vop_inactive 2010-11-19 21:17:34 +00:00
i386 MFamd64 r204214: Enforce stronger alignment semantics (require that the 2010-12-05 03:20:55 +00:00
ia64 Revert r216134. This checkin broke platforms where bus_space are macros: 2010-12-03 07:09:23 +00:00
isa bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
kern Add a KASSERT to make it obvious when fork_norfproc() is to be called, 2010-12-06 19:15:38 +00:00
kgssapi
libkern Add support for asterisk characters when filling in the GELI password 2010-11-14 14:12:43 +00:00
mips Fix double ;; 2010-12-06 10:24:06 +00:00
modules Import a clean-room implementation of the experimental H-TCP congestion control 2010-12-02 06:40:21 +00:00
net o Swap descriptions for net.bpf.bufsize and net.bpf.maxbufsize. 2010-11-24 05:50:19 +00:00
net80211 The meshid element is memcpy()'ed into se_meshid if included in either 2010-11-22 19:01:47 +00:00
netatalk
netgraph Simplify ng_pipe locking model by relying on the netgraph framework 2010-11-24 16:02:58 +00:00
netinet Use correct field to track statistics counting error as bad header length. 2010-12-05 01:09:48 +00:00
netinet6 Plug well observed races on la_hold entries with the callout handler. 2010-11-29 00:04:08 +00:00
netipsec After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
netipx
netnatm
netncp
netsmb
nfs Fix the type of the 3rd argument for nm_getinfo so that it works 2010-10-19 11:55:58 +00:00
nfsclient Remove prtactive variable and related printf()s in the vop_inactive 2010-11-19 21:17:34 +00:00
nfsserver Fix a bug in r214049. The nvp == vp case shall be handled specially 2010-11-05 21:13:16 +00:00
nlm Modify the NFS clients and the NLM so that the NLM can be used 2010-10-19 00:20:00 +00:00
opencrypto Let cryptosoft(4) add its pseudo-device with a specific unit number and its 2010-11-14 13:09:32 +00:00
pc98 Revert r216134. This checkin broke platforms where bus_space are macros: 2010-12-03 07:09:23 +00:00
pci Remove standard PCI configuration space register definitions. 2010-11-08 22:10:51 +00:00
powerpc Switch which software-reserved bit is used to designate a locked PTE 2010-12-05 01:17:53 +00:00
rpc Fix the krpc so that it can handle NFSv3,UDP mounts with a read/write 2010-10-13 00:57:14 +00:00
security Fix typos. 2010-11-09 10:59:09 +00:00
sparc64 Revert r216134. This checkin broke platforms where bus_space are macros: 2010-12-03 07:09:23 +00:00
sun4v Revert r216134. This checkin broke platforms where bus_space are macros: 2010-12-03 07:09:23 +00:00
sys Bump __FreeBSD_version for the addition of log2(). This is mainly for the 2010-12-05 22:12:07 +00:00
teken Use proper bounds checking on VPA. 2010-12-05 10:15:23 +00:00
tools
ufs Journal start looks up .sujournal file by doing lookup on the root dvp. 2010-12-01 21:19:11 +00:00
vm Fix comment intentation. 2010-12-04 17:41:58 +00:00
x86 Merge amd64/i386 _align.h by aligning on the size of register_t (copied 2010-11-26 10:59:20 +00:00
xdr
xen Improve the Xen para-virtualized device infrastructure of FreeBSD: 2010-10-19 20:53:30 +00:00
Makefile Add lex and yacc sources to things cscope'd. 2010-11-21 03:58:11 +00:00