freebsd-skq/sys/kern
ken 03d0445c16 Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers
out of cdregister() and daregister(), which are run from interrupt context.

The sysctl code does blocking mallocs (M_WAITOK), which causes problems
if malloc(9) actually needs to sleep.

The eventual fix for this issue will involve moving the CAM probe process
inside a kernel thread.  For now, though, I have fixed the issue by moving
dynamic sysctl variable creation for these two drivers to a task queue
running in a kernel thread.

The existing task queues (taskqueue_swi and taskqueue_swi_giant) run in
software interrupt handlers, which wouldn't fix the problem at hand.  So I
have created a new task queue, taskqueue_thread, that runs inside a kernel
thread.  (It also runs outside of Giant -- clients must explicitly acquire
and release Giant in their taskqueue functions.)

scsi_cd.c:	Remove sysctl variable creation code from cdregister(), and
		move it to a new function, cdsysctlinit().  Queue
		cdsysctlinit() to the taskqueue_thread taskqueue once we
		have fully registered the cd(4) driver instance.

scsi_da.c:	Remove sysctl variable creation code from daregister(), and
		move it to move it to a new function, dasysctlinit().
		Queue dasysctlinit() to the taskqueue_thread taskqueue once
		we have fully registered the da(4) instance.

taskqueue.h:	Declare the new taskqueue_thread taskqueue, update some
		comments.

subr_taskqueue.c:
		Create the new kernel thread taskqueue.  This taskqueue
		runs outside of Giant, so any functions queued to it would
		need to explicitly acquire/release Giant if they need it.

cd.4:		Update the cd(4) man page to talk about the minimum command
		size sysctl/loader tunable.  Also note that the changer
		variables are available as loader tunables as well.

da.4:		Update the da(4) man page to cover the retry_count,
		default_timeout and minimum_cmd_size sysctl variables/loader
		tunables.  Remove references to /dev/r???, they aren't used
		any longer.

cd.9:		Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY
		quirk.

taskqueue.9:	Update the taskqueue(9) man page to describe the new thread
		task queue, and the taskqueue_swi_giant queue.

MFC after:	3 days
2003-09-03 04:46:28 +00:00
..
bus_if.m
clock_if.m
device_if.m
genassym.sh
imgact_aout.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
imgact_elf32.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
imgact_elf64.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
imgact_elf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
imgact_gzip.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
imgact_shell.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
inflate.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
init_main.c Change instances of callout_init that specify MPSAFE behaviour to 2003-08-19 17:51:11 +00:00
init_sysent.c o Refine kse_thr_interrupt to allow it to handle different commands. 2003-07-17 22:45:33 +00:00
kern_acct.c Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout. 2003-07-27 17:04:56 +00:00
kern_acl.c Move more ACL logic from the UFS code (ufs_acl.c) to the central POSIX.1e 2003-08-04 02:13:05 +00:00
kern_alq.c Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout. 2003-07-27 17:04:56 +00:00
kern_clock.c Fix this to build on alpha. Build test successful. 2003-06-27 08:35:05 +00:00
kern_condvar.c Allow SA process unblocks a thread blocked in condition variable. 2003-07-02 01:19:15 +00:00
kern_conf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_context.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_descrip.c Do some minor Giant pushdown made possible by copyin, fget, fdrop, 2003-08-04 21:28:57 +00:00
kern_environment.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_event.c Initialize struct fileops with C99 sparse initialization. 2003-06-18 18:16:40 +00:00
kern_exec.c Add a "int fd" argument to VOP_OPEN() which in the future will 2003-07-26 07:32:23 +00:00
kern_exit.c Rename P_THREADED to P_SA. P_SA means a process is using scheduler 2003-06-15 00:31:24 +00:00
kern_fork.c Change instances of callout_init that specify MPSAFE behaviour to 2003-08-19 17:51:11 +00:00
kern_idle.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_intr.c Make swi_vm be INTR_MPSAFE. On all platforms, it is only used to activate 2003-07-01 16:00:38 +00:00
kern_jail.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_kse.c Let SA process work under ULE scheduler, originally it would panic kernel. 2003-08-26 11:33:15 +00:00
kern_kthread.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_ktr.c Both 'c' an 'lines' are unused, the bogus init of lines was accidentally 2003-08-02 17:35:00 +00:00
kern_ktrace.c Consistently use the BSD u_int and u_short instead of the SYSV uint and 2003-08-07 15:04:27 +00:00
kern_linker.c Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout. 2003-07-27 17:04:56 +00:00
kern_lock.c Rearrange the SYSINIT order to call lockmgr_init() earlier so that 2003-07-16 01:00:39 +00:00
kern_lockf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_mac.c Fix a mac_policy_list reference to be a mac_static_policy_list 2003-08-26 17:29:02 +00:00
kern_malloc.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
kern_mib.c Change description of kern.osreldate from "Operating system release date" to 2003-08-21 14:47:08 +00:00
kern_module.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_mtxpool.c Rearrange the SYSINIT order to call lockmgr_init() earlier so that 2003-07-16 01:00:39 +00:00
kern_mutex.c If a spin lock is held for too long and WITNESS is enabled, then call 2003-07-31 18:52:18 +00:00
kern_ntptime.c During a positive leap second, the tai_time offset should be 2003-06-25 20:56:40 +00:00
kern_physio.c Grab Giant in physio() since non-giant drivers are starting to appear. 2003-08-02 09:40:53 +00:00
kern_poll.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_proc.c kse.h is not needed for these files. 2003-08-05 12:08:49 +00:00
kern_prot.c Extend the mutex pool implementation to permit the creation and use of 2003-07-13 01:22:21 +00:00
kern_resource.c Extend the mutex pool implementation to permit the creation and use of 2003-07-13 01:22:21 +00:00
kern_sema.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_shutdown.c Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MI 2003-08-16 16:57:57 +00:00
kern_sig.c panic() if we try to handle an out-of-range signal number in 2003-08-10 23:05:37 +00:00
kern_subr.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_switch.c Rename P_THREADED to P_SA. P_SA means a process is using scheduler 2003-06-15 00:31:24 +00:00
kern_sx.c Extend the mutex pool implementation to permit the creation and use of 2003-07-13 01:22:21 +00:00
kern_synch.c Change instances of callout_init that specify MPSAFE behaviour to 2003-08-19 17:51:11 +00:00
kern_syscalls.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_sysctl.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_tc.c bde made a number of suggested improvements to the code. This commit 2003-08-20 19:12:46 +00:00
kern_thr.c Update powerpc to use the (old thread,new thread) calling convention 2003-08-14 03:56:24 +00:00
kern_thread.c Let SA process work under ULE scheduler, originally it would panic kernel. 2003-08-26 11:33:15 +00:00
kern_time.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_timeout.c On ia64 time_t is 64 bit. Explicitly cast tv_sec to long and change 2003-08-23 08:31:32 +00:00
kern_umtx.c Initialize 'blocked' to NULL. I think this was a real problem, but I 2003-07-23 20:29:13 +00:00
kern_uuid.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
kern_xxx.c Fix a logic error in osethostid() that was introduced in rev. 1.34: 2003-08-23 15:45:57 +00:00
ksched.c Use __FBSDID(). 2003-06-11 06:34:30 +00:00
link_elf_obj.c Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
link_elf.c Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
linker_if.m
Make.tags.inc
Makefile
makesyscalls.sh
md4c.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
md5c.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
p1003_1b.c Use __FBSDID(). 2003-06-11 06:34:30 +00:00
posix4_mib.c Use __FBSDID(). 2003-06-11 06:34:30 +00:00
sched_4bsd.c Change instances of callout_init that specify MPSAFE behaviour to 2003-08-19 17:51:11 +00:00
sched_ule.c Let SA process work under ULE scheduler, originally it would panic kernel. 2003-08-26 11:33:15 +00:00
subr_acl_posix1e.c Move more ACL logic from the UFS code (ufs_acl.c) to the central POSIX.1e 2003-08-04 02:13:05 +00:00
subr_autoconf.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
subr_blist.c Expand inline the relevant parts of src/COPYRIGHT for Matt Dillon's 2003-08-12 23:24:05 +00:00
subr_bus.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_clist.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
subr_clock.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_devstat.c It is not an error to have no devices in the kernel: Return the 2003-08-17 12:06:19 +00:00
subr_disk.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_eventhandler.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_hints.c Add a resource_disabled() helper function that returns true (non-zero) if 2003-07-02 16:01:38 +00:00
subr_kobj.c add a read-only sysctl to display the number of entries in the fixed size 2003-08-14 21:16:46 +00:00
subr_log.c Replace the code for reading and writing the kernel message buffer 2003-06-22 02:18:31 +00:00
subr_mbpool.c Add a facility for devices, specifically network interfaces, that require 2003-07-15 08:59:38 +00:00
subr_mbuf.c Use constants less throughout the code and instead use the objsize 2003-08-16 19:48:52 +00:00
subr_mchain.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_module.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_msgbuf.c Replace the code for reading and writing the kernel message buffer 2003-06-22 02:18:31 +00:00
subr_param.c More pipe changes: 2003-08-11 05:51:51 +00:00
subr_pcpu.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_power.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_prf.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
subr_prof.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_rman.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_rtc.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_sbuf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_scanf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
subr_smp.c Document some sysctl variables. 2003-06-12 19:46:51 +00:00
subr_taskqueue.c Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers 2003-09-03 04:46:28 +00:00
subr_trap.c kse.h is not needed for these files. 2003-08-05 12:08:49 +00:00
subr_turnstile.c If a spin lock is held for too long and WITNESS is enabled, then call 2003-07-31 18:52:18 +00:00
subr_witness.c Insert cosmetic spaces. 2003-08-04 19:24:25 +00:00
subr_xxx.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
sys_generic.c Remove Giant from writev(2). Eliminate trivial style differences between 2003-08-01 02:21:54 +00:00
sys_pipe.c if we got this far, we definately don't have an EBADF. Return a more 2003-08-15 04:31:01 +00:00
sys_process.c Add or finish support for machine dependent ptrace requests. When we 2003-08-15 05:25:06 +00:00
sys_socket.c Initialize struct fileops with C99 sparse initialization. 2003-06-18 18:16:40 +00:00
syscalls.c o Refine kse_thr_interrupt to allow it to handle different commands. 2003-07-17 22:45:33 +00:00
syscalls.master o Refine kse_thr_interrupt to allow it to handle different commands. 2003-07-17 22:45:33 +00:00
sysv_ipc.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
sysv_msg.c Update some argument-documenting comments to match reality. 2003-08-07 16:42:27 +00:00
sysv_sem.c Update some argument-documenting comments to match reality. 2003-08-07 16:42:27 +00:00
sysv_shm.c Update some argument-documenting comments to match reality. 2003-08-07 16:42:27 +00:00
tty_compat.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
tty_conf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
tty_cons.c Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout. 2003-07-27 17:04:56 +00:00
tty_pty.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
tty_subr.c Revert stuff which accidentally ended up in the previous commit. 2003-07-22 10:36:36 +00:00
tty_tty.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
tty.c Use a new message buffer `consmsgbuf' to forward messages to a 2003-06-22 02:54:33 +00:00
uipc_accf.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
uipc_cow.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
uipc_domain.c move domain list mutex initialization to earlier in the boot sequence so 2003-09-02 20:59:23 +00:00
uipc_jumbo.c Lock the vm object when removing a page. 2003-06-11 21:23:04 +00:00
uipc_mbuf2.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
uipc_mbuf.c Implement MBUF_STRESS_TEST mark II. 2003-09-01 05:55:37 +00:00
uipc_proto.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
uipc_sem.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
uipc_sockbuf.c Guard against MLEN growing larger than a uint8_t due to MSIZE grwoing to a 2003-07-26 07:23:24 +00:00
uipc_socket2.c Guard against MLEN growing larger than a uint8_t due to MSIZE grwoing to a 2003-07-26 07:23:24 +00:00
uipc_socket.c Make the second argument to sooptcopyout() constant in order to 2003-08-05 00:27:54 +00:00
uipc_syscalls.c Migrate the sf_buf allocator that is used by sendfile(2) and zero-copy 2003-08-29 20:04:10 +00:00
uipc_usrreq.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
vfs_acl.c Move more ACL logic from the UFS code (ufs_acl.c) to the central POSIX.1e 2003-08-04 02:13:05 +00:00
vfs_aio.c Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
vfs_bio.c - Define a new flag for getblk(): GB_NOCREAT. This flag causes getblk() to 2003-08-31 08:50:11 +00:00
vfs_cache.c Make the VFS cache use zones instead of malloc(9). This results in a 2003-06-13 08:46:13 +00:00
vfs_cluster.c - Move BX_BKGRDWAIT and BX_BKGRDINPROG to BV_ and the b_vflags field. 2003-08-28 06:55:18 +00:00
vfs_default.c I have not had any reports of trouble for a long time, so remove the 2003-06-15 19:49:14 +00:00
vfs_export.c Guard against MLEN growing larger than a uint8_t due to MSIZE grwoing to a 2003-07-26 07:23:24 +00:00
vfs_extattr.c Add mac_check_vnode_deleteextattr() and mac_check_vnode_listextattr(): 2003-08-21 13:53:01 +00:00
vfs_init.c Initialize struct vfsops C99-sparsely. 2003-06-12 20:48:38 +00:00
vfs_lookup.c Use __FBSDID(). 2003-06-11 00:56:59 +00:00
vfs_mount.c Add a new mount flag MNT_BYFSID that can be used to unmount a file 2003-07-01 17:40:23 +00:00
vfs_subr.c Consistently use the BSD u_int and u_short instead of the SYSV uint and 2003-08-07 15:04:27 +00:00
vfs_syscalls.c Add mac_check_vnode_deleteextattr() and mac_check_vnode_listextattr(): 2003-08-21 13:53:01 +00:00
vfs_vnops.c Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with the 2003-07-28 18:53:29 +00:00
vnode_if.src Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with the 2003-07-28 18:53:29 +00:00