freebsd-skq/sys
Konstantin Belousov 7054ee4e38 The kqueue_register() function assumes that it is called from the top of
the syscall code and acquires various event subsystem locks as needed.
The handling of the NOTE_TRACK for EVFILT_PROC is currently done by
calling the kqueue_register() from filt_proc() filter, causing recursive
entrance of the kqueue code. This results in the LORs and recursive
acquisition of the locks.

Implement the variant of the knote() function designed to only handle
the fork() event. It mostly copies the knote() body, but also handles
the NOTE_TRACK, removing the handling from the filt_proc(), where it
causes problems described above. The function is called from the fork1()
instead of knote().

When encountering NOTE_TRACK knote, it marks the knote as influx
and drops the knlist and kqueue lock. In this context call to
kqueue_register is safe from the problems.

An error from the kqueue_register() is reported to the observer as
NOTE_TRACKERR fflag.

PR:	108201
Reviewed by:	jhb, Pramod Srinivasan <pramod juniper net> (previous version)
Discussed with:	jmg
Tested by:	pho
MFC after:	2 weeks
2008-07-07 09:30:11 +00:00
..
amd64 Change create_pagetables() and pmap_init() so that many fewer page table 2008-07-06 22:36:28 +00:00
arm Remove the unused major/minor numbers from iodev and memdev. 2008-06-25 07:45:31 +00:00
boot Remove the sbni(4) driver. No one responded to calls to test it on 2008-07-04 21:06:57 +00:00
bsm
cam
cddl Remove the $FreeBSD$ tag again, now I know fbsd:nokeywords exists. 2008-06-12 08:53:54 +00:00
compat Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
conf Add CTF conversion to the objects compiled from generated code. 2008-07-05 06:12:14 +00:00
contrib Remove the oltr(4) driver. No one responded to calls for testing on 2008-07-04 18:58:53 +00:00
crypto
ddb Print out the container lock when showing the thread state in DDB. 2008-06-18 20:42:01 +00:00
dev Fix comment: s/before/after. 2008-07-06 16:18:58 +00:00
fs Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
gdb
geom Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
gnu
i386 Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
ia64 Remove the unused major/minor numbers from iodev and memdev. 2008-06-25 07:45:31 +00:00
isa
kern The kqueue_register() function assumes that it is called from the top of 2008-07-07 09:30:11 +00:00
libkern
mips As discussed on IRC and at BSDcan, move the mips32/* directories up a 2008-07-06 21:09:29 +00:00
modules Remove the sbsh(4) driver. No one responded to requests for testing the 2008-07-04 21:24:35 +00:00
net Add a new ioctl for changing the read filter (BIOCSETFNR). This is 2008-07-07 09:25:49 +00:00
net80211 correct construction of delba action frame; don't shift+mask the initiator 2008-07-05 19:56:47 +00:00
netatalk Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netgraph Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netinet Drop read lock on udbinfo earlier during delivery to the last matching 2008-07-07 09:26:52 +00:00
netinet6 Improve approximation of style(9) in raw socket code. 2008-07-05 18:03:39 +00:00
netipsec Enter the 1990s. Use real function declaration. 2008-06-29 00:49:50 +00:00
netipx Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netnatm Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netncp
netsmb
nfs
nfs4client Once the ENOLCK is detected we expect to retry the acquisition. 2008-05-27 00:20:19 +00:00
nfsclient Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
nfsserver Remove spls from NFS server setup call; expand receive socket buffer 2008-06-30 20:43:06 +00:00
nlm Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
opencrypto
pc98 Add i386_memio_compare() to compare two resources. 2008-07-05 16:31:58 +00:00
pccard
pci Add a new RTL8169 variant, 8169SB(L)/8110SB(L). 2008-07-02 08:00:14 +00:00
powerpc Remove the unused M_MEMDEV from the kernel. 2008-06-25 07:52:10 +00:00
rpc Introduce a new lock, hostname_mtx, and use it to synchronize access 2008-07-05 13:10:10 +00:00
security Rework the lifetime management of the kernel implementation of POSIX 2008-06-27 05:39:04 +00:00
sparc64 - Merge macros depending on the flags being preserved between calls 2008-07-05 15:44:56 +00:00
sun4v Given that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64 2008-06-25 21:03:26 +00:00
sys The kqueue_register() function assumes that it is called from the top of 2008-07-07 09:30:11 +00:00
tools
ufs Fix comments to replace SBSIZE with SBLOCKSIZE, since SBSIZE 2008-05-24 20:44:14 +00:00
vm Enable the creation of a kmem map larger than 4GB. 2008-07-05 19:34:33 +00:00
xdr
Makefile Remove ISDN4BSD (I4B) from HEAD as it is not MPSAFE and 2008-05-26 10:40:09 +00:00