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

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

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.310.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (3 months ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.310.2.1: preferred, colored
Changes since revision 1.310.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.310.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.310: preferred, colored
Changes since revision 1.310: +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.310: 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, HEAD
Branch point for: RELENG_9
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +21 -21 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.309: 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.308: preferred, colored
Changes since revision 1.308: +61 -35 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.308: download - view: text, markup, annotated - select for diffs
Thu Jun 30 10:56:02 2011 UTC (7 months, 1 week ago) by jonathan
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +7 -0 lines
SVN rev 223692 on 2011-06-30 10:56:02Z by jonathan

Add some checks to ensure that Capsicum is behaving correctly, and add some
more explicit comments about what's going on and what future maintainers
need to do when e.g. adding a new operation to a sys_machdep.c.

Approved by: mentor(rwatson), re(bz)

Revision 1.284.2.14: download - view: text, markup, annotated - select for diffs
Tue Jun 14 18:56:45 2011 UTC (7 months, 4 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.284.2.13: preferred, colored; branchpoint 1.284: preferred, colored; next MAIN 1.285: preferred, colored
Changes since revision 1.284.2.13: +4 -0 lines
SVN rev 223094 on 2011-06-14 18:56:45Z by jhb

MFC 222829:
Log the socket address passed as the destination to sendto() and sendmsg()
via ktrace.

Revision 1.307: download - view: text, markup, annotated - select for diffs
Tue Jun 7 17:40:33 2011 UTC (8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +4 -0 lines
SVN rev 222829 on 2011-06-07 17:40:33Z by jhb

Log the socket address passed as the destination to sendto() and sendmsg()
via ktrace.

MFC after:	1 week

Revision 1.284.2.13: download - view: text, markup, annotated - select for diffs
Sat Apr 16 23:30:53 2011 UTC (9 months, 3 weeks ago) by bz
Branches: RELENG_8
Diff to: previous 1.284.2.12: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.12: +1 -14 lines
SVN rev 220733 on 2011-04-16 23:30:53Z by bz

MFC r218757:

  Mfp4 CH=177274,177280,177284-177285,177297,177324-177325

    VNET socket push back:
    try to minimize the number of places where we have to switch vnets
    and narrow down the time we stay switched.  Add assertions to the
    socket code to catch possibly unset vnets as seen in r204147.

    While this reduces the number of vnet recursion in some places like
    NFS, POSIX local sockets and some netgraph, .. recursions are
    impossible to fix.

    The current expectations are documented at the beginning of
    uipc_socket.c along with the other information there.

    Sponsored by: The FreeBSD Foundation
    Sponsored by: CK Software GmbH
    Reviewed by:  jhb
    Tested by:    zec

  Tested by:    Mikolaj Golub (to.my.trociny gmail.com)

Revision 1.306: download - view: text, markup, annotated - select for diffs
Fri Apr 1 13:28:34 2011 UTC (10 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +5 -5 lines
SVN rev 220245 on 2011-04-01 13:28:34Z by kib

After the r219999 is merged to stable/8, rename fallocf(9) to falloc(9)
and remove the falloc() version that lacks flag argument. This is done
to reduce the KPI bloat.

Requested by:	jhb
X-MFC-note:	do not

Revision 1.305: download - view: text, markup, annotated - select for diffs
Wed Feb 16 21:29:13 2011 UTC (11 months, 3 weeks ago) by bz
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +1 -14 lines
SVN rev 218757 on 2011-02-16 21:29:13Z by bz

Mfp4 CH=177274,177280,177284-177285,177297,177324-177325

  VNET socket push back:
  try to minimize the number of places where we have to switch vnets
  and narrow down the time we stay switched.  Add assertions to the
  socket code to catch possibly unset vnets as seen in r204147.

  While this reduces the number of vnet recursion in some places like
  NFS, POSIX local sockets and some netgraph, .. recursions are
  impossible to fix.

  The current expectations are documented at the beginning of
  uipc_socket.c along with the other information there.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: CK Software GmbH
  Reviewed by:  jhb
  Tested by:    zec

Tested by:	Mikolaj Golub (to.my.trociny gmail.com)
MFC after:	2 weeks

Revision 1.284.2.12: download - view: text, markup, annotated - select for diffs
Fri Feb 4 09:15:23 2011 UTC (12 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.284.2.11: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.11: +12 -5 lines
SVN rev 218258 on 2011-02-04 09:15:23Z by kib

MFC r218026:
If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.

Switch to nowait allocations after we got first buffer already.

Revision 1.304: download - view: text, markup, annotated - select for diffs
Thu Feb 3 14:42:46 2011 UTC (12 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +1 -2 lines
SVN rev 218223 on 2011-02-03 14:42:46Z by alc

Eliminate unnecessary page hold_count checks.  These checks predate
r90944, which introduced a general mechanism for handling the freeing
of held pages.

Reviewed by:	kib@

Revision 1.303: download - view: text, markup, annotated - select for diffs
Fri Jan 28 17:37:09 2011 UTC (12 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +12 -5 lines
SVN rev 218026 on 2011-01-28 17:37:09Z by kib

If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.

Switch to nowait allocations after we got first buffer already.

Reported by:	az
Reviewed by:	alc (previous version)
Tested by:	pho
MFC after:	1 week

Revision 1.259.2.9.2.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.259.2.9: preferred, colored; next MAIN 1.259.4.1: preferred, colored
Changes since revision 1.259.2.9: +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.284.2.11.2.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.284.2.11: preferred, colored; next MAIN 1.284.2.12: preferred, colored
Changes since revision 1.284.2.11: +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.302: download - view: text, markup, annotated - select for diffs
Tue Dec 14 06:19:13 2010 UTC (13 months, 4 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +1 -2 lines
SVN rev 216427 on 2010-12-14 06:19:13Z by pjd

Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.

Revision 1.284.2.11: download - view: text, markup, annotated - select for diffs
Thu Oct 28 18:50:35 2010 UTC (15 months, 1 week ago) by tuexen
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.284.2.10: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.10: +2 -4 lines
SVN rev 214470 on 2010-10-28 18:50:35Z by tuexen

MFC 212242:

Implement correct handling of address parameter and
sendinfo for SCTP send calls.

Revision 1.301: download - view: text, markup, annotated - select for diffs
Sun Sep 5 20:13:07 2010 UTC (17 months ago) by tuexen
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +2 -4 lines
SVN rev 212242 on 2010-09-05 20:13:07Z by tuexen

Implement correct handling of address parameter and
sendinfo for SCTP send calls.

MFC after: 4 weeks.

Revision 1.259.2.9: download - view: text, markup, annotated - select for diffs
Wed Jul 14 21:52:23 2010 UTC (18 months, 4 weeks ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.259.2.8: preferred, colored; branchpoint 1.259: preferred, colored; next MAIN 1.260: preferred, colored
Changes since revision 1.259.2.8: +3 -3 lines
SVN rev 210086 on 2010-07-14 21:52:23Z by jhb

MFC 209595:
Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Revision 1.284.2.10: download - view: text, markup, annotated - select for diffs
Wed Jul 14 21:52:02 2010 UTC (18 months, 4 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.284.2.9: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.9: +3 -3 lines
SVN rev 210085 on 2010-07-14 21:52:02Z by jhb

MFC 209595:
Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Revision 1.284.2.8.2.2: download - view: text, markup, annotated - select for diffs
Mon Jul 5 18:45:59 2010 UTC (19 months, 1 week ago) by tuexen
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.284.2.8.2.1: preferred, colored; branchpoint 1.284.2.8: preferred, colored; next MAIN 1.284.2.9: preferred, colored
Changes since revision 1.284.2.8.2.1: +3 -2 lines
SVN rev 209711 on 2010-07-05 18:45:59Z by tuexen

MFC r209624
 * Do not dereference a NULL pointer when calling an SCTP send syscall
   not providing a destination address and using ktrace.
 * Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
 Both bugs where reported by Valentin Nechayev.
 The first bug results in a kernel panic.
Approved by: re@

Revision 1.284.2.9: download - view: text, markup, annotated - select for diffs
Thu Jul 1 12:55:34 2010 UTC (19 months, 1 week ago) by tuexen
Branches: RELENG_8
Diff to: previous 1.284.2.8: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.8: +3 -2 lines
SVN rev 209624 on 2010-07-01 12:55:34Z by tuexen

MFC r209540
 * Do not dereference a NULL pointer when calling an SCTP send syscall
   not providing a destination address and using ktrace.
 * Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
 Both bug where reported by Valentin Nechayev.
 The first bug results in a kernel panic.

Revision 1.300: download - view: text, markup, annotated - select for diffs
Tue Jun 29 20:44:19 2010 UTC (19 months, 1 week ago) by jhb
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +3 -3 lines
SVN rev 209595 on 2010-06-29 20:44:19Z by jhb

Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Reported by:	Anit Chakraborty
Reviewed by:	kib, deischen (concept)
MFC after:	1 week

Revision 1.299: download - view: text, markup, annotated - select for diffs
Sat Jun 26 19:26:20 2010 UTC (19 months, 2 weeks ago) by tuexen
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +3 -2 lines
SVN rev 209540 on 2010-06-26 19:26:20Z by tuexen

* Do not dereference a NULL pointer when calling an SCTP send syscall
  not providing a destination address and using ktrace.
* Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
Both bug where reported by Valentin Nechayev.
The first bug results in a kernel panic.
MFC after: 3 days.

Revision 1.298: download - view: text, markup, annotated - select for diffs
Mon Jun 21 09:55:56 2010 UTC (19 months, 3 weeks ago) by ed
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +1 -1 lines
SVN rev 209390 on 2010-06-21 09:55:56Z by ed

Use ISO C99 integer types in sys/kern where possible.

There are only about 100 occurences of the BSD-specific u_int*_t
datatypes in sys/kern. The ISO C99 integer types are used here more
often.

Revision 1.284.2.8.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
Diff to: previous 1.284.2.8: preferred, colored
Changes since revision 1.284.2.8: +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.297: download - view: text, markup, annotated - select for diffs
Thu May 6 17:43:41 2010 UTC (21 months ago) by alc
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +1 -6 lines
SVN rev 207708 on 2010-05-06 17:43:41Z by alc

Remove page queues locking from all sf_buf_mext()-like functions.  The page
lock now suffices.

Fix a couple nearby style violations.

Revision 1.296: download - view: text, markup, annotated - select for diffs
Thu May 6 15:52:08 2010 UTC (21 months ago) by alc
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +2 -7 lines
SVN rev 207700 on 2010-05-06 15:52:08Z by alc

Eliminate a small bit of unneeded code from kern_sendfile(): While
kern_sendfile() is running, the file's vm object can't be destroyed
because kern_sendfile() increments the vm object's reference count.  (Once
kern_sendfile() decrements the reference count and returns, the vm object
can, however, be destroyed.  So, sf_buf_mext() must handle the case where
the vm object is destroyed.)

Reviewed by:	kib

Revision 1.295: download - view: text, markup, annotated - select for diffs
Mon May 3 05:41:50 2010 UTC (21 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +4 -0 lines
SVN rev 207548 on 2010-05-03 05:41:50Z by alc

This is the first step in transitioning responsibility for synchronizing
access to the page's wire_count from the page queues lock to the page lock.

Submitted by:	kmacy

Revision 1.294: download - view: text, markup, annotated - select for diffs
Sun May 2 19:25:22 2010 UTC (21 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +2 -0 lines
SVN rev 207535 on 2010-05-02 19:25:22Z by kib

Lock the page around hold_count access.

Reviewed by:	alc

Revision 1.284.2.8: download - view: text, markup, annotated - select for diffs
Wed Apr 7 14:16:14 2010 UTC (22 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.284.2.7: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.7: +19 -4 lines
SVN rev 206345 on 2010-04-07 14:16:14Z by kib

MFC r205318:
Properly handle compat32 calls to sctp generic sendmsd/recvmsg functions that
take iov.

Revision 1.284.2.7: download - view: text, markup, annotated - select for diffs
Fri Apr 2 13:43:16 2010 UTC (22 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.284.2.6: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.6: +0 -1 lines
SVN rev 206092 on 2010-04-02 13:43:16Z by kib

MFC r205317:
Remove dead statement.

Revision 1.284.2.6: download - view: text, markup, annotated - select for diffs
Fri Apr 2 13:39:30 2010 UTC (22 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.284.2.5: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.5: +2 -2 lines
SVN rev 206091 on 2010-04-02 13:39:30Z by kib

MFC r205316:
Fix two style issues.

Revision 1.293: download - view: text, markup, annotated - select for diffs
Fri Mar 19 10:46:54 2010 UTC (22 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +19 -4 lines
SVN rev 205318 on 2010-03-19 10:46:54Z by kib

Properly handle compat32 calls to sctp generic sendmsd/recvmsg functions that
take iov.

Reviewed by:	tuexen
MFC after:	2 weeks

Revision 1.292: download - view: text, markup, annotated - select for diffs
Fri Mar 19 10:44:02 2010 UTC (22 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +0 -1 lines
SVN rev 205317 on 2010-03-19 10:44:02Z by kib

Remove dead statement.

Reviewed by:	tuexen
MFC after:	2 weeks

Revision 1.291: download - view: text, markup, annotated - select for diffs
Fri Mar 19 10:41:32 2010 UTC (22 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +2 -2 lines
SVN rev 205316 on 2010-03-19 10:41:32Z by kib

Fix two style issues.

MFC after:	2 weeks

Revision 1.290: download - view: text, markup, annotated - select for diffs
Thu Feb 18 22:12:40 2010 UTC (23 months, 3 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +2 -2 lines
SVN rev 204064 on 2010-02-18 22:12:40Z by pjd

Use NULL instead of 0 when setting up pointer.

Revision 1.259.2.8.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.259.2.8: preferred, colored; next MAIN 1.259.2.9: preferred, colored
Changes since revision 1.259.2.8: +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.284.2.5: download - view: text, markup, annotated - select for diffs
Sun Dec 27 22:49:34 2009 UTC (2 years, 1 month ago) by mjacob
Branches: RELENG_8
Diff to: previous 1.284.2.4: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.4: +1 -1 lines
SVN rev 201067 on 2009-12-27 22:49:34Z by mjacob

MFC 200620,200621: fix argument order to mtx_init call.

Revision 1.289: download - view: text, markup, annotated - select for diffs
Thu Dec 17 00:22:56 2009 UTC (2 years, 1 month ago) by mjacob
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +1 -1 lines
SVN rev 200621 on 2009-12-17 00:22:56Z by mjacob

Fix argument order in a call to mtx_init.

MFC after:	1 week

Revision 1.284.2.4: download - view: text, markup, annotated - select for diffs
Mon Dec 7 07:33:51 2009 UTC (2 years, 2 months ago) by tuexen
Branches: RELENG_8
Diff to: previous 1.284.2.3: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.3: +9 -0 lines
SVN rev 200208 on 2009-12-07 07:33:51Z by tuexen

MFC 197288,197326,197327,197328,197342,197914,197929,
    197955,199365,199370,199371,199373,199866
This MFCs all SCTP/VNET relevant fixes from head.

Approved by: rrs (mentor)

Revision 1.259.2.8: download - view: text, markup, annotated - select for diffs
Tue Nov 17 12:09:21 2009 UTC (2 years, 2 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.259.2.7: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.7: +1 -9 lines
SVN rev 199358 on 2009-11-17 12:09:21Z by kib

MFC r198853:
If socket buffer space appears to be lower then sum of count of
already prepared bytes and next portion of transfer, inner loop of
kern_sendfile() aborts, not preparing next mbuf for socket buffer, and
not modifying any outer loop invariants. The thread loops in the outer
loop forever.

Instead of breaking from inner loop, prepare only bytes that fit into
the socket buffer space.

Revision 1.284.2.3: download - view: text, markup, annotated - select for diffs
Tue Nov 17 11:43:53 2009 UTC (2 years, 2 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.284.2.2: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.2: +1 -9 lines
SVN rev 199356 on 2009-11-17 11:43:53Z by kib

MFC r198853:
If socket buffer space appears to be lower then sum of count of
already prepared bytes and next portion of transfer, inner loop of
kern_sendfile() aborts, not preparing next mbuf for socket buffer, and
not modifying any outer loop invariants. The thread loops in the outer
loop forever.

Instead of breaking from inner loop, prepare only bytes that fit into
the socket buffer space.

Revision 1.288: download - view: text, markup, annotated - select for diffs
Tue Nov 3 12:52:35 2009 UTC (2 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +1 -9 lines
SVN rev 198853 on 2009-11-03 12:52:35Z by kib

If socket buffer space appears to be lower then sum of count of already
prepared bytes and next portion of transfer, inner loop of kern_sendfile()
aborts, not preparing next mbuf for socket buffer, and not modifying
any outer loop invariants. The thread loops in the outer loop forever.

Instead of breaking from inner loop, prepare only bytes that fit into
the socket buffer space.

In collaboration with:	pho
Reviewed by:	bz
PR:	kern/138999
MFC after:	2 weeks

Revision 1.287: download - view: text, markup, annotated - select for diffs
Thu Oct 29 10:03:08 2009 UTC (2 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +1 -1 lines
SVN rev 198575 on 2009-10-29 10:03:08Z by kib

Fix style issue.

Revision 1.284.2.2.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.284.2.2: preferred, colored; next MAIN 1.284.2.3: preferred, colored
Changes since revision 1.284.2.2: +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.259.2.7: download - view: text, markup, annotated - select for diffs
Thu Oct 8 11:42:24 2009 UTC (2 years, 4 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.259.2.6: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.6: +5 -2 lines
SVN rev 197857 on 2009-10-08 11:42:24Z by kib

MFC r197662:
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Revision 1.284.2.2: download - view: text, markup, annotated - select for diffs
Thu Oct 8 11:28:32 2009 UTC (2 years, 4 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.284.2.1: preferred, colored; branchpoint 1.284: preferred, colored
Changes since revision 1.284.2.1: +5 -2 lines
SVN rev 197855 on 2009-10-08 11:28:32Z by kib

MFC r197662:
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Approved by:	re (bz)

Revision 1.286: download - view: text, markup, annotated - select for diffs
Thu Oct 1 12:50:26 2009 UTC (2 years, 4 months ago) by kib
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +5 -2 lines
SVN rev 197662 on 2009-10-01 12:50:26Z by kib

Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Noted by:	Igor Sysoev <is rambler-co ru>
MFC after:	1 week

Revision 1.285: download - view: text, markup, annotated - select for diffs
Sat Sep 19 14:02:16 2009 UTC (2 years, 4 months ago) by tuexen
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +9 -0 lines
SVN rev 197326 on 2009-09-19 14:02:16Z by tuexen

Get SCTP working in combination with VIMAGE.
Contains code from bz.
Approved by: rrs (mentor)
MFC after: 1 month.

Revision 1.284.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
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +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.284: download - view: text, markup, annotated - select for diffs
Sat Aug 1 19:26:27 2009 UTC (2 years, 6 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +2 -1 lines
SVN rev 196019 on 2009-08-01 19:26:27Z by rwatson

Merge the remainder of kern_vimage.c and vimage.h into vnet.c and
vnet.h, we now use jails (rather than vimages) as the abstraction
for virtualization management, and what remained was specific to
virtual network stacks.  Minor cleanups are done in the process,
and comments updated to reflect these changes.

Reviewed by:	bz
Approved by:	re (vimage blanket)

Revision 1.283: download - view: text, markup, annotated - select for diffs
Wed Jul 1 19:55:11 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +17 -0 lines
SVN rev 195255 on 2009-07-01 19:55:11Z by rwatson

Audit file descriptor numbers for various socket-related system calls.

Approved by:	re (audit argument blanket)
MFC after:	3 days

Revision 1.282: download - view: text, markup, annotated - select for diffs
Wed Jul 1 18:54:49 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +3 -0 lines
SVN rev 195252 on 2009-07-01 18:54:49Z by rwatson

Define missing audit argument macro AUDIT_ARG_SOCKET(), and
capture the domain, type, and protocol arguments to socket(2)
and socketpair(2).

Approved by:	re (audit argument blanket)
MFC after:	3 days

Revision 1.281: download - view: text, markup, annotated - select for diffs
Wed Jun 10 14:36:59 2009 UTC (2 years, 8 months ago) by bz
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +8 -4 lines
SVN rev 193926 on 2009-06-10 14:36:59Z by bz

SCTP needs either IPv4 or IPv6 as lower layer[1].
So properly hide the already #ifdef SCTP code with
#if defined(INET) || defined(INET6) as well to get us
closer to a non-INET/INET6 kernel.

Discussed with:	tuexen [1]

Revision 1.280: download - view: text, markup, annotated - select for diffs
Fri Jun 5 14:55:22 2009 UTC (2 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +0 -1 lines
SVN rev 193511 on 2009-06-05 14:55:22Z by rwatson

Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC
and used in a large number of files, but also because an increasing number
of incorrect uses of MAC calls were sneaking in due to copy-and-paste of
MAC-aware code without the associated opt_mac.h include.

Discussed with:	pjd

Revision 1.279: download - view: text, markup, annotated - select for diffs
Tue Jun 2 18:26:17 2009 UTC (2 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +12 -36 lines
SVN rev 193332 on 2009-06-02 18:26:17Z by rwatson

Add internal 'mac_policy_count' counter to the MAC Framework, which is a
count of the number of registered policies.

Rather than unconditionally locking sockets before passing them into MAC,
lock them in the MAC entry points only if mac_policy_count is non-zero.

This avoids locking overhead for a number of socket system calls when no
policies are registered, eliminating measurable overhead for the MAC
Framework for the socket subsystem when there are no active policies.

Possibly socket locks should be acquired by policies if they are required
for socket labels, which would further avoid locking overhead when there
are policies but they don't require labeling of sockets, or possibly
don't even implement socket controls.

Obtained from:	TrustedBSD Project

Revision 1.278: download - view: text, markup, annotated - select for diffs
Sun May 31 12:12:38 2009 UTC (2 years, 8 months ago) by dchagin
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +29 -24 lines
SVN rev 193167 on 2009-05-31 12:12:38Z by dchagin

Split native socketpair() syscall onto kern_socketpair() which should
be used by kernel consumers and socketpair() itself.

Approved by:	kib (mentor)
MFC after:	1 month

Revision 1.277: download - view: text, markup, annotated - select for diffs
Thu May 14 03:24:22 2009 UTC (2 years, 8 months ago) by jeff
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +9 -16 lines
SVN rev 192080 on 2009-05-14 03:24:22Z by jeff

 - Implement a lockless file descriptor lookup algorithm in
   fget_unlocked().
 - Save old file descriptor tables created on expansion until
   the entire descriptor table is freed so that pointers may be
   followed without regard for expanders.
 - Mark the file zone as NOFREE so we may attempt to reference
   potentially freed files.
 - Convert several fget_locked() users to fget_unlocked().  This
   requires us to manage reference counts explicitly but reduces
   locking overhead in the common case.

Revision 1.276: download - view: text, markup, annotated - select for diffs
Fri May 8 14:34:25 2009 UTC (2 years, 9 months ago) by zec
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +1 -1 lines
SVN rev 191917 on 2009-05-08 14:34:25Z by zec

A NOP change: style / whitespace cleanup of the noise that slipped
into r191816.

Spotted by:	bz
Approved by:	julian (mentor) (an earlier version of the diff)

Revision 1.275: download - view: text, markup, annotated - select for diffs
Tue May 5 10:56:12 2009 UTC (2 years, 9 months ago) by zec
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +17 -0 lines
SVN rev 191816 on 2009-05-05 10:56:12Z by zec

Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)

Revision 1.259.2.6.4.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.259.2.6: preferred, colored; next MAIN 1.259.2.7: preferred, colored
Changes since revision 1.259.2.6: +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.274: download - view: text, markup, annotated - select for diffs
Sun Apr 12 05:19:35 2009 UTC (2 years, 10 months ago) by kmacy
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +1 -1 lines
SVN rev 190958 on 2009-04-12 05:19:35Z by kmacy

sendfile doesn't modify the vnode - acquire vnode lock shared

Reviewed by:	ups, jeffr

Revision 1.259.2.6.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.259.2.6: preferred, colored; next MAIN 1.259.2.7: preferred, colored
Changes since revision 1.259.2.6: +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.273: download - view: text, markup, annotated - select for diffs
Thu Oct 23 15:53:51 2008 UTC (3 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +5 -5 lines
SVN rev 184205 on 2008-10-23 15:53:51Z by des

Retire the MALLOC and FREE macros.  They are an abomination unto style(9).

MFC after:	3 months

Revision 1.221.2.5.2.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.221.2.5: preferred, colored; next MAIN 1.222: preferred, colored
Changes since revision 1.221.2.5: +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.259.2.6: download - view: text, markup, annotated - select for diffs
Tue Aug 12 17:22:51 2008 UTC (3 years, 5 months ago) by des
Branches: RELENG_7
CVS tags: RELENG_7_2_BP, RELENG_7_1_BP
Branch point for: RELENG_7_2, RELENG_7_1
Diff to: previous 1.259.2.5: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.5: +36 -0 lines
SVN rev 181632 on 2008-08-12 17:22:51Z by des

MFH r176471 (KTR_STRUCT, support for struct stat and struct sockaddr)

Revision 1.259.2.5: download - view: text, markup, annotated - select for diffs
Wed Jul 2 16:22:00 2008 UTC (3 years, 7 months ago) by rwatson
Branches: RELENG_7
Diff to: previous 1.259.2.4: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.4: +5 -1 lines
SVN rev 180189 on 2008-07-02 16:22:00Z by rwatson

Merge uipc_syscalls.c:1.272 (r179196) from head to stable/7:

  When sendto(2) is called with an explicit destination address
  argument, call mac_socket_check_connect() on that address before
  proceeding with the send.  Otherwise policies instrumenting the
  connect entry point for the purposes of checking destination
  addresses will not have the opportunity to check implicit
  connect requests.

  Sponsored by:   nCircle Network Security, Inc.

Revision 1.272: download - view: text, markup, annotated - select for diffs
Thu May 22 07:18:54 2008 UTC (3 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +5 -1 lines
When sendto(2) is called with an explicit destination address
argument, call mac_socket_check_connect() on that address before
proceeding with the send.  Otherwise policies instrumenting the
connect entry point for the purposes of checking destination
addresses will not have the opportunity to check implicit
connect requests.

MFC after:	3 weeks
Sponsored by:	nCircle Network Security, Inc.

Revision 1.259.2.4: download - view: text, markup, annotated - select for diffs
Sat May 10 17:21:20 2008 UTC (3 years, 9 months ago) by rwatson
Branches: RELENG_7
Diff to: previous 1.259.2.3: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.3: +4 -3 lines
Merge uipc_syscalls.c:1.271 from HEAD to RELENG_7:

  When writing trailers in sendfile(2), don't call kern_writev()
  while holding the socket buffer lock.  These leads to an
  immediate panic due to recursing the socket buffer lock.  This
  bug was introduced in uipc_syscalls.c:1.240, but masked by
  another bug until that was fixed in uipc_syscalls.c:1.269.

  Note that the current fix isn't perfect, but better than
  panicking: normally we guarantee that simultaneous invocations
  of a system call to write on a stream socket won't be
  interlaced, which is ensured by use of the socket buffer sleep
  lock.  This is guaranteed for the sendfile headers, but not
  trailers.  In practice, this is likely not a problem, but
  should be fixed.

  Pointy hat to:  andre (1.240), cperciva (1.269)

Revision 1.271: download - view: text, markup, annotated - select for diffs
Sun Apr 27 15:50:00 2008 UTC (3 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +4 -3 lines
When writing trailers in sendfile(2), don't call kern_writev()
while holding the socket buffer lock.  These leads to an
immediate panic due to recursing the socket buffer lock.  This
bug was introduced in uipc_syscalls.c:1.240, but masked by
another bug until that was fixed in uipc_syscalls.c:1.269.

Note that the current fix isn't perfect, but better than
panicking: normally we guarantee that simultaneous invocations
of a system call to write on a stream socket won't be
interlaced, which is ensured by use of the socket buffer sleep
lock.  This is guaranteed for the sendfile headers, but not
trailers.  In practice, this is likely not a problem, but
should be fixed.

MFC after:	3 days
Pointy hat to:	andre (1.240), cperciva (1.269)

Revision 1.270: download - view: text, markup, annotated - select for diffs
Tue Mar 25 09:38:59 2008 UTC (3 years, 10 months ago) by ru
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +8 -20 lines
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.

Reviewed by:	arch

There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.

Revision 1.259.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 6 05:41:45 2008 UTC (3 years, 11 months ago) by cperciva
Branches: RELENG_7
Diff to: previous 1.259.2.2: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.2: +3 -1 lines
MFC revision 1.269: Fix sending trailers in sendfile(2).

Revision 1.269: download - view: text, markup, annotated - select for diffs
Sun Feb 24 00:07:00 2008 UTC (3 years, 11 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +3 -1 lines
After finishing sending file data in sendfile(2), don't forget to send
the provided trailers.  This has been broken since revision 1.240.

Submitted by:	Dan Nelson
PR:		kern/120948
"sounds ok to me" from:	phk
MFC after:	3 days

Revision 1.268: download - view: text, markup, annotated - select for diffs
Sat Feb 23 01:01:48 2008 UTC (3 years, 11 months ago) by des
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +36 -0 lines
This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload
consists of the null-terminated name and the contents of any structure
you wish to record.  A new ktrstruct() function constructs and emits a
KTR_STRUCT record.  It is accompanied by convenience macros for struct
stat and struct sockaddr.

In kdump(1), KTR_STRUCT records are handled by a dispatcher function
that runs stringent sanity checks on its contents before handing it
over to individual decoding funtions for each type of structure.
Currently supported structures are struct stat and struct sockaddr for
the AF_INET, AF_INET6 and AF_UNIX families; support for AF_APPLETALK
and AF_IPX is present but disabled, as I am unable to test it properly.

Since 's' was already taken, the letter 't' is used by ktrace(1) to
enable KTR_STRUCT trace points, and in kdump(1) to enable their
decoding.

Derived from patches by Andrew Li <andrew2.li@citi.com>.

PR:		kern/117836
MFC after:	3 weeks

Revision 1.221.2.1.2.1: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:47:39 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_6_1
Diff to: previous 1.221.2.1: preferred, colored; next MAIN 1.221.2.2: preferred, colored
Changes since revision 1.221.2.1: +3 -2 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile
Approved by:	so (simon)

Revision 1.221.2.4.2.1: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:47:06 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_6_2
Diff to: previous 1.221.2.4: preferred, colored; next MAIN 1.221.2.5: preferred, colored
Changes since revision 1.221.2.4: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile
Approved by:	so (simon)

Revision 1.221.2.4.4.1: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:46:40 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_6_3
Diff to: previous 1.221.2.4: preferred, colored; next MAIN 1.221.2.5: preferred, colored
Changes since revision 1.221.2.4: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile
Approved by:	so (simon)

Revision 1.221.2.5: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:46:08 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.221.2.4: preferred, colored; branchpoint 1.221: preferred, colored; next MAIN 1.222: preferred, colored
Changes since revision 1.221.2.4: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile

Revision 1.259.4.2: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:45:41 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_7_0
CVS tags: RELENG_7_0_0_RELEASE
Diff to: previous 1.259.4.1: preferred, colored; branchpoint 1.259: preferred, colored; next MAIN 1.260: preferred, colored
Changes since revision 1.259.4.1: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile
Approved by:	re (kensmith)

Revision 1.259.2.2: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:44:59 2008 UTC (3 years, 11 months ago) by simon
Branches: RELENG_7
Diff to: previous 1.259.2.1: preferred, colored; branchpoint 1.259: preferred, colored
Changes since revision 1.259.2.1: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile

Revision 1.267: download - view: text, markup, annotated - select for diffs
Thu Feb 14 11:44:31 2008 UTC (3 years, 11 months ago) by simon
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +17 -14 lines
Fix sendfile(2) write-only file permission bypass.

Security:	FreeBSD-SA-08:03.sendfile
Submitted by:	kib

Revision 1.266: download - view: text, markup, annotated - select for diffs
Sun Feb 3 15:54:40 2008 UTC (4 years ago) by phk
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +42 -1 lines
Give sendfile(2) a SF_SYNC flag which makes it wait until all mbufs
referencing the files VM pages are returned from the network stack,
making changes to the file safe.

This flag does not guarantee that the data has been transmitted to the
other end.

Revision 1.259.4.1: download - view: text, markup, annotated - select for diffs
Sat Feb 2 12:44:13 2008 UTC (4 years ago) by rwatson
Branches: RELENG_7_0
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +7 -2 lines
Merge uipc_sockbuf.c:1.175, uipc_socket.c:1.304, uipc_syscalls.c:1.264,
sctp_input.c:1.67, sctp_peeloff.c:1.17, sctputil.c:1.73,
socketvar.h:1.161 from HEAD to RELENG_7_0:

  Correct two problems relating to sorflush(), which is called to flush
  read socket buffers in shutdown() and close():

  - Call socantrcvmore() before sblock() to dislodge any threads that
    might be sleeping (potentially indefinitely) while holding sblock(),
    such as a thread blocked in recv().

  - Flag the sblock() call as non-interruptible so that a signal
    delivered to the thread calling sorflush() doesn't cause sblock() to
    fail.  The sblock() is required to ensure that all other socket
    consumer threads have, in fact, left, and do not enter, the socket
    buffer until we're done flushin it.

  To implement the latter, change the 'flags' argument to sblock() to
  accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
  flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
  acquisition, regardless of the setting of the disposition of SB_NOINTR
  on the socket buffer; without this change it would be possible for
  another thread to clear SB_NOINTR between when the socket buffer mutex
  is released and sblock() is invoked.

  Reviewed by:    bz, kmacy, rrs
  Reported by:    Jos Backus <jos at catnook dot com>

Approved by:	re (kensmith)

Revision 1.259.2.1: download - view: text, markup, annotated - select for diffs
Fri Feb 1 22:51:39 2008 UTC (4 years ago) by rwatson
Branches: RELENG_7
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +7 -2 lines
Merge uipc_sockbuf.c:1.175, uipc_socket.c:1.304, uipc_syscalls.c:1.264,
sctp_input.c:1.67, sctp_peeloff.c:1.17, sctputil.c:1.73,
socketvar.h:1.161 from HEAD to RELENG_7:

  Correct two problems relating to sorflush(), which is called to flush
  read socket buffers in shutdown() and close():

  - Call socantrcvmore() before sblock() to dislodge any threads that
    might be sleeping (potentially indefinitely) while holding sblock(),
    such as a thread blocked in recv().

  - Flag the sblock() call as non-interruptible so that a signal
    delivered to the thread calling sorflush() doesn't cause sblock() to
    fail.  The sblock() is required to ensure that all other socket
    consumer threads have, in fact, left, and do not enter, the socket
    buffer until we're done flushin it.

  To implement the latter, change the 'flags' argument to sblock() to
  accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
  flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
  acquisition, regardless of the setting of the disposition of SB_NOINTR
  on the socket buffer; without this change it would be possible for
  another thread to clear SB_NOINTR between when the socket buffer mutex
  is released and sblock() is invoked.

  Reviewed by:    bz, kmacy
  Reported by:    Jos Backus <jos at catnook dot com>

Revision 1.265: download - view: text, markup, annotated - select for diffs
Fri Feb 1 19:36:26 2008 UTC (4 years ago) by phk
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +1 -1 lines
Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.

Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.

Likely break the only non-convetional user of the API, after informing
the relevant committer.

Update the mbuf(9) manual page, which was already out of sync on
this point.

Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.

This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.

This does not affect the memory layout or size of mbufs.

Parental oversight by:	sam and rwatson.

No MFC is anticipated.

Revision 1.264: download - view: text, markup, annotated - select for diffs
Thu Jan 31 08:22:24 2008 UTC (4 years ago) by rwatson
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +7 -2 lines
Correct two problems relating to sorflush(), which is called to flush
read socket buffers in shutdown() and close():

- Call socantrcvmore() before sblock() to dislodge any threads that
  might be sleeping (potentially indefinitely) while holding sblock(),
  such as a thread blocked in recv().

- Flag the sblock() call as non-interruptible so that a signal
  delivered to the thread calling sorflush() doesn't cause sblock() to
  fail.  The sblock() is required to ensure that all other socket
  consumer threads have, in fact, left, and do not enter, the socket
  buffer until we're done flushin it.

To implement the latter, change the 'flags' argument to sblock() to
accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
acquisition, regardless of the setting of the disposition of SB_NOINTR
on the socket buffer; without this change it would be possible for
another thread to clear SB_NOINTR between when the socket buffer mutex
is released and sblock() is invoked.

Reviewed by:	bz, kmacy
Reported by:	Jos Backus <jos at catnook dot com>

Revision 1.263: 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.262: preferred, colored
Changes since revision 1.262: +2 -2 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.262: 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.261: preferred, colored
Changes since revision 1.261: +2 -2 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.261: download - view: text, markup, annotated - select for diffs
Sun Dec 30 01:42:13 2007 UTC (4 years, 1 month ago) by jeff
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +5 -28 lines
Remove explicit locking of struct file.
 - Introduce a finit() which is used to initailize the fields of struct file
   in such a way that the ops vector is only valid after the data, type,
   and flags are valid.
 - Protect f_flag and f_count with atomic operations.
 - Remove the global list of all files and associated accounting.
 - Rewrite the unp garbage collection such that it no longer requires
   the global list of all files and instead uses a list of all unp sockets.
 - Mark sockets in the accept queue so we don't incorrectly gc them.

Tested by:	kris, pho

Revision 1.260: download - view: text, markup, annotated - select for diffs
Wed Oct 24 19:03:55 2007 UTC (4 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +12 -12 lines
Merge first in a series of TrustedBSD MAC Framework KPI changes
from Mac OS X Leopard--rationalize naming for entry points to
the following general forms:

  mac_<object>_<method/action>
  mac_<object>_check_<method/action>

The previous naming scheme was inconsistent and mostly
reversed from the new scheme.  Also, make object types more
consistent and remove spaces from object types that contain
multiple parts ("posix_sem" -> "posixsem") to make mechanical
parsing easier.  Introduce a new "netinet" object type for
certain IPv4/IPv6-related methods.  Also simplify, slightly,
some entry point names.

All MAC policy modules will need to be recompiled, and modules
not updates as part of this commit will need to be modified to
conform to the new KPI.

Sponsored by:	SPARTA (original patches against Mac OS X)
Obtained from:	TrustedBSD Project, Apple Computer

Revision 1.259: download - view: text, markup, annotated - select for diffs
Mon Aug 27 05:19:45 2007 UTC (4 years, 5 months ago) by rrs
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP
Branch point for: RELENG_7_0, RELENG_7
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +5 -8 lines
- During shutdown pending, when the last sack came in and
  the last message on the send stream was "null" but still
  there, a state we allow, we could get hung and not clean
  it up and wait for the shutdown guard timer to clear the
  association without a graceful close. Fix this so that
  that we properly clean up.
- Added support for Multiple ASCONF per new RFC. We only
  (so far) accept input of these and cannot yet generate
  a multi-asconf.
- Sysctl'd support for experimental Fast Handover feature. Always
  disabled unless sysctl or socket option changes to enable.
- Error case in add-ip where the peer supports AUTH and ADD-IP
  but does NOT require AUTH of ASCONF/ASCONF-ACK. We need to
  ABORT in this case.
- According to the Kyoto summit of socket api developers
  (Solaris, Linux, BSD). We need to have:
   o non-eeor mode messages be atomic - Fixed
   o Allow implicit setup of an assoc in 1-2-1 model if
     using the sctp_**() send calls - Fixed
   o Get rid of HAVE_XXX declarations - Done
   o add a sctp_pr_policy in hole in sndrcvinfo structure - Done
   o add a PR_SCTP_POLICY_VALID type flag - yet to-do in a future patch!
- Optimize sctp6 calls to reuse code in sctp_usrreq. Also optimize
  when we close sending out the data and disabling Nagle.
- Change key concatenation order to match the auth RFC
- When sending OOTB shutdown_complete always do csum.
- Don't send PKT-DROP to a PKT-DROP
- For abort chunks just always checksums same for
  shutdown-complete.
- inpcb_free front state had a bug where in queue
  data could wedge an assoc. We need to just abandon
  ones in front states (free_assoc).
- If a peer sends us a 64k abort, we would try to
  assemble a response packet which may be larger than
  64k. This then would be dropped by IP. Instead make
  a "minimum" size for us 64k-2k (we want at least
  2k for our initack). If we receive such an init
  discard it early without all the processing.
- When we peel off we must increment the tcb ref count
  to keep it from being freed from underneath us.
- handling fwd-tsn had bugs that caused memory overwrites
  when given faulty data, fixed so can't happen and we
  also stop at the first bad stream no.
- Fixed so comm-up generates the adaption indication.
- peeloff did not get the hmac params copied.
- fix it so we lock the addr list when doing src-addr selection
  (in future we need to use a multi-reader/one writer lock here)
- During lowlevel output, we could end up with a _l_addr set
  to null if the iterator is calling the output routine. This
  means we would possibly crash when we gather the MTU info.
  Fix so we only do the gather where we have a src address
  cached.
- we need to be sure to set abort flag on conn state when
  we receive an abort.
- peeloff could leak a socket. Moved code so the close will
  find the socket if the peeloff fails (uipc_syscalls.c)

Approved by:	re@freebsd.org(Ken Smith)

Revision 1.258: download - view: text, markup, annotated - select for diffs
Mon Aug 6 14:26:00 2007 UTC (4 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +13 -54 lines
Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet.  As that
has now been removed, they are no longer required.  Removing them
significantly simplifies error-handling in the socket layer, eliminated
quite a bit of unwinding of locking in error cases.

While here clean up the now unneeded opt_net.h, which previously was used
for the NET_WITH_GIANT kernel option.  Clean up some related gotos for
consistency.

Reviewed by:	bz, csjp
Tested by:	kris
Approved by:	re (kensmith)

Revision 1.257: download - view: text, markup, annotated - select for diffs
Mon Jul 2 12:50:53 2007 UTC (4 years, 7 months ago) by rrs
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +10 -6 lines
- Add some needed error checking on bad fd passing in the sctp
  syscalls.
Approved by:	re@freebsd.org (Ken Smith)
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)

Revision 1.256: download - view: text, markup, annotated - select for diffs
Sat May 19 20:50:59 2007 UTC (4 years, 8 months ago) by andre
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +37 -13 lines
In kern_sendfile() adjust byte accounting of the file sending loop to
ignore the size of any headers that were passed with the sendfile(2)
system call.  Otherwise the file sent will be truncated by the header
size if the nbytes parameter was provided.  The bug doesn't show up
when either nbytes is zero, meaning send the whole file, or no header
iovec is provided.

Resolve a potential error aliasing of errors from the VM and sf_buf
parts and the protocol send parts where an error of the latter over-
writes one of the former.

Update comments.

The byte accounting bug wasn't seen in earlier because none of the popular
sendfile(2) consumers, Apache, lighttpd and our ftpd(8) use it in modes
that trigger it.  The varnish HTTP proxy makes full use of it and exposed
the problem.

Bug found by:	phk
Tested by:	phk

Revision 1.255: download - view: text, markup, annotated - select for diffs
Wed May 16 20:41:08 2007 UTC (4 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +21 -21 lines
Generally migrate to ANSI function headers, and remove 'register' use.

Revision 1.254: download - view: text, markup, annotated - select for diffs
Thu May 3 14:42:41 2007 UTC (4 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +0 -4 lines
sblock() implements a sleep lock by interlocking SB_WANT and SB_LOCK flags
on each socket buffer with the socket buffer's mutex.  This sleep lock is
used to serialize I/O on sockets in order to prevent I/O interlacing.

This change replaces the custom sleep lock with an sx(9) lock, which
results in marginally better performance, better handling of contention
during simultaneous socket I/O across multiple threads, and a cleaner
separation between the different layers of locking in socket buffers.
Specifically, the socket buffer mutex is now solely responsible for
serializing simultaneous operation on the socket buffer data structure,
and not for I/O serialization.

While here, fix two historic bugs:

(1) a bug allowing I/O to be occasionally interlaced during long I/O
    operations (discovere by Isilon).

(2) a bug in which failed non-blocking acquisition of the socket buffer
    I/O serialization lock might be ignored (discovered by sam).

SCTP portion of this patch submitted by rrs.

Revision 1.253: download - view: text, markup, annotated - select for diffs
Fri Apr 20 19:49:20 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +3 -23 lines
Don't reinvent vm_page_grab().

Reviewed by:	ups

Revision 1.252: download - view: text, markup, annotated - select for diffs
Thu Apr 19 05:54:45 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +2 -2 lines
Fix a bug in sendfile(2) when files larger than page size and nbytes=0.
When nbytes=0, sendfile(2) should use file size. Because of the bug, it
was sending half of a file. The bug is that 'off' variable can't be used
for size calculation, because it changes inside the loop, so we should
use uap->offset instead.

Revision 1.251: download - view: text, markup, annotated - select for diffs
Fri Apr 6 23:31:30 2007 UTC (4 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +0 -5 lines
Remove XXX comment that changes to file fields should be protected with
the file lock rather than the filedesc lock: I fixed this in the last
revision.

Spotted by:	kris

Revision 1.250: download - view: text, markup, annotated - select for diffs
Wed Apr 4 09:11:33 2007 UTC (4 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +14 -9 lines
Replace custom file descriptor array sleep lock constructed using a mutex
and flags with an sxlock.  This leads to a significant and measurable
performance improvement as a result of access to shared locking for
frequent lookup operations, reduced general overhead, and reduced overhead
in the event of contention.  All of these are imported for threaded
applications where simultaneous access to a shared file descriptor array
occurs frequently.  Kris has reported 2x-4x transaction rate improvements
on 8-core MySQL benchmarks; smaller improvements can be expected for many
workloads as a result of reduced overhead.

- Generally eliminate the distinction between "fast" and regular
  acquisisition of the filedesc lock; the plan is that they will now all
  be fast.  Change all locking instances to either shared or exclusive
  locks.

- Correct a bug (pointed out by kib) in fdfree() where previously msleep()
  was called without the mutex held; sx_sleep() is now always called with
  the sxlock held exclusively.

- Universally hold the struct file lock over changes to struct file,
  rather than the filedesc lock or no lock.  Always update the f_ops
  field last. A further memory barrier is required here in the future
  (discussed with jhb).

- Improve locking and reference management in linux_at(), which fails to
  properly acquire vnode references before using vnode pointers.  Annotate
  improper use of vn_fullpath(), which will be replaced at a future date.

In fcntl(), we conservatively acquire an exclusive lock, even though in
some cases a shared lock may be sufficient, which should be revisited.
The dropping of the filedesc lock in fdgrowtable() is no longer required
as the sxlock can be held over the sleep operation; we should consider
removing that (pointed out by attilio).

Tested by:	kris
Discussed with:	jhb, kris, attilio, jeff

Revision 1.249: download - view: text, markup, annotated - select for diffs
Mon Apr 2 19:15:47 2007 UTC (4 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +7 -2 lines
Fix a fd leak in socketpair():
- Close the new file objects created during socketpair() if the copyout of
  the new file descriptors fails.
- Add a test to the socketpair regression test for this edge case.

Revision 1.248: 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.247: preferred, colored
Changes since revision 1.247: +1 -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.247: download - view: text, markup, annotated - select for diffs
Sun Mar 4 22:36:47 2007 UTC (4 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +3 -78 lines
Remove 'MPSAFE' annotations from the comments above most system calls: all
system calls now enter without Giant held, and then in some cases, acquire
Giant explicitly.

Remove a number of other MPSAFE annotations in the credential code and
tweak one or two other adjacent comments.

Revision 1.246: download - view: text, markup, annotated - select for diffs
Wed Jan 24 12:59:56 2007 UTC (5 years ago) by rrs
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +10 -2 lines
Fixes the MSG_PEEK for sctp_generic_recvmsg() the msg_flags
were not being copied in properly so PEEK and any other
msg_flags input operation were not being performed right.
Approved by:	gnn

Revision 1.245: download - view: text, markup, annotated - select for diffs
Sun Nov 12 20:57:00 2006 UTC (5 years, 2 months ago) by andre
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +19 -23 lines
In kern_sendfile() fix the calculation of sbytes (the total number of bytes
written to the socket).  The rewrite in revision 1.240 got confused by the
FreeBSD 4.x bug compatibility code.

For some reason lighttpd, that was used for testing the new sendfile code,
was not affected by the problem but apache and others using headers/trailers
in the sendfile call received incorrect sbytes values after return from non-
blocking sockets.  This then lead to restarts with wrong offsets and thus
mixed up file contents when the socket was writeable again.  All programs
not using headers/trailers, like ftpd, were not affected by the bug.

Reported by:	Pawel Worach <pawel.worach-at-gmail.com>
Tested by:	Pawel Worach <pawel.worach-at-gmail.com>

Revision 1.244: download - view: text, markup, annotated - select for diffs
Tue Nov 7 21:28:12 2006 UTC (5 years, 3 months ago) by andre
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +95 -107 lines
Style cleanups to the sctp_* syscall functions.

Revision 1.243: download - view: text, markup, annotated - select for diffs
Mon Nov 6 21:53:19 2006 UTC (5 years, 3 months ago) by andre
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +9 -9 lines
Handle early errors in kern_sendfile() by introducing a new goto 'out'
label after the sbunlock() part.

This correctly handles calls to sendfile(2) without valid parameters
that was broken in rev. 1.240.

Coverity error:	272162

Revision 1.242: download - view: text, markup, annotated - select for diffs
Fri Nov 3 15:23:14 2006 UTC (5 years, 3 months ago) by rrs
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +451 -0 lines
Ok, here it is, we finally add SCTP to current. Note that this
work is not just mine, but it is also the works of Peter Lei
and Michael Tuexen. They both are my two key other developers
working on the project.. and they need ata-boy's too:
****
peterlei@cisco.com
tuexen@fh-muenster.de
****
I did do a make sysent which updated the
syscall's and sysproto.. I hope that is correct... without
it you don't build since we have new syscalls for SCTP :-0

So go out and look at the NOTES, add
option SCTP (make sure inet and inet6 are present too)
and play with SCTP.

I will see about comitting some test tools I have after I
figure out where I should place them. I also have a
lib (libsctp.a) that adds some of the missing socketapi
functions that I need to put into lib's.. I will talk
to George about this :-)

There may still be some 64 bit issues in here, none of
us have a 64 bit processor to test with yet.. Michael
may have a MAC but thats another beast too..

If you have a mac and want to use SCTP contact Michael
he maintains a web site with a loadable module with
this code :-)

Reviewed by:	gnn
Approved by:	gnn

Revision 1.241: download - view: text, markup, annotated - select for diffs
Thu Nov 2 17:37:21 2006 UTC (5 years, 3 months ago) by andre
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +1 -3 lines
Rename m_getm() to m_getm2() and rewrite it to allocate up to page sized
mbuf clusters.  Add a flags parameter to accept M_PKTHDR and M_EOR mbuf
chain flags.  Provide compatibility macro for m_getm() calling m_getm2()
with M_PKTHDR set.

Rewrite m_uiotombuf() to use m_getm2() for mbuf allocation and do the
uiomove() in a tight loop over the mbuf chain.  Add a flags parameter to
accept mbuf flags to be passed to m_getm2().  Adjust all callers for the
extra parameter.

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 month

Revision 1.240: download - view: text, markup, annotated - select for diffs
Thu Nov 2 16:53:26 2006 UTC (5 years, 3 months ago) by andre
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +280 -242 lines
Rewrite kern_sendfile() to work in two loops, the inner which turns as many
VM pages into mbufs as it can -- up to the free send socket buffer space.
The outer loop then drops the whole mbuf chain into the send socket buffer,
calls tcp_output() on it and then waits until 50% of the socket buffer are
free again to repeat the cycle. This way tcp_output() gets the full amount
of data to work with and can issue up to 64K sends for TSO to chop up in
the network adapter without using any CPU cycles. Thus it gets very efficient
especially with the readahead the VM and I/O system do.

The previous sendfile(2) code simply looped over the file, turned each 4K
page into an mbuf and sent it off. This had the effect that TSO could only
generate 2 packets per send instead of up to 44 at its maximum of 64K.

Add experimental SF_MNOWAIT flag to sendfile(2) to return ENOMEM instead of
sleeping on mbuf allocation failures.

Benchmarking shows significant improvements (95% confidence):
 45% less cpu (or 1.81 times better) with new sendfile vs. old sendfile (non-TSO)
 83% less cpu (or 5.7 times better) with new sendfile vs. old sendfile (TSO)

(Sender AMD Opteron 852 (2.6GHz) with em(4) PCI-X-133 interface and receiver
DELL Poweredge SC1425 P-IV Xeon 3.2GHz with em(4) LOM connected back to back
at 1000Base-TX full duplex.)

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 month

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sun Oct 22 11:52:14 2006 UTC (5 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +2 -1 lines
Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h
begun with a repo-copy of mac.h to mac_framework.h.  sys/mac.h now
contains the userspace and user<->kernel API and definitions, with all
in-kernel interfaces moved to mac_framework.h, which is now included
across most of the kernel instead.

This change is the first step in a larger cleanup and sweep of MAC
Framework interfaces in the kernel, and will not be MFC'd.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA

Revision 1.238: download - view: text, markup, annotated - select for diffs
Sun Oct 22 04:28:13 2006 UTC (5 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +1 -1 lines
Replace PG_BUSY with VPO_BUSY.  In other words, changes to the page's
busy flag, i.e., VPO_BUSY, are now synchronized by the per-vm object
lock instead of the global page queues lock.

Revision 1.221.2.4: download - view: text, markup, annotated - select for diffs
Wed Sep 13 09:10:01 2006 UTC (5 years, 4 months ago) by gnn
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_2_BP, RELENG_6_2_0_RELEASE
Branch point for: RELENG_6_3, RELENG_6_2
Diff to: previous 1.221.2.3: preferred, colored; branchpoint 1.221: preferred, colored
Changes since revision 1.221.2.3: +2 -2 lines
MFC of fix for PR 98858
Properly cast the values of valsize (the size of the value passed in)
in setsockopt so that they can be compared correctly against negative
values.  Passing in a negative value had a rather negative effect
on our socket code, making it impossible to open new sockets.

PR:             98858
Submitted by:   James.Juran@baesystems.com
Approved by:    re

Revision 1.221.2.3: download - view: text, markup, annotated - select for diffs
Tue Aug 15 18:48:51 2006 UTC (5 years, 5 months ago) by alc
Branches: RELENG_6
Diff to: previous 1.221.2.2: preferred, colored; branchpoint 1.221: preferred, colored
Changes since revision 1.221.2.2: +29 -4 lines
MFC revision 1.225
  Use NET_LOCK_GIANT() and VFS_LOCK_GIANT() instead of unconditionally
  acquiring Giant in kern_sendfile().

  Guard against the forced reclamation of a vnode in kern_sendfile().

Revision 1.237: download - view: text, markup, annotated - select for diffs
Wed Aug 9 17:43:26 2006 UTC (5 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +0 -2 lines
Introduce a field to struct vm_page for storing flags that are
synchronized by the lock on the object containing the page.

Transition PG_WANTED and PG_SWAPINPROG to use the new field,
eliminating the need for holding the page queues lock when setting
or clearing these flags.  Rename PG_WANTED and PG_SWAPINPROG to
VPO_WANTED and VPO_SWAPINPROG, respectively.

Eliminate the assertion that the page queues lock is held in
vm_page_io_finish().

Eliminate the acquisition and release of the page queues lock
around calls to vm_page_io_finish() in kern_sendfile() and
vfs_unbusy_pages().

Revision 1.236: download - view: text, markup, annotated - select for diffs
Sun Aug 6 01:00:09 2006 UTC (5 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +4 -4 lines
Reduce the scope of the page queues lock in kern_sendfile() now that
vm_page_sleep_if_busy() no longer requires the caller to hold the page
queues lock.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Fri Aug 4 05:53:20 2006 UTC (5 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +3 -3 lines
The page queues lock is no longer required by vm_page_io_start().  Reduce
the scope of the page queues lock in kern_sendfile() accordingly.

Revision 1.234: download - view: text, markup, annotated - select for diffs
Thu Jul 27 19:54:41 2006 UTC (5 years, 6 months ago) by jhb
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +15 -5 lines
Fix a file descriptor race I reintroduced when I split accept1() up into
kern_accept() and accept1().  If another thread closed the new file
descriptor and the first thread later got an error trying to copyout the
socket address, then it would attempt to close the wrong file object.  To
fix, add a struct file ** argument to kern_accept().  If it is non-NULL,
then on success kern_accept() will store a pointer to the new file object
there and not release any of the references.  It is up to the calling code
to drop the references appropriately (including a call to fdclose() in case
of error to safely handle the aforementioned race).  While I'm at it, go
ahead and fix the svr4 streams code to not leak the accept fd if it gets an
error trying to copyout the streams structures.

Revision 1.233: download - view: text, markup, annotated - select for diffs
Mon Jul 24 15:20:07 2006 UTC (5 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +2 -4 lines
soreceive_generic(), and sopoll_generic().  Add new functions sosend(),
soreceive(), and sopoll(), which are wrappers for pru_sosend,
pru_soreceive, and pru_sopoll, and are now used univerally by socket
consumers rather than either directly invoking the old so*() functions
or directly invoking the protocol switch method (about an even split
prior to this commit).

This completes an architectural change that was begun in 1996 to permit
protocols to provide substitute implementations, as now used by UDP.
Consumers now uniformly invoke sosend(), soreceive(), and sopoll() to
perform these operations on sockets -- in particular, distributed file
systems and socket system calls.

Architectural head nod:	sam, gnn, wollman

Revision 1.232: download - view: text, markup, annotated - select for diffs
Wed Jul 19 18:28:52 2006 UTC (5 years, 6 months ago) by jhb
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +6 -4 lines
Don't free the sockaddr in kern_bind() and kern_connect() as not all
callers pass a sockaddr allocated via malloc() from M_SONAME anymore.
Instead, free it in the callers when necessary.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Mon Jul 10 21:38:17 2006 UTC (5 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +169 -103 lines
- Split out kern_accept(), kern_getpeername(), and kern_getsockname() for
  use by ABI emulators.
- Alter the interface of kern_recvit() somewhat.  Specifically, go ahead
  and hard code UIO_USERSPACE in the uio as that's what all the callers
  specify.  In place, add a new uioseg to indicate what type of pointer
  is in mp->msg_name.  Previously it was always a userland address, but
  ABI emulators may pass in kernel-side sockaddrs.  Also, remove the
  namelenp field and instead require the two places that used it to
  explicitly copy mp->msg_namelen out to userland.
- Use the patched kern_recvit() to replace svr4_recvit() and the stock
  kern_sendit() to replace svr4_sendit().
- Use kern_bind() instead of stackgap use in ti_bind().
- Use kern_getpeername() and kern_getsockname() instead of stackgap in
  svr4_stream_ti_ioctl().
- Use kern_connect() instead of stackgap in svr4_do_putmsg().
- Use kern_getpeername() and kern_accept() instead of stackgap in
  svr4_do_getmsg().
- Retire the stackgap from SVR4 compat as it is no longer used.

Revision 1.230: download - view: text, markup, annotated - select for diffs
Tue Jun 20 12:36:40 2006 UTC (5 years, 7 months ago) by gnn
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +2 -2 lines
Properly cast the values of valsize (the size of the value passed in)
in setsockopt so that they can be compared correctly against negative
values.  Passing in a negative value had a rather negative effect
on our socket code, making it impossible to open new sockets.

PR:		98858
Submitted by:	James.Juran@baesystems.com
MFC after:	1 week

Revision 1.229: download - view: text, markup, annotated - select for diffs
Sat Jun 10 14:34:07 2006 UTC (5 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +0 -1 lines
Move some functions and definitions from uipc_socket2.c to uipc_socket.c:

- Move sonewconn(), which creates new sockets for incoming connections on
  listen sockets, so that all socket allocate code is together in
  uipc_socket.c.

- Move 'maxsockets' and associated sysctls to uipc_socket.c with the
  socket allocation code.

- Move kern.ipc sysctl node to uipc_socket.c, add a SYSCTL_DECL() for it
  to sysctl.h and remove lots of scattered implementations in various
  IPC modules.

- Sort sodealloc() after soalloc() in uipc_socket.c for dependency order
  reasons.  Statisticize soalloc() and sodealloc() as they are now
  required only in uipc_socket.c, and are internal to the socket
  implementation.

After this change, socket allocation and deallocation is entirely
centralized in one file, and uipc_socket2.c consists entirely of socket
buffer manipulation and default protocol switch functions.

MFC after:	1 month

Revision 1.228: download - view: text, markup, annotated - select for diffs
Thu May 25 15:10:13 2006 UTC (5 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +4 -2 lines
Use getsock() and fput() instead of fgetsock() and fputsock() in
sendfile().  This causes sendfile() to use the file descriptor
reference to the socket instead of bumping the socket reference
count, which avoids an additional refcount operation, as well as a
potential expensive socket refcount drop, which can lead to
contention on the accept mutex.  This change also has the side
effect of further reducing the number of cases where an in-progress
I/O operation can occur on a socket after close, as using the file
descriptor refcount prevents the socket from closing while in use.

MFC after:	3 months

Revision 1.221.2.2: download - view: text, markup, annotated - select for diffs
Mon May 15 18:34:05 2006 UTC (5 years, 8 months ago) by ps
Branches: RELENG_6
Diff to: previous 1.221.2.1: preferred, colored; branchpoint 1.221: preferred, colored
Changes since revision 1.221.2.1: +55 -38 lines
MFC: 32bit sendfile support

Revision 1.227: download - view: text, markup, annotated - select for diffs
Tue Apr 25 11:48:16 2006 UTC (5 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +19 -18 lines
Extend getsock() to return the struct file flags read while holding the
file lock, in the style of fgetsock().

Modify accept1() to use getsock() instead of fgetsock(), relying on the
file descriptor reference rather than an acquired socket reference to
prevent the listen socket from being destroyed during accept().  This
avoids additional reference count operations, which should improve
performance, and also avoids accept1() operating on a socket whose file
descriptor has been torn down, which may have resulted in protocol
shutdown starting.

MFC after:	3 months

Revision 1.226: download - view: text, markup, annotated - select for diffs
Sat Apr 1 11:14:56 2006 UTC (5 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +3 -0 lines
Add comment to accept1() that it should use getsock() instead of fgetsock()
to avoid additional mutex operations, and also to avoid use of soref/sorele
which are now not preferred.

MFC after:	3 months

Revision 1.225: download - view: text, markup, annotated - select for diffs
Mon Mar 27 04:23:16 2006 UTC (5 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +29 -4 lines
Use NET_LOCK_GIANT() and VFS_LOCK_GIANT() instead of unconditionally
acquiring Giant in kern_sendfile().

Guard against the forced reclamation of a vnode in kern_sendfile().

Discussed with: jeff
Reviewed by: tegge
MFC after: 3 weeks

Revision 1.224: download - view: text, markup, annotated - select for diffs
Tue Feb 28 19:39:17 2006 UTC (5 years, 11 months ago) by ps
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +55 -38 lines
Fix 32bit sendfile by implementing kern_sendfile so that it takes
the header and trailers as iovec arguments instead of copying them
in inside of sendfile.

Reviewed by:	jhb
MFC after:	3 weeks

Revision 1.221.2.1: download - view: text, markup, annotated - select for diffs
Wed Dec 28 19:30:41 2005 UTC (6 years, 1 month ago) by ps
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE
Branch point for: RELENG_6_1
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +26 -6 lines
MFC: 32bit compat for recvmsg, sendmsg, osigaction, osigprocmask,
osigpending, osigvec, osigblock, osigsetmask, osigsuspend, osigstack,
clock_gettime, clock_settime, and clock_getres.

Also correct the prototype for freebsd32_nanosleep in syscalls.master.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Mon Oct 31 21:09:55 2005 UTC (6 years, 3 months ago) by ps
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +14 -5 lines
Reformat socket control messages on input/output for 32bit compatibility
on 64bit systems.

Submitted by:	ps, ups
Reviewed by:	jhb

Revision 1.222: download - view: text, markup, annotated - select for diffs
Sat Oct 15 05:57:06 2005 UTC (6 years, 3 months ago) by ps
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +15 -3 lines
Implement the 32bit versions of recvmsg, recvfrom, sendmsg

Partially obtained from:	jhb

Revision 1.221: download - view: text, markup, annotated - select for diffs
Tue Jul 5 22:49:09 2005 UTC (6 years, 7 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +14 -0 lines
Add MAC Framework and MAC policy entry point mac_check_socket_create(),
which is invoked from socket() and socketpair(), permitting MAC
policy modules to control the creation of sockets by domain, type, and
protocol.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA, SPAWAR
Approved by:	re (scottl)
Requested by:	SCC

Revision 1.200.2.9: download - view: text, markup, annotated - select for diffs
Fri Jun 10 08:41:56 2005 UTC (6 years, 8 months ago) by rwatson
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.200.2.8: preferred, colored; branchpoint 1.200: preferred, colored; next MAIN 1.201: preferred, colored
Changes since revision 1.200.2.8: +1 -3 lines
Merge uipc_syscalls.c:1.215 and 1.216 from HEAD to RELENG_5:

  De-spl kern_connect().

  Remove now unused 'int s' from spl().

Revision 1.200.2.8: download - view: text, markup, annotated - select for diffs
Wed May 11 21:54:43 2005 UTC (6 years, 9 months ago) by emax
Branches: RELENG_5
Diff to: previous 1.200.2.7: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.7: +1 -1 lines
MFC to RELENG_5

Change m_uiotombuf so it will accept offset at which data should be copied
to the mbuf. Offset cannot exceed MHLEN bytes. This is currently used to
fix Ethernet header alignment problem on alpha and sparc64. Also change all
users of m_uiotombuf to pass proper offset.

Reviewed by:	jmg, sam
Approved by:	re

Revision 1.220: download - view: text, markup, annotated - select for diffs
Wed May 4 18:55:02 2005 UTC (6 years, 9 months ago) by emax
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +1 -1 lines
Change m_uiotombuf so it will accept offset at which data should be copied
to the mbuf. Offset cannot exceed MHLEN bytes. This is currently used to
fix Ethernet header alignment problem on alpha and sparc64. Also change all
users of m_uiotombuf to pass proper offset.

Reviewed by:	jmg, sam
Tested by:	Sten Spans "sten AT blinkenlights DOT nl"
MFC after:	1 week

Revision 1.219: download - view: text, markup, annotated - select for diffs
Sat Apr 16 18:46:28 2005 UTC (6 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +7 -0 lines
Introduce three additional MAC Framework and MAC Policy entry points to
control socket poll() (select()), fstat(), and accept() operations,
required for some policies:

        poll()          mac_check_socket_poll()
        fstat()         mac_check_socket_stat()
        accept()        mac_check_socket_accept()

Update mac_stub and mac_test policies to be aware of these entry points.
While here, add missing entry point implementations for:

        mac_stub.c      stub_check_socket_receive()
        mac_stub.c      stub_check_socket_send()
        mac_test.c      mac_test_check_socket_send()
        mac_test.c      mac_test_check_socket_visible()

Obtained from:	TrustedBSD Project
Sponsored by:	SPAWAR, SPARTA

Revision 1.218: download - view: text, markup, annotated - select for diffs
Thu Mar 31 04:31:29 2005 UTC (6 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +1 -1 lines
 - LK_NOPAUSE is a nop now.

Sponsored by:   Isilon Systems, Inc.

Revision 1.200.2.7: download - view: text, markup, annotated - select for diffs
Wed Mar 9 18:59:20 2005 UTC (6 years, 11 months ago) by alc
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.200.2.6: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.6: +1 -1 lines
MFC
 Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
 Change the spelling of the "catch" option to be consistent with the new
 options.

Approved by: re (kensmith)

Revision 1.217: download - view: text, markup, annotated - select for diffs
Tue Mar 8 16:11:40 2005 UTC (6 years, 11 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +2 -1 lines
Add kernel-only flag MSG_NOSIGNAL to be used in emulation layers to surpress
SIGPIPE signal for the duration of the sento-family syscalls. Use it to
replace previously added hack in Linux layer based on temporarily setting
SO_NOSIGPIPE flag.

Suggested by:	alfred

Revision 1.200.2.6: download - view: text, markup, annotated - select for diffs
Sun Feb 27 02:51:39 2005 UTC (6 years, 11 months ago) by jeff
Branches: RELENG_5
Diff to: previous 1.200.2.5: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.5: +12 -45 lines
MFC revisions 1.206 - 1.207, 1.209 - 1.211
 - filedesc locking cleanup.

Revision 1.200.2.5: download - view: text, markup, annotated - select for diffs
Fri Feb 25 18:03:49 2005 UTC (6 years, 11 months ago) by alc
Branches: RELENG_5
Diff to: previous 1.200.2.4: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.4: +4 -5 lines
MFC revision 1.202
 Modify the vm object locking in do_sendfile() so that the containing object
 is locked when vm_page_io_finish() is called on a page.

MFC revision 1.203
 Use VM_ALLOC_NOBUSY instead of calling vm_page_wakeup().

MFC revision 1.205
 Eliminate unnecessary calls to vm_page_busy().

Revision 1.200.2.4: download - view: text, markup, annotated - select for diffs
Sun Feb 20 00:56:04 2005 UTC (6 years, 11 months ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.200.2.3: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.3: +2 -2 lines
Merge uipc_syscalls.c:1.214 from HEAD to RELENG_5:

  date: 2005/02/17 13:00:23;  author: rwatson;  state: Exp;  lines: +2 -2
  In accept1(), extend coverage of the socket lock from just covering
  soref() to also covering the update of so_state.  While no other user
  threads can update the socket state here as it's not yet hooked up to
  the file descriptor array yet, the protocol could also frob the
  socket state here, leading to a lost update to the so_state field.
  No reported instances of this bug (as yet).

Revision 1.216: download - view: text, markup, annotated - select for diffs
Fri Feb 18 21:39:55 2005 UTC (6 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +1 -1 lines
Remove now unused 'int s' from spl().

MFC after:	3 days

Revision 1.215: download - view: text, markup, annotated - select for diffs
Fri Feb 18 19:37:36 2005 UTC (6 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +0 -2 lines
De-spl kern_connect().

MFC after:	3 days

Revision 1.214: download - view: text, markup, annotated - select for diffs
Thu Feb 17 13:00:23 2005 UTC (6 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +2 -2 lines
In accept1(), extend coverage of the socket lock from just covering
soref() to also covering the update of so_state.  While no other user
threads can update the socket state here as it's not yet hooked up to
the file descriptor array yet, the protocol could also frob the
socket state here, leading to a lost update to the so_state field.
No reported instances of this bug (as yet).

MFC after:      3 days

Revision 1.200.2.3: 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.200.2.2: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.2: +1 -1 lines
MFC: /*- and related license changes

Revision 1.213: download - view: text, markup, annotated - select for diffs
Sun Jan 30 07:20:36 2005 UTC (7 years ago) by sobomax
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +4 -3 lines
Extend kern_sendit() to take another enum uio_seg argument, which specifies
where the buffer to send lies and use it to eliminate yet another stackgap
in linuxlator.

MFC after:	2 weeks

Revision 1.212: download - view: text, markup, annotated - select for diffs
Tue Jan 25 00:39:00 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +2 -1 lines
Don't use VOP_GETVOBJECT, use vp->v_object directly.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Mon Jan 24 14:13:24 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +1 -2 lines
Save a line by unlocking before we test.

Revision 1.210: 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.209: preferred, colored
Changes since revision 1.209: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary

Revision 1.200.2.2: download - view: text, markup, annotated - select for diffs
Sat Nov 20 02:09:48 2004 UTC (7 years, 2 months ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.200.2.1: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.1: +87 -23 lines
Merge uipc_syscalls:1.204 from HEAD to RELENG_5:

  date: 2004/10/24 23:45:01;  author: rwatson;  state: Exp;  lines: +87 -23
  Move from using the socket reference count to the file reference
  count to prevent sockets from being garbage collected during
  socket-specific system calls.  This is the same approach used in
  most VFS-specific system calls, as well as generic file descriptor
  system calls such as read() and write().

  To do this, add a utility function getsock(), which is logically
  identical to getvnode() used for the same purpose in VFS.  Unlike
  fgetsock(), it returns with the file reference count elevated, but
  no bump of the socket reference count.  Replace matching calls to
  fputsock() with fdrop().

  This change is made to all socket system calls other than
  sendfile() and accept(), but the approach should be applicable to
  those system calls also.

  This shaves about four mutex operations off of each of these
  system calls, including send() and recv() variants, adding about
  1% to pps on minimal UDP packets for UP using netblast, and 4% on
  SMP.

  Reviewed by:    pjd

Revision 1.209: download - view: text, markup, annotated - select for diffs
Sat Nov 13 11:53:01 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +5 -5 lines
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.

Use this in all the places where sleeping with the lock held is not
an issue.

The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Mon Nov 8 00:43:46 2004 UTC (7 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +1 -1 lines
Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new
options.  Implement the "no wait" option.  An implementation of the "CPU
private" for i386 will be committed at a later date.

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sun Nov 7 22:16:07 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +6 -38 lines
Introduce fdclose() which will clean an entry in a filedesc.

Replace homerolled versions with call to fdclose().

Make fdunused() static to kern_descrip.c

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sun Nov 7 16:09:56 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +2 -2 lines
Use fget_locked() instead of homerolled

Revision 1.205: download - view: text, markup, annotated - select for diffs
Wed Nov 3 20:17:31 2004 UTC (7 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +0 -1 lines
The synchronization provided by vm object locking has eliminated the
need for most calls to vm_page_busy().  Specifically, most calls to
vm_page_busy() occur immediately prior to a call to vm_page_remove().
In such cases, the containing vm object is locked across both calls.
Consequently, the setting of the vm page's PG_BUSY flag is not even
visible to other threads that are following the synchronization
protocol.

This change (1) eliminates the calls to vm_page_busy() that
immediately precede a call to vm_page_remove() or functions, such as
vm_page_free() and vm_page_rename(), that call it and (2) relaxes the
requirement in vm_page_remove() that the vm page's PG_BUSY flag is
set.  Now, the vm page's PG_BUSY flag is set only when the vm object
lock is released while the vm page is still in transition.  Typically,
this is when it is undergoing I/O.

Revision 1.204: download - view: text, markup, annotated - select for diffs
Sun Oct 24 23:45:01 2004 UTC (7 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +87 -23 lines
Move from using the socket reference count to the file reference
count to prevent sockets from being garbage collected during
socket-specific system calls.  This is the same approach used in
most VFS-specific system calls, as well as generic file descriptor
system calls such as read() and write().

To do this, add a utility function getsock(), which is logically
identical to getvnode() used for the same purpose in VFS.  Unlike
fgetsock(), it returns with the file reference count elevated, but
no bump of the socket reference count.  Replace matching calls to
fputsock() with fdrop().

This change is made to all socket system calls other than
sendfile() and accept(), but the approach should be applicable to
those system calls also.

This shaves about four mutex operations off of each of these
system calls, including send() and recv() variants, adding about
1% to pps on minimal UDP packets for UP using netblast, and 4% on
SMP.

Reviewed by:	pjd

Revision 1.203: download - view: text, markup, annotated - select for diffs
Sun Oct 24 20:09:59 2004 UTC (7 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +1 -2 lines
Use VM_ALLOC_NOBUSY instead of calling vm_page_wakeup().

Revision 1.202: download - view: text, markup, annotated - select for diffs
Wed Oct 20 17:44:40 2004 UTC (7 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +3 -2 lines
Modify the vm object locking in do_sendfile() so that the containing object
is locked when vm_page_io_finish() is called on a page.  This is to satisfy
a new, post-RELENG_5 assertion in vm_page_io_finish().  (I am in the
process of transitioning the responsibility for synchronizing access to
various fields/flags on the page from the global page queues lock to the
per-object lock.)

Tripped over by: obrien@

Revision 1.200.2.1: download - view: text, markup, annotated - select for diffs
Fri Oct 8 23:37:19 2004 UTC (7 years, 4 months ago) by alc
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +1 -0 lines
MFC
 Add a SOCKBUF_LOCK() to a rarely executed path in do_sendfile().

Approved by: re (scottl)

Revision 1.201: download - view: text, markup, annotated - select for diffs
Sat Oct 2 05:37:47 2004 UTC (7 years, 4 months ago) by alc
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +1 -0 lines
Add a SOCKBUF_LOCK() to a rarely executed path in do_sendfile().

Revision 1.200: 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.199: preferred, colored
Changes since revision 1.199: +1 -1 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.65.2.21: download - view: text, markup, annotated - select for diffs
Fri Aug 13 14:51:45 2004 UTC (7 years, 5 months ago) by ume
Branches: RELENG_4
CVS tags: RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11
Diff to: previous 1.65.2.20: preferred, colored; branchpoint 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65.2.20: +4 -1 lines
MFC 1.187: allow more than MLEN bytes for ancillary data to meet the
requirement of Section 20.1 of RFC3542.

Revision 1.199: download - view: text, markup, annotated - select for diffs
Sat Jul 17 21:06:36 2004 UTC (7 years, 6 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +87 -35 lines
Add a kern_setsockopt and kern_getsockopt which can read the option
values from either user land or from the kernel. Use them for
[gs]etsockopt and to clean up some calls to [gs]etsockopt in the
Linux emulation code that uses the stackgap.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Sat Jul 10 15:42:16 2004 UTC (7 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +55 -142 lines
Clean up and wash struct iovec and struct uio handling.

Add copyiniov() which copies a struct iovec array in from userland into
a malloc'ed struct iovec.  Caller frees.

Change uiofromiov() to malloc the uio (caller frees) and name it
copyinuio() which is more appropriate.

Add cloneuio() which returns a malloc'ed copy.  Caller frees.

Use them throughout.

Revision 1.197: download - view: text, markup, annotated - select for diffs
Fri Jul 9 01:46:03 2004 UTC (7 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +1 -6 lines
Remove spl()'s from do_sendfile().

Revision 1.196: download - view: text, markup, annotated - select for diffs
Thu Jun 24 01:43:23 2004 UTC (7 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +4 -1 lines
Acquire socket lock in the "waiting for connection" loop in
kern_connect(), replacing tsleep() with msleep() with the socket
mutex.

Revision 1.195: download - view: text, markup, annotated - select for diffs
Tue Jun 22 23:58:09 2004 UTC (7 years, 7 months ago) by bms
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +1 -0 lines
Fix an inconsistency in socket option propagation on accept(). Propagate
the SS_NBIO flag from the parent socket to the child socket during an
accept() operation.

The file descriptor O_NONBLOCK flag would have been propagated already
by the fflag assignment, and therefore would have been inconsistent
with the underlying socket's so_state member.

This makes accept() more closely adhere to the API contract we effectively
outline in the manual page. Note also that Linux continues to differ here;
O_NONBLOCK is not propagated. The other BSDs do propagate the flag, as
does Solaris. The Single UNIX Specification does not offer specific
advice on this issue.

PR:		kern/45733
Requested by:	Jayanth Vijayaraghavan
Reviewed by:	rwatson

Revision 1.194: download - view: text, markup, annotated - select for diffs
Sat Jun 19 03:23:14 2004 UTC (7 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +21 -0 lines
Assert socket buffer lock in sb_lock() to protect socket buffer sleep
lock state.  Convert tsleep() into msleep() with socket buffer mutex
as argument.  Hold socket buffer lock over sbunlock() to protect sleep
lock state.

Assert socket buffer lock in sbwait() to protect the socket buffer
wait state.  Convert tsleep() into msleep() with socket buffer mutex
as argument.

Modify sofree(), sosend(), and soreceive() to acquire SOCKBUF_LOCK()
in order to call into these functions with the lock, as well as to
start protecting other socket buffer use in their implementation.  Drop
the socket buffer mutexes around calls into the protocol layer, around
potentially blocking operations, for copying to/from user space, and
VM operations relating to zero-copy.  Assert the socket buffer mutex
strategically after code sections or at the beginning of loops.  In
some cases, modify return code to ensure locks are properly dropped.

Convert the potentially blocking allocation of storage for the remote
address in soreceive() into a non-blocking allocation; we may wish to
move the allocation earlier so that it can block prior to acquisition
of the socket buffer lock.

Drop some spl use.

NOTE: Some races exist in the current structuring of sosend() and
soreceive().  This commit only merges basic socket locking in this
code; follow-up commits will close additional races.  As merged,
these changes are not sufficient to run without Giant safely.

Reviewed by:	juli, tjr

Revision 1.65.2.20: download - view: text, markup, annotated - select for diffs
Thu Jun 17 00:08:22 2004 UTC (7 years, 7 months ago) by fjoe
Branches: RELENG_4
Diff to: previous 1.65.2.19: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.19: +6 -0 lines
MFC:

sendfile(2)-related statistics that can be viewed through netstat -m:
- The number of times sendfile() had to do disk I/O
- The number of times sfbuf allocation failed
- The number of times sfbuf allocation had to wait
and three sysctl's: kern.ipc.nsfbufs, kern.ipc.nsfbufspeak,
kern.ipc.nsfbufsused that also can be viewed through netstat -m.

Submitted by:	Igor Sysoev <is (at) rambler-co.ru>

Revision 1.193: download - view: text, markup, annotated - select for diffs
Mon Jun 14 18:16:19 2004 UTC (7 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +4 -4 lines
The socket field so_state is used to hold a variety of socket related
flags relating to several aspects of socket functionality.  This change
breaks out several bits relating to send and receive operation into a
new per-socket buffer field, sb_state, in order to facilitate locking.
This is required because, in order to provide more granular locking of
sockets, different state fields have different locking properties.  The
following fields are moved to sb_state:

  SS_CANTRCVMORE            (so_state)
  SS_CANTSENDMORE           (so_state)
  SS_RCVATMARK              (so_state)

Rename respectively to:

  SBS_CANTRCVMORE           (so_rcv.sb_state)
  SBS_CANTSENDMORE          (so_snd.sb_state)
  SBS_RCVATMARK             (so_rcv.sb_state)

This facilitates locking by isolating fields to be located with other
identically locked fields, and permits greater granularity in socket
locking by avoiding storing fields with different locking semantics in
the same short (avoiding locking conflicts).  In the future, we may
wish to coallesce sb_state and sb_flags; for the time being I leave
them separate and there is no additional memory overhead due to the
packing/alignment of shorts in the socket buffer structure.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Sun Jun 13 02:50:05 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +12 -0 lines
Socket MAC labels so_label and so_peerlabel are now protected by
SOCK_LOCK(so):

- Hold socket lock over calls to MAC entry points reading or
  manipulating socket labels.

- Assert socket lock in MAC entry point implementations.

- When externalizing the socket label, first make a thread-local
  copy while holding the socket lock, then release the socket lock
  to externalize to userspace.

Revision 1.191: download - view: text, markup, annotated - select for diffs
Sat Jun 12 23:36:59 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +5 -5 lines
Correct whitespace errors in merge from rwatson_netperf: tabs instead of
spaces, no trailing tab at the end of line.

Pointed out by:	csjp

Revision 1.190: download - view: text, markup, annotated - select for diffs
Sat Jun 12 20:47:28 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +7 -0 lines
Extend coverage of SOCK_LOCK(so) to include so_count, the socket
reference count:

- Assert SOCK_LOCK(so) macros that directly manipulate so_count:
  soref(), sorele().

- Assert SOCK_LOCK(so) in macros/functions that rely on the state of
  so_count: sofree(), sotryfree().

- Acquire SOCK_LOCK(so) before calling these functions or macros in
  various contexts in the stack, both at the socket and protocol
  layers.

- In some cases, perform soisdisconnected() before sotryfree(), as
  this could result in frobbing of a non-present socket if
  sotryfree() actually frees the socket.

- Note that sofree()/sotryfree() will release the socket lock even if
  they don't free the socket.

Submitted by:	sam
Sponsored by:	FreeBSD Foundation
Obtained from:	BSD/OS

Revision 1.189: download - view: text, markup, annotated - select for diffs
Fri Jun 11 11:16:24 2004 UTC (7 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +1 -1 lines
Deorbit COMPAT_SUNOS.

We inherited this from the sparc32 port of BSD4.4-Lite1.  We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.

Revision 1.188: download - view: text, markup, annotated - select for diffs
Mon Jun 7 21:45:44 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +4 -4 lines
Correct a resource leak introduced in recent accept locking changes:
when I reordered events in accept1() to allocate a file descriptor
earlier, I didn't properly update use of goto on exit to unwind for
cases where the file descriptor is now held, but wasn't previously.
The result was that, in the event of accept() on a non-blocking socket,
or in the event of a socket error, a file descriptor would be leaked.

This ended up being non-fatal in many cases, as the file descriptor
would be properly GC'd on process exit, so only showed up for processes
that do a lot of non-blocking accept() calls, and also live for a long
time (such as qmail).

This change updates the use of goto targets to do additional unwinding.

Eyes provided by:	Brian Feldman <green@freebsd.org>
Feet, hands provided by:	Stefan Ehmann <shoesoft@gmx.net>,
				Dimitry Andric <dimitry@andric.com>
				Arjan van Leeuwen <avleeuwen@piwebs.com>

Revision 1.187: download - view: text, markup, annotated - select for diffs
Mon Jun 7 09:59:50 2004 UTC (7 years, 8 months ago) by ume
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +9 -1 lines
allow more than MLEN bytes for ancillary data to meet the
requirement of Section 20.1 of RFC3542.

Obtained from:	KAME
MFC after:	1 week

Revision 1.186: download - view: text, markup, annotated - select for diffs
Wed Jun 2 04:15:37 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +25 -43 lines
Integrate accept locking from rwatson_netperf, introducing a new
global mutex, accept_mtx, which serializes access to the following
fields across all sockets:

          so_qlen          so_incqlen         so_qstate
          so_comp          so_incomp          so_list
          so_head

While providing only coarse granularity, this approach avoids lock
order issues between sockets by avoiding ownership of the fields
by a specific socket and its per-socket mutexes.

While here, rewrite soclose(), sofree(), soaccept(), and
sonewconn() to add assertions, close additional races and  address
lock order concerns.  In particular:

- Reorganize the optimistic concurrency behavior in accept1() to
  always allocate a file descriptor with falloc() so that if we do
  find a socket, we don't have to encounter the "Oh, there wasn't
  a socket" race that can occur if falloc() sleeps in the current
  code, which broke inbound accept() ordering, not to mention
  requiring backing out socket state changes in a way that raced
  with the protocol level.  We may want to add a lockless read of
  the queue state if polling of empty queues proves to be important
  to optimize.

- In accept1(), soref() the socket while holding the accept lock
  so that the socket cannot be free'd in a race with the protocol
  layer.  Likewise in netgraph equivilents of the accept1() code.

- In sonewconn(), loop waiting for the queue to be small enough to
  insert our new socket once we've committed to inserting it, or
  races can occur that cause the incomplete socket queue to
  overfill.  In the previously implementation, it was sufficient
  to simply tested once since calling soabort() didn't release
  synchronization permitting another thread to insert a socket as
  we discard a previous one.

- In soclose()/sofree()/et al, it is the responsibility of the
  caller to remove a socket from the incomplete connection queue
  before calling soabort(), which prevents soabort() from having
  to walk into the accept socket to release the socket from its
  queue, and avoids races when releasing the accept mutex to enter
  soabort(), permitting soabort() to avoid lock ordering issues
  with the caller.

- Generally cluster accept queue related operations together
  throughout these functions in order to facilitate locking.

Annotate new locking in socketvar.h.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Tue Jun 1 02:42:55 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +1 -1 lines
The SS_COMP and SS_INCOMP flags in the so_state field indicate whether
the socket is on an accept queue of a listen socket.  This change
renames the flags to SQ_COMP and SQ_INCOMP, and moves them to a new
state field on the socket, so_qstate, as the locking for these flags
is substantially different for the locking on the remainder of the
flags in so_state.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Mon May 31 21:46:04 2004 UTC (7 years, 8 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +16 -0 lines
Bring in mbuma to replace mballoc.

mbuma is an Mbuf & Cluster allocator built on top of a number of
extensions to the UMA framework, all included herein.

Extensions to UMA worth noting:
  - Better layering between slab <-> zone caches; introduce
    Keg structure which splits off slab cache away from the
    zone structure and allows multiple zones to be stacked
    on top of a single Keg (single type of slab cache);
    perhaps we should look into defining a subset API on
    top of the Keg for special use by malloc(9),
    for example.
  - UMA_ZONE_REFCNT zones can now be added, and reference
    counters automagically allocated for them within the end
    of the associated slab structures.  uma_find_refcnt()
    does a kextract to fetch the slab struct reference from
    the underlying page, and lookup the corresponding refcnt.

mbuma things worth noting:
  - integrates mbuf & cluster allocations with extended UMA
    and provides caches for commonly-allocated items; defines
    several zones (two primary, one secondary) and two kegs.
  - change up certain code paths that always used to do:
    m_get() + m_clget() to instead just use m_getcl() and
    try to take advantage of the newly defined secondary
    Packet zone.
  - netstat(1) and systat(1) quickly hacked up to do basic
    stat reporting but additional stats work needs to be
    done once some other details within UMA have been taken
    care of and it becomes clearer to how stats will work
    within the modified framework.

From the user perspective, one implication is that the
NMBCLUSTERS compile-time option is no longer used.  The
maximum number of clusters is still capped off according
to maxusers, but it can be made unlimited by setting
the kern.ipc.nmbclusters boot-time tunable to zero.
Work should be done to write an appropriate sysctl
handler allowing dynamic tuning of kern.ipc.nmbclusters
at runtime.

Additional things worth noting/known issues (READ):
   - One report of 'ips' (ServeRAID) driver acting really
     slow in conjunction with mbuma.  Need more data.
     Latest report is that ips is equally sucking with
     and without mbuma.
   - Giant leak in NFS code sometimes occurs, can't
     reproduce but currently analyzing; brueffer is
     able to reproduce but THIS IS NOT an mbuma-specific
     problem and currently occurs even WITHOUT mbuma.
   - Issues in network locking: there is at least one
     code path in the rip code where one or more locks
     are acquired and we end up in m_prepend() with
     M_WAITOK, which causes WITNESS to whine from within
     UMA.  Current temporary solution: force all UMA
     allocations to be M_NOWAIT from within UMA for now
     to avoid deadlocks unless WITNESS is defined and we
     can determine with certainty that we're not holding
     any locks when we're M_WAITOK.
   - I've seen at least one weird socketbuffer empty-but-
     mbuf-still-attached panic.  I don't believe this
     to be related to mbuma but please keep your eyes
     open, turn on debugging, and capture crash dumps.

This change removes more code than it adds.

A paper is available detailing the change and considering
various performance issues, it was presented at BSDCan2004:
http://www.unixdaemons.com/~bmilekic/netbuf_bmilekic.pdf
Please read the paper for Future Work and implementation
details, as well as credits.

Testing and Debugging:
    rwatson,
    brueffer,
    Ketrien I. Saihr-Kesenchedra,
    ...
Reviewed by: Lots of people (for different parts)

Revision 1.183: download - view: text, markup, annotated - select for diffs
Sat May 8 02:24:21 2004 UTC (7 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +2 -2 lines
Unconditionally lock Giant in do_sendfile(), rather than locking it
conditional on debug.mpsafenet.  We can try pushing down Giant here
later, but we don't want to enter VFS without holding Giant.

Bumped into by:	kris

Revision 1.182: download - view: text, markup, annotated - select for diffs
Thu May 6 05:03:22 2004 UTC (7 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +0 -1 lines
Make vm_page's PG_ZERO flag immutable between the time of the page's
allocation and deallocation.  This flag's principal use is shortly after
allocation.  For such cases, clearing the flag is pointless.  The only
unusual use of PG_ZERO is in vfs_bio_clrbuf().  However, allocbuf() never
requests a prezeroed page.  So, vfs_bio_clrbuf() never sees a prezeroed
page.

Reviewed by:	tegge@

Revision 1.181: download - view: text, markup, annotated - select for diffs
Thu Apr 8 07:14:34 2004 UTC (7 years, 10 months ago) by silby
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +8 -2 lines
Fix a regression in my change which sends headers along with data; a
side effect of that change caused headers to not be sent if a 0 byte
file was passed to sendfile.  This change fixes that behavior, allowing
sendfile to send out the headers even with a 0 byte file again.

Noticed by:	Dirk Engling

Revision 1.180: download - view: text, markup, annotated - select for diffs
Mon Apr 5 21:03:36 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +0 -4 lines
Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core

Revision 1.179: download - view: text, markup, annotated - select for diffs
Sun Apr 4 19:15:45 2004 UTC (7 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +1 -1 lines
Detatch incorrect spellings of detach.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Sat Apr 3 09:16:26 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +1 -1 lines
In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it
should not.  Add a new parameter so that the caller can specify which is
the case.

Reported by:	dillon

Revision 1.177: download - view: text, markup, annotated - select for diffs
Mon Mar 29 02:21:56 2004 UTC (7 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +31 -31 lines
Conditionally acquire Giant when entering the sockets layer via the
socket-specific system calls based on debug.mpsafenet, rather than
acquiring Giant unconditionally.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Mon Mar 29 01:37:06 2004 UTC (7 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +1 -0 lines
When validating that the length sum in recvit(), we fail to release
Giant on an error.  Add a Giant acquisition.

Reviewed by:	sam, bms

Revision 1.175: download - view: text, markup, annotated - select for diffs
Tue Mar 16 19:04:28 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +24 -2 lines
Refactor the existing machine-dependent sf_buf_free() into a machine-
dependent function by the same name and a machine-independent function,
sf_buf_mext().  Aside from the virtue of making more of the code machine-
independent, this change also makes the interface more logical.  Before,
sf_buf_free() did more than simply undo an sf_buf_alloc(); it also
unwired and if necessary freed the page.  That is now the purpose of
sf_buf_mext().  Thus, sf_buf_alloc() and sf_buf_free() can now be used
as a general-purpose emphemeral map cache.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Mar 4 01:57:48 2004 UTC (7 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +1 -2 lines
Remove unneeded label 'done2' from socket().  We now grab Giant
only around socreate(), and don't need it for file descriptor
accesses.

Submitted by:	sam

Revision 1.65.2.19: download - view: text, markup, annotated - select for diffs
Thu Feb 19 11:55:42 2004 UTC (7 years, 11 months ago) by truckman
Branches: RELENG_4
CVS tags: RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.65.2.18: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.18: +2 -0 lines
MFC 1.163  - Add a somewhat redundant check on the getsockaddr() len
             argument to avoid writing past the end of a dynamically
             allocated buffer, even though the minimum allocation size
             prevents an actual buffer overflow from occuring without
             this check.

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sun Feb 8 07:35:48 2004 UTC (8 years ago) by silby
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +22 -19 lines
Add the SF_NODISKIO flag to sendfile.  This flag causes sendfile to be
mindful of blocking on disk I/O and instead return EBUSY when such
blocking would occur.

Results from the DeBox project indicate that blocking on disk I/O
can slow the performance of a kqueue/poll based webserver.  Using
a flag such as SF_NODISKIO and throwing connections that would block
to helper processes/threads helped increase performance.

Currently, only the Flash webserver uses this flag, although it could
probably be applied to thttpd with relative ease.

Idea by:	Yaoping Ruan & Vivek Pai

Revision 1.172: download - view: text, markup, annotated - select for diffs
Wed Feb 4 08:43:21 2004 UTC (8 years ago) by silby
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +1 -1 lines
Rename iov_to_uio to uiofromiov to be more consistent with other
uio* functions.

Suggested by:	bde

Revision 1.171: download - view: text, markup, annotated - select for diffs
Sun Feb 1 07:56:44 2004 UTC (8 years ago) by silby
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +43 -12 lines
Rewrite sendfile's header support so that headers are now sent in the first
packet along with data, instead of in their own packet.  When serving files
of size (packetsize - headersize) or smaller, this will result in one less
packet crossing the network.  Quick testing with thttpd and http_load has
shown a noticeable performance improvement in this case (350 vs 330 fetches
per second.)

Included in this commit are two support routines, iov_to_uio, and m_uiotombuf;
these routines are used by sendfile to construct the header mbuf chain that
will be linked to the rest of the data in the socket buffer.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Mon Jan 19 20:45:43 2004 UTC (8 years ago) by kan
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +1 -1 lines
One more instance of magic number used in place of IO_SEQSHIFT.

Submitted by:	alc

Revision 1.169: download - view: text, markup, annotated - select for diffs
Thu Jan 15 10:15:03 2004 UTC (8 years ago) by des
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +4 -0 lines
New file descriptor allocation code, derived from similar code introduced
in OpenBSD by Niels Provos.  The patch introduces a bitmap of allocated
file descriptors which is used to locate available descriptors when a new
one is needed.  It also moves the task of growing the file descriptor table
out of fdalloc(), reducing complexity in both fdalloc() and do_dup().

Debts of gratitude are owed to tjr@ (who provided the original patch on
which this work is based), grog@ (for the gdb(4) man page) and rwatson@
(for assistance with pxeboot(8)).

Revision 1.168: download - view: text, markup, annotated - select for diffs
Sun Jan 11 20:07:15 2004 UTC (8 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +0 -4 lines
Back out 1.166, which was committed by mistake.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Sun Jan 11 19:56:42 2004 UTC (8 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +24 -19 lines
Mechanical whitespace cleanup + other minor style nits.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Sun Jan 11 19:43:14 2004 UTC (8 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +4 -0 lines
Mechanical whitespace cleanup + minor style nits.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Sat Jan 10 17:14:53 2004 UTC (8 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +1 -1 lines
More unparenthesized return values.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Sat Jan 10 13:03:43 2004 UTC (8 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +3 -3 lines
Style: parenthesize return values.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sat Jan 10 08:28:54 2004 UTC (8 years, 1 month ago) by truckman
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +2 -0 lines
Add a somewhat redundant check on the len arguement to getsockaddr() to
avoid relying on the minimum memory allocation size to avoid problems.
The check is somewhat redundant because the consumers of the returned
structure will check that sa_len is a protocol-specific larger size.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	nectar
MFC after:	30 days

Revision 1.162: download - view: text, markup, annotated - select for diffs
Sun Dec 28 08:57:08 2003 UTC (8 years, 1 month ago) by silby
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +2 -0 lines
Track three new sendfile-related statistics:
- The number of times sendfile had to do disk I/O
- The number of times sfbuf allocation failed
- The number of times sfbuf allocation had to wait

Revision 1.161: download - view: text, markup, annotated - select for diffs
Thu Dec 25 23:44:38 2003 UTC (8 years, 1 month ago) by dwmalone
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +2 -2 lines
In socket(2) we only need Giant around the call to socreate, so just
grab it there.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Wed Dec 24 18:47:42 2003 UTC (8 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +24 -19 lines
Add restrict qualifiers.

PR: 44394
Submitted by: Craig Rodrigues <rodrige@attbi.com>

Revision 1.159: download - view: text, markup, annotated - select for diffs
Mon Dec 1 22:12:50 2003 UTC (8 years, 2 months ago) by dg
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.158: preferred, colored
Changes since revision 1.158: +5 -0 lines
Fixed a bug in sendfile(2) where the sent data would be corrupted due
to sendfile(2) being erroneously automatically restarted after a signal
is delivered. Fixed by converting ERESTART to EINTR prior to exiting.

Updated manual page to indicate the potential EINTR error, its cause
and consequences.

Approved by: re@freebsd.org

Revision 1.65.2.18: download - view: text, markup, annotated - select for diffs
Mon Dec 1 09:38:11 2003 UTC (8 years, 2 months ago) by dg
Branches: RELENG_4
Diff to: previous 1.65.2.17: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.17: +5 -0 lines
Fixed a bug in sendfile(2) where the sent data would be corrupted due
to sendfile(2) being erroneously automatically restarted after a signal
is delivered. Fixed by converting ERESTART to EINTR prior to exiting.

Updated manual page to indicate the potential EINTR error, its cause
and consequences.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sun Nov 16 06:11:25 2003 UTC (8 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +4 -3 lines
 - Modify alpha's sf_buf implementation to use the direct virtual-to-
   physical mapping.
 - Move the sf_buf API to its own header file; make struct sf_buf's
   definition machine dependent.  In this commit, we remove an
   unnecessary field from struct sf_buf on the alpha, amd64, and ia64.
   Ultimately, we may eliminate struct sf_buf on those architecures
   except as an opaque pointer that references a vm page.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Sun Oct 19 20:41:07 2003 UTC (8 years, 3 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +3 -4 lines
falloc allocates a file structure and adds it to the file descriptor
table, acquiring the necessary locks as it works. It usually returns
two references to the new descriptor: one in the descriptor table
and one via a pointer argument.

As falloc releases the FILEDESC lock before returning, there is a
potential for a process to close the reference in the file descriptor
table before falloc's caller gets to use the file. I don't think this
can happen in practice at the moment, because Giant indirectly protects
closes.

To stop the file being completly closed in this situation, this change
makes falloc set the refcount to two when both references are returned.
This makes life easier for several of falloc's callers, because the
first thing they previously did was grab an extra reference on the
file.

Reviewed by:	iedowse
Idea run past:	jhb

Revision 1.156: download - view: text, markup, annotated - select for diffs
Fri Aug 29 20:04:09 2003 UTC (8 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +0 -99 lines
Migrate the sf_buf allocator that is used by sendfile(2) and zero-copy
sockets into machine-dependent files.  The rationale for this
migration is illustrated by the modified amd64 allocator.  It uses the
amd64's direct map to avoid emphemeral mappings in the kernel's
address space.  On an SMP, the emphemeral mappings result in an IPI
for TLB shootdown for each transmitted page.  Yuck.

Maintainers of other 64-bit platforms with direct maps should be able
to use the amd64 allocator as a reference implementation.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Mon Aug 11 19:37:11 2003 UTC (8 years, 6 months ago) by kan
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +4 -1 lines
Drop Giant in recvit before returning an error to the caller to avoid
leaking the Giant on the syscall exit.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Aug 6 14:04:47 2003 UTC (8 years, 6 months ago) by yar
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +8 -3 lines
If connect(2) has been interrupted by a signal and therefore the
connection is to be established asynchronously, behave as in the
case of non-blocking mode:

- keep the SS_ISCONNECTING bit set thus indicating that
  the connection establishment is in progress, which is the case
  (clearing the bit in this case was just a bug);

- return EALREADY, instead of the confusing and unreasonable
  EADDRINUSE, upon further connect(2) attempts on this socket
  until the connection is established (this also brings our
  connect(2) into accord with IEEE Std 1003.1.)

Revision 1.153: download - view: text, markup, annotated - select for diffs
Mon Aug 4 21:28:57 2003 UTC (8 years, 6 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +8 -13 lines
Do some minor Giant pushdown made possible by copyin, fget, fdrop,
malloc and mbuf allocation all not requiring Giant.

1) ostat, fstat and nfstat don't need Giant until they call fo_stat.
2) accept can copyin the address length without grabbing Giant.
3) sendit doesn't need Giant, so don't bother grabbing it until kern_sendit.
4) move Giant grabbing from each indivitual recv* syscall to recvit.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Sat Aug 2 04:18:56 2003 UTC (8 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -1 lines
Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in sf_buf_init().
(See revision 1.140 of kern/sys_pipe.c for a detailed rationale.)

Submitted by:	tegge

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Jun 19 03:55:01 2003 UTC (8 years, 7 months ago) by truckman
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -0 lines
VOP_GETVOBJECT() wants to be called with the vnode lock held.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Thu Jun 12 05:52:09 2003 UTC (8 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +8 -1 lines
Finish the vm object locking in sendfile(2).  More generally,
the vm locking in sendfile(2) is complete.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Wed Jun 11 21:23:04 2003 UTC (8 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +3 -0 lines
Lock the vm object when removing a page.

Revision 1.148: 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.147: preferred, colored
Changes since revision 1.147: +3 -1 lines
Use __FBSDID().

Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu May 29 18:36:26 2003 UTC (8 years, 8 months ago) by dwmalone
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +6 -4 lines
Grab giant in sendit rather than kern_sendit because sockargs may
allocate mbufs with M_TRYWAIT, which may require Giant.

Reviewed by:	bmilekic
Approved by:	re (scottl)

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon May 5 20:33:37 2003 UTC (8 years, 9 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +65 -50 lines
Split sendit into two parts. The first part, still called sendit, that
does the copyin stuff and then calls the second part kern_sendit to do
the hard work. Don't bother holding Giant during the copyin phase.

The intent of this is to allow the Linux emulator to impliment send*
syscalls without using the stackgap.

Revision 1.65.2.17: download - view: text, markup, annotated - select for diffs
Fri Apr 4 17:11:16 2003 UTC (8 years, 10 months ago) by tegge
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9
Diff to: previous 1.65.2.16: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.16: +7 -0 lines
MFC: Sync new socket nonblocking/async state with file flags in accept().

PR:		1775

Revision 1.65.2.16: download - view: text, markup, annotated - select for diffs
Fri Apr 4 17:04:04 2003 UTC (8 years, 10 months ago) by tegge
Branches: RELENG_4
Diff to: previous 1.65.2.15: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.15: +1 -1 lines
MFC: Track type change (file flags extended to 32 bits)

Revision 1.145: download - view: text, markup, annotated - select for diffs
Mon Mar 31 06:25:42 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +3 -3 lines
Recent changes to uipc_cow.c have eliminated the need for some sf_buf-
related variables to be global.  Make them either local to sf_buf_init() or
static.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Mar 29 06:14:14 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +6 -9 lines
Pass the vm_page's address to sf_buf_alloc(); map the vm_page as part
of sf_buf_alloc() instead of expecting sf_buf_alloc()'s caller to map it.

The ultimate reason for this change is to enable two optimizations:
(1) that there never be more than one sf_buf mapping a vm_page at a time
and (2) 64-bit architectures can transparently use their 1-1 virtual
to physical mapping (e.g., "K0SEG") avoiding the overhead of pmap_qenter()
and pmap_qremove().

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sun Mar 16 07:19:12 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +3 -5 lines
Pass the sf buf to MEXTADD() as the optional argument.  This permits
the simplification of socow_iodone() and sf_buf_free(); they don't
have to reverse engineer the sf buf from the data's address.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Thu Mar 6 04:48:19 2003 UTC (8 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +0 -2 lines
Remove GIANT_REQUIRED from sf_buf_free().

Revision 1.141: download - view: text, markup, annotated - select for diffs
Sun Feb 23 23:00:28 2003 UTC (8 years, 11 months ago) by tegge
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +7 -0 lines
Sync new socket nonblocking/async state with file flags in accept().

PR:		1775
Reviewed by:	mbr

Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Feb 20 03:26:11 2003 UTC (8 years, 11 months ago) by cognet
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +0 -1 lines
Remove duplicate includes.

Submitted by:	Cyril Nguyen-Huu <cyril@ci0.org>

Revision 1.139: 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.138: preferred, colored
Changes since revision 1.138: +11 -11 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.138: download - view: text, markup, annotated - select for diffs
Mon Feb 3 17:36:52 2003 UTC (9 years ago) by ume
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +40 -15 lines
Break out the bind and connect syscalls to intend to make calling
these syscalls internally easy.
This is preparation for force coming IPv6 support for Linuxlator.

Submitted by:	dwmalone
MFC after:	10 days

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sun Feb 2 13:17:29 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +0 -3 lines
Consolidate MIN/MAX macros into one place (param.h).

Submitted by: Hiten Pandya <hiten@unixdaemons.com>

Revision 1.136: 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.135: preferred, colored
Changes since revision 1.135: +11 -11 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.135: download - view: text, markup, annotated - select for diffs
Mon Jan 13 00:28:55 2003 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +4 -4 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.134: 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.133: preferred, colored
Changes since revision 1.133: +4 -4 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.133: download - view: text, markup, annotated - select for diffs
Mon Dec 23 22:46:47 2002 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +0 -2 lines
Move the declaration of the socket fileops from socketvar.h to file.h.
This allows us to use the new typedefs and removes the needs for a number
of forward struct declarations in socketvar.h

Revision 1.132: download - view: text, markup, annotated - select for diffs
Sun Oct 6 14:39:14 2002 UTC (9 years, 4 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +22 -0 lines
Integrate mac_check_socket_send() and mac_check_socket_receive()
checks from the MAC tree: allow policies to perform access control
for the ability of a process to send and receive data via a socket.
At some point, we might also pass in additional address information
if an explicit address is requested on send.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.131: download - view: text, markup, annotated - select for diffs
Thu Oct 3 02:12:58 2002 UTC (9 years, 4 months ago) by truckman
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +4 -2 lines
In an SMP environment post-Giant it is no longer safe to blindly
dereference the struct sigio pointer without any locking.  Change
fgetown() to take a reference to the pointer instead of a copy of the
pointer and call SIGIO_LOCK() before copying the pointer and
dereferencing it.

Reviewed by:	rwatson

Revision 1.65.2.15: download - view: text, markup, annotated - select for diffs
Sat Aug 31 22:11:56 2002 UTC (9 years, 5 months ago) by archie
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.65.2.14: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.14: +4 -5 lines
MFC: (rev. 1.130) Make accept(2) on a socket that has been shutdown(2)
return ECONNABORTED in the non-blocking case.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Aug 28 20:56:01 2002 UTC (9 years, 5 months ago) by archie
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +4 -5 lines
accept(2) on a socket that has been shutdown(2) normally returns
ECONNABORTED. Make this happen in the non-blocking case as well.
The previous behavior was to return EAGAIN, which (a) is not
consistent with the blocking case and (b) causes the application
to think the socket is still valid.

PR:		bin/42100
Reviewed by:	freebsd-net
MFC after:	3 days

Revision 1.129: download - view: text, markup, annotated - select for diffs
Thu Aug 15 20:55:04 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +6 -1 lines
In order to better support flexible and extensible access control,
make a series of modifications to the credential arguments relating
to file read and write operations to cliarfy which credential is
used for what:

- Change fo_read() and fo_write() to accept "active_cred" instead of
  "cred", and change the semantics of consumers of fo_read() and
  fo_write() to pass the active credential of the thread requesting
  an operation rather than the cached file cred.  The cached file
  cred is still available in fo_read() and fo_write() consumers
  via fp->f_cred.  These changes largely in sys_generic.c.

For each implementation of fo_read() and fo_write(), update cred
usage to reflect this change and maintain current semantics:

- badfo_readwrite() unchanged
- kqueue_read/write() unchanged
  pipe_read/write() now authorize MAC using active_cred rather
  than td->td_ucred
- soo_read/write() unchanged
- vn_read/write() now authorize MAC using active_cred but
  VOP_READ/WRITE() with fp->f_cred

Modify vn_rdwr() to accept two credential arguments instead of a
single credential: active_cred and file_cred.  Use active_cred
for MAC authorization, and select a credential for use in
VOP_READ/WRITE() based on whether file_cred is NULL or not.  If
file_cred is provided, authorize the VOP using that cred,
otherwise the active credential, matching current semantics.

Modify current vn_rdwr() consumers to pass a file_cred if used
in the context of a struct file, and to always pass active_cred.
When vn_rdwr() is used without a file_cred, pass NOCRED.

These changes should maintain current semantics for read/write,
but avoid a redundant passing of fp->f_cred, as well as making
it more clear what the origin of each credential is in file
descriptor read/write operations.

Follow-up commits will make similar changes to other file descriptor
operations, and modify the MAC framework to pass both credentials
to MAC policy modules so they can implement either semantic for
revocation.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.128: download - view: text, markup, annotated - select for diffs
Thu Aug 15 17:34:03 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +4 -2 lines
Fix return case for negative namelen by jumping to normal exit processing
rather than immediately returning, or we may not unlock necessary locks.

Noticed by:	Mike Heffner <mheffner@acm.vt.edu>

Revision 1.65.2.14: download - view: text, markup, annotated - select for diffs
Wed Aug 14 22:23:05 2002 UTC (9 years, 5 months ago) by dg
Branches: RELENG_4
Diff to: previous 1.65.2.13: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.13: +0 -3 lines
MFC: moved sf_buf_* function prototypes to socketvar.h.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Tue Aug 13 19:03:11 2002 UTC (9 years, 6 months ago) by dg
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +0 -2 lines
Moved sf_buf_alloc and sf_buf_free function declarations to sys/socketvar.h
so that they can be seen by external callers.

Revision 1.65.2.13: download - view: text, markup, annotated - select for diffs
Tue Aug 13 18:26:30 2002 UTC (9 years, 6 months ago) by dg
Branches: RELENG_4
Diff to: previous 1.65.2.12: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.12: +6 -9 lines
MFC: make sf_buf_* functions non-static, fixup comment. I need access to
these functions for a third-party kernel module that I'm developing.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Tue Aug 13 18:20:08 2002 UTC (9 years, 6 months ago) by dg
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +0 -3 lines
Remove obsolete comment about sf_buf_* functions being static. They were
made un-static in rev 1.114.

Revision 1.65.2.9.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 13 12:13:50 2002 UTC (9 years, 6 months ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.65.2.9: preferred, colored; next MAIN 1.65.2.10: preferred, colored
Changes since revision 1.65.2.9: +11 -1 lines
MFC of upc_syscalls:1.123,1.124 and vesa.c:1.37.

Submitted by:	Silvio Cesare <silvio@qualys.com> (1.123, 1.37)

Revision 1.65.2.9.4.1: download - view: text, markup, annotated - select for diffs
Tue Aug 13 12:13:11 2002 UTC (9 years, 6 months ago) by nectar
Branches: RELENG_4_5
Diff to: previous 1.65.2.9: preferred, colored; next MAIN 1.65.2.10: preferred, colored
Changes since revision 1.65.2.9: +11 -1 lines
MFC of upc_syscalls:1.123,1.124 and vesa.c:1.37.

Submitted by:	Silvio Cesare <silvio@qualys.com> (1.123, 1.37)

Revision 1.65.2.9.6.1: download - view: text, markup, annotated - select for diffs
Tue Aug 13 12:12:41 2002 UTC (9 years, 6 months ago) by nectar
Branches: RELENG_4_6
CVS tags: RELENG_4_6_2_RELEASE
Diff to: previous 1.65.2.9: preferred, colored; next MAIN 1.65.2.10: preferred, colored
Changes since revision 1.65.2.9: +11 -1 lines
MFC of upc_syscalls:1.123,1.124 and vesa.c:1.37.

Submitted by:	Silvio Cesare <silvio@qualys.com> (1.123, 1.37)

Revision 1.65.2.12: download - view: text, markup, annotated - select for diffs
Tue Aug 13 02:42:32 2002 UTC (9 years, 6 months ago) by rwatson
Branches: RELENG_4
Diff to: previous 1.65.2.11: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.11: +10 -0 lines
MFC of uipc_syscalls.c:1.123,1.124 and vesa.c:1.37.

Submitted by:	Silvio Cesare <silvio@qualys.com> (1.123, 1.37)

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Aug 11 20:33:11 2002 UTC (9 years, 6 months ago) by semenu
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +2 -2 lines
Fix sendfile(), who was calling vn_rdwr() without aresid parameter and
thus hiting EIO at the end of file. This is believed to be a feature
(not a bug) of vn_rdwr(), so we turn it off by supplying aresid param.

Reviewed by:	rwatson, dg

Revision 1.124: download - view: text, markup, annotated - select for diffs
Fri Aug 9 12:58:11 2002 UTC (9 years, 6 months ago) by nectar
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +8 -0 lines
While we're at it, add range checks similar to those in previous commit to
getsockname() and getpeername(), too.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Fri Aug 9 05:50:32 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +2 -0 lines
Add additional range checks for copyout targets.

Submitted by:	Silvio Cesare <silvio@qualys.com>

Revision 1.122: download - view: text, markup, annotated - select for diffs
Thu Aug 1 17:47:56 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +1 -0 lines
Include file cleanup; mac.h and malloc.h at one point had ordering
relationship requirements, and no longer do.

Reminded by:	bde

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Jul 31 16:39:49 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +21 -0 lines
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument connect(), listen(), and bind() system calls to invoke
MAC framework entry points to permit policies to authorize these
requests.  This can be useful for policies that want to limit
the activity of processes involving particular types of IPC and
network activity.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.120: download - view: text, markup, annotated - select for diffs
Tue Jul 30 18:51:07 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +6 -5 lines
 o In do_sendfile(), replace vm_page_sleep_busy() by vm_page_sleep_if_busy()
   and extend the scope of the page queues lock to cover all accesses
   to the page's flags and busy fields.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Jul 23 01:09:34 2002 UTC (9 years, 6 months ago) by arr
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +12 -12 lines
- Make use of the VM_ALLOC_WIRED flag in the call to vm_page_alloc() in
  do_sendfile().  This allows us to rearrange an if statement in order to
  avoid doing an unnecesary call to vm_page_lock_queues(), and an attempt
  at re-wiring the pages (which were wired in the vm_page_alloc() call).

Reviewed by:	alc, jhb

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Jul 13 03:10:55 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +8 -0 lines
Lock accesses to the page queues by sendfile() and friends.

Revision 1.65.2.11: download - view: text, markup, annotated - select for diffs
Fri Jul 12 08:22:46 2002 UTC (9 years, 7 months ago) by alfred
Branches: RELENG_4
Diff to: previous 1.65.2.10: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.10: +37 -3 lines
MFC: compat syscall for broken sendfile.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Fri Jul 12 06:51:57 2002 UTC (9 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +36 -3 lines
Create a bug-for-bug FreeBSD4 compatible version of sendfile and move the
fixed sendfile over.  This is needed to preserve binary compatibility from
4.x to 5.x.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sat Jun 29 00:02:01 2002 UTC (9 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +19 -23 lines
nuke more instances of caddr_t

Revision 1.115: download - view: text, markup, annotated - select for diffs
Fri Jun 28 23:48:22 2002 UTC (9 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +29 -32 lines
remove or replace caddr_t with void.
make the mbuf external free function take a void * rather than caddr_t.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Wed Jun 26 03:34:48 2002 UTC (9 years, 7 months ago) by ken
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +7 -7 lines
At long last, commit the zero copy sockets code.

MAKEDEV:	Add MAKEDEV glue for the ti(4) device nodes.

ti.4:		Update the ti(4) man page to include information on the
		TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options,
		and also include information about the new character
		device interface and the associated ioctls.

man9/Makefile:	Add jumbo.9 and zero_copy.9 man pages and associated
		links.

jumbo.9:	New man page describing the jumbo buffer allocator
		interface and operation.

zero_copy.9:	New man page describing the general characteristics of
		the zero copy send and receive code, and what an
		application author should do to take advantage of the
		zero copy functionality.

NOTES:		Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS,
		TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT.

conf/files:	Add uipc_jumbo.c and uipc_cow.c.

conf/options:	Add the 5 options mentioned above.

kern_subr.c:	Receive side zero copy implementation.  This takes
		"disposable" pages attached to an mbuf, gives them to
		a user process, and then recycles the user's page.
		This is only active when ZERO_COPY_SOCKETS is turned on
		and the kern.ipc.zero_copy.receive sysctl variable is
		set to 1.

uipc_cow.c:	Send side zero copy functions.  Takes a page written
		by the user and maps it copy on write and assigns it
		kernel virtual address space.  Removes copy on write
		mapping once the buffer has been freed by the network
		stack.

uipc_jumbo.c:	Jumbo disposable page allocator code.  This allocates
		(optionally) disposable pages for network drivers that
		want to give the user the option of doing zero copy
		receive.

uipc_socket.c:	Add kern.ipc.zero_copy.{send,receive} sysctls that are
		enabled if ZERO_COPY_SOCKETS is turned on.

		Add zero copy send support to sosend() -- pages get
		mapped into the kernel instead of getting copied if
		they meet size and alignment restrictions.

uipc_syscalls.c:Un-staticize some of the sf* functions so that they
		can be used elsewhere.  (uipc_cow.c)

if_media.c:	In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid
		calling malloc() with M_WAITOK.  Return an error if
		the M_NOWAIT malloc fails.

		The ti(4) driver and the wi(4) driver, at least, call
		this with a mutex held.  This causes witness warnings
		for 'ifconfig -a' with a wi(4) or ti(4) board in the
		system.  (I've only verified for ti(4)).

ip_output.c:	Fragment large datagrams so that each segment contains
		a multiple of PAGE_SIZE amount of data plus headers.
		This allows the receiver to potentially do page
		flipping on receives.

if_ti.c:	Add zero copy receive support to the ti(4) driver.  If
		TI_PRIVATE_JUMBOS is not defined, it now uses the
		jumbo(9) buffer allocator for jumbo receive buffers.

		Add a new character device interface for the ti(4)
		driver for the new debugging interface.  This allows
		(a patched version of) gdb to talk to the Tigon board
		and debug the firmware.  There are also a few additional
		debugging ioctls available through this interface.

		Add header splitting support to the ti(4) driver.

		Tweak some of the default interrupt coalescing
		parameters to more useful defaults.

		Add hooks for supporting transmit flow control, but
		leave it turned off with a comment describing why it
		is turned off.

if_tireg.h:	Change the firmware rev to 12.4.11, since we're really
		at 12.4.11 plus fixes from 12.4.13.

		Add defines needed for debugging.

		Remove the ti_stats structure, it is now defined in
		sys/tiio.h.

ti_fw.h:	12.4.11 firmware.

ti_fw2.h:	12.4.11 firmware, plus selected fixes from 12.4.13,
		and my header splitting patches.  Revision 12.4.13
		doesn't handle 10/100 negotiation properly.  (This
		firmware is the same as what was in the tree previously,
		with the addition of header splitting support.)

sys/jumbo.h:	Jumbo buffer allocator interface.

sys/mbuf.h:	Add a new external mbuf type, EXT_DISPOSABLE, to
		indicate that the payload buffer can be thrown away /
		flipped to a userland process.

socketvar.h:	Add prototype for socow_setup.

tiio.h:		ioctl interface to the character portion of the ti(4)
		driver, plus associated structure/type definitions.

uio.h:		Change prototype for uiomoveco() so that we'll know
		whether the source page is disposable.

ufs_readwrite.c:Update for new prototype of uiomoveco().

vm_fault.c:	In vm_fault(), check to see whether we need to do a page
		based copy on write fault.

vm_object.c:	Add a new function, vm_object_allocate_wait().  This
		does the same thing that vm_object allocate does, except
		that it gives the caller the opportunity to specify whether
		it should wait on the uma_zalloc() of the object structre.

		This allows vm objects to be allocated while holding a
		mutex.  (Without generating WITNESS warnings.)

		vm_object_allocate() is implemented as a call to
		vm_object_allocate_wait() with the malloc flag set to
		M_WAITOK.

vm_object.h:	Add prototype for vm_object_allocate_wait().

vm_page.c:	Add page-based copy on write setup, clear and fault
		routines.

vm_page.h:	Add page based COW function prototypes and variable in
		the vm_page structure.

Many thanks to Drew Gallatin, who wrote the zero copy send and receive
code, and to all the other folks who have tested and reviewed this code
over the years.

Revision 1.65.2.10: download - view: text, markup, annotated - select for diffs
Mon Jun 24 06:42:22 2002 UTC (9 years, 7 months ago) by alfred
Branches: RELENG_4
Diff to: previous 1.65.2.9: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.9: +6 -4 lines
Fix sendfile bug where headers counted against amount of file to be sent.
MFC: 1.103

Revision 1.113: download - view: text, markup, annotated - select for diffs
Thu Jun 20 18:52:54 2002 UTC (9 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +2 -1 lines
Implement SO_NOSIGPIPE option for sockets.  This allows one to request that
an EPIPE error return not generate SIGPIPE on sockets.

Submitted by: lioux
Inspired by: Darwin

Revision 1.112: download - view: text, markup, annotated - select for diffs
Fri Jun 7 05:37:18 2002 UTC (9 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +8 -8 lines
Catch up to changes in ktrace API.

Revision 1.111: 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.110: preferred, colored
Changes since revision 1.110: +2 -35 lines
Back out my lats commit of locking down a socket, it conflicts with hsu's work.

Requested by:	hsu

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon May 20 05:41:03 2002 UTC (9 years, 8 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +35 -2 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.109: download - view: text, markup, annotated - select for diffs
Fri Apr 19 13:46:24 2002 UTC (9 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +4 -13 lines
In sendfile(), use the vn_rdwr() helper function, rather than manually
constructing a struct aio and invoking VOP_READ() directly.  This cleans
up the code a little, but also has the advantage of making sure almost
all vnode read/write access in the kernel goes through the helper
function, meaning that instrumentation of that helper function can impact
almost all relevant read/write operations.  In this case, it permits us
to put MAC hooks into vn_rdwr() and not modify uipc_syscalls.c (yet).

In general, if helper vn_*() functions exist, they should be used in
preference to direct VOP's in system call service code.

Submitted by:	green
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Apr 4 21:03:26 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +1 -1 lines
Change callers of mtx_init() to pass in an appropriate lock type name.  In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sun Mar 24 05:09:11 2002 UTC (9 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +3 -3 lines
Fixed some style bugs in the removal of __P(()).  The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses.  Switch to KNF
formatting and/or rewrap the whole prototype in some cases.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Tue Mar 19 21:24:06 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +8 -8 lines
Remove __P.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Wed Feb 27 18:32:12 2002 UTC (9 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -4 lines
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Jan 22 17:38:58 2002 UTC (10 years ago) by dg
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +0 -0 lines
Null commit -  the previous log message should have read:

  Fixed bug in calculation of amount of file sent when nbytes !=0 and
  headers or trailers are supplied. Reported by Vladislav Shabanov
  <vs@rambler-co.ru>.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Tue Jan 22 17:32:10 2002 UTC (10 years ago) by dg
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +6 -3 lines
Fixed bug in calculation of amount of file to send when nbytes !=0 and
headers or trailers are supplied. Reported by Vladislav Shabanov
<vs@rambler-co.ru>.

PR:		33771
Submitted by:	Maxim Konovalov <maxim@macomnet.ru>
MFC after:	3 days

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Jan 13 11:58:02 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +29 -7 lines
SMP Lock struct file, filedesc and the global file list.

Seigo Tanimura (tanimura) posted the initial delta.

I've polished it quite a bit reducing the need for locking and
adapting it for KSE.

Locks:

1 mutex in each filedesc
   protects all the fields.
   protects "struct file" initialization, while a struct file
     is being changed from &badfileops -> &pipeops or something
     the filedesc should be locked.

1 mutex in each struct file
   protects the refcount fields.
   doesn't protect anything else.
   the flags used for garbage collection have been moved to
     f_gcflag which was the FILLER short, this doesn't need
     locking because the garbage collection is a single threaded
     container.
  could likely be made to use a pool mutex.

1 sx lock for the global filelist.

struct file *	fhold(struct file *fp);
        /* increments reference count on a file */

struct file *	fhold_locked(struct file *fp);
        /* like fhold but expects file to locked */

struct file *	ffind_hold(struct thread *, int fd);
        /* finds the struct file in thread, adds one reference and
                returns it unlocked */

struct file *	ffind_lock(struct thread *, int fd);
        /* ffind_hold, but returns file locked */

I still have to smp-safe the fget cruft, I'll get to that asap.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Jan 9 02:47:00 2002 UTC (10 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +8 -8 lines
Sockets are called 'so' not 'sp'.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Mon Dec 31 17:45:15 2001 UTC (10 years, 1 month ago) by rwatson
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +6 -3 lines
o Make the credential used by socreate() an explicit argument to
  socreate(), rather than getting it implicitly from the thread
  argument.

o Make NFS cache the credential provided at mount-time, and use
  the cached credential (nfsmount->nm_cred) when making calls to
  socreate() on initially connecting, or reconnecting the socket.

This fixes bugs involving NFS over TCP and ipfw uid/gid rules, as well
as bugs involving NFS and mandatory access control implementations.

Reviewed by:	freebsd-arch

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sat Nov 17 03:07:07 2001 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +71 -134 lines
Give struct socket structures a ref counting interface similar to
vnodes.  This will hopefully serve as a base from which we can
expand the MP code.  We currently do not attempt to obtain any
mutex or SX locks, but the door is open to add them when we nail
down exactly how that part of it is going to work.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Wed Nov 14 06:30:35 2001 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +6 -18 lines
remove holdfp()

Replace uses of holdfp() with fget*() or fgetvp*() calls as appropriate

introduce fget(), fget_read(), fget_write() - these functions will take
a thread and file descriptor and return a file pointer with its ref
count bumped.

introduce fgetvp(), fgetvp_read(), fgetvp_write() - these functions will
take a thread and file descriptor and return a vref()'d vnode.

*_read() requires that the file pointer be FREAD, *_write that it be
FWRITE.

This continues the cleanup of struct filedesc and struct file access
routines which, when are all through with it, will allow us to then
make the API calls MP safe and be able to move Giant down into the fo_*
functions.

Revision 1.97: 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.96: preferred, colored
Changes since revision 1.96: +169 -177 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.96: download - view: text, markup, annotated - select for diffs
Fri Aug 31 00:37:34 2001 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +231 -68 lines
Giant pushdown syscalls in kern/uipc_syscalls.c.  Affected calls:

recvmsg(), sendmsg(), recvfrom(), accept(), getpeername(), getsockname(),
socket(), connect(), accept(), send(), recv(), bind(), setsockopt(), listen(),
sendto(), shutdown(), socketpair(), sendfile()

Revision 1.65.2.9: download - view: text, markup, annotated - select for diffs
Tue Jul 31 10:49:39 2001 UTC (10 years, 6 months ago) by dwmalone
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_4_BP, RELENG_4_4_0_RELEASE
Branch point for: RELENG_4_6, RELENG_4_5, RELENG_4_4
Diff to: previous 1.65.2.8: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.8: +27 -5 lines
MFC: Make the sleep for sendfile buffers interruptable. This is a bit
different from the code in -current, but the idea should be the same.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:20:12 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +5 -14 lines
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Jun 24 12:27:30 2001 UTC (10 years, 7 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +3 -2 lines
Don't dereference a NULL pointer if we fail to get a sendfilebuf.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Fri May 25 19:23:04 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +14 -6 lines
Add vm locking to sendfile(2) and sf_buf_free().

Reported by:	Tamiji Homma <thomma@BayNetworks.com>
Tested by:	Tamiji Homma <thomma@BayNetworks.com>

Revision 1.65.2.8: download - view: text, markup, annotated - select for diffs
Fri May 18 09:58:42 2001 UTC (10 years, 8 months ago) by bp
Branches: RELENG_4
Diff to: previous 1.65.2.7: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.7: +2 -3 lines
MFC: introduce VOP_CREATEVOBJECT(), VOP_GETVOBJECT and VOP_DESTROYVOBJECT()
which help to get proper reference to VM backing object.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Tue May 1 08:12:59 2001 UTC (10 years, 9 months ago) by markm
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +6 -3 lines
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sun Apr 29 02:44:49 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -2 lines
Revert consequences of changes to mount.h, part 2.

Requested by:	bde

Revision 1.90: download - view: text, markup, annotated - select for diffs
Thu Apr 26 00:14:14 2001 UTC (10 years, 9 months ago) by alfred
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +8 -1 lines
Sendfile is documented to return 0 on success, however if when a
sf_hdtr is used to provide writev(2) style headers/trailers on the
sent data the return value is actually either the result of writev(2)
from the trailers or headers of no tailers are specified.

Fix sendfile to comply with the documentation, by returning 0 on
success.

Ok'd by: dg

Revision 1.89: download - view: text, markup, annotated - select for diffs
Mon Apr 23 08:50:34 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -1 lines
Correct #includes to work with fixed sys/mount.h.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Thu Mar 8 19:21:45 2001 UTC (10 years, 11 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +8 -7 lines
Fix is a similar race condition as existed in the mbuf code. When we go
into an interruptable sleep and we increment a sleep count, we make sure
that we are the thread that will decrement the count when we wakeup.
Otherwise, what happens is that if we get interrupted (signal) and we
have to wake up, but before we get our mutex, some thread that wants
to wake us up detects that the count is non-zero and so enters wakeup_one(),
but there's nothing on the sleep queue and so we don't get woken up. The
thread will still decrement the sleep count, which is bad because we will
also decrement it again later (as we got interrupted) and are already off
the sleep queue.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Thu Mar 8 16:28:10 2001 UTC (10 years, 11 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +25 -4 lines
Make the wait for sendfile buffers interruptable. Stops one process
consuming them all and then getting stuck.

Reviewed by:	dg
Reviewed by:	bmilekic
Observed by:	Andreas Persson <pap@garen.net>

Revision 1.86: 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.85: preferred, colored
Changes since revision 1.85: +5 -2 lines
Grab the process lock while calling psignal and before calling psignal.

Revision 1.65.2.7: download - view: text, markup, annotated - select for diffs
Sat Feb 24 18:37:26 2001 UTC (10 years, 11 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.65.2.6: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.6: +15 -2 lines
MFC: have accept return ECONNABORTED for sockets which are now gone.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Feb 14 02:09:11 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +15 -2 lines
Return ECONNABORTED from accept if connection is closed while on the
listen queue, as well as the current behavior of a zero-length sockaddr.

Obtained from: KAME
Reviewed by: -net

Revision 1.84: 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.83: preferred, colored
Changes since revision 1.83: +7 -7 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.83: download - view: text, markup, annotated - select for diffs
Tue Jan 2 11:51:55 2001 UTC (11 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +8 -9 lines
Fix the <sys/queue.h> abuse.

Submitted by:	Dima Dorfman <dima@unixfreak.org>
Reviewed by:	/sbin/md5

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Jan 2 10:34:09 2001 UTC (11 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -1 lines
Add an XXX about a <sys/queue.h> transgression which needs cleaned up.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Dec 21 21:43:24 2000 UTC (11 years, 1 month ago) by bmilekic
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +4 -4 lines
* Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
  This is because calls with M_WAIT (now M_TRYWAIT) may not wait
  forever when nothing is available for allocation, and may end up
  returning NULL. Hopefully we now communicate more of the right thing
  to developers and make it very clear that it's necessary to check whether
  calls with M_(TRY)WAIT also resulted in a failed allocation.
  M_TRYWAIT basically means "try harder, block if necessary, but don't
  necessarily wait forever." The time spent blocking is tunable with
  the kern.ipc.mbuf_wait sysctl.
  M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
  malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
  value of the M_WAIT flag, this could have became a big problem.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:50:37 2000 UTC (11 years, 2 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +3 -3 lines
Convert more malloc+bzero to malloc+M_ZERO.

Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Dec 3 01:35:46 2000 UTC (11 years, 2 months ago) by dg
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -2 lines
Changed second argument in a call to sf_buf_free() to be NULL instead of
PAGE_SIZE to match the prototype better. The argument is ignored, so this
is just to silence the compile-time warning.

Pointed out by:	jhb

Revision 1.65.2.6: download - view: text, markup, annotated - select for diffs
Sat Dec 2 00:47:50 2000 UTC (11 years, 2 months ago) by bmilekic
Branches: RELENG_4
Diff to: previous 1.65.2.5: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.5: +2 -1 lines
MFC: Fix sf_buf leak in mbuf exhaustion case.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sat Dec 2 00:40:57 2000 UTC (11 years, 2 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +2 -1 lines
Make sure to free the sf_buf if we've allocated it but fail to allocate
an mbuf (ENOBUFS) before returning so that we don't leak sf_bufs in
the case where we're out of mbufs.

Submitted by: David Greenman (dg)

Revision 1.65.2.5: 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.65.2.4: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.4: +152 -67 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.77: 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.76: preferred, colored
Changes since revision 1.76: +152 -67 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.65.2.4: download - view: text, markup, annotated - select for diffs
Mon Nov 13 07:15:44 2000 UTC (11 years, 3 months ago) by dg
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE
Diff to: previous 1.65.2.3: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.3: +4 -2 lines
Merged rev 1.76: Fix for a page not busy panic when an IO error occurs.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sun Nov 12 14:51:15 2000 UTC (11 years, 3 months ago) by dg
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +4 -2 lines
Fixed a certain panic on IO error in sendfile(): Page must be set PG_BUSY
before calling vm_page_free() on it.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sat Nov 11 23:04:15 2000 UTC (11 years, 3 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +3 -2 lines
* Have m_pulldown() use the new M_WRITABLE() macro in order to determine
whether the given ext_buf is shared.

* Have the sf_bufs be setup with the mbuf subsystem using MEXTADD() with the
two new arguments.

Note: m_pulldown() is somewhat crotchy; the added comment explains the
situation.

Reviewed by: jlemon

Revision 1.74: download - view: text, markup, annotated - select for diffs
Sat Nov 4 21:55:25 2000 UTC (11 years, 3 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +6 -5 lines
Change the sf_bufs wakeups to be wakeup_one(), because we don't want to
wakeup all of the sleeping threads when we free only one buffer. This
avoids us having to needlessly try again (and fail, and go back to
sleep) for all the threads sleeping. We will now only wakeup the
thread we know will succeed.

Reviewed by: green

Revision 1.73: download - view: text, markup, annotated - select for diffs
Sat Nov 4 07:16:08 2000 UTC (11 years, 3 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +19 -10 lines
Setup and put to use the mutex lock for sf_freelist, the sendfile(2) bufs
freelist. Should now be thread-friendly, in part.

Note: More work is needed in uipc_syscalls.c, but it will have to wait until
the socket locking issues are at least 80% implemented and committed.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Tue Sep 12 09:49:05 2000 UTC (11 years, 5 months ago) by bp
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -3 lines
Add three new VOPs: VOP_CREATEVOBJECT, VOP_DESTROYVOBJECT and VOP_GETVOBJECT.
They will be used by nullfs and other stacked filesystems to support full
cache coherency.

Reviewed in general by:	mckusick, dillon

Revision 1.71: download - view: text, markup, annotated - select for diffs
Sat Aug 19 08:32:01 2000 UTC (11 years, 5 months ago) by dwmalone
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +26 -44 lines
Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR:		19866
Submitted by:	Bosko Milekic <bmilekic@dsuper.net>
Reviewed by:	alfred (glanced at by others on -net)

Revision 1.65.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 16 19:20:31 2000 UTC (11 years, 5 months ago) by alfred
Branches: RELENG_4
CVS tags: RELENG_4_1_1_RELEASE
Diff to: previous 1.65.2.2: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.2: +3 -4 lines
MFC: make getfp non static and make sendfile() use it

Revision 1.49.2.5: download - view: text, markup, annotated - select for diffs
Thu Jul 20 01:42:30 2000 UTC (11 years, 6 months ago) by green
Branches: RELENG_3
Diff to: previous 1.49.2.4: preferred, colored; branchpoint 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.2.4: +15 -7 lines
MFC: make ktrgenio() use a uio

Revision 1.65.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 15 06:32:21 2000 UTC (11 years, 6 months ago) by green
Branches: RELENG_4
CVS tags: RELENG_4_1_0_RELEASE
Diff to: previous 1.65.2.1: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.1: +15 -7 lines
MFC: convert ktrgenio() to use a uio to fix a DoS.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sun Jul 2 08:08:00 2000 UTC (11 years, 7 months ago) by green
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +15 -7 lines
Modify ktrace's general I/O tracing, ktrgenio(), to use a struct uio *
instead of a struct iovec * array and int len.  Get rid of stupidly trying
to allocate all of the memory and copyin()ing the entire iovec[], and
instead just do the proper VOP_WRITE() in ktrwrite() using a copy of
the struct uio that the syscall originally used.

This solves the DoS which could easily be performed; to work around the
DoS, one could also remove "options KTRACE" from the kernel.  This is
a very strong MFC candidate for 4.1.

Found by:	art@OpenBSD.org

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Jun 12 18:06:12 2000 UTC (11 years, 8 months ago) by alfred
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +3 -4 lines
unstatic getfp() so that other subsystems can use it.

make sendfile() use it.

Approved by: dg

Revision 1.49.2.4: download - view: text, markup, annotated - select for diffs
Sat Jun 10 17:44:57 2000 UTC (11 years, 8 months ago) by jlemon
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE
Diff to: previous 1.49.2.3: preferred, colored; branchpoint 1.49: preferred, colored
Changes since revision 1.49.2.3: +5 -1 lines
MFC: mbuf wait code, as well as some other mbuf related bugfixes.
Submitted by: Mike Silbersack <silby@silby.com>

Revision 1.68: 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.67: preferred, colored
Changes since revision 1.67: +2 -2 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.67: 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.66: preferred, colored
Changes since revision 1.66: +2 -2 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.65.2.1: download - view: text, markup, annotated - select for diffs
Fri May 5 03:49:57 2000 UTC (11 years, 9 months ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +5 -1 lines
MFC: kqueue() and kevent()

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

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sun Dec 12 05:52:49 1999 UTC (12 years, 2 months ago) by green
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +5 -1 lines
This is Bosko Milekic's mbuf allocation waiting code.  Basically, this
means that running out of mbuf space isn't a panic anymore, and code
which runs out of network memory will sleep to wait for it.

Submitted by:	Bosko Milekic <bmilekic@dsuper.net>
Reviewed by:	green, wollman

Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Nov 24 20:48:58 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines
General clean-up of socket.h and associated sources to synchronise up
with NetBSD and the Single Unix Specification v2.

This updates some structures with other, almost equivalent types and
effort is under way to get the whole more consistent.

Also removes a double definition of INET6 and some other clean-ups.

Reviewed by: green, bde, phk
Some part obtained from: NetBSD, SUSv2 specification

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Nov 16 10:56:05 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +4 -4 lines
This is a partial commit of the patch from PR 14914:

   Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
   structures for list operations.  This patch makes all list operations
   in sys/kern use the queue(3) macros, rather than directly accessing the
   *Q_{HEAD,ENTRY} structures.

This batch of changes compile to the same object files.

Reviewed by:    phk
Submitted by:   Jake Burkholder <jake@checker.org>
PR:     14914

Revision 1.62: download - view: text, markup, annotated - select for diffs
Fri Oct 29 18:08:54 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +1 -2 lines
useracc() the prequel:

Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Oct 14 05:16:16 1999 UTC (12 years, 4 months ago) by green
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +2 -1 lines
Add a missing spl lowering.

Submitted by:	Ville-Pertti Keinonen <will@iki.fi>

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 -3 lines
Trim unused options (or #ifdef for undoc options).

Submitted by:	phk

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Sep 30 19:13:17 1999 UTC (12 years, 4 months ago) by guido
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +7 -2 lines
Plug a potential filedescriptor leak. This will probably almost
never be triggered.

Reviewed by:	 David Greenman

Revision 1.58: 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.57: preferred, colored
Changes since revision 1.57: +5 -1 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.6.4.2: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:32:39 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.6.4.1: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.4.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.20.2.3: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:15:36 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.20.2.2: preferred, colored; branchpoint 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20.2.2: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.49.2.3: 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_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.49.2.2: preferred, colored; branchpoint 1.49: preferred, colored
Changes since revision 1.49.2.2: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.57: 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.56: preferred, colored
Changes since revision 1.56: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Aug 4 18:53:47 1999 UTC (12 years, 6 months ago) by green
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +11 -14 lines
Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files
are more carefully ordered. f_ops should also be set to &badfileops
upon "close" of a file.

This does not fix other problems mentioned in this PR than the first
one.

PR:		11629
Reviewed by:	peter

Revision 1.49.2.2: download - view: text, markup, annotated - select for diffs
Fri Feb 26 17:32:50 1999 UTC (12 years, 11 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.49.2.1: preferred, colored; branchpoint 1.49: preferred, colored
Changes since revision 1.49.2.1: +3 -2 lines
Backport NetBSD's 19990120-accept fix from -current to 3.x-stable.

This includes:  uipc_socket.c rev 1.52,1.54; uipc_socket2.c rev 1.44,
socketvar.h rev 1.33, uipc_syscall.c rev 1.54 (indirectly related)

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Jan 27 21:49:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, PRE_SMP_VMSHARE, PRE_NEWBUS, POST_VFS_BIO_NFS_PATCH, POST_SMP_VMSHARE, POST_NEWBUS
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
        Fix warnings in preparation for adding -Wall -Wcast-qual to the
        kernel compile

Revision 1.54: download - view: text, markup, annotated - select for diffs
Mon Jan 25 16:53:53 1999 UTC (13 years ago) by fenner
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -2 lines
Don't free the socket address if soaccept() / pru_accept() doesn't
 return one.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Jan 24 03:49:58 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +1 -1 lines
    Addendum:  The original code that the last commit 'fixed' actually did
    not have a bug in it, but the last commit did make it more readable so
    we are keeping it.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sun Jan 24 01:15:58 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +35 -32 lines
     There was a situation where sendfile() might attempt to initiate I/O
     on a PG_BUSY page, due to a bug in its sequencing of a conditional.

Revision 1.49.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 22 05:26:39 1999 UTC (13 years ago) by dillon
Branches: RELENG_3
CVS tags: RELENG_3_1_0_RELEASE
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +9 -2 lines
    Backport from -4.x.  Not really a bug, but cleanup manual clearing of
    PG_BUSY to formal clearing using vm_page_wakeup().

Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu Jan 21 09:00:26 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +1 -1 lines
    Fixed a potential bug ( but maybe not ), where sendfile() clears PG_BUSY
    on a page without testing for waiters.  Also collapsed busy wait into
    new vm_page_sleep_busy() inline ( see vm/vm_page.h )

Revision 1.50: download - view: text, markup, annotated - select for diffs
Thu Jan 21 08:29:04 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: POST_MATT_SWAPPER
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +13 -16 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.49: download - view: text, markup, annotated - select for diffs
Mon Dec 7 21:58:29 1998 UTC (13 years, 2 months ago) by archie
Branches: MAIN
CVS tags: RELENG_3_BP, PRE_MATT_SWAPPER
Branch point for: RELENG_3
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -2 lines
The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu Dec 3 12:35:47 1998 UTC (13 years, 2 months ago) by dg
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +7 -5 lines
Fixed broken code in sendfile(2) when using file offsets.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Nov 23 00:45:39 1998 UTC (13 years, 2 months ago) by truckman
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +3 -1 lines
We can't call fsetown() from sonewconn() because sonewconn() is be called
from an interrupt context and fsetown() wants to peek at curproc, call
malloc(..., M_WAITOK), and fiddle with various unprotected data structures.
The fix is to move the code that duplicates the F_SETOWN/FIOSETOWN state
of the original socket to the new socket from sonewconn() to accept1(),
since accept1() runs in the correct context.  Deferring this until the
process calls accept() is harmless since the process can't do anything
useful with SIGIO on the new socket until it has the descriptor for that
socket.

One could make the case for not bothering to duplicate the
F_SETOWN/FIOSETOWN state and requiring the process to explicitly make the
fcntl() or ioctl() call on the new socket, but this would be incompatible
with the previous implementation and might break programs which rely on
the old semantics.

This bug was discovered by Andrew Gallatin <gallatin@cs.duke.edu>.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Nov 18 09:00:47 1998 UTC (13 years, 2 months ago) by dg
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +4 -1 lines
Closed a very narrow and rare race condition that involved net interrupts,
bio interrupts, and a truncated file that along with the precise alignment
of the planets could result in a page being freed multiple times or a
just-freed page being put onto the inactive queue.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sun Nov 15 16:55:09 1998 UTC (13 years, 2 months ago) by dg
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -2 lines
In sendfile(2), check against sb_lowat when filling the socket buffer,
rather than 0.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat Nov 14 23:36:17 1998 UTC (13 years, 2 months ago) by dg
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +3 -3 lines
Fixed a couple of nits in sendfile(2): clear PG_ZERO before unbusying
the page, and use passed-in "p" rather than curproc in uio struct.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Nov 6 19:16:30 1998 UTC (13 years, 3 months ago) by dg
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +20 -1 lines
Added support for non-blocking sockets to sendfile(2).

Revision 1.42: download - view: text, markup, annotated - select for diffs
Thu Nov 5 14:28:24 1998 UTC (13 years, 3 months ago) by dg
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +403 -1 lines
Implemented zero-copy TCP/IP extensions via sendfile(2) - send a
file to a stream socket. sendfile(2) is similar to implementations in
HP-UX, Linux, and other systems, but the API is more extensive and
addresses many of the complaints that the Apache Group and others have
had with those other implementations. Thanks to Marc Slemko of the
Apache Group for helping me work out the best API for this.
Anyway, this has the "net" result of speeding up sends of files over
TCP/IP sockets by about 10X (that is to say, uses 1/10th of the CPU
cycles) when compared to a traditional read/write loop.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Aug 23 03:06:59 1998 UTC (13 years, 5 months ago) by wollman
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +34 -44 lines
Yow!  Completely change the way socket options are handled, eliminating
another specialized mbuf type in the process.  Also clean up some
of the cruft surrounding IPFW, multicast routing, RSVP, and other
ill-explored corners.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Jun 10 10:30:23 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +5 -3 lines
64bit fixes: don't cast p->p_retval to an int*.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue Apr 14 06:24:43 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
CVS tags: PRE_DEVFS_SLICE, POST_DEVFS_SLICE
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +4 -2 lines
Fix a minor mbuf leak created by the previous change.
Reviewed by:	phk
Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Apr 11 20:31:46 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -2 lines
setsockopt() transports user option data in an mbuf. if the user
data is greater than MLEN, setsockopt is unable to pass it onto
the protocol handler.  Allocate a cluster in such case.

PR:		2575
Reviewed by:	 phk
Submitted by:	Julian Assange proff@iq.org

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

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Feb 9 06:09:27 1998 UTC (14 years ago) by eivind
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, POST_SOFTUPDATE
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +5 -5 lines
Staticize.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue Dec 16 17:40:30 1997 UTC (14 years, 1 month ago) by eivind
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -1 lines
Make COMPAT_43 and COMPAT_SUNOS new-style options.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Dec 15 02:29:11 1997 UTC (14 years, 1 month ago) by msmith
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +4 -3 lines
Consult sa_len before trampling it with MSG_COMPAT set.
PR:             kern/5291
Submitted by:   pb@fasterix.freenix.org (Pierre Beyssac)

Revision 1.20.2.2: download - view: text, markup, annotated - select for diffs
Mon Dec 15 02:24:08 1997 UTC (14 years, 1 month ago) by msmith
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE
Diff to: previous 1.20.2.1: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.1: +8 -6 lines
MFS: fixes to avoid trampling sa_len fields in the presence of MSG_COMPAT
with COMPAT_OLDSOCK defined  (ie. COMPAT_43 in kernel config).
Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Dec 14 03:15:21 1997 UTC (14 years, 2 months ago) by msmith
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +6 -5 lines
As described by the submitter:

... fix a bug with orecvfrom() or recvfrom() called with
the MSG_COMPAT flag on kernels compiled with the COMPAT_43 option.
The symptom is that the fromaddr is not correctly returned.

This affects the Linux emulator.

Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Nov 6 19:29:26 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +55 -88 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.31: download - view: text, markup, annotated - select for diffs
Sun Oct 12 20:24:17 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +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.30: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:05:58 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +1 -4 lines
Removed unused #includes.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun Aug 17 19:47:28 1997 UTC (14 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +0 -7 lines
Delete a bit of debugging code that mistakenly crept in, and as a consequence
revert rev. 1.28's header file additions which are no longer needed.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Aug 17 17:40:11 1997 UTC (14 years, 5 months ago) by tegge
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +6 -2 lines
Use KERNBASE, not 0xf0000000.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Aug 16 19:15:06 1997 UTC (14 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +100 -58 lines
Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.

Revision 1.26.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 2 19:53:46 1997 UTC (14 years, 7 months ago) by wollman
Branches: WOLLMAN_MBUF
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +97 -58 lines
Check in my big get-rid-of-sockaddrs-in-mbufs patch, on a private branch.

Requested by: julian

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Apr 27 20:00:45 1997 UTC (14 years, 9 months ago) by wollman
Branches: MAIN
CVS tags: BP_WOLLMAN_MBUF
Branch point for: WOLLMAN_MBUF
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +13 -9 lines
The long-awaited mega-massive-network-code- cleanup.  Part I.

This commit includes the following changes:
1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility
glue for them is deleted, and the kernel will panic on boot if any are compiled
in.

2) Certain protocol entry points are modified to take a process structure,
so they they can easily tell whether or not it is possible to sleep, and
also to access credentials.

3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt()
call.  Protocols should use the process pointer they are now passed.

4) The PF_LOCAL and PF_ROUTE families have been updated to use the new
style, as has the `raw' skeleton family.

5) PF_LOCAL sockets now obey the process's umask when creating a socket
in the filesystem.

As a result, LINT is now broken.  I'm hoping that some enterprising hacker
with a bit more time will either make the broken bits work (should be
easy for netipx) or dike them out.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Apr 9 16:53:40 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +1 -55 lines
Removed support for OLD_PIPE.  <sys/stat.h> is now missing the hack that
supported nameless pipes being indistinguishable from fifos.  We're not
going back.

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 3 06:24:36 1997 UTC (14 years, 10 months ago) by davidg
Branches: RELENG_2_2
CVS tags: RELENG_2_2_5_RELEASE, RELENG_2_2_2_RELEASE
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +22 -6 lines
Merged from -current: avoid potential "accept" panic by re-ordering the
code a bit, plus changed a wakeup to a wakeup_one in the socket code.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Mar 31 12:30:01 1997 UTC (14 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +22 -6 lines
In accept1(), falloc() is called after the process has awoken, but prior
to removing the connection from the queue. The problem here is that
falloc() may block and this would allow another process to accept the
connection instead. If this happens to leave the queue empty, then the
system will panic with an "accept: nothing queued".

Also changed a wakeup() to a wakeup_one() to avoid the "thundering herd"
problem on new connections in Apache (or any other application that has
multiple processes blocked in accept() for the same socket).

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Mar 23 03:36:32 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -1 lines
Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.
Fixed everything that depended on getting fcntl.h stuff from the wrong
place.  Most things don't depend on file.h stuff at all.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:39:29 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:44:21 1997 UTC (15 years, 1 month ago) by jkh
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Oct 15 19:28:44 1996 UTC (15 years, 3 months ago) by wollman
Branches: MAIN
CVS tags: RELENG_2_2_BP, RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Branch point for: RELENG_2_2
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -2 lines
Preserve file flags in accept(2).

Submitted by: fredriks@mcs.com in PR#1775 (this implmentaion is different)

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat Aug 24 03:35:13 1996 UTC (15 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -1 lines
The socketpair(0 syscall is bogusly returning the fd numbers through
the primary and secondary return codes, causing it to not behave as
documented.  This probably originates from the ancient BSD kernels that
had pipe(2) implemented by socketpair(2), there are no binaries left that
we can run that do this.

Pointed out by: Robert Withrow <witr@rwwa.com>, PR#731

Revision 1.18: download - view: text, markup, annotated - select for diffs
Thu Jul 11 16:32:02 1996 UTC (15 years, 7 months ago) by wollman
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -3 lines
Modify the kernel to use the new pr_usrreqs interface rather than the old
pr_usrreq mechanism which was poorly designed and error-prone.  This
commit renames pr_usrreq to pr_ousrreq so that old code which depended on it
would break in an obvious manner.  This commit also implements the new
interface for TCP, although the old function is left as an example
(#ifdef'ed out).  This commit ALSO fixes a longstanding bug in the
TCP timer processing (introduced by davidg on 1995/04/12) which caused
timer processing on a TCB to always stop after a single timer had
expired (because it misinterpreted the return value from tcp_usrreq()
to indicate that the TCB had been deleted).  Finally, some code
related to polling has been deleted from if.c because it is not
relevant t -current and doesn't look at all like my current code.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu May 9 20:14:59 1996 UTC (15 years, 9 months ago) by wollman
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +24 -11 lines
Make it possible to return more than one piece of control information
(PR #1178).
Define a new SO_TIMESTAMP socket option for datagram sockets to return
packet-arrival timestamps  as control information (PR #1179).

Submitted by:	Louis Mamakos <loiue@TransSys.com>

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Mar 11 20:01:53 1996 UTC (15 years, 11 months ago) by peter
Branches: CSRG
CVS tags: bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +346 -300 lines
Import 4.4BSD-Lite2 onto the vendor branch, note that in the kernel, all
files are off the vendor branch, so this should not change anything.

A "U" marker generally means that the file was not changed in between
the 4.4Lite and Lite-2 releases, and does not need a merge.  "C" generally
means that there was a change.
[note new unused (in this form) syscalls.conf, to be 'cvs rm'ed]

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Mar 11 15:37:33 1996 UTC (15 years, 11 months ago) by davidg
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +21 -17 lines
Changed socket code to use 4.4BSD queue macros. This includes removing
the obsolete soqinsque and soqremque functions as well as collapsing
so_q0len and so_qlen into a single queue length of unaccepted connections.
Now the queue of unaccepted & complete connections is checked directly
for queued sockets. The new code should be functionally equivilent to
the old while being substantially faster - especially in cases where
large numbers of connections are often queued for accept (e.g. http).

Revision 1.6.4.1: download - view: text, markup, annotated - select for diffs
Mon Feb 26 14:01:20 1996 UTC (15 years, 11 months ago) by phk
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +13 -6 lines
Make getsockopt handle a link of mbufs, rather than just one.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Feb 24 13:38:07 1996 UTC (15 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +13 -6 lines
Make getsockopt() capable of handling more than one mbuf worth of data.
Use this to read rules out of ipfw.
Add the lkm code to ipfw.c

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Feb 13 18:16:21 1996 UTC (16 years ago) by wollman
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +6 -6 lines
Kill XNS.
While we're at it, fix socreate() to take a process argument.  (This
was supposed to get committed days ago...)

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Jan 28 23:41:40 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -2 lines
Enable the new fast pipe code.  The old pipes can be used with the
"OLD_PIPE" config option.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed Jan 3 21:42:21 1996 UTC (16 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -1 lines
Converted two options over to the new scheme: USER_LDT and KTRACE.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Jan 1 10:28:21 1996 UTC (16 years, 1 month ago) by peter
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -3 lines
Make pipe() return a set of bidirectional pipe fd's rather than one-way only
just like on SVR4.

This has no effect on any current programs in our source, but makes
the use of SVR4 code a little easier.  There is no code or implementation
cost in the kernel.. This two-line change merely sets the modes on the ends
of the pipes to be bidirectional.  There are no other changes.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Dec 14 22:51:04 1995 UTC (16 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +3 -3 lines
Nuked ambiguous sleep message strings:
	old:				new:
	netcls[] = "netcls"		"soclos"
	netcon[] = "netcon"		"accept", "connec"
	netio[] = "netio"		"sblock", "sbwait"

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Oct 23 15:42:12 1995 UTC (16 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +181 -218 lines
Simplify the pseudo-argument removal changes by not optimizing for
the !COMPAT_43 case - use a common function even when there is no
`old' function.  The diffs for this are large because of code motion
to restore the function order to what it was before the pseudo-argument
changes.

Include <sys/sysproto.h> to get correct args structs and prototypes.
The diffs for this are large because the declarations of the args structs
were moved to become comments in the function headers.  The comments may
actually match the automatically generated declarations right now.

Add prototypes.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Oct 11 06:09:45 1995 UTC (16 years, 4 months ago) by swallace
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -2 lines
Remove the '1' from getpeername1 and getsockname1 when NOT COMPAT_OLDSOCK.
Left it in there by mistake.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Oct 7 23:47:26 1995 UTC (16 years, 4 months ago) by swallace
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +104 -101 lines
Remove compat_43 psuedo-argument hack, and replace with a better hack.
Instead of using a fake "compat" argument, pass a real compat int to function
if COMPAT_43 is defined.  Functions involved: wait4, accept, recvfrom,
getsockname.

With the compat psuedo-argument, this introduces an argument structure
that can have two possible sizes depending on compat options.
This makes life difficult for lkm modules like ibcs2, which would
have to guess what size used in kernel when compiled.  Also,
the prototype generator for these structures cannot generate proper sizes.

Now there is only one fixed structure and makes everybody happy.

I recommend these changes be introduced to 2.1 so that ibcs2, linux
lkm's generated for 2.2 can still run on a 2.1 kernel.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue May 30 08:06:24 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_0_RELEASE, RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5
Branch point for: RELENG_2_1_0
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +7 -7 lines
Remove trailing whitespace.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Mar 16 18:12:46 1995 UTC (16 years, 11 months ago) by bde
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -1 lines
Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Oct 2 17:35:35 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +395 -336 lines
All of this is cosmetic.  prototypes, #includes, printfs and so on.  Makes
GCC a lot more silent.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:43:10 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
Added $Id$

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed May 25 09:05:51 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +32 -4 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue May 24 10:04:23 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite, REL_before_johndavid_2_0_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite Kernel Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue May 24 10:04:22 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

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