freebsd-dev/sys/kern
Luigi Rizzo d4619572b4 Clarify and reimplement the bioq API so that bioq_disksort() has
the correct behaviour (sorting by distance from the current head position
in the scan direction) and bioq_insert_head() and bioq_insert_tail()
have a well defined (and useful) behaviour, especially when intermixed
with calls to bioq_disksort().

In particular:
- fix a bug in the existing bioq_disksort() that did not use the
  current head position correctly;
- redefine semantics of bioq_insert_head() and bioq_insert_tail().
  bioq_insert_tail() can now be used as a barrier
  between previous and subsequent calls to bioq_disksort().

The code is heavily documented in the source code so please refer
to that for the details.

Much of this code comes from Fabio Checconi. Also thanks to Kirk
for feedback on the (re)definition of bioq_insert_tail().

NOTE: in the current tree there is only a handful of files which
intermix calls to bioq_disksort() with bioq_insert_head() and
bioq_insert_tail(). The ordering of the queue in these situation
was not specified (nor easy to figure out) before, so I doubt any
of that code could be affected by the specification of the API.

Also note that the current implementation is significantly simpler
than the previous one (also used in ata_sort_queue()).
It would be useful to reimplement ata_sort_queue() using
the same code used in bioq_disksort().

MFC after:	1 week
2009-02-13 11:36:32 +00:00
..
bus_if.m Allow device hints to wire the unit numbers of devices. 2008-11-18 21:01:54 +00:00
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
imgact_aout.c Add sv_flags field to struct sysentvec with intention to provide description 2008-11-22 12:36:15 +00:00
imgact_elf32.c
imgact_elf64.c
imgact_elf.c When a statically linked binary is executed (or at least, one without 2009-01-25 12:07:43 +00:00
imgact_gzip.c
imgact_shell.c
inflate.c
init_main.c Rename three MAC entry points from _proc_ to _cred_ to reflect the fact 2008-10-28 11:33:06 +00:00
init_sysent.c Regenerate system call tables for r184789. 2008-11-09 10:48:06 +00:00
kern_acct.c
kern_alq.c
kern_clock.c - Implement generic macros for producing KTR records that are compatible 2009-01-17 07:17:57 +00:00
kern_condvar.c
kern_conf.c Explicitely note that destroy_dev() sleeps. 2008-11-27 16:47:25 +00:00
kern_cons.c Reimplement the /dev/console device node. 2008-11-01 08:35:28 +00:00
kern_context.c
kern_cpu.c If possible, try to obtain max_mhz on cpufreq attach instead of first request. 2008-12-16 01:24:05 +00:00
kern_cpuset.c MFp4: 2008-11-29 14:32:14 +00:00
kern_ctf.c
kern_descrip.c Modify fdcopy() so that, during fork(2), it won't copy file descriptors 2009-02-11 15:22:01 +00:00
kern_dtrace.c
kern_environment.c
kern_event.c Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
kern_exec.c Several threads in a process may do vfork() simultaneously. Then, all 2008-12-05 20:50:24 +00:00
kern_exit.c Several threads in a process may do vfork() simultaneously. Then, all 2008-12-05 20:50:24 +00:00
kern_fork.c Several threads in a process may do vfork() simultaneously. Then, all 2008-12-05 20:50:24 +00:00
kern_idle.c
kern_intr.c
kern_jail.c Don't allow creating a socket with a protocol family that the current 2009-02-05 14:15:18 +00:00
kern_kthread.c
kern_ktr.c
kern_ktrace.c Fix a credential reference leak. [1] 2008-12-03 15:54:35 +00:00
kern_linker.c Scanning all the formats for binary translation of modules loading can 2009-02-10 15:50:19 +00:00
kern_lock.c Tweak the output of VOP_PRINT/vn_printf() some. 2009-02-06 20:06:48 +00:00
kern_lockf.c Remove unused variable. 2008-11-27 04:40:37 +00:00
kern_malloc.c - Make the keg abstraction more complete. Permit a zone to have multiple 2009-01-25 09:11:24 +00:00
kern_mbuf.c Temporary workaround for the limitations of the mbuf flowid field: zero 2009-01-01 20:03:01 +00:00
kern_mib.c Mark most often used sysctl's as MPSAFE. 2009-01-28 19:58:05 +00:00
kern_module.c When the SYSINIT() to load a module invokes the MOD_LOAD event successfully, 2008-12-05 16:47:30 +00:00
kern_mtxpool.c Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
kern_mutex.c
kern_ntptime.c
kern_osd.c Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. 2008-11-17 20:49:29 +00:00
kern_physio.c
kern_pmc.c
kern_poll.c Order #includes - also to reduce diffs with vimage branches in p4. 2008-12-11 16:09:31 +00:00
kern_priv.c
kern_proc.c - Add conditional Giant locking around the vrele() in 2009-01-23 22:46:45 +00:00
kern_prot.c The userland_sysctl() function retries sysctl_root() until returned 2008-12-12 12:06:28 +00:00
kern_resource.c Don't rearm callout if the process is exiting, it may leak a callout 2008-10-24 01:09:24 +00:00
kern_rmlock.c
kern_rwlock.c add RW_SYSINIT_FLAGS macro and rw_sysinit_flags initialization function 2008-12-08 21:46:55 +00:00
kern_sdt.c
kern_sema.c
kern_shutdown.c It's possible that the dump device has gone away after it was 2008-11-23 21:05:22 +00:00
kern_sig.c Revert rev 184216 and 184199, due to the way the thread_lock works, 2008-11-05 03:01:23 +00:00
kern_subr.c
kern_switch.c
kern_sx.c
kern_synch.c - Implement generic macros for producing KTR records that are compatible 2009-01-17 07:17:57 +00:00
kern_syscalls.c
kern_sysctl.c Expand the scope of the sysctllock sx lock to protect the sysctl tree itself. 2009-02-06 14:51:32 +00:00
kern_tc.c
kern_thr.c Add sv_flags field to struct sysentvec with intention to provide description 2008-11-22 12:36:15 +00:00
kern_thread.c Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. 2008-11-17 20:49:29 +00:00
kern_time.c In realtimer_delete(), clear timer's value and interval to tell 2008-10-20 02:37:53 +00:00
kern_timeout.c Add explicit static DTrace tracing to the callout mechanism, capturing 2009-01-24 10:22:49 +00:00
kern_umtx.c
kern_uuid.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
kern_vimage.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
kern_xxx.c Fix compilation. Also move ogetkerninfo() to kern_xxx.c. 2008-12-29 19:24:00 +00:00
ksched.c
link_elf_obj.c Scanning all the formats for binary translation of modules loading can 2009-02-10 15:50:19 +00:00
link_elf.c Scanning all the formats for binary translation of modules loading can 2009-02-10 15:50:19 +00:00
linker_if.m
Make.tags.inc Catch up with the disappearance of sys/dev/hfa. 2008-12-01 14:34:42 +00:00
Makefile
makesyscalls.sh
md4c.c
md5c.c
p1003_1b.c
posix4_mib.c
sched_4bsd.c - Use __XSTRING where I want the define to be expanded. This resulted in 2009-01-25 07:35:10 +00:00
sched_ule.c - Use __XSTRING where I want the define to be expanded. This resulted in 2009-01-25 07:35:10 +00:00
serdev_if.m
stack_protector.c
subr_acl_posix1e.c Rename a variable missed in previous accmode_t-related commits. 2008-10-28 21:58:48 +00:00
subr_autoconf.c Prefer ANSI function definitions to K&R ones. 2009-02-03 07:52:07 +00:00
subr_blist.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
subr_bufring.c - bump __FreeBSD version to reflect added buf_ring, memory barriers, 2008-11-22 05:55:56 +00:00
subr_bus.c o Use NULL in pereference to 0 in pointer contexts. 2009-02-11 04:54:02 +00:00
subr_clist.c Remove a stale comment from the clists code. 2009-02-09 11:27:56 +00:00
subr_clock.c
subr_devstat.c Use NULL in preference to 0 in pointer contexts. 2009-02-03 07:54:42 +00:00
subr_disk.c Clarify and reimplement the bioq API so that bioq_disksort() has 2009-02-13 11:36:32 +00:00
subr_eventhandler.c
subr_fattime.c
subr_firmware.c Use NULL in preference to 0 for pointers. 2009-02-03 07:51:11 +00:00
subr_hints.c
subr_kdb.c
subr_kobj.c Use NULL in preference to 0 in pointer contexts. 2009-02-03 07:54:42 +00:00
subr_lock.c
subr_log.c
subr_mbpool.c
subr_mchain.c
subr_module.c
subr_msgbuf.c
subr_param.c Document the relationship between enum VM_GUEST and the vm_guest_sysctl_names 2008-12-30 23:49:54 +00:00
subr_pcpu.c - Implement generic macros for producing KTR records that are compatible 2009-01-17 07:17:57 +00:00
subr_power.c
subr_prf.c Use NULL in preference to 0 for pointers. 2009-02-03 07:51:11 +00:00
subr_prof.c Use ANSI function definition for profil. 2009-02-03 07:52:36 +00:00
subr_rman.c rman_debug should be static, so make it static. 2009-02-03 07:53:08 +00:00
subr_rtc.c int foo(void) is the proper ANSI function definition when there's no 2009-02-03 07:50:01 +00:00
subr_sbuf.c
subr_scanf.c
subr_sleepqueue.c Revision 184199 had not been fully reverted, add missing piece. 2008-12-01 01:54:55 +00:00
subr_smp.c Whitespace tweak. 2009-01-26 15:32:39 +00:00
subr_stack.c Make it possible to compile kernel with KTR but without DDB. 2008-10-30 21:48:28 +00:00
subr_taskqueue.c Check the exit flag at the start of the taskqueue loop rather than the end. It 2009-02-13 01:16:51 +00:00
subr_trap.c - Bug fix: prevent a thread from migrating between CPUs between the 2008-12-13 13:07:12 +00:00
subr_turnstile.c
subr_unit.c
subr_witness.c o Use unsigned for bit fields. 2009-02-03 07:50:41 +00:00
sys_generic.c Fix select on platforms where sizeof(long) != sizeof(int). This used 2009-02-02 03:34:40 +00:00
sys_pipe.c Several cleanups related to pipe(2). 2008-11-11 14:55:59 +00:00
sys_process.c Revert rev 184216 and 184199, due to the way the thread_lock works, 2008-11-05 03:01:23 +00:00
sys_socket.c Lock receive socket buffer in soo_stat() rather than commenting that we 2008-10-07 07:10:28 +00:00
syscalls.c Regenerate system call tables for r184789. 2008-11-09 10:48:06 +00:00
syscalls.master Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4. 2008-11-09 10:45:13 +00:00
systrace_args.c Regenerate system call tables for r184789. 2008-11-09 10:48:06 +00:00
sysv_ipc.c
sysv_msg.c
sysv_sem.c Lock the semaphore identifier lock during semaphore initialization to 2009-01-15 12:15:46 +00:00
sysv_shm.c
tty_compat.c
tty_info.c If a process is a zombie and we couldn't identify another useful state, 2009-01-29 09:32:56 +00:00
tty_inq.c Slightly improve the design of the TTY buffer. 2009-02-03 19:58:28 +00:00
tty_outq.c Slightly improve the design of the TTY buffer. 2009-02-03 19:58:28 +00:00
tty_pts.c Set PTS_FINISHED before waking up any threads. 2008-12-21 21:16:57 +00:00
tty_pty.c Remove unneeded use of device unit numbers from pty(4). 2009-01-25 08:27:11 +00:00
tty_tty.c
tty_ttydisc.c Don't forget to relock the TTY after uiomove() returns an error. 2008-11-12 09:04:44 +00:00
tty.c Serialize write() calls on TTYs. 2009-02-11 16:28:49 +00:00
uipc_accf.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
uipc_cow.c Extend the struct vm_page wire_count to u_int to avoid the overflow 2009-01-03 13:24:08 +00:00
uipc_debug.c Remove extra 'comma = 0' in socket state printing code, which otherwise 2009-02-09 18:19:58 +00:00
uipc_domain.c Remove Giant locking from domains list. 2009-01-04 19:22:53 +00:00
uipc_mbuf2.c
uipc_mbuf.c Teach m_copyback() to use trailing space of the last mbuf in chain. 2009-01-18 20:19:55 +00:00
uipc_mqueue.c Fix matching of message queues by name. 2008-11-28 14:53:18 +00:00
uipc_sem.c
uipc_shm.c Shared memory objects that have size which is not necessarily equal to 2008-12-01 22:33:50 +00:00
uipc_sockbuf.c Rewrite sbreserve_locked()'s comment on NULL thread pointers, eliminating 2008-10-07 09:51:39 +00:00
uipc_socket.c Don't allow creating a socket with a protocol family that the current 2009-02-05 14:15:18 +00:00
uipc_syscalls.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
uipc_usrreq.c White space and comment tweaks. 2009-01-01 20:03:22 +00:00
vfs_acl.c
vfs_aio.c Use the correct type for the timeout parameter to the 32-bit 2009-01-23 13:23:17 +00:00
vfs_bio.c Tweak the output of VOP_PRINT/vn_printf() some. 2009-02-06 20:06:48 +00:00
vfs_cache.c Convert the global mutex protecting the directory lookup name cache from a 2009-01-28 19:05:18 +00:00
vfs_cluster.c
vfs_default.c Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name 2008-12-12 00:57:38 +00:00
vfs_export.c drop rnh lock before destroying it 2008-12-28 14:32:27 +00:00
vfs_extattr.c Do not call namei() while having another user-controlled vnode 2009-01-08 12:47:30 +00:00
vfs_hash.c
vfs_init.c Expand the scope of the sysctllock sx lock to protect the sysctl tree itself. 2009-02-06 14:51:32 +00:00
vfs_lookup.c Do not return success and doomed vnode from lookup. LK_UPGRADE allows 2008-12-18 11:58:12 +00:00
vfs_mount.c Add more KTR_VFS logging point in order to have a more effective tracing. 2009-02-05 15:03:35 +00:00
vfs_subr.c Tweak the output of VOP_PRINT/vn_printf() some. 2009-02-06 20:06:48 +00:00
vfs_syscalls.c In some situations, mnt_lockref could go negative due to vfs_unbusy() being 2009-02-05 08:46:18 +00:00
vfs_vnops.c Move the code from ufs_lookup.c used to do dotdot lookup, into 2009-01-21 14:51:38 +00:00
vnode_if.src Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP: 2009-01-21 14:42:00 +00:00