freebsd-dev/sys
Will Andrews fdbc71742b Extend taskqueue(9) to enable per-taskqueue callbacks.
The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments.  They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().

This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.

The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9).  This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.

Two callback types are supported at this point:

- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
  to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
  after it has processed its last task but before the taskqueue is
  reclaimed.

While I'm here:

- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
  in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
  interface for all consumers of taskqueue(9).

Reviewed by:	kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	1 month
2013-03-23 15:11:53 +00:00
..
amd64 Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
arm Minimal timer period of 100us introduced in r244758 is overkill. While 2013-03-21 15:42:41 +00:00
boot Integrate Efika MX project back to home. 2013-03-20 15:39:27 +00:00
bsm Implement chflagsat(2) system call, similar to fchmodat(2), but operates on 2013-03-21 22:59:01 +00:00
cam Commit the removal of a whitespace to record the proper commit message 2013-03-19 15:05:21 +00:00
cddl fbt_getargdesc: correctly handle types for return probes 2013-03-23 08:52:50 +00:00
compat Regenerate after r248599. 2013-03-21 23:02:19 +00:00
conf Sync back vmcontention branch into HEAD: 2013-03-18 00:25:02 +00:00
contrib Simplify TAILQ usage and avoid additional memory allocations. 2013-03-05 08:08:16 +00:00
crypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
ddb
dev Don't attempt to reference sc before testing whether it's NULL. 2013-03-22 22:46:19 +00:00
fs - Constify local path variable for chflagsat(). 2013-03-22 07:40:34 +00:00
gdb
geom Correct the page count when excess length is trimmed from the bio. 2013-03-21 22:36:43 +00:00
gnu/fs/reiserfs Garbage collect XFS bits which are now already completely disconnected 2013-03-02 15:33:54 +00:00
i386 Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
ia64 Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
isa
kern Extend taskqueue(9) to enable per-taskqueue callbacks. 2013-03-23 15:11:53 +00:00
kgssapi
libkern Add __aeabi_memset to libkern, implemented using memset, as clang may 2013-03-16 23:11:55 +00:00
mips Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
modules Fix the powerpc64 build. MACHINE_CPUARCH is common for powerpc/powerpc64, 2013-03-19 00:39:02 +00:00
net Remove __FreeBSD_version ifdefs. 2013-03-22 20:44:16 +00:00
net80211 Add VNET wrappers around the rest of the ieee80211 rtsock messages. 2013-03-20 02:42:52 +00:00
netatalk
netgraph Add NGM_NAT_LIBALIAS_INFO command, that reports internal stats 2013-03-21 08:36:15 +00:00
netinet Add ipfw support for setting/matching DiffServ codepoints (DSCP). 2013-03-20 10:35:33 +00:00
netinet6 Clean up some unused leftover code. 2013-03-22 01:45:54 +00:00
netipsec Use m_get2() + m_align() instead of hand made key_alloc_mbuf(). Code 2013-03-15 10:20:15 +00:00
netipx
netnatm
netpfil Add ipfw support for setting/matching DiffServ codepoints (DSCP). 2013-03-20 10:35:33 +00:00
netsmb Call make_dev_credf() rather than using the couple make_dev()/dev_ref(). 2013-03-09 16:58:19 +00:00
nfs Use m_get() and m_getcl() instead of compat macros. 2013-03-15 10:21:18 +00:00
nfsclient Fix remainder calculation when biosize is not a power of 2 2013-03-19 13:06:11 +00:00
nfsserver Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
nlm
ofed Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
opencrypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
pc98 Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
pci Fix build. 2013-02-21 12:52:18 +00:00
powerpc Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
rpc Revert 195703 and 195821 as this special stop handling in NFS is now 2013-03-13 21:06:03 +00:00
security Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
sparc64 Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
sys Extend taskqueue(9) to enable per-taskqueue callbacks. 2013-03-23 15:11:53 +00:00
teken
tools Further refine the handling of stop signals in the NFS client. The 2013-02-21 19:02:50 +00:00
ufs The purpose of this change to the FFS layout policy is to reduce the 2013-03-22 21:45:28 +00:00
vm Only size and create the bio_transient_map when unmapped buffers are 2013-03-21 07:28:15 +00:00
x86 MFcalloutng: 2013-02-28 13:46:03 +00:00
xdr Use m_get() and m_getcl() instead of compat macros. 2013-03-15 10:21:18 +00:00
xen
Makefile Remove netncp cscope entry missed in r248097 2013-03-12 14:21:52 +00:00