Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/kern/vfs_aio.c

[BACK] Up to [FreeBSD] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.254: download - view: text, markup, annotated - select for diffs
Sun Feb 5 04:49:31 2012 UTC (4 days, 21 hours ago) by davidxu
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +1 -0 lines
SVN rev 231006 on 2012-02-05 04:49:31Z by davidxu

Add 32-bit compat code for AIO kevent flags introduced in revision 230857.

Revision 1.253: download - view: text, markup, annotated - select for diffs
Wed Feb 1 02:53:06 2012 UTC (8 days, 22 hours ago) by davidxu
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +7 -1 lines
SVN rev 230857 on 2012-02-01 02:53:06Z by davidxu

If multiple threads call kevent() to get AIO events on same kqueue fd,
it is possible that a single AIO event will be reported to multiple
threads, it is not threading friendly, and the existing API can not
control this behavior.
Allocate a kevent flags field sigev_notify_kevent_flags for AIO event
notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH
or EV_ONESHOT to AIO kernel code, user can control whether the event
should be cleared once it is retrieved by a thread. This change should
be comptaible with existing application, because the field should have
already been zero-filled, and no additional action will be taken by
kernel.

PR:	kern/156567

Revision 1.252: download - view: text, markup, annotated - select for diffs
Mon Jan 30 19:19:22 2012 UTC (10 days, 6 hours ago) by ambrisko
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +12 -6 lines
SVN rev 230778 on 2012-01-30 19:19:22Z by ambrisko

When detaching an AIO or LIO requests grab the lock and tell knlist_remove
that we have the lock now.  This cleans up a locking panic ASSERT when
knlist_empty is called without a lock when INVARIANTS etc. are turned.

Reviewed by:	kib jhb
MFC after:	1 week

Revision 1.251: download - view: text, markup, annotated - select for diffs
Fri Jan 27 08:58:58 2012 UTC (13 days, 16 hours ago) by glebius
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +1 -1 lines
SVN rev 230610 on 2012-01-27 08:58:58Z by glebius

Fix size check, that prevents getting negative after casting
to a signed type

Reviewed by:	bde

Revision 1.250: download - view: text, markup, annotated - select for diffs
Thu Jan 26 11:59:48 2012 UTC (2 weeks ago) by glebius
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +6 -0 lines
SVN rev 230583 on 2012-01-26 11:59:48Z by glebius

Although aio_nbytes is size_t, later is is signed to
casted types: to ssize_t in filesystem code and to
int in buf code, thus supplying a negative argument
leads to kernel panic later. To fix that check user
supplied argument in the beginning of syscall.

Submitted by:	Maxim Dounin <mdounin mdounin.ru>, maxim@

Revision 1.249.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.249.2.1: preferred, colored; next MAIN 1.250: preferred, colored
Changes since revision 1.249.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.249.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.249: preferred, colored; next MAIN 1.250: preferred, colored
Changes since revision 1.249: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.249: download - view: text, markup, annotated - select for diffs
Fri Sep 16 13:58:51 2011 UTC (4 months, 3 weeks ago) by kmacy
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +15 -15 lines
SVN rev 225617 on 2011-09-16 13:58:51Z by kmacy

In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by:	rwatson
Approved by:	re (bz)

Revision 1.248: download - view: text, markup, annotated - select for diffs
Thu Aug 11 12:30:23 2011 UTC (6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +19 -10 lines
SVN rev 224778 on 2011-08-11 12:30:23Z by rwatson

Second-to-last commit implementing Capsicum capabilities in the FreeBSD
kernel for FreeBSD 9.0:

Add a new capability mask argument to fget(9) and friends, allowing system
call code to declare what capabilities are required when an integer file
descriptor is converted into an in-kernel struct file *.  With options
CAPABILITIES compiled into the kernel, this enforces capability
protection; without, this change is effectively a no-op.

Some cases require special handling, such as mmap(2), which must preserve
information about the maximum rights at the time of mapping in the memory
map so that they can later be enforced in mprotect(2) -- this is done by
narrowing the rights in the existing max_protection field used for similar
purposes with file permissions.

In namei(9), we assert that the code is not reached from within capability
mode, as we're not yet ready to enforce namespace capabilities there.
This will follow in a later commit.

Update two capability names: CAP_EVENT and CAP_KEVENT become
CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they
represent.

Approved by:	re (bz)
Submitted by:	jonathan
Sponsored by:	Google Inc

Revision 1.233.2.5.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.233.2.5: preferred, colored; next MAIN 1.233.4.1: preferred, colored
Changes since revision 1.233.2.5: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.243.2.3.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.243.2.3: preferred, colored; next MAIN 1.244: preferred, colored
Changes since revision 1.243.2.3: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.247: download - view: text, markup, annotated - select for diffs
Sat Oct 9 02:50:23 2010 UTC (16 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +8 -4 lines
SVN rev 213642 on 2010-10-09 02:50:23Z by davidxu

Create a global thread hash table to speed up thread lookup, use
rwlock to protect the table. In old code, thread lookup is done with
process lock held, to find a thread, kernel has to iterate through
process and thread list, this is quite inefficient.
With this change, test shows in extreme case performance is
dramatically improved.

Earlier patch was reviewed by: jhb, julian

Revision 1.243.2.3.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.243.2.3: preferred, colored; next MAIN 1.244: preferred, colored
Changes since revision 1.243.2.3: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.243.2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 7 14:50:58 2010 UTC (22 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP
Branch point for: RELENG_8_2, RELENG_8_1
Diff to: previous 1.243.2.2: preferred, colored; branchpoint 1.243: preferred, colored; next MAIN 1.244: preferred, colored
Changes since revision 1.243.2.2: +59 -33 lines
SVN rev 206352 on 2010-04-07 14:50:58Z by kib

MFC r205326:
Convert aio syscall registration to SYSCALL_INIT_HELPER.

Revision 1.243.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 7 02:24:41 2010 UTC (22 months ago) by nwhitehorn
Branches: RELENG_8
Diff to: previous 1.243.2.1: preferred, colored; branchpoint 1.243: preferred, colored
Changes since revision 1.243.2.1: +1 -1 lines
SVN rev 206336 on 2010-04-07 02:24:41Z by nwhitehorn

MFC r205014,205015:

Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
of the kernel and enhances the freebsd32 compatibility code to support
big-endian platforms.

This MFC is required for MFCs of later changes to the freebsd32
compatibility from HEAD.

Requested by:	kib

Revision 1.246: download - view: text, markup, annotated - select for diffs
Fri Mar 19 11:11:34 2010 UTC (22 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +59 -33 lines
SVN rev 205326 on 2010-03-19 11:11:34Z by kib

Convert aio syscall registration to SYSCALL_INIT_HELPER.

Reviewed by:	jhb
MFC after:	2 weeks

Revision 1.245: download - view: text, markup, annotated - select for diffs
Thu Mar 11 14:49:06 2010 UTC (23 months ago) by nwhitehorn
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +1 -1 lines
SVN rev 205014 on 2010-03-11 14:49:06Z by nwhitehorn

Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
of the kernel and enhances the freebsd32 compatibility code to support
big-endian platforms.

Reviewed by:	kib, jhb

Revision 1.233.2.5.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.233.2.5: preferred, colored; next MAIN 1.233.4.1: preferred, colored
Changes since revision 1.233.2.5: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.233.2.5: download - view: text, markup, annotated - select for diffs
Fri Jan 22 17:02:07 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP
Branch point for: RELENG_7_4, RELENG_7_3
Diff to: previous 1.233.2.4: preferred, colored; branchpoint 1.233: preferred, colored; next MAIN 1.234: preferred, colored
Changes since revision 1.233.2.4: +2 -2 lines
SVN rev 202814 on 2010-01-22 17:02:07Z by jhb

MFC 193951:
Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
vnode interlock to protect the knote fields. The locking assumes
that shared vnode lock is held, thus we get exclusive access to knote
either by exclusive vnode lock protection, or by shared vnode lock +
vnode interlock.

Unlike the change in HEAD, this does not remove kl_locked() and replace it
with kl_assert_locked() and kl_assert_unlocked().  Instead, the kl_locked
can now be set to NULL in which case no assertion checks are performed on
the lock.  The vfs kqfilter code uses this mode to disable assertion checks.
This preserves the existing ABI for knlist_init().

Add convenience function knlist_init_mtx to reduce number of arguments
for typical knlist initialization.

Reviewed by:	kib

Revision 1.243.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.243.2.1: preferred, colored; next MAIN 1.243.2.2: preferred, colored
Changes since revision 1.243.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.244: download - view: text, markup, annotated - select for diffs
Sat Sep 12 20:03:45 2009 UTC (2 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +12 -4 lines
SVN rev 197134 on 2009-09-12 20:03:45Z by rwatson

Use C99 initialization for struct filterops.

Obtained from:	Mac OS X
Sponsored by:	Apple Inc.
MFC after:	3 weeks

Revision 1.243.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.243: download - view: text, markup, annotated - select for diffs
Wed Jun 10 20:59:32 2009 UTC (2 years, 8 months ago) by kib
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +2 -2 lines
SVN rev 193951 on 2009-06-10 20:59:32Z by kib

Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
vnode interlock to protect the knote fields [1]. The locking assumes
that shared vnode lock is held, thus we get exclusive access to knote
either by exclusive vnode lock protection, or by shared vnode lock +
vnode interlock.

Do not use kl_locked() method to assert either lock ownership or the
fact that curthread does not own the lock. For shared locks, ownership
is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared
lock not owned by curthread, causing false positives in kqueue subsystem
assertions about knlist lock.

Remove kl_locked method from knlist lock vector, and add two separate
assertion methods kl_assert_locked and kl_assert_unlocked, that are
supposed to use proper asserts. Change knlist_init accordingly.

Add convenience function knlist_init_mtx to reduce number of arguments
for typical knlist initialization.

Submitted by:	jhb [1]
Noted by:	jhb [2]
Reviewed by:	jhb
Tested by:	rnoland

Revision 1.242: download - view: text, markup, annotated - select for diffs
Mon Jun 1 21:17:03 2009 UTC (2 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +1 -2 lines
SVN rev 193272 on 2009-06-01 21:17:03Z by jhb

Rework socket upcalls to close some races with setup/teardown of upcalls.
- Each socket upcall is now invoked with the appropriate socket buffer
  locked.  It is not permissible to call soisconnected() with this lock
  held; however, so socket upcalls now return an integer value.  The two
  possible values are SU_OK and SU_ISCONNECTED.  If an upcall returns
  SU_ISCONNECTED, then the soisconnected() will be invoked on the
  socket after the socket buffer lock is dropped.
- A new API is provided for setting and clearing socket upcalls.  The
  API consists of soupcall_set() and soupcall_clear().
- To simplify locking, each socket buffer now has a separate upcall.
- When a socket upcall returns SU_ISCONNECTED, the upcall is cleared from
  the receive socket buffer automatically.  Note that a SO_SND upcall
  should never return SU_ISCONNECTED.
- All this means that accept filters should now return SU_ISCONNECTED
  instead of calling soisconnected() directly.  They also no longer need
  to explicitly clear the upcall on the new socket.
- The HTTP accept filter still uses soupcall_set() to manage its internal
  state machine, but other accept filters no longer have any explicit
  knowlege of socket upcall internals aside from their return value.
- The various RPC client upcalls currently drop the socket buffer lock
  while invoking soreceive() as a temporary band-aid.  The plan for
  the future is to add a new flag to allow soreceive() to be called with
  the socket buffer locked.
- The AIO callback for socket I/O is now also invoked with the socket
  buffer locked.  Previously sowakeup() would drop the socket buffer
  lock only to call aio_swake() which immediately re-acquired the socket
  buffer lock for the duration of the function call.

Discussed with:	rwatson, rmacklem

Revision 1.233.2.4.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.233.2.4: preferred, colored; next MAIN 1.233.2.5: preferred, colored
Changes since revision 1.233.2.4: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.233.2.4: download - view: text, markup, annotated - select for diffs
Mon Jan 26 15:39:42 2009 UTC (3 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.233.2.3: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.3: +1 -1 lines
SVN rev 187720 on 2009-01-26 15:39:42Z by jhb

MFC: Use the correct type for the timeout parameter to the 32-bit
compat version aio_waitcomplete().

Revision 1.241: download - view: text, markup, annotated - select for diffs
Fri Jan 23 13:23:17 2009 UTC (3 years ago) by jhb
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +1 -1 lines
SVN rev 187631 on 2009-01-23 13:23:17Z by jhb

Use the correct type for the timeout parameter to the 32-bit
compat version aio_waitcomplete().

Reminded by:	bz
Submitted by:	jamie
MFC after:	3 days

Revision 1.233.2.3: download - view: text, markup, annotated - select for diffs
Wed Jan 21 18:52:33 2009 UTC (3 years ago) by jhb
Branches: RELENG_7
Diff to: previous 1.233.2.2: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.2: +755 -126 lines
SVN rev 187559 on 2009-01-21 18:52:33Z by jhb

MFC: Add 32-bit compat system calls for VFS_AIO.

Revision 1.240: download - view: text, markup, annotated - select for diffs
Wed Dec 10 20:56:19 2008 UTC (3 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +755 -126 lines
SVN rev 185878 on 2008-12-10 20:56:19Z by jhb

- Add 32-bit compat system calls for VFS_AIO.  The system calls live in the
  aio code and are registered via the recently added SYSCALL32_*() helpers.
- Since the aio code likes to invoke fuword and suword a lot down in the
  "bowels" of system calls, add a structure holding a set of operations for
  things like storing errors, copying in the aiocb structure, storing
  status, etc.  The 32-bit system calls use a separate operations vector to
  handle fuword32 vs fuword, etc.  Also, the oldsigevent handling is now
  done by having seperate operation vectors with different aiocb copyin
  routines.
- Split out kern_foo() functions for the various AIO system calls so the
  32-bit front ends can manage things like copying in and converting
  timespec structures, etc.
- For both the native and 32-bit aio_suspend() and lio_listio() calls,
  just use copyin() to read the array of aiocb pointers instead of using
  a for loop that iterated over fuword/fuword32.  The error handling in
  the old case was incomplete (lio_listio() just ignored any aiocb's that
  it got an EFAULT trying to read rather than reporting an error), and
  possibly slower.

MFC after:	1 month

Revision 1.195.2.5: download - view: text, markup, annotated - select for diffs
Mon Dec 1 19:29:47 2008 UTC (3 years, 2 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.195.2.4: preferred, colored; branchpoint 1.195: preferred, colored; next MAIN 1.196: preferred, colored
Changes since revision 1.195.2.4: +38 -12 lines
SVN rev 185528 on 2008-12-01 19:29:47Z by jhb

Expand the scope of the 'aio_freeproc_mtx' lock to protect the aio data
structures used in the socket upcall.  This removes the need for Giant to
be held for the aio socket upcall and thus the need for NET_NEEDS_GIANT()
for AIO in 6.x.  Note that this is not an MFC of the locking in 7.x+ as
the AIO code in 7.x is substantially different from that in 6.x.

Revision 1.233.2.2.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.233.2.2: preferred, colored; next MAIN 1.233.2.3: preferred, colored
Changes since revision 1.233.2.2: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.195.2.4.6.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.195.2.4: preferred, colored; next MAIN 1.195.2.5: preferred, colored
Changes since revision 1.195.2.4: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.233.2.2: download - view: text, markup, annotated - select for diffs
Wed Jul 30 13:19:50 2008 UTC (3 years, 6 months ago) by rwatson
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.233.2.1: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.1: +2 -0 lines
SVN rev 180996 on 2008-07-30 13:19:50Z by rwatson

Merge r175870 from head to stable/7:

  Use FEATURE() macro to advertise aio availability.

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sat Jun 21 11:34:34 2008 UTC (3 years, 7 months ago) by gonzo
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +1 -1 lines
SVN rev 179908 on 2008-06-21 11:34:34Z by gonzo

Use minimum of max_aio_procs and target_aio_procs when spawning new
aiod since there should be no more then max_aio_procs processes.

Revision 1.238: download - view: text, markup, annotated - select for diffs
Fri Feb 1 11:59:14 2008 UTC (4 years ago) by rwatson
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +2 -0 lines
Use FEATURE() macro to advertise aio availability.

Revision 1.233.4.1: download - view: text, markup, annotated - select for diffs
Mon Jan 28 10:43:10 2008 UTC (4 years ago) by dumbbell
Branches: RELENG_7_0
CVS tags: RELENG_7_0_0_RELEASE
Diff to: previous 1.233: preferred, colored; next MAIN 1.234: preferred, colored
Changes since revision 1.233: +6 -4 lines
MFC:
  sys/kern/vfs_aio.c; revision 1.237
  sys/sys/event.h; revision 1.38

  When asked to use kqueue, AIO stores its internal state in the
  `kn_sdata' member of the newly registered knote. The problem is that
  this member is overwritten by a call to kevent(2) with the EV_ADD flag,
  targetted at the same kevent/knote. For instance, a userland application
  may set the pointer to NULL, leading to a panic.

  A testcase was provided by the submitter.

  PR:	kern/118911
  Submitted by:	MOROHOSHI Akihiko <moro@remus.dti.ne.jp>

Approved by:	re (kensmith)

Revision 1.233.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 28 10:26:24 2008 UTC (4 years ago) by dumbbell
Branches: RELENG_7
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +6 -4 lines
MFC:
  sys/kern/vfs_aio.c; revision 1.237
  sys/sys/event.h; revision 1.38

  When asked to use kqueue, AIO stores its internal state in the
  `kn_sdata' member of the newly registered knote. The problem is that
  this member is overwritten by a call to kevent(2) with the EV_ADD flag,
  targetted at the same kevent/knote. For instance, a userland application
  may set the pointer to NULL, leading to a panic.

  A testcase was provided by the submitter.

  PR:	kern/118911
  Submitted by:	MOROHOSHI Akihiko <moro@remus.dti.ne.jp>

Revision 1.237: download - view: text, markup, annotated - select for diffs
Thu Jan 24 17:10:19 2008 UTC (4 years ago) by dumbbell
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +6 -4 lines
When asked to use kqueue, AIO stores its internal state in the
`kn_sdata' member of the newly registered knote. The problem is that
this member is overwritten by a call to kevent(2) with the EV_ADD flag,
targetted at the same kevent/knote. For instance, a userland application
may set the pointer to NULL, leading to a panic.

A testcase was provided by the submitter.

PR:	kern/118911
Submitted by:	MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
MFC after:	1 day

Revision 1.236: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:09 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +1 -1 lines
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>

Revision 1.235: download - view: text, markup, annotated - select for diffs
Thu Jan 10 01:10:52 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +1 -1 lines
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina <siarodx at gmail dot com>,
		Andrea Di Pasquale <whyx dot it at gmail dot com>

Revision 1.234: download - view: text, markup, annotated - select for diffs
Sat Oct 20 23:23:21 2007 UTC (4 years, 3 months ago) by julian
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +2 -2 lines
Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.

Revision 1.233: download - view: text, markup, annotated - select for diffs
Mon Aug 20 11:53:26 2007 UTC (4 years, 5 months ago) by kib
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP
Branch point for: RELENG_7_0, RELENG_7
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +5 -1 lines
Destroy the kaio_mtx on the freeing the struct kaioinfo in the
aio_proc_rundown.

Do not allow for zero-length read to be passed to the fo_read file method
by aio.

Reported and tested by:	Peter Holm
Approved by:	re (kensmith)

Revision 1.232: download - view: text, markup, annotated - select for diffs
Sun Jun 10 01:50:05 2007 UTC (4 years, 8 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +0 -1 lines
Remove unused variable.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Fri Jun 1 01:12:44 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +8 -10 lines
 - Move rusage from being per-process in struct pstats to per-thread in
   td_ru.  This removes the requirement for per-process synchronization in
   statclock() and mi_switch().  This was previously supported by
   sched_lock which is going away.  All modifications to rusage are now
   done in the context of the owning thread.  reads proceed without locks.
 - Aggregate exiting threads rusage in thread_exit() such that the exiting
   thread's rusage is not lost.
 - Provide a new routine, rufetch() to fetch an aggregate of all rusage
   structures from all threads in a process.  This routine must be used
   in any place requiring a rusage from a process prior to it's exit.  The
   exited process's rusage is still available via p_ru.
 - Aggregate tick statistics only on demand via rufetch() or when a thread
   exits.  Tick statistics are kept in the thread and protected by sched_lock
   until it exits.

Initial patch by:	attilio
Reviewed by:		attilio, bde (some objections), arch (mostly silent)

Revision 1.230: download - view: text, markup, annotated - select for diffs
Mon Mar 5 13:10:58 2007 UTC (4 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +3 -3 lines
Further system call comment cleanup:

- Remove also "MP SAFE" after prior "MPSAFE" pass. (suggested by bde)
- Remove extra blank lines in some cases.
- Add extra blank lines in some cases.
- Remove no-op comments consisting solely of the function name, the word
  "syscall", or the system call name.
- Add punctuation.
- Re-wrap some comments.

Revision 1.229: download - view: text, markup, annotated - select for diffs
Sat Nov 11 16:26:56 2006 UTC (5 years, 3 months ago) by trhodes
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +1 -1 lines
Merge posix4/* into normal kernel hierarchy.

Reviewed by:	glanced at by jhb
Approved by:	silence on -arch@ and -standards@

Revision 1.228: download - view: text, markup, annotated - select for diffs
Sun Oct 15 14:22:13 2006 UTC (5 years, 3 months ago) by netchild
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +4 -4 lines
MFP4 (with some minor changes):

Implement the linux_io_* syscalls (AIO). They are only enabled if the native
AIO code is available (either compiled in to the kernel or as a module) at
the time the functions are used. If the AIO stuff is not available there
will be a ENOSYS.

From the submitter:
---snip---
DESIGN NOTES:

1. Linux permits a process to own multiple AIO queues (distinguished by
   "context"), but FreeBSD creates only one single AIO queue per process.
   My code maintains a request queue (STAILQ of queue(3)) per "context",
   and throws all AIO requests of all contexts owned by a process into
   the single FreeBSD per-process AIO queue.

   When the process calls io_destroy(2), io_getevents(2), io_submit(2) and
   io_cancel(2), my code can pick out requests owned by the specified context
   from the single FreeBSD per-process AIO queue according to the per-context
   request queues maintained by my code.

2. The request queue maintained by my code stores contrast information between
   Linux IO control blocks (struct linux_iocb) and FreeBSD IO control blocks
   (struct aiocb). FreeBSD IO control block actually exists in userland memory
   space, required by FreeBSD native aio_XXXXXX(2).

3. It is quite troubling that the function io_getevents() of libaio-0.3.105
   needs to use Linux-specific "struct aio_ring", which is a partial mirror
   of context in user space. I would rather take the address of context in
   kernel as the context ID, but the io_getevents() of libaio forces me to
   take the address of the "ring" in user space as the context ID.

   To my surprise, one comment line in the file "io_getevents.c" of
   libaio-0.3.105 reads:

             Ben will hate me for this

REFERENCE:

1. Linux kernel source code:   http://www.kernel.org/pub/linux/kernel/v2.6/
   (include/linux/aio_abi.h, fs/aio.c)

2. Linux manual pages:         http://www.kernel.org/pub/linux/docs/manpages/
   (io_setup(2), io_destroy(2), io_getevents(2), io_submit(2), io_cancel(2))

3. Linux Scalability Effort:   http://lse.sourceforge.net/io/aio.html
   The design notes:           http://lse.sourceforge.net/io/aionotes.txt

4. The package libaio, both source and binary:
       http://rpmfind.net/linux/rpm2html/search.php?query=libaio
   Simple transparent interface to Linux AIO system calls.

5. Libaio-oracle:              http://oss.oracle.com/projects/libaio-oracle/
   POSIX AIO implementation based on Linux AIO system calls (depending on
   libaio).
---snip---

Submitted by:	Li, Xiao <intron@intron.ac>

Revision 1.227: download - view: text, markup, annotated - select for diffs
Sun Sep 24 04:47:47 2006 UTC (5 years, 4 months ago) by jmg
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +6 -33 lines
hide kqueue_register from public view, and replace it w/ kqfd_register...
this eliminates a possible race in aio registering a kevent..

Revision 1.195.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 9 01:30:11 2006 UTC (5 years, 5 months ago) by mp
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Branch point for: RELENG_6_4
Diff to: previous 1.195.2.3: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.3: +0 -6 lines
MFC:

Remove call to fdfree() for the AIO daemons to prevent kernel panics
with linprocfs. This call is not needed since file descriptor sharing
was removed in v1.125.

Revision 1.226: download - view: text, markup, annotated - select for diffs
Wed Sep 6 15:11:20 2006 UTC (5 years, 5 months ago) by mp
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +0 -6 lines
Remove call to fdfree() for the AIO daemons to prevent kernel panics
with linprocfs. This call is not needed since file descriptor sharing
was removed in v1.125.

Reviewed by:	alc, davidxu, ambrisko
MFC after:	3 days

Revision 1.225: download - view: text, markup, annotated - select for diffs
Tue Aug 15 12:10:57 2006 UTC (5 years, 5 months ago) by netchild
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +8 -1 lines
- Change process_exec function handlers prototype to include struct
  image_params arg.
- Change struct image_params to include struct sysentvec pointer and
  initialize it.
- Change all consumers of process_exit/process_exec eventhandlers to
  new prototypes (includes splitting up into distinct exec/exit functions).
- Add eventhandler to userret.

Sponsored by:		Google SoC 2006
Submitted by:		rdivacky
Parts suggested by:	jhb (on hackers@)

Revision 1.224: download - view: text, markup, annotated - select for diffs
Fri Jun 2 17:45:48 2006 UTC (5 years, 8 months ago) by ambrisko
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +1 -1 lines
Make lio ident more consistant with aio ident.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Tue May 9 00:10:11 2006 UTC (5 years, 9 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +69 -51 lines
Use a dedicated mutex to protect aio queues, the movation is to reduce
lock contention with other parts.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Fri Mar 24 00:50:06 2006 UTC (5 years, 10 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +51 -77 lines
1. Move code for scanning pending I/O from aio_fsync to aio_aqueue,
   it has less overhead.
2. Avoid scheduling task if maximum number of I/O threads is reached.

Revision 1.221: download - view: text, markup, annotated - select for diffs
Thu Mar 23 08:46:42 2006 UTC (5 years, 10 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +244 -78 lines
Implement aio_fsync() syscall.

Revision 1.195.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 27 00:01:15 2006 UTC (5 years, 11 months ago) by davidxu
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.195.2.2: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.2: +3 -0 lines
MFC revision 1.219.

Approved by: re (scottl)

Revision 1.220: download - view: text, markup, annotated - select for diffs
Sun Feb 26 12:56:23 2006 UTC (5 years, 11 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +17 -19 lines
1. Remove aio entry from lists earlier in aio_free_entry,
   so other threads can not see it if we unlock the proc
   lock (this can happen in knlist_delete).  Don't do wakeup,
   it is not necessary.

2. Decrease kaio_buffer_count in biohelper rather than
   doing it in aio_bio_done_notify.

3. In aio_bio_done_notify, don't send notification if KAIO_RUNDOWN
   was set, because the process is already in single thread mode.

4. Use assignment to initialize aiothreadflags.

5. AIOCBLIST_RUNDOWN is not useful, axe the code using it.

6. use LIO_NOP instead of zero.

Revision 1.219: download - view: text, markup, annotated - select for diffs
Wed Feb 22 00:05:12 2006 UTC (5 years, 11 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +3 -0 lines
If block size is zero, use normal file operations to do I/O,
this eliminates a divided-by-zero fault.

Recommended by: phk

Revision 1.218: download - view: text, markup, annotated - select for diffs
Fri Jan 27 08:02:25 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +2 -0 lines
Just like dofilewrite(), call bwillwrite before fo_write.

Revision 1.217: download - view: text, markup, annotated - select for diffs
Fri Jan 27 04:14:16 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +0 -1 lines
return final error code in aio_return rather than a hardcoded 0.

Revision 1.216: download - view: text, markup, annotated - select for diffs
Thu Jan 26 08:37:02 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -3 lines
in aio_aqueue, store same return code into job->_aiocb_private.error.
in aio_return, unlock proc lock before suword.

Revision 1.215: download - view: text, markup, annotated - select for diffs
Tue Jan 24 07:24:24 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +126 -125 lines
Add locking annotation and comments about socket, pipe, fifo problem.
Temporarily fix a locking problem for socket I/O.

Revision 1.214: download - view: text, markup, annotated - select for diffs
Tue Jan 24 02:50:42 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +1 -0 lines
Er, rescure a deleted comment line.

Revision 1.213: download - view: text, markup, annotated - select for diffs
Tue Jan 24 02:46:15 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +9 -11 lines
More cleanup for aio code:
1) unregsiter kqueue filter for EVFILT_LIO.
2) free uma_zones.
3) call setsid directly to enter another session rather than
   implementing by itself.

Submitted by: jhb

Revision 1.212: download - view: text, markup, annotated - select for diffs
Mon Jan 23 23:46:30 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +1 -1 lines
Add bracket.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Mon Jan 23 10:27:15 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +18 -3 lines
Verify all supported notification types.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Mon Jan 23 02:49:34 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +29 -45 lines
1) Merge _aio_aqueue and aio_aqueue, check quota in aio_aqueue,
   so that lio_listio won't exceed the quota.
2) Remove lio_ref_count, it is no longer used.

Revision 1.209: download - view: text, markup, annotated - select for diffs
Sun Jan 22 09:39:59 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +1 -1 lines
Fix a bogus panic.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sun Jan 22 09:25:52 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +5 -2 lines
Decrease kaio_active_count first, because user process may go away
after we notified it.

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sun Jan 22 05:59:27 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +573 -842 lines
Make aio code MP safe.

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sun Jan 15 01:55:45 2006 UTC (6 years ago) by csjp
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +2 -2 lines
Initialize ki to p->p_aioinfo after we know it's going to be referencing
a valid kaioinfo structure. This avoids a potential NULL pointer dereference.

Found with:	Coverity Prevent(tm)
MFC after:	2 weeks

Revision 1.205: download - view: text, markup, annotated - select for diffs
Fri Jan 6 16:34:22 2006 UTC (6 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +1 -1 lines
Return error from fget_write() rather than hardcoding EBADF now that
fget_write() DTRT.

Requested by:	bde

Revision 1.204: download - view: text, markup, annotated - select for diffs
Tue Nov 8 23:48:32 2005 UTC (6 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +1 -1 lines
In aio_waitcomplete, do not return EAGAIN if no other threads
have started aio, instead, initialize aio management structure
if it hasn't been done, the reason to adjust this behavior is
to make it a bit friendly for threaded program, consider two
threads, one submits aio_write, and another just calls
aio_waitcomplete to wait any I/O to be completed and recycle the
aio requests, before submitter doing any I/O, the recycler wants
to wait in kernel. This also fixes inconsistency with other aio
syscalls.

Revision 1.203: download - view: text, markup, annotated - select for diffs
Tue Nov 8 17:43:05 2005 UTC (6 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +84 -80 lines
Various and sundry cleanups:
- Use curthread for calls to knlist_delete() and add a big comment
  explaining why as well as appropriate assertions.
- Use TAILQ_FOREACH and TAILQ_FOREACH_SAFE instead of handrolling them.
- Use fget() family of functions to lookup file objects instead of
  grovelling around in file descriptor tables.
- Destroy the aio_freeproc mutex if we are unloaded.

Tested on:	i386

Revision 1.195.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 8 16:08:40 2005 UTC (6 years, 3 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.195.2.1: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.1: +0 -2 lines
MFC: Push down Giant into fdfree() and remove it from two of the callers.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Fri Nov 4 09:39:17 2005 UTC (6 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +2 -2 lines
Fix name compatible problem with POSIX standard. the sigval_ptr and
sigval_int really should be sival_ptr and sival_int.
Also sigev_notify_function accepts a union sigval value but not a
pointer.

Revision 1.201: download - view: text, markup, annotated - select for diffs
Thu Nov 3 05:25:26 2005 UTC (6 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +40 -8 lines
Support sending realtime signal information via signal queue, realtime
signal memory is pre-allocated, so kernel can always notify user code.

Revision 1.200: download - view: text, markup, annotated - select for diffs
Tue Nov 1 17:13:05 2005 UTC (6 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +0 -2 lines
Push down Giant into fdfree() and remove it from two of the callers.
Other callers such as some rfork() cases weren't locking Giant anyway.

Reviewed by:	csjp
MFC after:	1 week

Revision 1.199: download - view: text, markup, annotated - select for diffs
Sun Oct 30 02:12:49 2005 UTC (6 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +63 -9 lines
Fix sigevent's POSIX incompatible problem by adding member fields
sigev_notify_function and sigev_notify_attributes. AIO syscalls
use sigevent, so they have to be adjusted.

Reviewed by:	alc

Revision 1.198: download - view: text, markup, annotated - select for diffs
Wed Oct 12 22:33:22 2005 UTC (6 years, 3 months ago) by ambrisko
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +0 -6 lines
Fix tinderbox box by removing incomplete/bad spl usage.  Proper giant free
locking is required in for aio.

Pointed out by:	imp

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Oct 12 17:51:31 2005 UTC (6 years, 3 months ago) by ambrisko
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +198 -121 lines
Add in kqueue support to LIO event notification and fix how it handled
notifications when LIO operations completed.  These were the problems
with LIO event complete notification:
      -	Move all LIO/AIO event notification into one general function
	so we don't have bugs in different data paths.  This unification
	got rid of several notification bugs one of which if kqueue was
	used a SIGILL could get sent to the process.
      -	Change the LIO event accounting to count all AIO request that
	could have been split across the fast path and daemon mode.
	The prior accounting only kept track of AIO op's in that
	mode and not the entire list of operations.  This could cause
	a bogus LIO event complete notification to occur when all of
	the fast path AIO op's completed and not the AIO op's that
	ended up queued for the daemon.

Suggestions from:	alc

Revision 1.195.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 20 06:07:54 2005 UTC (6 years, 5 months ago) by alc
Branches: RELENG_6
CVS tags: RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +1 -0 lines
MFC
 Eliminate inconsistency in the setting of the B_DONE flag.

Approved by:	re (kensmith)

Revision 1.196: download - view: text, markup, annotated - select for diffs
Wed Jul 20 19:06:06 2005 UTC (6 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +1 -0 lines
Eliminate inconsistency in the setting of the B_DONE flag.  Specifically,
make the b_iodone callback responsible for setting it if it is needed.
Previously, it was set unconditionally by bufdone() without holding
whichever lock is shared by the b_iodone callback and the corresponding
top-half function.  Consequently, in a race, the top-half function could
conclude that operation was done before the b_iodone callback finished.
See, for example, aio_physwakeup() and aio_fphysio().

Note: I don't believe that the other, more widely-used b_iodone callbacks
are affected.

Discussed with: jeff
Reviewed by: phk
MFC after: 2 weeks

Revision 1.195: download - view: text, markup, annotated - select for diffs
Fri Jul 1 16:28:30 2005 UTC (6 years, 7 months ago) by ssouhlal
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +1 -1 lines
Fix the recent panics/LORs/hangs created by my kqueue commit by:

- Introducing the possibility of using locks different than mutexes
for the knlist locking. In order to do this, we add three arguments to
knlist_init() to specify the functions to use to lock, unlock and
check if the lock is owned. If these arguments are NULL, we assume
mtx_lock, mtx_unlock and mtx_owned, respectively.

- Using the vnode lock for the knlist locking, when doing kqueue operations
on a vnode. This way, we don't have to lock the vnode while holding a
mutex, in filt_vfsread.

Reviewed by:	jmg
Approved by:	re (scottl), scottl (mentor override)
Pointyhat to:	ssouhlal
Will be happy:	everyone

Revision 1.194: download - view: text, markup, annotated - select for diffs
Tue Jun 7 05:28:21 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +2 -1 lines
In lio_listio(2) change jobref from an int to a long so that
lio_listio(LIO_WAIT, ...) works correctly on 64-bit architectures.

Reviewed by: tegge

Revision 1.193: download - view: text, markup, annotated - select for diffs
Sun Jun 5 05:41:48 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +0 -2 lines
Eliminate an unused field from struct aio_liojob.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Sat Jun 4 19:16:33 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +14 -58 lines
Eliminate the original method of requesting notification of aio_read(2) and
aio_write(2) completion through kevent(2).  This method does not work on
64-bit architectures.  It was deprecated in FreeBSD 4.4.  See revisions
1.87 and 1.70.2.7.

Change aio_physwakeup() to call psignal(9) directly rather than indirectly
through a timeout(9).  Discussed with: bde

Correct a bug introduced in revision 1.65 that could result in premature
delivery of a signal if an lio_listio(2) consisted of a mixture of
direct/raw and queued I/O operations.  Observed by: tegge

Eliminate a field from struct kaioinfo that is now unused.

Reviewed by: tegge

Revision 1.191: download - view: text, markup, annotated - select for diffs
Fri Jun 3 05:27:20 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +19 -2 lines
Synchronize access to the per process aiocb lists in many of the functions.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Thu Jun 2 23:14:38 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +4 -2 lines
In aio_waitcomplete() correct two cases of using an aiocb after freeing it.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Mon May 30 22:26:34 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +21 -12 lines
Synchronize access to aio_freeproc with a mutex.  Eliminate related spl
calls.

Reduce the scope of Giant in aio_daemon().

Revision 1.188: download - view: text, markup, annotated - select for diffs
Mon May 30 19:33:33 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +21 -16 lines
Use the proc mtx to prevent simultaneous changes to p_aioinfo.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Mon May 30 18:02:00 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +1 -12 lines
Eliminate unnecessary calls to wakeup(); no one sleeps on &aio_freeproc.

Eliminate an unused flag, AIOP_SCHED; it's cleared but never set.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Mon May 30 05:25:10 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +0 -6 lines
Eliminate aio_activeproc; it's unused.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Sun May 29 21:29:15 2005 UTC (6 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +0 -5 lines
Eliminate aio_bufjobs; it's unused.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Sat Apr 30 11:27:31 2005 UTC (6 years, 9 months ago) by jeff
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +2 -0 lines
 - Acquire Giant in AIO's iodone routine.  VFS will no longer do it for us
   soon.

Sponsored by:	Isilon Systems, Inc.

Revision 1.174.2.3: download - view: text, markup, annotated - select for diffs
Fri Mar 25 16:28:05 2005 UTC (6 years, 10 months ago) by jmg
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.174.2.2: preferred, colored; branchpoint 1.174: preferred, colored; next MAIN 1.175: preferred, colored
Changes since revision 1.174.2.2: +1 -1 lines
MFC:
>fix aio+kq... I've been running ambrisko's test program for much longer
>w/o problems than I was before...  This simply brings back the knote_delete
>as knlist_delete which will also drop the knote's, instead of just clearing
>the list and setting _ONESHOT...
>
>Fix a race where if a note was _INFLUX and _DETACHED, it could end up being
>modified... whoopse..
>
>Revision  Changes    Path
>1.90      +11 -8     src/sys/kern/kern_event.c
>1.183     +1 -1      src/sys/kern/vfs_aio.c
>1.28      +6 -1      src/sys/sys/event.h

Approved by:	re (kensmith)

Revision 1.183: download - view: text, markup, annotated - select for diffs
Fri Mar 18 01:11:39 2005 UTC (6 years, 10 months ago) by jmg
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +1 -1 lines
fix aio+kq... I've been running ambrisko's test program for much longer
w/o problems than I was before...  This simply brings back the knote_delete
as knlist_delete which will also drop the knote's, instead of just clearing
the list and seeing _ONESHOT...

Fix a race where if a note was _INFLUX and _DETACHED, it could end up being
modified... whoopse..

MFC after:	1 week
Prodded by:	ambrisko and dwhite

Revision 1.182: download - view: text, markup, annotated - select for diffs
Thu Feb 10 12:23:29 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +1 -1 lines
Make a SYSCTL_NODE static

Revision 1.174.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:18 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.174.2.1: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.1: +1 -1 lines
MFC: /*- and related license changes

Revision 1.181: download - view: text, markup, annotated - select for diffs
Thu Jan 6 23:35:40 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary

Revision 1.180: download - view: text, markup, annotated - select for diffs
Thu Nov 4 07:59:56 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +0 -1 lines
Remove buf->b_dev field.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Fri Oct 29 07:16:36 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +1 -1 lines
Give dev_strategy() an explict cdev argument in preparation for removing
buf->b-dev.

Put a bio between the buf passed to dev_strategy() and the device driver
strategy routine in order to not clobber fields in the buf.

Assert copyright on vfs_bio.c and update copyright message to canonical
text.  There is no legal difference between John Dysons two-clause
abbreviated BSD license and the canonical text.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Oct 26 07:39:11 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +1 -1 lines
Put the I/O block size in bufobj->bo_bsize.

We keep si_bsize_phys around for now as that is the simplest way to pull
the number out of disk device drivers in devfs_open().  The correct solution
would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth
when filesystems sit on GEOM, so don't bother for now.

Revision 1.177: download - view: text, markup, annotated - select for diffs
Fri Oct 1 05:54:06 2004 UTC (7 years, 4 months ago) by alfred
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +9 -9 lines
cover soreadable and sowriteable with the corresponding socketbuffer locks.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Thu Sep 23 14:45:04 2004 UTC (7 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +1 -1 lines
Eliminate DEV_STRATEGY() macro: call dev_strategy() directly.

Make dev_strategy() handle errors and departing devices properly.

Revision 1.174.2.1: download - view: text, markup, annotated - select for diffs
Mon Sep 6 19:32:00 2004 UTC (7 years, 5 months ago) by rwatson
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +2 -0 lines
Merge vfs_aio.c:1.175 to RELENG_5:

  date: 2004/09/03 03:19:14;  author: rwatson;  state: Exp;  lines: +2 -0
  Tag AIO as requiring Giant over the network stack using
  NET_NEEDS_GIANT().

  RELENG_5 candidate.

Approved by:	re (scottl)

Revision 1.175: download - view: text, markup, annotated - select for diffs
Fri Sep 3 03:19:14 2004 UTC (7 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +2 -0 lines
Tag AIO as requiring Giant over the network stack using
NET_NEEDS_GIANT().

RELENG_5 candidate.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Sun Aug 15 06:24:41 2004 UTC (7 years, 5 months ago) by jmg
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +15 -10 lines
Add locking to the kqueue subsystem.  This also makes the kqueue subsystem
a more complete subsystem, and removes the knowlege of how things are
implemented from the drivers.  Include locking around filter ops, so a
module like aio will know when not to be unloaded if there are outstanding
knotes using it's filter ops.

Currently, it uses the MTX_DUPOK even though it is not always safe to
aquire duplicate locks.  Witness currently doesn't support the ability
to discover if a dup lock is ok (in some cases).

Reviewed by:	green, rwatson (both earlier versions)

Revision 1.173: download - view: text, markup, annotated - select for diffs
Fri Aug 13 17:43:53 2004 UTC (7 years, 5 months ago) by jmg
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +55 -55 lines
clean up whitespace...

Revision 1.172: download - view: text, markup, annotated - select for diffs
Tue Jul 27 03:53:40 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +1 -1 lines
 - Use atomic ops for updating the vmspace's refcnt and exitingcnt.
 - Push down Giant into shmexit().  (Giant is acquired only if the vmspace
   contains shm segments.)
 - Eliminate the acquisition of Giant from proc_rwmem().
 - Reduce the scope of Giant in exit1(), uncovering the destruction of the
   address space.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Thu Jun 17 22:48:09 2004 UTC (7 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +15 -2 lines
Merge additional socket buffer locking from rwatson_netperf:

- Lock down low hanging fruit use of sb_flags with socket buffer
  lock.

- Lock down low hanging fruit use of so_state with socket lock.

- Lock down low hanging fruit use of so_options.

- Lock down low-hanging fruit use of sb_lowwat and sb_hiwat with
  socket buffer lock.

- Annotate situations in which we unlock the socket lock and then
  grab the receive socket buffer lock, which are currently actually
  the same lock.  Depending on how we want to play our cards, we
  may want to coallesce these lock uses to reduce overhead.

- Convert a if()->panic() into a KASSERT relating to so_state in
  soaccept().

- Remove a number of splnet()/splx() references.

More complex merging of socket and socket buffer locking to
follow.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Sun May 30 20:34:58 2004 UTC (7 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +1 -0 lines
Add missing #include <sys/module.h>

Revision 1.169: download - view: text, markup, annotated - select for diffs
Sun Mar 14 02:06:27 2004 UTC (7 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +2 -0 lines
Make the process_exit eventhandler run without Giant.  Add Giant hooks
in the two consumers that need it.. processes using AIO and netncp.
Update docs.  Say that process_exec is called with Giant, but not to
depend on it.  All our consumers can handle it without Giant.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Sat Nov 15 09:28:08 2003 UTC (8 years, 2 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +0 -1 lines
Send B_PHYS out to pasture, it no longer serves any function.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Fri Oct 24 21:07:53 2003 UTC (8 years, 3 months ago) by jmg
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +3 -2 lines
don't allow reading from files that haven't been open'd for reading.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Tue Oct 21 13:18:19 2003 UTC (8 years, 3 months ago) by simokawa
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +2 -0 lines
We need to initialize bp->b_offset and bp->b_iooffset
becuase bp->b_blkno is ignored now.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Wed Sep 10 15:48:51 2003 UTC (8 years, 5 months ago) by simokawa
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +3 -4 lines
Fix asynchronous physio breakage introduced in rev 1.163.
We cannnot use bp->b_caller2 because DEV_STRATEGY will overwrite it.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Sun Jun 22 08:41:42 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +2 -2 lines
Add a f_vnode field to struct file.

Several of the subtypes have an associated vnode which is used for
stuff like the f*() functions.

By giving the vnode a speparate field, a number of checks for the specific
subtype can be replaced simply with a check for f_vnode != NULL, and
we can later free f_data up to subtype specific use.

At this point in time, f_data still points to the vnode, so any code I
might have overlooked will still work.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Mon Jun 16 07:18:39 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +2 -2 lines
Get rid of the b_spc specialty field in struct buf by using an already
available caller private field.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:58 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +3 -2 lines
Use __FBSDID().

Revision 1.70.2.28: download - view: text, markup, annotated - select for diffs
Thu May 29 06:15:35 2003 UTC (8 years, 8 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.70.2.27: preferred, colored; branchpoint 1.70: preferred, colored; next MAIN 1.71: preferred, colored
Changes since revision 1.70.2.27: +3 -16 lines
MFC
 o Don't reinitialize fields that are already initialized by getpbuf().
 o Sufficient access checks are performed by vmapbuf() that calling
   useracc() is pointless (and costly).  Remove the call to useracc().

Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Apr 29 13:36:03 2003 UTC (8 years, 9 months ago) by kan
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +1 -2 lines
Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>

Revision 1.160: download - view: text, markup, annotated - select for diffs
Thu Apr 17 22:37:48 2003 UTC (8 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +1 -7 lines
- kthread's don't have p_textvp set to anything, so replace code that
  dealt with that possibility with a KASSERT().
- No need to set P_SYSTEM, kthread_create() does that for us.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Sat Apr 5 23:02:58 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +1 -1 lines
Don't reinitialize fields that are already initialized by getpbuf().

Revision 1.158: download - view: text, markup, annotated - select for diffs
Fri Apr 4 06:26:28 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +1 -20 lines
 o Remove useracc() calls from aio_qphysio(); they are redundant
   given the checks performed by vmapbuf().

Reviewed by:	tegge

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Mar 24 21:15:34 2003 UTC (8 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +11 -6 lines
Replace the at_fork, at_exec, and at_exit functions with the slightly more
flexible process_fork, process_exec, and process_exit eventhandlers.  This
reduces code duplication and also means that I don't have to go duplicate
the eventhandler locking three more times for each of at_fork, at_exec, and
at_exit.

Reviewed by:	phk, jake, almost complete silence on arch@

Revision 1.156: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:26 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +8 -8 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.70.2.27: download - view: text, markup, annotated - select for diffs
Sat Jan 25 19:04:40 2003 UTC (9 years ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8
Diff to: previous 1.70.2.26: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.26: +4 -1 lines
MFC vmapbuf()/userland race. vmapbuf() can block, allowing another userland
process or thread to change a mapping or resize a file.  vmapbuf() Now
returns an error which callers check.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:55:55 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +8 -8 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Mon Jan 20 17:46:48 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +13 -2 lines
Close the remaining user address mapping races for physical
I/O, CAM, and AIO.  Still TODO: streamline useracc() checks.

Reviewed by:	alc, tegge
MFC after:	7 days

Revision 1.153: download - view: text, markup, annotated - select for diffs
Mon Jan 13 15:06:05 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +65 -63 lines
style(9) fixes, mostly add parens around return arguments.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Mon Jan 13 00:28:55 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +6 -6 lines
Bow to the whining masses and change a union back into void *.  Retain
removal of unnecessary casts and throw in some minor cleanups to see if
anyone complains, just for the hell of it.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Sun Jan 12 09:40:23 2003 UTC (9 years, 1 month ago) by tjr
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +2 -2 lines
Allowing nent < 0 in aio_suspend() and lio_listio() is just asking for
trouble. Return EINVAL instead.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Sun Jan 12 09:33:16 2003 UTC (9 years, 1 month ago) by tjr
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +1 -1 lines
Remove "XXX undocumented" comment from lio_listio().

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sun Jan 12 01:37:08 2003 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +6 -6 lines
Change struct file f_data to un_data, a union of the correct struct
pointer types, and remove a huge number of casts from code using it.

Change struct xfile xf_data to xun_data (ABI is still compatible).

If we need to add a #define for f_data and xf_data we can, but I don't
think it will be necessary.  There are no operational changes in this
commit.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Fri Jan 3 05:57:34 2003 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +1 -1 lines
Remove unused second argument from DEV_STRATEGY().

Revision 1.147: download - view: text, markup, annotated - select for diffs
Fri Dec 27 08:39:42 2002 UTC (9 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -0 lines
Lock filedesc while performing a range check on the file descriptor.

Reviewed by: alc

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sun Nov 17 04:15:34 2002 UTC (9 years, 2 months ago) by alfred
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -3 lines
Rework the sysconf(3) interaction with aio:

sysconf.c:
  Use 'break' rather than 'goto yesno' in sysconf.c so that we report a '0'
  return value from the kernel sysctl.

vfs_aio.c:
  Make aio reset its configuration parameters to -1 after unloading
  instead of 0.

posix4_mib.c:
  Initialize the aio configuration parameters to -1
  to indicate that it is not loaded.
  Add a facility (p31b_iscfg()) to determine if a posix4 facility has been
  initialized to avoid having to re-order the SYSINITs.
  Use p31b_iscfg() to determine if aio has had a chance to run yet which
  is likely if it is compiled into the kernel and avoid spamming its
  values.
  Introduce a macro P31B_VALID() instead of doing the same comparison over
  and over.

posix4.h:
  Prototype p31b_iscfg().

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Nov 16 06:38:07 2002 UTC (9 years, 2 months ago) by alfred
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +4 -0 lines
Export the values for _SC_AIO_MAX and _SC_AIO_PRIO_DELTA_MAX via the p1003b
sysctl interface.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Nov 16 04:22:55 2002 UTC (9 years, 2 months ago) by alfred
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +3 -0 lines
Call 'p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, AIO_LISTIO_MAX)'
when AIO is initialized so that sysconf() gives correct results.

Reported by: Craig Rodrigues <rodrigc@attbi.com>

Revision 1.143: download - view: text, markup, annotated - select for diffs
Thu Nov 7 20:46:37 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +7 -0 lines
Do a bit more work in the aio code to simulate the credential environment
of the original AIO request: save and restore the active thread credential
as well as using the file credential, since MAC (and some other bits of
the system) rely on the thread credential instead of/as well as the
file credential.  In brief: cache td->td_ucred when the AIO operation
is queued, temporarily set and restore the kernel thread credential,
and release the credential when done.  Similar to ktrace credential
management.

Reviewed by:	alc
Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sun Oct 27 18:07:41 2002 UTC (9 years, 3 months ago) by wollman
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +2 -0 lines
Change the way support for asynchronous I/O is indicated to applications
to conform to 1003.1-2001.  Make it possible for applications to actually
tell whether or not asynchronous I/O is supported.

Since FreeBSD's aio implementation works on all descriptor types, don't
call down into file or vnode ops when [f]pathconf() is asked about
_PC_ASYNC_IO; this avoids the need for every file and vnode op to know about
it.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Fri Oct 18 17:44:39 2002 UTC (9 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +0 -1 lines
fdfree() clears p_fd for us, no need to do it again.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Mon Oct 14 01:21:37 2002 UTC (9 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +1 -4 lines
Eliminate the unnecessary clearing of flag bits that are already clear
in lio_listio(2).

Revision 1.70.2.26: download - view: text, markup, annotated - select for diffs
Sun Oct 13 02:14:17 2002 UTC (9 years, 4 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.25: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.25: +20 -77 lines
MFC
 - Maintain the hold on a file for the duration of an AIO operation.
 - Use the reference to a file contained in the AIO control block
   rather than recomputing it.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Oct 2 07:44:23 2002 UTC (9 years, 4 months ago) by scottl
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +1 -1 lines
Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb

Revision 1.70.2.25: download - view: text, markup, annotated - select for diffs
Sun Sep 1 06:37:31 2002 UTC (9 years, 5 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.70.2.24: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.24: +3 -2 lines
MFC
 o Add some comments and eliminate some unnecessary white space
   to reduce the differences relative to -CURRENT.

Reviewed by:	md5

Revision 1.70.2.24: download - view: text, markup, annotated - select for diffs
Sat Aug 31 17:54:11 2002 UTC (9 years, 5 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.23: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.23: +43 -35 lines
MFC
 o Add extensive sysctl documentation.

Revision 1.70.2.23: download - view: text, markup, annotated - select for diffs
Sat Aug 31 03:18:23 2002 UTC (9 years, 5 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.22: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.22: +17 -35 lines
MFC
 o Remove dead or unused code.
 o Apply style fixes.

Revision 1.70.2.22: download - view: text, markup, annotated - select for diffs
Fri Aug 30 22:44:44 2002 UTC (9 years, 5 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.21: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.21: +2 -3 lines
MFC [revision 1.109 and part of revision 1.110]
 o Correctly initialize aiol_zone and the aiolio_zone.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Thu Aug 22 21:24:00 2002 UTC (9 years, 5 months ago) by archie
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +1 -1 lines
Replace (ab)uses of "NULL" where "0" is really meant.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Thu Aug 22 08:50:15 2002 UTC (9 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +2 -19 lines
 o Remove the AIOCBLIST_ASYNCFREE flag and related code.  It's never set.

Submitted by:	Romer Gil <rgil@cs.rice.edu>

Revision 1.70.2.21: download - view: text, markup, annotated - select for diffs
Tue Aug 13 08:57:03 2002 UTC (9 years, 6 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.20: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.20: +3 -1 lines
MFC
 o In aio_cancel(2), make sure that p->p_aioinfo isn't NULL before
   dereferencing it.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sun Aug 11 19:04:17 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +2 -2 lines
 o Make a correction to the last change: In aio_cancel(2) return AIO_ALLDONE
   instead of EINVAL if p->p_aioinfo is NULL.

Revision 1.70.2.20: download - view: text, markup, annotated - select for diffs
Sun Aug 11 04:12:31 2002 UTC (9 years, 6 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.19: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.19: +3 -5 lines
MFC
 o Misc. synchronization fixes: Add a missing splnet(), remove an
   unnecessary splnet(), and move a rarely used label inside of a
   critical section so that the splnet() isn't repeated.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Sun Aug 11 04:09:14 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +2 -0 lines
 o In aio_cancel(2), make sure that p->p_aioinfo isn't NULL before
   dereferencing it.

Submitted by:	saureen <sshah@apple.com>

Revision 1.70.2.19: download - view: text, markup, annotated - select for diffs
Wed Aug 7 06:03:10 2002 UTC (9 years, 6 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.18: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.18: +6 -12 lines
MFC
 o Change jobref and *ijoblist from int to long in order to avoid
   a catastrophe after the 2^32nd AIO operation on 64-bit architectures.
 o Remove unused or unnecessary variables and fields.

Revision 1.70.2.18: download - view: text, markup, annotated - select for diffs
Wed Aug 7 03:24:22 2002 UTC (9 years, 6 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.17: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.17: +11 -10 lines
MFC two changes in _aio_aqueue():
 o Set struct kevent's ident field to the address of the user's aiocb
   rather than the kernel's.
 o Unbreak lio_listio() by recognizing LIO_READ and LIO_WRITE as opcodes
   rather than requests for notification through kevent().

PR:		kern/39556

Revision 1.134: download - view: text, markup, annotated - select for diffs
Tue Aug 6 19:01:08 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +5 -4 lines
Set the ident field of the struct kevent that is registered by _aio_aqueue()
to the address of the user's aiocb rather than the kernel's aiocb.  (In other
words, prior to this change, the ident field returned by kevent(2) on
completion of an AIO was effectively garbage.)

Submitted by:	Romer Gil <rgil@cs.rice.edu>

Revision 1.133: download - view: text, markup, annotated - select for diffs
Mon Aug 5 19:14:27 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +6 -6 lines
 o The introduction of kevent() broke lio_listio(): _aio_aqueue() thought
   that LIO_READ and LIO_WRITE were requests for kevent()-based
   notification of completion.  Modify _aio_aqueue() to recognize LIO_READ
   and LIO_WRITE.

Notes: (1) The patch provided by the PR perpetuates a second bug in this
code, a direct access to user-space memory.  This change fixes that bug
as well. (2) This change is to code that implements a deprecated interface.
It should probably be removed after an MFC.

PR:		kern/39556

Revision 1.132: download - view: text, markup, annotated - select for diffs
Fri May 31 11:52:30 2002 UTC (9 years, 8 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +0 -3 lines
Back out my lats commit of locking down a socket, it conflicts with hsu's work.

Requested by:	hsu

Revision 1.131: download - view: text, markup, annotated - select for diffs
Sat May 25 18:39:42 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +3 -3 lines
 o Remove some unnecessary casting from and add some necessary casting to
   aio_suspend() and lio_listio().

Submitted by:	bde

Revision 1.130: download - view: text, markup, annotated - select for diffs
Fri May 24 06:06:18 2002 UTC (9 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +4 -6 lines
Fix warnings.  Also, removed an unused variable that I found that was just
initialized and never used afterwards.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Mon May 20 05:41:04 2002 UTC (9 years, 8 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +3 -0 lines
Lock down a socket, milestone 1.

o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a
  socket buffer. The mutex in the receive buffer also protects the data
  in struct socket.

o Determine the lock strategy for each members in struct socket.

o Lock down the following members:

  - so_count
  - so_options
  - so_linger
  - so_state

o Remove *_locked() socket APIs.  Make the following socket APIs
  touching the members above now require a locked socket:

 - sodisconnect()
 - soisconnected()
 - soisconnecting()
 - soisdisconnected()
 - soisdisconnecting()
 - sofree()
 - soref()
 - sorele()
 - sorwakeup()
 - sotryfree()
 - sowakeup()
 - sowwakeup()

Reviewed by:	alfred

Revision 1.128: download - view: text, markup, annotated - select for diffs
Fri May 3 07:46:59 2002 UTC (9 years, 9 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -1 lines
As malloc(9) and free(9) are now Giant-free, remove the Giant lock
across malloc(9) and free(9) of a pgrp or a session.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sat Apr 20 12:02:52 2002 UTC (9 years, 9 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +2 -0 lines
Push down Giant for setpgid(), setsid() and aio_daemon(). Giant protects only
malloc(9) and free(9).

Revision 1.126: download - view: text, markup, annotated - select for diffs
Tue Apr 16 17:11:34 2002 UTC (9 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +2 -2 lines
Lock proctree_lock instead of pgrpsess_lock.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Apr 14 03:04:19 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -45 lines
 o Use aiocblist::fd_file in the AIO threads rather than recomputing
   the file * from the calling process's descriptor table.
 o Eliminate sharing of the calling process's descriptor table
   with the AIO threads.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Mon Apr 8 04:57:56 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +15 -21 lines
Restructure aio_return() to eliminate duplicated code and facilitate Giant
push down.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sun Apr 7 07:17:59 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +7 -19 lines
Reduce the duplication of code for error handling in _aio_aqueue().

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sun Apr 7 01:28:34 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -3 lines
Change jobref and *ijoblist from int to long in order to avoid
a catastrophe after the 2^32nd AIO operation on 64-bit architectures.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Thu Apr 4 02:13:20 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +6 -13 lines
 o aio_process needn't fhold()/fdrop() the fp now that _aio_aqueue() and
   aio_free_entry() do this.
 o Remove two unnecessary/unused variables from aio_process() and one field
   from aiocblist.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Mar 31 20:17:56 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +7 -3 lines
Keep the reference to the file acquired in _aio_aqueue() until the operation
completes.  The reference is released in aio_free_entry().

Submitted by:	tegge

Revision 1.119: download - view: text, markup, annotated - select for diffs
Mon Mar 25 21:52:04 2002 UTC (9 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +1 -0 lines
Added used include of <sys/sx.h>.  Don't depend on namespace pollution in
<sys/file.h> or <sys/socketvar.h>.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Wed Mar 20 04:09:58 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +45 -40 lines
Remove references to vm_zone.h and switch over to the new uma API.

Also, remove maxsockets.  If you look carefully you'll notice that the old
zone allocator never honored this anyway.

Revision 1.70.2.17: download - view: text, markup, annotated - select for diffs
Mon Mar 11 00:02:06 2002 UTC (9 years, 11 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6
Diff to: previous 1.70.2.16: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.16: +27 -21 lines
MFC:
 A variety of modifications that don't change the object code's md5(1)
 signature, including new and corrected comments, use of
 TAILQ_FOREACH(), and elimination of unnecessary casts.

Revision 1.70.2.16: download - view: text, markup, annotated - select for diffs
Sun Mar 10 19:43:39 2002 UTC (9 years, 11 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.15: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.15: +12 -12 lines
MFC: [Revision 1.107]
 o White-space changes to simplify later MFCs.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Tue Mar 5 15:38:49 2002 UTC (9 years, 11 months ago) by eivind
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +80 -43 lines
Document all functions, global and static variables, and sysctls.
Includes some minor whitespace changes, and re-ordering to be able to document
properly (e.g, grouping of variables and the SYSCTL macro calls for them, where
the documentation has been added.)

Reviewed by:	phk (but all errors are mine)

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sat Feb 23 11:12:54 2002 UTC (9 years, 11 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +9 -1 lines
Lock struct pgrp, session and sigio.

New locks are:

- pgrpsess_lock which locks the whole pgrps and sessions,
- pg_mtx which protects the pgrp members, and
- s_mtx which protects the session members.

Please refer to sys/proc.h for the coverage of these locks.

Changes on the pgrp/session interface:

- pgfind() needs the pgrpsess_lock held.

- The caller of enterpgrp() is responsible to allocate a new pgrp and
  session.

- Call enterthispgrp() in order to enter an existing pgrp.

- pgsignal() requires a pgrp lock held.

Reviewed by:	jhb, alfred
Tested on:	cvsup.jp.FreeBSD.org
		(which is a quad-CPU machine running -current)

Revision 1.115: download - view: text, markup, annotated - select for diffs
Tue Feb 12 17:40:41 2002 UTC (9 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +1 -6 lines
 o Clearing p/td_retval[0] after aio_newproc() is unnecessary.  (We stopped
   calling rfork() to create aio threads in revision 1.46.)
 o Don't recompute the FILE * when it's already stored in the kernel's AIOCB.

Revision 1.70.2.15: download - view: text, markup, annotated - select for diffs
Sun Feb 10 01:05:17 2002 UTC (10 years ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.14: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.14: +3 -14 lines
MFC: [Revision 1.107]
 o Properly check the file descriptor passed to aio_cancel(2).  Eliminate
   some excessive white space from aio_cancel(2).

Revision 1.70.2.14: download - view: text, markup, annotated - select for diffs
Sat Feb 9 20:41:58 2002 UTC (10 years ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.13: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.13: +7 -21 lines
MFC
 o [Revision 1.113] Remove JOBST_JOBQPROC and the per-thread jobtorun queue.
   They're not used.  Use TAILQ_EMPTY() instead of TAILQ_FIRST(...) == NULL.
 o [Revision 1.111] Eliminate an unused parameter from aio_fphysio().
 o [Revision 1.104] Eliminate the unnecessary initialization
   of several static variables to zero.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Thu Feb 7 20:58:44 2002 UTC (10 years ago) by julian
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +4 -4 lines
Pre-KSE/M3 commit.
this is a low-functionality change that changes the kernel to access the main
thread of a process via the linked list of threads rather than
assuming that it is embedded in the process. It IS still embeded there
but remove all teh code that assumes that in preparation for the next commit
which will actually move it out.

Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Jan 20 18:59:58 2002 UTC (10 years ago) by alc
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +1 -15 lines
 o Remove the unused vestiges of JOBST_JOBQPROC and
   the per-thread jobtorun queue.
 o Use TAILQ_EMPTY() instead of TAILQ_FIRST(...) == NULL.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Jan 20 00:52:44 2002 UTC (10 years ago) by alc
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +2 -2 lines
 o Revision 1.99 ("KSE Milestone 2") left the aio daemons
   sleeping on a process object but changed the corresponding
   wakeup()s to the thread object.  The result was that non-raw
   aio ops waited for an aio daemon to timeout before action
   was taken.  Now, we sleep on the thread object.

PR:		kern/34016

Revision 1.111: download - view: text, markup, annotated - select for diffs
Thu Jan 17 17:19:40 2002 UTC (10 years ago) by alc
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -3 lines
 o Eliminate an unused parameter from aio_fphysio().

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon Jan 14 07:26:33 2002 UTC (10 years ago) by alc
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +5 -13 lines
 o Correct the initialization of aiolio_zone: Each entry was 16 times larger
   than necessary.
 o Move a rarely-used goto label inside a critical section so that we don't
   perform an splnet() for which there is no corresponding splx().
 o Remove unnecessary splnet()/splx() around accesses to kaioinfo::kaio_jobdone
   in aio_return().
 o Use TAILQ_FOREACH for simple cases of iteration over kaioinfo::kaio_jobdone.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Jan 9 06:40:45 2002 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +1 -1 lines
 o Correct a 32/64-bit error in the initialization of aiol_zone, specifically,
   sizeof(int) is not the size of a pointer.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sun Jan 6 21:03:39 2002 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +27 -1 lines
 o Add missing synchronization (splnet()/splx()) in aio_free_entry().
 o Move the definition of struct aiocblist from sys/aio.h to kern/vfs_aio.c.
 o Make aio_swake_cb() static.

Revision 1.70.2.13: download - view: text, markup, annotated - select for diffs
Thu Jan 3 23:31:04 2002 UTC (10 years, 1 month ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.70.2.12: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.12: +6 -8 lines
MFC: [Revisions 1.101 and 1.102]
 o Eliminate unnecessary synchronization from filt_aiodetach().
 o The manual page for kevent says that EVFILT_AIO returns under the same
   conditions as aio_error().  With that in mind, set the data field
   of the returned struct kevent to the value that would be returned
   by aio_error().
 o Fix compilation warnings.

Approved by:	re

Revision 1.70.2.12: download - view: text, markup, annotated - select for diffs
Wed Jan 2 07:33:36 2002 UTC (10 years, 1 month ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.11: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.11: +2 -2 lines
MFC: [Revision 1.105]
 o Correct an off-by-one error in aio_suspend(2).

PR:		18350
Approved by:	re

Revision 1.107: download - view: text, markup, annotated - select for diffs
Wed Jan 2 07:04:38 2002 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +3 -14 lines
 o Properly check the file descriptor passed to aio_cancel(2).  (Previously,
   no out-of-bounds check was performed on the file descriptor.)
 o Eliminate some excessive white space from aio_cancel(2).

Revision 1.106: download - view: text, markup, annotated - select for diffs
Tue Jan 1 00:40:28 2002 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +13 -13 lines
 o Some style(9)-motivated changes to white space.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Dec 31 03:13:24 2001 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +1 -1 lines
 o Correct an off-by-one error in aio_suspend(2).

PR:		18350

Revision 1.104: download - view: text, markup, annotated - select for diffs
Mon Dec 31 02:03:39 2001 UTC (10 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +8 -10 lines
 o Use "td->td_proc" instead of "curproc" where possible.
 o Eliminate the unnecessary initialization of several static variables
   to zero.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Dec 29 07:13:46 2001 UTC (10 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +85 -72 lines
Make AIO a loadable module.

Remove the explicit call to aio_proc_rundown() from exit1(), instead AIO
will use at_exit(9).

Add functions at_exec(9), rm_at_exec(9) which function nearly the
same as at_exec(9) and rm_at_exec(9), these functions are called
on behalf of modules at the time of execve(2) after the image
activator has run.

Use a modified version of tegge's suggestion via at_exec(9) to close
an exploitable race in AIO.

Fix SYSCALL_MODULE_HELPER such that it's archetecuterally neutral,
the problem was that one had to pass it a paramater indicating the
number of arguments which were actually the number of "int".  Fix
it by using an inline version of the AS macro against the syscall
arguments.  (AS should be available globally but we'll get to that
later.)

Add a primative system for dynamically adding kqueue ops, it's really
not as sophisticated as it should be, but I'll discuss with jlemon when
he's around.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Mon Dec 10 03:34:06 2001 UTC (10 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +3 -3 lines
 o Eliminate compilation warnings on 64-bit architectures.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sun Dec 9 08:16:36 2001 UTC (10 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +4 -6 lines
 o Eliminate unnecessary synchronization from filt_aiodetach().
 o The manual page for kevent says that EVFILT_AIO returns under the same
   conditions as aio_error().  With that in mind, set the data field
   of the returned struct kevent to the value that would be returned
   by aio_error().
 o Fix two compilation warnings.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Oct 5 17:55:11 2001 UTC (10 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +1 -8 lines
The aio kthreads start off with a root credential just like all other
kthreads, so don't malloc a ucred just so we can create a duplicate of the
one we already have.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:37:46 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +94 -77 lines
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha

Revision 1.70.2.11: download - view: text, markup, annotated - select for diffs
Thu Aug 30 06:16:49 2001 UTC (10 years, 5 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.70.2.10: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.10: +11 -145 lines
MFC: revision 1.92 and part of revision 1.93 of kern/vfs_aio.c and
 revision 1.22 of sys/aio.h.

 Remove the field privatemodes from struct __aiocb_private and the
 related code from aio_read() and aio_write().

 Remove unnecessary fhold() and fdrop() calls from aio_qphysio().  Add
 a comment explaining why.

Approved by:	re (jkh)

Revision 1.70.2.10: download - view: text, markup, annotated - select for diffs
Thu Apr 19 01:38:34 2001 UTC (10 years, 9 months ago) by alfred
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.70.2.9: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.9: +14 -3 lines
MFC: do not allow user applications to give aio bogus signals, fix some
     possible memory leakage of aio structures
PR: kern/17152
Approved by: jkh

Revision 1.98: download - view: text, markup, annotated - select for diffs
Wed Apr 18 22:18:39 2001 UTC (10 years, 9 months ago) by alfred
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +14 -3 lines
Check validity of signal callback requested via aio routines.

Also move the insertion of the request to after the request is validated,
there's still looks like there may be some problems if an invalid address
is passed to the aio routines, basically a possible leak or having a
not completely initialized structure on the queue may still be possible.

A new sig macro was made _SIG_VALID to check the validity of a signal,
it would be advisable to use it from now on (in kern/kern_sig.c) rather
than rolling your own.

PR: kern/17152

Revision 1.70.2.9: download - view: text, markup, annotated - select for diffs
Sat Mar 17 22:17:03 2001 UTC (10 years, 10 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.8: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.8: +27 -8 lines
MFC: revision 1.97 of kern/vfs_aio.c and revision 1.24 of sys/aio.h

 Corrects numerous problems including buffer corruption, signal delivery,
 and some race conditions.

PR:		25617
Submitted by:	tegge
Approved by:	jkh

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sat Mar 10 22:47:56 2001 UTC (10 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +27 -8 lines
When aio_read/write() is used on a raw device, physical buffers are
used for up to "vfs.aio.max_buf_aio" of the requests.  If a request
size is MAXPHYS, but the request base isn't page aligned, vmapbuf()
will map the end of the user space buffer into the start of the kva
allocated for the next physical buffer.  Don't use a physical buffer
in this case.  (This change addresses problem report 25617.)

When an aio_read/write() on a raw device has completed, timeout() is
used to schedule a signal to the process.  Thus, the reporting is
delayed up to 10 ms (assuming hz is 100).  The process might have
terminated in the meantime, causing a trap 12 when attempting to
deliver the signal.  Thus, the timeout must be cancelled when removing
the job.

aio jobs in state JOBST_JOBQGLOBAL should be removed from the
kaio_jobqueue list during process rundown.

During process rundown, some aio jobs might move from one list to a
different list that has already been "emptied", causing the rundown to
be incomplete.  Retry the rundown.

A call to BUF_KERNPROC() is needed after obtaining a physical buffer
to disassociate the lock from the running process since it can return
to userland without releasing that lock.

PR:		25617
Submitted by:	tegge

Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri Mar 9 06:27:01 2001 UTC (10 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +8 -10 lines
Use the kthread API to create and destroy AIO daemons.

Submitted by:	jhb

Revision 1.70.2.8: download - view: text, markup, annotated - select for diffs
Wed Mar 7 06:37:24 2001 UTC (10 years, 11 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.70.2.7: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.7: +7 -13 lines
MFC:

 sys/aio.h: Remove outdated comments that describe aio_cancel() as
  unimplemented.  Remove a duplicate function prototype for aio_error().
  [revisions 1.21, 1.23, and 1.24]

 kern/vfs_aio.c: Add a missing splx() to aio_fphysio().
  [revision 1.94]

Approved by:	jkh

Revision 1.95: download - view: text, markup, annotated - select for diffs
Wed Mar 7 03:37:03 2001 UTC (10 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +27 -10 lines
Grab the process lock while calling psignal and before calling psignal.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Tue Mar 6 15:54:38 2001 UTC (10 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +7 -13 lines
Add a missing splx() to aio_fphysio().  (This change is a no-op in -5.0,
 but potentially significant in -4.x.)

Eliminate a pointless parameter to aio_fphysio().

Remove unnecessary casts from aio_fphysio() and aio_physwakeup().

Revision 1.93: download - view: text, markup, annotated - select for diffs
Mon Mar 5 01:30:23 2001 UTC (10 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +31 -41 lines
Eliminate the aio_freejobs list.  Its purpose was to store free
 aiocb's allocated by zalloc().  In other words, zfree() was never
 called.  Now, we call zfree().  Why eliminate this micro-
 optimization?  At some later point, when we multithread the AIO
 system, we would need a mutex to synchronize access to aio_freejobs,
 making its use nearly indistinguishable in cost from zalloc() and
 zfree().

Remove unnecessary fhold() and fdrop() calls from aio_qphysio(),
 undo'ing a part of revision 1.86.  The reference count on the file
 structure is already incremented by _aio_aqueue() before it calls
 aio_qphysio().  (Update the comments to document this fact.)

Remove unnecessary casts from _aio_aqueue(), aio_read(), aio_write()
 and aio_waitcomplete().

Remove an unnecessary "return;" from aio_process().

Add "static" in various places.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sun Mar 4 01:22:23 2001 UTC (10 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +3 -138 lines
Remove the field privatemodes from struct __aiocb_private and the
related code from aio_read() and aio_write().  This field was
intended, but never used, to allow a mythical user-level library to
make an aio_read() or aio_write() behave like an ordinary read() or
write(), i.e., a blocking I/O operation.

Revision 1.70.2.7: download - view: text, markup, annotated - select for diffs
Mon Feb 26 03:32:12 2001 UTC (10 years, 11 months ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.70.2.6: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.6: +34 -30 lines
MFC: Better approach for registering EVFILT_AIO type kq events.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:09:52 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +2 -2 lines
Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Feb 6 09:25:03 2001 UTC (11 years ago) by asmodai
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +2 -2 lines
Fix typo: wierd -> weird.

There is no such thing as wierd in the english language.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun Feb 4 16:08:10 2001 UTC (11 years ago) by phk
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +3 -5 lines
Another round of the <sys/queue.h> FOREACH transmogriffer.

Created with:   sed(1)
Reviewed by:    md5(1)

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sat Dec 2 05:41:30 2000 UTC (11 years, 2 months ago) by jake
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -2 lines
Remove thr_sleep and thr_wakeup.  Remove fields p_nthread and p_wakeup
from struct proc, which are now unused (p_nthread already was).
Remove process flag P_KTHREADP which was untested and only set
in vfs_aio.c (it should use kthread_create).  Move the yield
system call to kern_synch.c as kern_threads.c has been removed
completely.

moral support from:	alfred, jhb

Revision 1.70.2.6: download - view: text, markup, annotated - select for diffs
Sun Nov 26 02:30:05 2000 UTC (11 years, 2 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.70.2.5: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.5: +33 -6 lines
    MFC from current the major file descriptor race fixing patchset.
    This fix file descriptor races in open(), close(), fcntl(),
    read(), write(), and most other system calls that take file descriptors
    as arguments.  The races being fixed are mainly due to the file
    descriptor table sharing that rfork()/threading allows.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Tue Nov 21 19:36:35 2000 UTC (11 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +34 -30 lines
Provide a new interface for the user of aio_read() and aio_write() to request
a kevent upon completion of the I/O.  Specifically, introduce a new type
of sigevent notification, SIGEV_EVENT.  If sigev_notify is SIGEV_EVENT,
then sigev_notify_kqueue names the kqueue that should receive the event
and sigev_value contains the "void *" is copied into the kevent's udata
field.

In contrast to the existing interface, this one: 1) works on
the Alpha 2) avoids the extra copyin() call for the kevent because all
of the information needed is in the sigevent and 3) could be
applied to request a single kevent upon completion of an entire lio_listio().

Reviewed by:	jlemon

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:01:02 2000 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +33 -6 lines
    This patchset fixes a large number of file descriptor race conditions.
    Pre-rfork code assumed inherent locking of a process's file descriptor
    array.  However, with the advent of rfork() the file descriptor table
    could be shared between processes.  This patch closes over a dozen
    serious race conditions related to one thread manipulating the table
    (e.g. closing or dup()ing a descriptor) while another is blocked in
    an open(), close(), fcntl(), read(), write(), etc...

PR: kern/11629
Discussed with: Alexander Viro <viro@math.psu.edu>

Revision 1.70.2.5: download - view: text, markup, annotated - select for diffs
Tue Oct 31 23:00:40 2000 UTC (11 years, 3 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE
Diff to: previous 1.70.2.4: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.4: +8 -23 lines
MFC: [rev 1.83] and [rev 1.85]
 _aio_aqueue(): Change kevent registration to use its own struct file pointer.
  Eliminate redundant initialization.
 aio_qphysio(): Eliminate redundant out-of-range check.
 aio_physwakeup(): Eliminate redundant synchronization.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Oct 29 21:38:28 2000 UTC (11 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +5 -4 lines
_aio_aqueue(): Change kevent registration to use its own struct file pointer.
 Otherwise, aio_read() and aio_write() on sockets are broken if a kevent is
 registered.  (The code after kevent registration for handling sockets assumes
 that the struct file pointer "fp" still refers to the socket, not the kqueue.)

Revision 1.84: download - view: text, markup, annotated - select for diffs
Fri Oct 20 07:58:04 2000 UTC (11 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -2 lines
Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h

Revision 1.83: download - view: text, markup, annotated - select for diffs
Tue Sep 26 06:35:22 2000 UTC (11 years, 4 months ago) by alc
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +4 -19 lines
aio_qphysio: Eliminate one instance of an out-of-range check that is
 performed twice.  Eliminate initialization that is already performed
 by _aio_aqueue.

aio_physwakeup: Eliminate redundant synchronization that is already
 performed by bufdone.

Revision 1.70.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 22 09:39:30 2000 UTC (11 years, 4 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_1_1_RELEASE
Diff to: previous 1.70.2.3: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.3: +3 -2 lines
MFC: [rev 1.79] Make filt_aio() check the jobstate for JOBST_JOBBFINISHED.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sun Sep 17 12:20:49 2000 UTC (11 years, 4 months ago) by bde
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -1 lines
Added used include of <sys/mutex.h> (don't depend on pollution in
<sys/signalvar.h>).

Revision 1.81: download - view: text, markup, annotated - select for diffs
Mon Sep 11 04:06:48 2000 UTC (11 years, 5 months ago) by jhb
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +2 -1 lines
aio processes need to have the Giant mutex before doing work.

Submitted by:	tegge

Revision 1.70.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 7 19:13:38 2000 UTC (11 years, 5 months ago) by truckman
Branches: RELENG_4
Diff to: previous 1.70.2.2: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.2: +3 -1 lines
MFC:

Remove hash table lookups and maintenance from chgproccnt() and chgsbsize()
and chase pointers stored in pcred and ucred instead for better performance
and to avoid these operations in interrupt context which could possibly
cause panics.

Because the pcred and ucred structures changed size, libkvm and friends
will need to be rebuilt.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Sep 5 22:10:27 2000 UTC (11 years, 5 months ago) by truckman
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +3 -1 lines
Remove uidinfo hash table lookup and maintenance out of chgproccnt() and
chgsbsize(), which are called rather frequently and may be called from an
interrupt context in the case of chgsbsize().  Instead, do the hash table
lookup and maintenance when credentials are changed, which is a lot less
frequent.  Add pointers to the uidinfo structures to the ucred and pcred
structures for fast access.  Pass a pointer to the credential to chgproccnt()
and chgsbsize() instead of passing the uid.  Add a reference count to the
uidinfo structure and use it to decide when to free the structure rather
than freeing the structure when the resource consumption drops to zero.
Move the resource tracking code from kern_proc.c to kern_resource.c.  Move
some duplicate code sequences in kern_prot.c to separate helper functions.
Change KASSERTs in this code to unconditional tests and calls to panic().

Revision 1.79: download - view: text, markup, annotated - select for diffs
Mon Sep 4 07:56:32 2000 UTC (11 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +3 -2 lines
Make filt_aio() check the jobstate for JOBST_JOBBFINISHED (in addition
to JOBST_JOBFINISHED) in case the aio_read() or aio_write() was performed
via the high-performance physio method, i.e., aio_qphysio().

Revision 1.70.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 7 19:20:33 2000 UTC (11 years, 6 months ago) by peter
Branches: RELENG_4
Diff to: previous 1.70.2.1: preferred, colored; branchpoint 1.70: preferred, colored
Changes since revision 1.70.2.1: +35 -8 lines
MFC: 1.78: complete the #ifdef VFS_AIO option.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Fri Jul 28 23:10:10 2000 UTC (11 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +35 -8 lines
Fix the #ifdef VFS_AIO to not compile a whole bunch of unused stuff in the
 !VFS_AIO case.  Lots of things have hooks into here (kqueue, exit(),
 sockets, etc), I elected to keep the external interfaces the same
 rather than spread more #ifdefs around the kernel.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri May 26 02:04:39 2000 UTC (11 years, 8 months ago) by jake
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +15 -15 lines
Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others

Revision 1.76: download - view: text, markup, annotated - select for diffs
Tue May 23 20:37:17 2000 UTC (11 years, 8 months ago) by jake
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +15 -15 lines
Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd

Revision 1.75: download - view: text, markup, annotated - select for diffs
Fri May 5 09:58:24 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +2 -1 lines
Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter

Revision 1.70.2.1: download - view: text, markup, annotated - select for diffs
Fri May 5 03:49:58 2000 UTC (11 years, 9 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_1_0_RELEASE
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +105 -4 lines
MFC: kqueue() and kevent()

Revision 1.74: download - view: text, markup, annotated - select for diffs
Sun Apr 16 18:53:14 2000 UTC (11 years, 9 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +105 -4 lines
Introduce kqueue() and kevent(), a kernel event notification facility.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Sun Apr 2 15:24:19 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +4 -4 lines
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Mar 20 11:28:44 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -2 lines
Rename the existing BUF_STRATEGY() to DEV_STRATEGY()

substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo)

substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo)

This patch is machine generated except for the ccd.c and buf.h parts.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Mar 20 10:44:28 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +4 -5 lines
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd.  The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue.  It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users:  Greg has not had time to test this yet, be careful.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Feb 23 18:02:23 2000 UTC (11 years, 11 months ago) by jasone
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +1 -1 lines
(Null commit)

Note that previous commit adds an implementation of aio_cancel() and fixes a
couple of bugs in aio_waitcomplete().

Submitted by:	Chris Sedore <cmsedore@maxwell.syr.edu>

Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Feb 23 07:44:25 2000 UTC (11 years, 11 months ago) by jasone
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +154 -8 lines
Add the VFS_AIO config option and leave it off by default.  Unless the
VFS_AIO option is specified, all aio-related syscalls return ENOSYS.

The aio code is very fragile right now, and is unsuitable for default
inclusion in a production shell box.

Approved by:	jkh

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Jan 20 08:15:13 2000 UTC (12 years ago) by jasone
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +2 -2 lines
Back out the previous spl change, since it opens a race window.

Reviewed by:	alfred, dillon, peter

Revision 1.67: download - view: text, markup, annotated - select for diffs
Thu Jan 20 01:59:58 2000 UTC (12 years ago) by jasone
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +13 -3 lines
Don't tsleep() while at splbio().

Correctly return EINPROGRESS from aio_error() even when an aio request
is still in the socket queue.

Submitted by:	Adrian Chadd <adrian@bofh.co.uk>

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Jan 17 21:18:39 2000 UTC (12 years ago) by green
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +12 -3 lines
Fix vn_isdisk() usage to make AIO work on non-disk-files again, rather
than just return ENOTBLK.

PR:	16163
Submitted by:	Adrian Chadd <adrian@FreeBSD.org>

Revision 1.65: download - view: text, markup, annotated - select for diffs
Fri Jan 14 02:53:26 2000 UTC (12 years ago) by jasone
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +634 -503 lines
Add aio_waitcomplete().  Make aio work correctly for socket descriptors.
Make gratuitous style(9) fixes (me, not the submitter) to make the aio
code more readable.

PR:		kern/12053
Submitted by:	Chris Sedore <cmsedore@maxwell.syr.edu>

Revision 1.64: download - view: text, markup, annotated - select for diffs
Mon Jan 10 12:04:15 2000 UTC (12 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +3 -3 lines
Give vn_isdisk() a second argument where it can return a suitable errno.

Suggested by:	bde

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Nov 22 10:33:50 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +2 -5 lines
Convert various pieces of code to use vn_isdisk() rather than checking
for vp->v_type == VBLK.

In ccd: we don't need to call VOP_GETATTR to find the type of a vnode.

Reviewed by:    sos

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Nov 7 13:09:09 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +16 -32 lines
Simplify and de-bogotify check for raw disk.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Oct 30 06:31:52 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +14 -19 lines
Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.

Fix two bugs (physio & cam) resulting by the confusion caused by this.

Submitted by:   Tor.Egge@fast.no
Reviewed by:    alc, ken (partly)

Revision 1.60: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:19:11 1999 UTC (12 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +1 -4 lines
Trim unused options (or #ifdef for undoc options).

Submitted by:	phk

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sun Sep 19 17:00:24 1999 UTC (12 years, 4 months ago) by green
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +5 -5 lines
This is what was "fdfix2.patch," a fix for fd sharing.  It's pretty
far-reaching in fd-land, so you'll want to consult the code for
changes.  The biggest change is that now, you don't use
	fp->f_ops->fo_foo(fp, bar)
but instead
	fo_foo(fp, bar),
which increments and decrements the fp refcount upon entry and exit.
Two new calls, fhold() and fdrop(), are provided.  Each does what it
seems like it should, and if fdrop() brings the refcount to zero, the
fd is freed as well.

Thanks to peter ("to hell with it, it looks ok to me.") for his review.
Thanks to msmith for keeping me from putting locks everywhere :)

Reviewed by:	peter

Revision 1.36.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:26:12 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.36.2.1: preferred, colored; branchpoint 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:46:22 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Aug 14 11:40:44 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +3 -10 lines
Spring cleaning around strategy and disklabels/slices:

Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize().  Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Fri Aug 13 10:10:01 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +2 -2 lines
s/v_specinfo/v_rdev/

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Aug 8 18:42:48 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +1 -2 lines
Decommision miscfs/specfs/specdev.h.  Most of it goes into <sys/conf.h>,
a few lines into <sys/vnode.h>.

Add a few fields to struct specinfo, paving the way for the fun part.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Thu Jul 1 13:21:40 1999 UTC (12 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -3 lines
Slight reorganization of kernel thread/process creation.  Instead of using
SYSINIT_KT() etc (which is a static, compile-time procedure), use a
NetBSD-style kthread_create() interface.  kproc_start is still available
as a SYSINIT() hook.  This allowed simplification of chunks of the
sysinit code in the process.  This kthread_create() is our old kproc_start
internals, with the SYSINIT_KT fork hooks grafted in and tweaked to work
the same as the NetBSD one.

One thing I'd like to do shortly is get rid of nfsiod as a user initiated
process.  It makes sense for the nfs client code to create them on the
fly as needed up to a user settable limit.  This means that nfsiod
doesn't need to be in /sbin and is always "available".  This is a fair bit
easier to do outside of the SYSINIT_KT() framework.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Wed Jun 30 15:33:36 1999 UTC (12 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +2 -3 lines
Slight tweak to fork1() calling conventions.  Add a third argument so
the caller can easily find the child proc struct.  fork(), rfork() etc
syscalls set p->p_retval[] themselves.  Simplify the SYSINIT_KT() code
and other kernel thread creators to not need to use pfind() to find the
child based on the pid.  While here, partly tidy up some of the fork1()
code for RF_SIGSHARE etc.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sat Jun 26 02:46:05 1999 UTC (12 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Convert buffer locking from using the B_BUSY and B_WANTED flags to using
lockmgr locks. This commit should be functionally equivalent to the old
semantics. That is, all buffer locking is done with LK_EXCLUSIVE
requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will
be done in future commits.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Tue Jun 1 18:56:24 1999 UTC (12 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -2 lines
Introduce the makebdev() function, it does the same as the makedev()
function for now, but that will change.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Sun May 9 13:13:52 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -4 lines
major(something) can never become NODEV.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sat May 8 06:39:46 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -2 lines
I got tired of seeing all the cdevsw[major(foo)] all over the place.

Made a new (inline) function devsw(dev_t dev) and substituted it.

Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)

DEVFS will eventually benefit from this change too.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu May 6 20:00:25 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +3 -3 lines
remove b_proc from struct buf, it's (now) unused.

Reviewed by:	dillon, bde

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu May 6 18:44:42 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +3 -2 lines
Fix up a few easy 'assignment used as truth value' and 'suggest parens
around && within ||' type warnings.  I'm pretty sure I have not masked
any problems here, I've committed real problem fixes seperately.

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Wed May 5 22:53:06 1999 UTC (12 years, 9 months ago) by dt
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +5 -5 lines
MFC: pread() and pwrite().

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Apr 28 01:04:28 1999 UTC (12 years, 9 months ago) by luoqi
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, POST_VFS_BIO_NFS_PATCH, POST_SMP_VMSHARE
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +5 -43 lines
Enable vmspace sharing on SMP. Major changes are,
- %fs register is added to trapframe and saved/restored upon kernel entry/exit.
- Per-cpu pages are no longer mapped at the same virtual address.
- Each cpu now has a separate gdt selector table. A new segment selector
  is added to point to per-cpu pages, per-cpu global variables are now
  accessed through this new selector (%fs). The selectors in gdt table are
  rearranged for cache line optimization.
- fask_vfork is now on as default for both UP and SMP.
- Some aio code cleanup.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		John Dyson	<dyson@iquest.net>
		Julian Elischer	<julian@whistel.com>
		Bruce Evans	<bde@zeta.org.au>
		David Greenman	<dg@root.com>

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sun Apr 4 21:41:16 1999 UTC (12 years, 10 months ago) by dt
Branches: MAIN
CVS tags: PRE_SMP_VMSHARE, PRE_NEWBUS, POST_NEWBUS
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +5 -5 lines
Add standard padding argument to pread and pwrite syscall. That should make them
NetBSD compatible.

Add parameter to fo_read and fo_write. (The only flag FOF_OFFSET mean that
the offset is set in the struct uio).

Factor out some common code from read/pread/write/pwrite syscalls.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Thu Feb 25 15:54:06 1999 UTC (12 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -1 lines
Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Feb 19 14:25:35 1999 UTC (12 years, 11 months ago) by luoqi
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -2 lines
Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This
is the preparation step for moving pmap storage out of vmspace proper.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		Matthew Dillion	<dillon@apollo.backplane.com>

Revision 1.42: download - view: text, markup, annotated - select for diffs
Fri Jan 29 23:18:49 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +3 -3 lines
    More const fixes for -Wall, -Wcast-qual

Revision 1.41: download - view: text, markup, annotated - select for diffs
Fri Jan 29 08:29:04 1999 UTC (13 years ago) by bde
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +2 -2 lines
Removed bogus casts to c_caddr_t.  This is part of terminating
c_caddr_t with extreme prejudice.  Here the original casts to
caddr_t were to support K&R compilers (or missing prototypes),
but the relevant source files require an ANSI compiler.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu Jan 28 17:32:00 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
    Fix warnings related to -Wall -Wcast-qual

Revision 1.39: download - view: text, markup, annotated - select for diffs
Thu Jan 28 00:57:47 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +6 -5 lines
    Fix warnings in preparation for adding -Wall -Wcast-qual to the
    kernel compile

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Jan 27 21:49:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +8 -8 lines
        Fix warnings in preparation for adding -Wall -Wcast-qual to the
        kernel compile

Revision 1.37: download - view: text, markup, annotated - select for diffs
Thu Jan 21 08:29:05 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: POST_MATT_SWAPPER
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +5 -5 lines
    This is a rather large commit that encompasses the new swapper,
    changes to the VM system to support the new swapper, VM bug
    fixes, several VM optimizations, and some additional revamping of the
    VM code.  The specific bug fixes will be documented with additional
    forced commits.  This commit is somewhat rough in regards to code
    cleanup issues.

Reviewed by:	"John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>

Revision 1.36: download - view: text, markup, annotated - select for diffs
Tue Dec 15 17:38:33 1998 UTC (13 years, 1 month ago) by des
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_1_0_RELEASE, PRE_MATT_SWAPPER
Branch point for: RELENG_3
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines
Wrap two macros into do { ... } while (0), and fix the way they're used
in the kernel.

Reviewed by: bde

Revision 1.35: download - view: text, markup, annotated - select for diffs
Fri Nov 27 01:14:21 1998 UTC (13 years, 2 months ago) by tegge
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -2 lines
Don't forget to update the pmap associated with aio daemons when adding
new page directory entries for a growing kernel virtual address space.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Oct 25 17:44:52 1998 UTC (13 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -5 lines
Nitpicking and dusting performed on a train.  Removes trivial warnings
about unused variables, labels and other lint.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Mon Aug 17 17:28:10 1998 UTC (13 years, 5 months ago) by bde
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +5 -7 lines
Fixed nonsense overflow checking (checking that a long variable is less
than INT_MAX after it has possibly overflowed).

Removed an unused variable and its associated 2 style bugs.

Removed unused includes.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Jul 15 06:51:14 1998 UTC (13 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +17 -17 lines
Cast between longs and pointers via intptr_t.  There shouldn't be
nearly so many casts here.  Casting an pointer that was an integer
back to an integer just to compare it with -1 is bad, and casting
it back just to compare it with NULL is just wrong.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Jul 5 20:33:18 1998 UTC (13 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
fix braino from yesterdays' megacommit

Not sure of the result of it..
(may or may not effect anything) but it's fixed now.
(found by: comparing what cvsup sent back to me with what I tested..)

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat Jul 4 22:30:22 1998 UTC (13 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +5 -4 lines
There is no such thing any more as "struct bdevsw".

There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries.  The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).

rawread()/rawwrite() went away as part of this though it's not strictly
the same  patch, just that it involves all the same lines in the drivers.

cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.

Reviewed by: Eivind Eklund and Mike Smith
	Changes suggested by eivind.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Wed Jun 10 10:31:08 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +14 -14 lines
64bit fixes: don't cast pointers to int.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Apr 17 22:36:50 1998 UTC (13 years, 9 months ago) by des
Branches: MAIN
CVS tags: PRE_DEVFS_SLICE, POST_DEVFS_SLICE
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +4 -4 lines
Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Mar 30 09:51:00 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +2 -5 lines
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Mar 28 11:50:04 1998 UTC (13 years, 10 months ago) by dufault
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
Finish _POSIX_PRIORITY_SCHEDULING.  Needs P1003_1B and
_KPOSIX_PRIORITY_SCHEDULING options to work.  Changes:

Change all "posix4" to "p1003_1b".  Misnamed files are left
as "posix4" until I'm told if I can simply delete them and add
new ones;

Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux;

Add man pages for _POSIX_PRIORITY_SCHEDULING system calls;

Add options to LINT;

Minor fixes to P1003_1B code during testing.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Mar 28 10:33:09 1998 UTC (13 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +2 -1 lines
Moved some #includes from <sys/param.h> nearer to where they are actually
used.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Feb 25 06:30:15 1998 UTC (13 years, 11 months ago) by bde
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, POST_SOFTUPDATE
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -7 lines
Removed a stale comment and staler code.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Feb 9 06:09:28 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +16 -16 lines
Staticize.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:13:29 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +1 -3 lines
Back out DIAGNOSTIC changes.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:32:38 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -1 lines
Turn DIAGNOSTIC into a new-style option.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed Dec 10 04:14:23 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +5 -5 lines
Quiet some lint.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Dec 8 02:18:25 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -2 lines
Correct prototypes to match POSIX.   Correct return code for aio_cancel.
Submitted by:	Alex Nash <nash@mcs.com>

Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Dec 1 18:41:08 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -1 lines
Fix a problem when creating a new kernel thread.  In some cases, aio_read
or aio_write can return the pid of the new thread.  This is due to the
way that return values from system calls being passed by side-effect in
the proc structure now.  This commit fixes the problem with aio_read and
aio_write.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Dec 1 07:01:45 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +93 -342 lines
Fix error handling for VCHR type I/O.  Also, fix another spl problem, and
remove alot of overly verbose debugging statements.
ioproclist {
	int aioprocflags;			/* AIO proc flags */
	TAILQ_ENTRY(aioproclist) list;		/* List of processes */
	struct proc *aioproc;			/* The AIO thread */
	TAILQ_HEAD (,aiocblist) jobtorun;	/* suggested job to run */
};

/*
 * data-structure for lio signal management
 */
struct aio_liojob {
	int lioj_flags;
	int	lioj_buffer_count;
	int	lioj_buffer_finished_count;
	int	lioj_queue_count;
	int	lioj_queue_finished_count;
	struct sigevent lioj_signal;	/* signal on all I/O done */
	TAILQ_ENTRY (aio_liojob) lioj_list;
	struct kaioinfo *lioj_ki;
};
#define	LIOJ_SIGNAL			0x1 /* signal on all done (lio) */
#define	LIOJ_SIGNAL_POSTED	0x2	/* signal has been posted */

/*
 * per process aio data structure
 */
struct kaioinfo {
	int	kaio_flags;			/* per process kaio flags */
	int	kaio_maxactive_count;	/* maximum number of AIOs */
	int	kaio_active_count;	/* number of currently used AIOs */
	int	kaio_qallowed_count;	/* maxiumu size of AIO queue */
	int	kaio_queue_count;	/* size of AIO queue */
	int	kaio_ballowed_count;	/* maximum number of buffers */
	int	kaio_queue_finished_count;	/* number of daemon jobs finished */
	int	kaio_buffer_count;	/* number of physio buffers */
	int	kaio_buffer_finished_count;	/* count of I/O done */
	struct proc *kaio_p;			/* process that uses this kaio block */
	TAILQ_HEAD (,aio_liojob) kaio_liojoblist;	/* list of lio jobs */
	TAILQ_HEAD (,aiocblist)	kaio_jobqueue;	/* job queue for process */
	TAILQ_HEAD (,aiocblist)	kaio_jobdone;	/* done queue for process */
	TAILQ_HEAD (,aiocblist)	kaio_bufqueue;	/* buffer job queue for process */
	TAILQ_HEAD (,aiocblist)	kaio_bufdone;	/* buffer done queue for process */
};

#define KAIO_RUNDOWN 0x1		/* process is being run down */
#define KAIO_WAKEUP 0x2			/* wakeup process when there is a significant
								   event */


TAILQ_HEAD (,aioproclist) aio_freeproc, aio_activeproc;
TAILQ_HEAD(,aiocblist) aio_jobs;			/* Async job list */
TAILQ_HEAD(,aiocblist) aio_bufjobs;			/* Phys I/O job list */
TAILQ_HEAD(,aiocblist) aio_freejobs;		/* Pool of free jobs */

static void aio_init_aioinfo(struct proc *p) ;
static void aio_onceonly(void *) ;
static int aio_free_entry(struct aiocblist *aiocbe);
static void aio_process(struct aiocblist *aiocbe);
static int aio_newproc(void) ;
static int aio_aqueue(struct proc *p, struct aiocb *job, int type) ;
static void aio_physwakeup(struct buf *bp);
static int aio_fphysio(struct proc *p, struct aiocblist *aiocbe, int type);
static int aio_qphysio(struct proc *p, struct aiocblist *iocb);
static void aio_daemon(void *uproc);

SYSINIT(aio, SI_SUB_VFS, SI_ORDER_ANY, aio_onceonly, NULL);

static vm_zone_t kaio_zone=0, aiop_zone=0,
	aiocb_zone=0, aiol_zone=0, aiolio_zone=0;

/*
 * Single AIOD vmspace shared amongst all of them
 */
static struct vmspace *aiovmspace = NULL;

/*
 * Startup initialization
 */
void
aio_onceonly(void *na)
{
	TAILQ_INIT(&aio_freeproc);
	TAILQ_INIT(&aio_activeproc);
	TAILQ_INIT(&aio_jobs);
	TAILQ_INIT(&aio_bufjobs);
	TAILQ_INIT(&aio_freejobs);
	kaio_zone = zinit("AIO", sizeof (struct kaioinfo), 0, 0, 1);
	aiop_zone = zinit("AIOP", sizeof (struct aioproclist), 0, 0, 1);
	aiocb_zone = zinit("AIOCB", sizeof (struct aiocblist), 0, 0, 1);
	aiol_zone = zinit("AIOL", AIO_LISTIO_MAX * sizeof (int), 0, 0, 1);
	aiolio_zone = zinit("AIOLIO",
		AIO_LISTIO_MAX * sizeof (struct aio_liojob), 0, 0, 1);
	aiod_timeout = AIOD_TIMEOUT_DEFAULT;
	aiod_lifetime = AIOD_LIFETIME_DEFAULT;
	jobrefid = 1;
}

/*
 * Init the per-process aioinfo structure.
 * The aioinfo limits are set per-process for user limit (resource) management.
 */
void
aio_init_aioinfo(struct proc *p)
{
	struct kaioinfo *ki;
	if (p->p_aioinfo == NULL) {
		ki = zalloc(kaio_zone);
		p->p_aioinfo = ki

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sun Nov 30 23:21:08 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +4 -8 lines
Correct a last minute code change.  Would have been an infinite loop under
certain error conditions.
Submitted by:	pst@shockwave.com

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Nov 30 21:47:36 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +7 -1 lines
Fix an spl nit.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Nov 30 04:36:31 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +552 -106 lines
Finish up the vast majority of the AIO/LIO functionality.  Proper signal
support was missing in the previous version of the AIO code.  More
tunables added, and very efficient support for VCHR files has been added.
Kernel threads are not used for VCHR files, all work for such files is
done for the requesting process directly.  Some attempt has been made to
charge the requesting process for resource utilization, but more work
is needed.  aio_fsync is still missing (but the original fsync system
call can be used for now.)  aio_cancel is essentially a noop, but that
is okay per POSIX.  More aio_cancel functionality can be added later,
if it is found to be needed.

The functions implemented include:
	aio_read, aio_write, lio_listio, aio_error, aio_return,
	aio_cancel, aio_suspend.

The code has been implemented to support the POSIX spec 1003.1b
(formerly known as POSIX 1003.4 spec) features of the above.  The
async I/O features are truly async, with the VCHR mode of operation
being essentially the same as physio (for appropriate files) for
maximum efficiency.  This code also supports the signal capability,
is highly tunable, allowing management of resource usage, and
has been written to allow a per process usage quota.

Both the O'Reilly POSIX.4 book and the actual POSIX 1003.1b document
were the reference specs used.  Any filedescriptor can be used with
these new system calls.  I know of no exceptions where these
system calls will not work.  (TTY's will also probably work.)

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Nov 29 02:57:46 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -1 lines
Disable the VCHR optimization for AIO until I have implemented it.  Just in
case anyone wants to play with the POSIX AIO/LIO stuff.  (As it is, it should
work with ANY vnode, on UP systems only, for now.)

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Nov 29 01:33:07 1997 UTC (14 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +781 -302 lines
Fix and complete the AIO syscalls.  There are some performance enhancements
coming up soon, but the code is functional.  Docs will be forthcoming.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Nov 18 10:02:40 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -2 lines
Get locking stuff by #including <sys/lock.h> instead of <sys/vnode.h>.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Nov 7 08:53:03 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -7 lines
Remove a bunch of variables which were unused both in GENERIC and LINT.

Found by:	-Wunused

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Nov 6 19:29:27 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +16 -17 lines
Move the "retval" (3rd) parameter from all syscall functions and put
it in struct proc instead.

This fixes a boatload of compiler warning, and removes a lot of cruft
from the sources.

I have not removed the /*ARGSUSED*/, they will require some looking at.

libkvm, ps and other userland struct proc frobbing programs will need
recompiled.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Oct 12 20:24:19 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -2 lines
Last major round (Unless Bruce thinks of somthing :-) of malloc changes.

Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Oct 11 18:31:25 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +3 -1 lines
Distribute and statizice a lot of the malloc M_* types.

Substantial input from:	bde

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Oct 11 01:07:03 1997 UTC (14 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +18 -2 lines
Make the target for the number of AIO daemons work.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Oct 9 04:14:41 1997 UTC (14 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +258 -65 lines
Major cleanup and debugging of the new AIO/LIO code.  The LIO code is
now corrected.  New tunables/instrumentation added.  The code is now
likely "good enough to use."  I will add the userland support soon.
The "high performance" mode for raw devices is still missing, and will
be added next.  POSIX system calls that now appear to work:
aio_cancel, aio_error, aio_read, aio_return, aio_suspend, aio_write,
lio_listio.  Missing, but to be added soon: aio_fsync.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:06:00 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +1 -9 lines
Removed unused #includes.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Jul 17 04:49:31 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +6 -4 lines
Clean up some lint associated with the AIO code.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Jul 6 02:40:43 1997 UTC (14 years, 7 months ago) by dyson
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +977 -64 lines
This is an upgrade so that the kernel supports the AIO calls from
POSIX.4.  Additionally, there is some initial code that supports LIO.
This code supports AIO/LIO for all types of file descriptors, with
few if any restrictions.  There will be a followup very soon that
will support significantly more efficient operation for VCHR type
files (raw.)  This code is also dependent on some kernel features
that don't work under SMP yet.  After I commit the changes to the
kernel to support proper address space sharing on SMP, this code
will also work under SMP.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Mon Jun 16 00:27:26 1997 UTC (14 years, 7 months ago) by dyson
Branches: MAIN
CVS tags: WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Add initial AIO/LIO kernel thread support files.  This is preliminary, and
further features will be added.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options