CVS log for src/sys/kern/sys_generic.c
Up to [FreeBSD] / src / sys / kern
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Revision 1.175.2.10: download - view: text, markup, annotated - select for diffs
Sun Nov 27 19:36:36 2011 UTC (2 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.175.2.9: preferred, colored; branchpoint 1.175: preferred, colored; next MAIN 1.176: preferred, colored
Changes since revision 1.175.2.9: +63 -3 lines
SVN rev 228038 on 2011-11-27 19:36:36Z by kib MFC r227485: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379
Revision 1.187.2.1.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 27 19:00:52 2011 UTC (2 months, 1 week ago) by kib
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.187.2.1.2.1: preferred, colored; branchpoint 1.187.2.1: preferred, colored; next MAIN 1.187.2.2: preferred, colored
Changes since revision 1.187.2.1.2.1: +63 -3 lines
SVN rev 228034 on 2011-11-27 19:00:52Z by kib MFC r227485: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Approved by: re (bz)
Revision 1.187.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 27 18:49:16 2011 UTC (2 months, 1 week ago) by kib
Branches: RELENG_9
Diff to: previous 1.187.2.1: preferred, colored; branchpoint 1.187: preferred, colored; next MAIN 1.188: preferred, colored
Changes since revision 1.187.2.1: +63 -3 lines
SVN rev 228032 on 2011-11-27 18:49:16Z by kib MFC r227485: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Approved by: re (bz)
Revision 1.188: download - view: text, markup, annotated - select for diffs
Sun Nov 13 10:28:01 2011 UTC (2 months, 3 weeks ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +63 -3 lines
SVN rev 227485 on 2011-11-13 10:28:01Z by kib To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Discussed with: cognet, glebius Tested by: andreast (powerpc, all 64/32bit ABI combinations, big-endian), marius (sparc64, big-endian) MFC after: 2 weeks
Revision 1.187.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
Diff to: previous 1.187.2.1: preferred, colored
Changes since revision 1.187.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.187.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.187: preferred, colored
Changes since revision 1.187: +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.187: download - view: text, markup, annotated - select for diffs
Fri Sep 16 13:58:51 2011 UTC (4 months, 3 weeks ago) by kmacy
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +17 -17 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.175.2.9: download - view: text, markup, annotated - select for diffs
Thu Sep 15 12:27:26 2011 UTC (4 months, 3 weeks ago) by attilio
Branches: RELENG_8
Diff to: previous 1.175.2.8: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.8: +17 -0 lines
SVN rev 225585 on 2011-09-15 12:27:26Z by attilio MFC r225177,225181: Introduce and use seldrain() function for dealing with fast selrecord/selinfo destruction. Sponsored by: Sandvine Incorporated
Revision 1.186: download - view: text, markup, annotated - select for diffs
Thu Aug 25 15:51:54 2011 UTC (5 months, 2 weeks ago) by attilio
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +17 -0 lines
SVN rev 225177 on 2011-08-25 15:51:54Z by attilio Fix a deficiency in the selinfo interface: If a selinfo object is recorded (via selrecord()) and then it is quickly destroyed, with the waiters missing the opportunity to awake, at the next iteration they will find the selinfo object destroyed, causing a PF#. That happens because the selinfo interface has no way to drain the waiters before to destroy the registered selinfo object. Also this race is quite rare to get in practice, because it would require a selrecord(), a poll request by another thread and a quick destruction of the selrecord()'ed selinfo object. Fix this by adding the seldrain() routine which should be called before to destroy the selinfo objects (in order to avoid such case), and fix the present cases where it might have already been called. Sometimes, the context is safe enough to prevent this type of race, like it happens in device drivers which installs selinfo objects on poll callbacks. There, the destruction of the selinfo object happens at driver detach time, when all the filedescriptors should be already closed, thus there cannot be a race. For this case, mfi(4) device driver can be set as an example, as it implements a full correct logic for preventing this from happening. Sponsored by: Sandvine Incorporated Reported by: rstone Tested by: pluknet Reviewed by: jhb, kib Approved by: re (bz) MFC after: 3 weeks
Revision 1.185: download - view: text, markup, annotated - select for diffs
Tue Aug 16 14:14:56 2011 UTC (5 months, 3 weeks ago) by jonathan
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +11 -0 lines
SVN rev 224910 on 2011-08-16 14:14:56Z by jonathan poll(2) implementation for capabilities. When calling poll(2) on a capability, unwrap first and then poll the underlying object. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc
Revision 1.184: download - view: text, markup, annotated - select for diffs
Fri Aug 12 14:26:47 2011 UTC (5 months, 4 weeks ago) by jonathan
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +1 -1 lines
SVN rev 224797 on 2011-08-12 14:26:47Z by jonathan Rename CAP_*_KEVENT to CAP_*_EVENT. Change the names of a couple of capability rights to be less FreeBSD-specific. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc
Revision 1.183: 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.182: preferred, colored
Changes since revision 1.182: +47 -10 lines
SVN rev 224778 on 2011-08-11 12:30:23Z by rwatson Second-to-last commit implementing Capsicum capabilities in the FreeBSD kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc
Revision 1.158.2.3.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.158.2.3: preferred, colored; next MAIN 1.158.6.1: preferred, colored
Changes since revision 1.158.2.3: +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.175.2.8.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.175.2.8: preferred, colored; next MAIN 1.175.2.9: preferred, colored
Changes since revision 1.175.2.8: +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.175.2.8: download - view: text, markup, annotated - select for diffs
Fri Sep 10 12:55:36 2010 UTC (17 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.175.2.7: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.7: +9 -3 lines
SVN rev 212415 on 2010-09-10 12:55:36Z by kib MFC r211941: Recalcule the return value in pollout(). PR: kern/143029 Tested by: John Plevyak <jplevyak apache org>
Revision 1.182: download - view: text, markup, annotated - select for diffs
Sat Aug 28 17:42:08 2010 UTC (17 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +9 -3 lines
SVN rev 211941 on 2010-08-28 17:42:08Z by kib For some file types, select code registers two selfd structures. E.g., for socket, when specified POLLIN|POLLOUT in events, you would have one selfd registered for receiving socket buffer, and one for sending. Now, if both events are not ready to fire at the time of the initial scan, but are simultaneously ready after the sleep, pollrescan() would iterate over the pollfd struct twice. Since both times revents is not zero, returned value would be off by one. Fix this by recalculating the return value in pollout(). PR: kern/143029 MFC after: 2 weeks
Revision 1.158.2.3: download - view: text, markup, annotated - select for diffs
Wed Jul 14 21:52:23 2010 UTC (18 months, 3 weeks ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.158.2.2: preferred, colored; branchpoint 1.158: preferred, colored; next MAIN 1.159: preferred, colored
Changes since revision 1.158.2.2: +1 -1 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.175.2.7: download - view: text, markup, annotated - select for diffs
Wed Jul 14 21:52:02 2010 UTC (18 months, 3 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.175.2.6: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.6: +1 -1 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.181: 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.180: preferred, colored
Changes since revision 1.180: +1 -1 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.175.2.6.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.175.2.6: preferred, colored; next MAIN 1.175.2.7: preferred, colored
Changes since revision 1.175.2.6: +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.175.2.6: download - view: text, markup, annotated - select for diffs
Fri Jun 4 14:06:59 2010 UTC (20 months, 1 week ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.175.2.5: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.5: +1 -1 lines
SVN rev 208801 on 2010-06-04 14:06:59Z by kib MFC r208374: Remove POLLHUP from the flags used to test for to set exceptfsd fd_set bits in select(2). It seems that historical behaviour is to not reporting exception on EOF, and several applications are broken. Approved by: re (kensmith)
Revision 1.180: download - view: text, markup, annotated - select for diffs
Fri May 21 10:36:29 2010 UTC (20 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +1 -1 lines
SVN rev 208374 on 2010-05-21 10:36:29Z by kib Remove PIOLLHUP from the flags used to test for to set exceptfsd fd_set bits in select(2). It seems that historical behaviour is to not reporting exception on EOF, and several applications are broken. Reported by: Yoshihiko Sarumaru <ysarumaru gmail com> Discussed with: bde PR: ports/140934 MFC after: 2 weeks
Revision 1.175.2.5: download - view: text, markup, annotated - select for diffs
Wed Apr 7 02:24:41 2010 UTC (22 months ago) by nwhitehorn
Branches: RELENG_8
Diff to: previous 1.175.2.4: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.4: +32 -2 lines
SVN rev 206336 on 2010-04-07 02:24:41Z by nwhitehorn MFC r205014,205015: Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. This MFC is required for MFCs of later changes to the freebsd32 compatibility from HEAD. Requested by: kib
Revision 1.179: download - view: text, markup, annotated - select for diffs
Thu Mar 11 14:49:06 2010 UTC (23 months ago) by nwhitehorn
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +32 -2 lines
SVN rev 205014 on 2010-03-11 14:49:06Z by nwhitehorn Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
Revision 1.158.2.2.4.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.158.2.2: preferred, colored; next MAIN 1.158.2.3: preferred, colored
Changes since revision 1.158.2.2: +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.175.2.4: download - view: text, markup, annotated - select for diffs
Sat Dec 19 11:47:00 2009 UTC (2 years, 1 month ago) by kib
Branches: RELENG_8
Diff to: previous 1.175.2.3: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.3: +53 -3 lines
SVN rev 200725 on 2009-12-19 11:47:00Z by kib MFC r198508, r198509: Reimplement pselect() in kernel, making change of sigmask and sleep atomic. MFC r198538: Move pselect(3) man page to section 2.
Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Oct 27 10:55:34 2009 UTC (2 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +53 -3 lines
SVN rev 198508 on 2009-10-27 10:55:34Z by kib Current pselect(3) is implemented in usermode and thus vulnerable to well-known race condition, which elimination was the reason for the function appearance in first place. If sigmask supplied as argument to pselect() enables a signal, the signal might be delivered before thread called select(2), causing lost wakeup. Reimplement pselect() in kernel, making change of sigmask and sleep atomic. Since signal shall be delivered to the usermode, but sigmask restored, set TDP_OLDMASK and save old mask in td_oldsigmask. The TDP_OLDMASK should be cleared by ast() in case signal was not gelivered during syscall execution. Reviewed by: davidxu Tested by: pho MFC after: 1 month
Revision 1.175.2.3.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.175.2.3: preferred, colored; next MAIN 1.175.2.4: preferred, colored
Changes since revision 1.175.2.3: +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.175.2.3: download - view: text, markup, annotated - select for diffs
Wed Sep 16 13:24:37 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.175.2.2: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.2: +9 -5 lines
SVN rev 197255 on 2009-09-16 13:24:37Z by kib MFC r197049: Calculate the amount of bytes to copy for select filedescriptor masks taking into account size of fd_set for the current process ABI. Approved by: re (kensmith)
Revision 1.177: download - view: text, markup, annotated - select for diffs
Wed Sep 9 20:59:01 2009 UTC (2 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +9 -5 lines
SVN rev 197049 on 2009-09-09 20:59:01Z by kib kern_select(9) copies fd_set in and out of userspace in quantities of longs. Since 32bit processes longs are 4 bytes, 64bit kernel may copy in or out 4 bytes more then the process expected. Calculate the amount of bytes to copy taking into account size of fd_set for the current process ABI. Diagnosed and tested by: Peter Jeremy <peterjeremy acm org> Reviewed by: jhb MFC after: 1 week
Revision 1.175.2.2: download - view: text, markup, annotated - select for diffs
Tue Sep 1 20:58:41 2009 UTC (2 years, 5 months ago) by jilles
Branches: RELENG_8
Diff to: previous 1.175.2.1: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.1: +7 -0 lines
SVN rev 196741 on 2009-09-01 20:58:41Z by jilles MFC r196460 Fix the conformance of poll(2) for sockets after r195423 by returning POLLHUP instead of POLLIN for several cases. Now, the tools/regression/poll results for FreeBSD are closer to that of the Solaris and Linux. Also, improve the POSIX conformance by explicitely clearing POLLOUT when POLLHUP is reported in pollscan(), making the fix global. Submitted by: bde Reviewed by: rwatson MFC r196556 Fix poll() on half-closed sockets, while retaining POLLHUP for fifos. This reverts part of r196460, so that sockets only return POLLHUP if both directions are closed/error. Fifos get POLLHUP by closing the unused direction immediately after creating the sockets. The tools/regression/poll/*poll.c tests now pass except for two other things: - if POLLHUP is returned, POLLIN is always returned as well instead of only when there is data left in the buffer to be read - fifo old/new reader distinction does not work the way POSIX specs it Reviewed by: kib, bde MFC r196554 Add some tests for poll(2)/shutdown(2) interaction. Approved by: re (kensmith)
Revision 1.176: download - view: text, markup, annotated - select for diffs
Sun Aug 23 12:44:15 2009 UTC (2 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +7 -0 lines
SVN rev 196460 on 2009-08-23 12:44:15Z by kib Fix the conformance of poll(2) for sockets after r195423 by returning POLLHUP instead of POLLIN for several cases. Now, the tools/regression/poll results for FreeBSD are closer to that of the Solaris and Linux. Also, improve the POSIX conformance by explicitely clearing POLLOUT when POLLHUP is reported in pollscan(), making the fix global. Submitted by: bde Reviewed by: rwatson MFC after: 1 week
Revision 1.175.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.175: preferred, colored
Changes since revision 1.175: +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.175: download - view: text, markup, annotated - select for diffs
Thu Jul 2 09:16:25 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +2 -0 lines
SVN rev 195281 on 2009-07-02 09:16:25Z by rwatson Audit file descriptor and command arguments to ioctl(2). Approved by: re (audit argument blanket) MFC after: 1 week
Revision 1.174: download - view: text, markup, annotated - select for diffs
Wed Jul 1 20:43:46 2009 UTC (2 years, 7 months ago) by jeff
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +8 -6 lines
SVN rev 195259 on 2009-07-01 20:43:46Z by jeff - Use fd_lastfile + 1 as the upper bound on nd. This is more correct than using the size of the descriptor array. - A lock is not needed to fetch fd_lastfile. The results are stale the instant it is dropped. - Use a private mutex pool for select since the pool mutex is not used as a leaf. - Fetch the si_mtx pointer first before resorting to hashing to compute the mutex address. Reviewed by: McKusick Approved by: re (kib)
Revision 1.173: download - view: text, markup, annotated - select for diffs
Sat Jun 27 13:58:44 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +2 -2 lines
SVN rev 195104 on 2009-06-27 13:58:44Z by rwatson Replace AUDIT_ARG() with variable argument macros with a set more more specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week
Revision 1.172: 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.171: preferred, colored
Changes since revision 1.171: +4 -10 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.158.2.2.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.158.2.2: preferred, colored; next MAIN 1.158.2.3: preferred, colored
Changes since revision 1.158.2.2: +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.158.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 11:54:22 2009 UTC (2 years, 9 months ago) by rwatson
Branches: RELENG_7
CVS tags: RELENG_7_3_BP, RELENG_7_2_BP
Branch point for: RELENG_7_3, RELENG_7_2
Diff to: previous 1.158.2.1: preferred, colored; branchpoint 1.158: preferred, colored
Changes since revision 1.158.2.1: +22 -1 lines
SVN rev 190997 on 2009-04-13 11:54:22Z by rwatson Merge r190996 from head to stable/7: When writing out updated pollfd records when returning from poll(), only copy out the revents field, not the whole pollfd structure. Otherwise, if the events field is updated concurrently by another thread, that update may be lost. This issue apparently causes problems for the JDK on FreeBSD, which expects the Linux behavior of not updating all fields (somewhat oddly, Solaris does not implement the required behavior, but presumably our adaptation of the JDK is based on the Linux port?). MFC after: 2 weeks PR: kern/130924 Submitted by: Kurt Miller <kurt @ intricatesoftware.com> Discussed with: kib Approved by: re (kib)
Revision 1.158.2.1: download - view: text, markup, annotated - select for diffs
Fri Mar 13 10:52:22 2009 UTC (2 years, 10 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +16 -0 lines
SVN rev 189766 on 2009-03-13 10:52:22Z by kib MFC r189450: Extract the no_poll() and vop_nopoll() code into the common routine poll_no_poll(). Return a poll_no_poll() result from devfs_poll_f() when filedescriptor does not reference the live cdev, instead of ENXIO.
Revision 1.171: download - view: text, markup, annotated - select for diffs
Wed Mar 11 22:00:03 2009 UTC (2 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +22 -1 lines
SVN rev 189708 on 2009-03-11 22:00:03Z by rwatson When writing out updated pollfd records when returning from poll(), only copy out the revents field, not the whole pollfd structure. Otherwise, if the events field is updated concurrently by another thread, that update may be lost. This issue apparently causes problems for the JDK on FreeBSD, which expects the Linux behavior of not updating all fields (somewhat oddly, Solaris does not implement the required behavior, but presumably our adaptation of the JDK is based on the Linux port?). MFC after: 2 weeks PR: kern/130924 Submitted by: Kurt Miller <kurt @ intricatesoftware.com> Discussed with: kib
Revision 1.170: download - view: text, markup, annotated - select for diffs
Fri Mar 6 15:35:37 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +16 -0 lines
SVN rev 189450 on 2009-03-06 15:35:37Z by kib Extract the no_poll() and vop_nopoll() code into the common routine poll_no_poll(). Return a poll_no_poll() result from devfs_poll_f() when filedescriptor does not reference the live cdev, instead of ENXIO. Noted and tested by: hps MFC after: 1 week
Revision 1.169: download - view: text, markup, annotated - select for diffs
Mon Feb 2 03:34:40 2009 UTC (3 years ago) by sepotvin
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +2 -2 lines
SVN rev 187996 on 2009-02-02 03:34:40Z by sepotvin Fix select on platforms where sizeof(long) != sizeof(int). This used to work by accident before the cleanup done in revision 187693. Approved by: kan (mentor)
Revision 1.168: download - view: text, markup, annotated - select for diffs
Sun Jan 25 18:38:42 2009 UTC (3 years ago) by jeff
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +6 -5 lines
SVN rev 187693 on 2009-01-25 18:38:42Z by jeff - bit has to be fd_mask to work properly on 64bit platforms. Constants must also be cast even though the result ultimately is promoted to 64bit. - Correct a loop index upper bound in selscan().
Revision 1.167: download - view: text, markup, annotated - select for diffs
Sun Jan 25 09:17:16 2009 UTC (3 years ago) by jeff
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +1 -1 lines
SVN rev 187682 on 2009-01-25 09:17:16Z by jeff - Correct a typo in a comment. Noticed by: danger
Revision 1.166: download - view: text, markup, annotated - select for diffs
Sun Jan 25 07:24:34 2009 UTC (3 years ago) by jeff
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +96 -44 lines
SVN rev 187677 on 2009-01-25 07:24:34Z by jeff Fix errors introduced when I rewrote select. - Restructure selscan() and selrescan() to avoid producing extra selfps when we have a fd in multiple sets. As described below multiple selfps may still exist for other reasons. - Make selrescan() tolerate multiple selfds for a given descriptor set since sockets use two selinfos per fd. If an event on each selinfo fires selrescan() will see the descriptor twice. This could result in select() returning 2x the number of fds actually existing in fd sets. Reported by: mgleason@ncftp.com
Revision 1.158.6.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.158: preferred, colored; next MAIN 1.159: preferred, colored
Changes since revision 1.158: +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.146.2.2.4.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.146.2.2: preferred, colored; next MAIN 1.147: preferred, colored
Changes since revision 1.146.2.2: +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.165: download - view: text, markup, annotated - select for diffs
Tue Sep 23 14:25:38 2008 UTC (3 years, 4 months ago) by obrien
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +3 -4 lines
SVN rev 183297 on 2008-09-23 14:25:38Z by obrien Reverse if() logic to improve readability. Reviewed by: ru
Revision 1.164: download - view: text, markup, annotated - select for diffs
Wed Mar 19 07:33:16 2008 UTC (3 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +0 -8 lines
- Remove stale comment. - In the last revision the code was changed to use maxfilesperproc rather than the per-process file limit to restrict the size of the poll array. This eliminates a significant source of process lock contention in multithreaded programs and is cheaper. This had been committed with the wrong batch of changes.
Revision 1.163: download - view: text, markup, annotated - select for diffs
Wed Mar 19 06:19:00 2008 UTC (3 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +1 -6 lines
- Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from requiring the per-process spinlock to only requiring the process lock. - Reflect these changes in the proc.h documentation and consumers throughout the kernel. This is a substantial reduction in locking cost for these fields and was made possible by recent changes to threading support.
Revision 1.162: download - view: text, markup, annotated - select for diffs
Mon Jan 7 20:05:18 2008 UTC (4 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +66 -1 lines
Make ftruncate a 'struct file' operation rather than a vnode operation. This makes it possible to support ftruncate() on non-vnode file types in the future. - 'struct fileops' grows a 'fo_truncate' method to handle an ftruncate() on a given file descriptor. - ftruncate() moves to kern/sys_generic.c and now just fetches a file object and invokes fo_truncate(). - The vnode-specific portions of ftruncate() move to vn_truncate() in vfs_vnops.c which implements fo_truncate() for vnode file types. - Non-vnode file types return EINVAL in their fo_truncate() method. Submitted by: rwatson
Revision 1.161: 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.160: preferred, colored
Changes since revision 1.160: +4 -8 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.160: download - view: text, markup, annotated - select for diffs
Sun Dec 16 06:21:19 2007 UTC (4 years, 1 month ago) by jeff
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +414 -168 lines
Refactor select to reduce contention and hide internal implementation details from consumers. - Track individual selecters on a per-descriptor basis such that there are no longer collisions and after sleeping for events only those descriptors which triggered events must be rescaned. - Protect the selinfo (per descriptor) structure with a mtx pool mutex. mtx pool mutexes were chosen to preserve api compatibility with existing code which does nothing but bzero() to setup selinfo structures. - Use a per-thread wait channel rather than a global wait channel. - Hide select implementation details in a seltd structure which is opaque to the rest of the kernel. - Provide a 'selsocket' interface for those kernel consumers who wish to select on a socket when they have no fd so they no longer have to be aware of select implementation details. Tested by: kris Reviewed on: arch
Revision 1.159: download - view: text, markup, annotated - select for diffs
Wed Nov 14 06:21:23 2007 UTC (4 years, 2 months ago) by julian
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +1 -1 lines
generally we are interested in what thread did something as opposed to what process. Since threads by default have teh name of the process unless over-written with more useful information, just print the thread name instead.
Revision 1.158: download - view: text, markup, annotated - select for diffs
Wed Jul 4 22:57:21 2007 UTC (4 years, 7 months ago) by peter
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7_1, RELENG_7
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +28 -0 lines
Add freebsd6_ wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate Approved by: re (kensmith)
Revision 1.157: download - view: text, markup, annotated - select for diffs
Tue Jun 5 00:00:54 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +16 -16 lines
Commit 14/14 of sched_lock decomposition. - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
Revision 1.156: download - view: text, markup, annotated - select for diffs
Tue May 1 06:35:54 2007 UTC (4 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +0 -2 lines
Remove unneeded include files.
Revision 1.155: 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.154: preferred, colored
Changes since revision 1.154: +11 -12 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.154: download - view: text, markup, annotated - select for diffs
Mon Mar 5 13:10:57 2007 UTC (4 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +0 -15 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.146.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 5 11:17:31 2007 UTC (4 years, 11 months ago) by bms
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Branch point for: RELENG_6_4
Diff to: previous 1.146.2.1: preferred, colored; branchpoint 1.146: preferred, colored; next MAIN 1.147: preferred, colored
Changes since revision 1.146.2.1: +1 -1 lines
MFC rev 1.152: Do not dispatch SIGPIPE from the generic write path for a socket; with this patch the code behaves according to the comment on the line above. Without this patch, a socket could cause SIGPIPE to be delivered to its process, once with SO_NOSIGPIPE set, and twice without. With this patch, the kernel now passes the sigpipe regression test in both HEAD and RELENG_6. PR: 78478 (the bug fix for this PR introduced this bug) Tested by: Anton Yuzhaninov Reviewed by: jhb
Revision 1.153: download - view: text, markup, annotated - select for diffs
Sun Mar 4 22:36:46 2007 UTC (4 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +10 -45 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.152: download - view: text, markup, annotated - select for diffs
Thu Mar 1 19:20:25 2007 UTC (4 years, 11 months ago) by bms
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -1 lines
Do not dispatch SIGPIPE from the generic write path for a socket; with this patch the code behaves according to the comment on the line above. Without this patch, a socket could cause SIGPIPE to be delivered to its process, once with SO_NOSIGPIPE set, and twice without. With this patch, the kernel now passes the sigpipe regression test. Tested by: Anton Yuzhaninov MFC after: 1 week
Revision 1.151: download - view: text, markup, annotated - select for diffs
Sat Oct 14 19:01:55 2006 UTC (5 years, 3 months ago) by ru
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +2 -1 lines
Prevent IOC_IN with zero size argument (this is only supported if backward copatibility options are present) from attempting to free memory that wasn't allocated. This is an old bug, and previously it would attempt to free a null pointer. I noticed this bug when working on the previous revision, but forgot to fix it. Security: local DoS Reported by: Peter Holm MFC after: 3 days
Revision 1.146.2.1: download - view: text, markup, annotated - select for diffs
Wed Oct 4 06:09:10 2006 UTC (5 years, 4 months ago) by ru
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +11 -4 lines
MFC: Fix our ioctl(2) implementation for ioctls with "int" arguments. Approved by: re (hrs, kensmith)
Revision 1.150: download - view: text, markup, annotated - select for diffs
Wed Sep 27 19:57:00 2006 UTC (5 years, 4 months ago) by ru
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +15 -11 lines
Fix our ioctl(2) implementation when the argument is "int". New ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls. Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64. Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
Revision 1.149: download - view: text, markup, annotated - select for diffs
Sat Jul 8 20:12:14 2006 UTC (5 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +44 -37 lines
- Split ioctl() up into ioctl() and kern_ioctl(). The kern_ioctl() assumes that the 'data' pointer is already setup to point to a valid KVM buffer or contains the copied-in data from userland as appropriate (ioctl(2) still does this). kern_ioctl() takes care of looking up a file pointer, implementing FIONCLEX and FIOCLEX, and calling fi_ioctl(). - Use kern_ioctl() to implement xenix_rdchk() instead of using the stackgap and mark xenix_rdchk() MPSAFE.
Revision 1.148: download - view: text, markup, annotated - select for diffs
Fri Jan 6 16:34:22 2006 UTC (6 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +2 -2 lines
Return error from fget_write() rather than hardcoding EBADF now that fget_write() DTRT. Requested by: bde
Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu Jan 5 22:20:31 2006 UTC (6 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +2 -2 lines
Remove XXX comments complaining that write(2) on a read-only descriptor returns EBADF. That errno is correct and is mandated by POSIX. It also goes back to revision 1.1 of our CVS history (i.e. 4.4BSD). The _fget() function should probably also be upated as it currently returns EINVAL in that case rather than EBADF. (It does return EBADF for reads on a write-only descriptor without any XXX comments oddly enough.) Discussed with: scottl, grog, mjacob, bde
Revision 1.132.2.8: download - view: text, markup, annotated - select for diffs
Thu Jul 14 19:08:22 2005 UTC (6 years, 6 months ago) by jhb
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.132.2.7: preferred, colored; branchpoint 1.132: preferred, colored; next MAIN 1.133: preferred, colored
Changes since revision 1.132.2.7: +198 -167 lines
MFC: Add the preadv() and pwritev() system calls.
Revision 1.132.2.7: download - view: text, markup, annotated - select for diffs
Thu Jul 14 18:59:58 2005 UTC (6 years, 6 months ago) by jhb
Branches: RELENG_5
Diff to: previous 1.132.2.6: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.6: +4 -2 lines
MFC 1.143: Use ssize_t for cnt in dofile{read,write}() rather than long.
Revision 1.146: download - view: text, markup, annotated - select for diffs
Thu Jul 7 18:17:55 2005 UTC (6 years, 7 months ago) by jhb
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +198 -167 lines
- Add two new system calls: preadv() and pwritev() which are like readv() and writev() except that they take an additional offset argument and do not change the current file position. In SAT speak: preadv:readv::pread:read and pwritev:writev::pwrite:write. - Try to reduce code duplication some by merging most of the old kern_foov() and dofilefoo() functions into new dofilefoo() functions that are called by kern_foov() and kern_pfoov(). The non-v functions now all generate a simple uio on the stack from the passed in arguments and then call kern_foov(). For example, read() now just builds a uio and calls kern_readv() and pwrite() just builds a uio and calls kern_pwritev(). PR: kern/80362 Submitted by: Marc Olzheim marcolz at stack dot nl (1) Approved by: re (scottl) MFC after: 1 week
Revision 1.145: download - view: text, markup, annotated - select for diffs
Thu Jun 30 00:19:08 2005 UTC (6 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +7 -2 lines
Conditionally weaken sys_generic.c rev 1.136 to allow certain dubious ioctl numbers in backwards compatability mode. eg: an IOC_IN ioctl with a size of zero. Traditionally this was what you did before IOC_VOID existed, and we had some established users of this in the tree, namely procfs. Certain 3rd party drivers with binary userland components also have this too. This is necessary to have 4.x and 5.x binaries use these ioctl's. We found this at work when trying to run 4.x binaries. Approved by: re
Revision 1.132.2.6: download - view: text, markup, annotated - select for diffs
Thu Apr 21 20:33:05 2005 UTC (6 years, 9 months ago) by ps
Branches: RELENG_5
Diff to: previous 1.132.2.5: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.5: +32 -19 lines
MFC:
kern_ntptime.c, kern_time.c, sys_generic.c p1003_1b.c, syscallsubr.h:
- Implement kern_adjtime(), kern_readv(),
kern_sched_rr_get_interval(), kern_settimeofday(), and
kern_writev() to allow for further stackgap reduction in
the compat ABIs.
osf1_misc.c:
- Use a custom version of copyinuio() to implement
osf1_{read,write}v() via kern_{read,write}v().
linux32_machdep.c:
- Use a custom version of copyinuio() to implement readv/writev using
kern_readv/writev.
- Use kern_sched_rr_get_interval() rather than the stackgap.
freebsd32_misc.c:
- Use a custom version of copyinuio() to implement readv/writev using
kern_readv/writev.
- Use kern_settimeofday() and kern_adjtime() rather than
stackgapping it.
ibcs2_misc.c:
- Use kern_settimeofday() to avoid stackgap use.
Revision 1.132.2.5: download - view: text, markup, annotated - select for diffs
Tue Apr 19 20:02:37 2005 UTC (6 years, 9 months ago) by ps
Branches: RELENG_5
Diff to: previous 1.132.2.4: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.4: +12 -0 lines
MFC: rev 1.142 Deal with zero length transfers before we even get to fo_ops->fo_read().
Revision 1.132.2.3.2.1: download - view: text, markup, annotated - select for diffs
Sun Apr 10 00:53:36 2005 UTC (6 years, 10 months ago) by kensmith
Branches: RELENG_5_4
CVS tags: RELENG_5_4_0_RELEASE
Diff to: previous 1.132.2.3: preferred, colored; next MAIN 1.132.2.4: preferred, colored
Changes since revision 1.132.2.3: +1 -3 lines
MFR5: revision 1.132.2.4 > date: 2005/04/08 12:05:37; author: jeff; state: Exp; lines: +1 -3 > - Fix kern/78664, restore the old ioctl length verification code for 5.x. > > Contributed by: Dan Nelson Actual work by: jeff Approved by: re (kensmith, scottl) - I approved commit but couldn't find Jeff in time for him to do this before RC2, scottl said we should go ahead with it so RC2 can be started.
Revision 1.132.2.4: download - view: text, markup, annotated - select for diffs
Fri Apr 8 12:05:37 2005 UTC (6 years, 10 months ago) by jeff
Branches: RELENG_5
Diff to: previous 1.132.2.3: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.3: +1 -3 lines
- Fix kern/78664, restore the old ioctl length verification code for 5.x. Contributed by: Dan Nelson
Revision 1.144: download - view: text, markup, annotated - select for diffs
Thu Mar 31 22:51:18 2005 UTC (6 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +32 -19 lines
Implement kern_adjtime(), kern_readv(), kern_sched_rr_get_interval(), kern_settimeofday(), and kern_writev() to allow for further stackgap reduction in the compat ABIs.
Revision 1.132.2.3: download - view: text, markup, annotated - select for diffs
Sun Feb 27 02:42:55 2005 UTC (6 years, 11 months ago) by jeff
Branches: RELENG_5
CVS tags: RELENG_5_4_BP
Branch point for: RELENG_5_4
Diff to: previous 1.132.2.2: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.2: +36 -74 lines
MFC revisions 1.134 - 1.139 - filedesc locking cleanup.
Revision 1.143: download - view: text, markup, annotated - select for diffs
Thu Feb 10 20:19:17 2005 UTC (7 years ago) by cperciva
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +4 -2 lines
Declare "cnt" (a number of bytes to read or write) as an "ssize_t", not as a "long" in dofileread() and dofilewrite(). Discussed with: jhb
Revision 1.132.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:17 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.132.2.1: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.1: +1 -1 lines
MFC: /*- and related license changes
Revision 1.142: download - view: text, markup, annotated - select for diffs
Tue Jan 25 09:15:32 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +12 -0 lines
Previously a read of zero bytes got handled in devfs:vop_read() but I missed that when the vnode bypass was introduced. Deal with zero length transfers before we even get to fo_ops->fo_read(). Found by: Slawa Olhovchenkov <slwzxy.spb.ru@zxy.spb.ru> PR: 75758
Revision 1.141: download - view: text, markup, annotated - select for diffs
Tue Jan 18 07:37:05 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +6 -0 lines
Detect sign-extension bugs in the ioctl(2) command argument: Truncate to 32 bits and print warning.
Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Jan 6 23:35:39 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary
Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Nov 17 09:09:54 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +0 -7 lines
Push Giant down through ioctl. Don't grab Giant in the upper syscall/wrapper code NET_LOCK_GIANT in the socket code (sockets/fifos). mtx_lock(&Giant) in the vnode code. mtx_lock(&Giant) in the opencrypto code. (This may actually not be needed, but better safe than sorry). Devfs grabs Giant if the driver is marked as needing Giant.
Revision 1.138: download - view: text, markup, annotated - select for diffs
Wed Nov 17 08:01:10 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +1 -12 lines
Push Giant down through select and poll. Don't grab Giant in the upper syscall/wrapper code NET_LOCK_GIANT in the socket code (sockets/fifos). mtx_lock(&Giant) in the vnode code. Devfs grabs Giant if the driver is marked as needing Giant.
Revision 1.137: download - view: text, markup, annotated - select for diffs
Tue Nov 16 14:47:04 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +10 -19 lines
Polish code to correctly reflect structure.
Revision 1.136: download - view: text, markup, annotated - select for diffs
Sun Nov 14 14:34:12 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +16 -25 lines
Rearrange memory management for ioctl arguments to use stronger checks for illegal values and don't store them on the stack any more.
Revision 1.135: download - view: text, markup, annotated - select for diffs
Sun Nov 14 12:04:34 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +6 -8 lines
style polish.
Revision 1.134: 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.133: preferred, colored
Changes since revision 1.133: +6 -6 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.132.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 15 14:56:26 2004 UTC (7 years, 4 months ago) by andre
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +3 -3 lines
MFC 1.133: Change the array of char to an array of struct pollfd. Approved by: re (kensmith)
Revision 1.55.2.12: download - view: text, markup, annotated - select for diffs
Mon Sep 13 19:46:21 2004 UTC (7 years, 4 months ago) by andre
Branches: RELENG_4
CVS tags: RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11
Diff to: previous 1.55.2.11: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.2.11: +3 -3 lines
MFC 1.133: Change the array of char to an array of struct pollfd.
Revision 1.133: download - view: text, markup, annotated - select for diffs
Fri Aug 27 21:23:50 2004 UTC (7 years, 5 months ago) by andre
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +3 -3 lines
Poll() uses the array smallbits that is big enough to hold 32 struct pollfd's to avoid calling malloc() on small numbers of fd's. Because smalltype's members have type char, its address might be misaligned for a struct pollfd. Change the array of char to an array of struct pollfd. PR: kern/58214 Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: bde (a long time ago) MFC after: 3 days
Revision 1.132: 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
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +57 -154 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.131: download - view: text, markup, annotated - select for diffs
Mon Apr 5 21:03:35 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +0 -4 lines
Remove advertising clause from University of California Regent's license, per letter dated July 22, 1999. Approved by: core
Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Mar 13 05:58:57 2004 UTC (7 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +8 -0 lines
Add annotations to mtx_lock(&Giant) in kern_select() and poll() that we always grab Giant, even if we're actually only polling objects that don't require giant. Once socket locking is merged, there will be strong motivation to fix this.
Revision 1.129: download - view: text, markup, annotated - select for diffs
Fri Feb 27 18:52:43 2004 UTC (7 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +3 -8 lines
Switch the sleep/wakeup and condition variable implementations to use the sleep queue interface: - Sleep queues attempt to merge some of the benefits of both sleep queues and condition variables. Having sleep qeueus in a hash table avoids having to allocate a queue head for each wait channel. Thus, struct cv has shrunk down to just a single char * pointer now. However, the hash table does not hold threads directly, but queue heads. This means that once you have located a queue in the hash bucket, you no longer have to walk the rest of the hash chain looking for threads. Instead, you have a list of all the threads sleeping on that wait channel. - Outside of the sleepq code and the sleep/cv code the kernel no longer differentiates between cv's and sleep/wakeup. For example, calls to abortsleep() and cv_abort() are replaced with a call to sleepq_abort(). Thus, the TDF_CVWAITQ flag is removed. Also, calls to unsleep() and cv_waitq_remove() have been replaced with calls to sleepq_remove(). - The sched_sleep() function no longer accepts a priority argument as sleep's no longer inherently bump the priority. Instead, this is soley a propery of msleep() which explicitly calls sched_prio() before blocking. - The TDF_ONSLEEPQ flag has been dropped as it was never used. The associated TDF_SET_ONSLEEPQ and TDF_CLR_ON_SLEEPQ macros have also been dropped and replaced with a single explicit clearing of td_wchan. TD_SET_ONSLEEPQ() would really have only made sense if it had taken the wait channel and message as arguments anyway. Now that that only happens in one place, a macro would be overkill.
Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Feb 4 21:52:55 2004 UTC (8 years ago) by jhb
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +4 -1 lines
Locking for the per-process resource limits structure. - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
Revision 1.127: download - view: text, markup, annotated - select for diffs
Tue Jan 20 01:27:42 2004 UTC (8 years ago) by ache
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +9 -4 lines
pread/pwrite: follow lseek spirit - return EINVAL on negative offset for non-VCHR
Revision 1.126: download - view: text, markup, annotated - select for diffs
Sun Nov 9 09:17:24 2003 UTC (8 years, 3 months ago) by tanimura
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.125: preferred, colored
Changes since revision 1.125: +24 -3 lines
- Implement selwakeuppri() which allows raising the priority of a thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
Revision 1.55.2.10.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 16:05:44 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_3
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.10.4.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:58:53 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.10.6.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:57:48 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_5
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.10.8.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:56:56 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_6
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.10.10.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:55:54 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_7
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.10.12.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:54:48 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4_8
Diff to: previous 1.55.2.10: preferred, colored; next MAIN 1.55.2.11: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
MFS 1.55.2.11: Correct a reference counting bug in readv(2).
Revision 1.55.2.11: download - view: text, markup, annotated - select for diffs
Thu Oct 2 15:08:01 2003 UTC (8 years, 4 months ago) by nectar
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.55.2.10: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.10: +7 -7 lines
Correct a case in readv(2) where the file descriptor reference count should have been decremented but was not. Reported by: Joost Pol <joost@pine.nl> Approved by: re
Revision 1.125: download - view: text, markup, annotated - select for diffs
Sat Sep 27 12:53:33 2003 UTC (8 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +0 -11 lines
Introduce no_poll() default method for device drivers. Have it
do exactly the same as vop_nopoll() for consistency and put a
comment in the two pointing at each other.
Retire seltrue() in favour of no_poll().
Create private default functions in kern_conf.c instead of public
ones.
Change default strategy to return the bio with ENODEV instead of
doing nothing which would lead the bio stranded.
Retire public nullopen() and nullclose() as well as the entire band
of public no{read,write,ioctl,mmap,kqfilter,strategy,poll,dump}
funtions, they are the default actions now.
Move the final two trivial functions from subr_xxx.c to kern_conf.c
and retire the now empty subr_xxx.c
Revision 1.124: download - view: text, markup, annotated - select for diffs
Fri Aug 1 02:21:54 2003 UTC (8 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +4 -11 lines
Remove Giant from writev(2). Eliminate trivial style differences between writev(2) and readv(2).
Revision 1.123: download - view: text, markup, annotated - select for diffs
Wed Jun 18 19:53:59 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +4 -4 lines
Introduce a new flag on a file descriptor: DFLAG_SEEKABLE and use that rather than assume that only DTYPE_VNODE is seekable.
Revision 1.122: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:57 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -1 lines
Use __FBSDID().
Revision 1.121: download - view: text, markup, annotated - select for diffs
Tue Apr 29 13:36:03 2003 UTC (8 years, 9 months ago) by kan
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +1 -2 lines
Deprecate machine/limits.h in favor of new sys/limits.h. Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
Revision 1.120: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:25 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +7 -7 lines
Back out M_* changes, per decision of the TRB. Approved by: trb
Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:55:54 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +7 -7 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.115.2.1: download - view: text, markup, annotated - select for diffs
Thu Dec 19 09:40:11 2002 UTC (9 years, 1 month ago) by alfred
Branches: RELENG_5_0
CVS tags: RELENG_5_0_0_RELEASE
Diff to: previous 1.115: preferred, colored; next MAIN 1.116: preferred, colored
Changes since revision 1.115: +6 -6 lines
MFC: SCARGS and syscallargs removal. Approved by: re@ (rwatson)
Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Dec 14 01:56:25 2002 UTC (9 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +6 -6 lines
SCARGS removal take II.
Revision 1.117: download - view: text, markup, annotated - select for diffs
Fri Dec 13 22:41:46 2002 UTC (9 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +6 -6 lines
Backout removal SCARGS, the code freeze is only "selectively" over.
Revision 1.116: download - view: text, markup, annotated - select for diffs
Fri Dec 13 22:27:24 2002 UTC (9 years, 1 month ago) by alfred
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +6 -6 lines
Remove SCARGS. Reviewed by: md5
Revision 1.115: download - view: text, markup, annotated - select for diffs
Sat Sep 28 17:14:55 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_0_BP
Branch point for: RELENG_5_0
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +1 -1 lines
Be consistent about "static" functions: if the function is marked static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
Revision 1.114: download - view: text, markup, annotated - select for diffs
Fri Sep 20 17:45:44 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +0 -3 lines
We don't need the <sys/disklabel.h> include for alpha anymore. Sponsored by: DARPA & NAI Labs.
Revision 1.113: download - view: text, markup, annotated - select for diffs
Wed Sep 11 08:13:54 2002 UTC (9 years, 5 months ago) by julian
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -4 lines
Completely redo thread states. Reviewed by: davidxu@freebsd.org
Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Sep 1 20:37:28 2002 UTC (9 years, 5 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +38 -21 lines
Split out a number of mostly VFS and signal related syscalls into a kernel-internal kern_*() version and a wrapper that is called via the syscall vector table. For paths and structure pointers, the internal version either takes a uio_seg parameter or requires the caller to copyin() the data to kernel memory as appropiate. This will permit emulation layers to use these syscalls without having to copy out translated arguments to the stack gap. Discussed on: -arch Review/suggestions: bde, jhb, peter, marcel
Revision 1.111: download - view: text, markup, annotated - select for diffs
Fri Aug 23 22:43:28 2002 UTC (9 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +2 -4 lines
Move the TAILQ_INIT(&td->td_selq) before the retry: label. Otherwise in some circumstances when we get a select collision, we can end up with cases where we do not clear some sip->si_thread on the way out, leading to page faults in selwakeup(). This should solve the problem where postfix can crash the kernel during select collisions. Reviewed by: alfred
Revision 1.110: download - view: text, markup, annotated - select for diffs
Sat Aug 17 02:36:16 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -3 lines
In continuation of early fileop credential changes, modify fo_ioctl() to accept an 'active_cred' argument reflecting the credential of the thread initiating the ioctl operation. - Change fo_ioctl() to accept active_cred; change consumers of the fo_ioctl() interface to generally pass active_cred from td->td_ucred. - In fifofs, initialize filetmp.f_cred to ap->a_cred so that the invocations of soo_ioctl() are provided access to the calling f_cred. Pass ap->a_td->td_ucred as the active_cred, but note that this is required because we don't yet distinguish file_cred and active_cred in invoking VOP's. - Update kqueue_ioctl() for its new argument. - Update pipe_ioctl() for its new argument, pass active_cred rather than td_ucred to MAC for authorization. - Update soo_ioctl() for its new argument. - Update vn_ioctl() for its new argument, use active_cred rather than td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR(). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Revision 1.109: download - view: text, markup, annotated - select for diffs
Fri Aug 16 12:51:57 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +3 -2 lines
Make similar changes to fo_stat() and fo_poll() as made earlier to fo_read() and fo_write(): explicitly use the cred argument to fo_poll() as "active_cred" using the passed file descriptor's f_cred reference to provide access to the file credential. Add an active_cred argument to fo_stat() so that implementers have access to the active credential as well as the file credential. Generally modify callers of fo_stat() to pass in td->td_ucred rather than fp->f_cred, which was redundantly provided via the fp argument. This set of modifications also permits threads to perform these operations on behalf of another thread without modifying their credential. Trickle this change down into fo_stat/poll() implementations: - badfo_poll(), badfo_stat(): modify/add arguments. - kqueue_poll(), kqueue_stat(): modify arguments. - pipe_poll(), pipe_stat(): modify/add arguments, pass active_cred to MAC checks rather than td->td_ucred. - soo_poll(), soo_stat(): modify/add arguments, pass fp->f_cred rather than cred to pru_sopoll() to maintain current semantics. - sopoll(): moidfy arguments. - vn_poll(), vn_statfile(): modify/add arguments, pass new arguments to vn_stat(). Pass active_cred to MAC and fp->f_cred to VOP_POLL() to maintian current semantics. - vn_close(): rename cred to file_cred to reflect reality while I'm here. - vn_stat(): Add active_cred and file_cred arguments to vn_stat() and consumers so that this distinction is maintained at the VFS as well as 'struct file' layer. Pass active_cred instead of td->td_ucred to MAC and to VOP_GETATTR() to maintain current semantics. - fifofs: modify the creation of a "filetemp" so that the file credential is properly initialized and can be used in the socket code if desired. Pass ap->a_td->td_ucred as the active credential to soo_poll(). If we teach the vnop interface about the distinction between file and active credentials, we would use the active credential here. Note that current inconsistent passing of active_cred vs. file_cred to VOP's is maintained. It's not clear why GETATTR would be authorized using active_cred while POLL would be authorized using file_cred at the file system level. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Revision 1.108: 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.107: preferred, colored
Changes since revision 1.107: +4 -4 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.107: download - view: text, markup, annotated - select for diffs
Wed Jul 24 00:29:22 2002 UTC (9 years, 6 months ago) by alfred
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +8 -4 lines
Attempt to clarify comment in selrecord.
Revision 1.106: download - view: text, markup, annotated - select for diffs
Mon Jul 22 15:46:51 2002 UTC (9 years, 6 months ago) by alfred
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +2 -2 lines
remove caddr_t from fo_ioctl calls
Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Jul 22 15:44:27 2002 UTC (9 years, 6 months ago) by alfred
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +8 -9 lines
remove caddr_t
Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Jun 29 17:26:18 2002 UTC (9 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +1 -1 lines
Part 1 of KSE-III The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
Revision 1.103: 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.102: preferred, colored
Changes since revision 1.102: +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.102: download - view: text, markup, annotated - select for diffs
Wed Jun 19 08:37:02 2002 UTC (9 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +0 -22 lines
Remove the compat bits for the mis-aligned struct disklabel on alpha, people got three times longer than I promised. Sponsored by: DARPA & NAI Labs.
Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Jun 12 02:08:18 2002 UTC (9 years, 8 months ago) by kbyanc
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +6 -6 lines
Make nselcol, the number of select collisions since boot, unsigned as negative collisions simply doesn't make sense. PR: (one small part of) 19720 Approved by: alfred
Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Jun 7 05:36:16 2002 UTC (9 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +8 -10 lines
Catch up to changes in ktrace API.
Revision 1.99: download - view: text, markup, annotated - select for diffs
Thu May 9 02:30:41 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +6 -9 lines
o Correct an error made in revision 1.65: In readv(), if uap->iovcnt is out-of-range, drop the file reference before returning. (This error also exists in the RELENG_4 branch.) o Eliminate the acquisition and release of Giant in readv() now that malloc() and free() are callable without Giant.
Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu May 2 21:53:39 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +14 -3 lines
As promised make the hack for sizeof(struct disklabel) on alpha annoying. Run make world (or recompile whatever program whines) to get rid of warning. Compat bits will be removed entirely in about two weeks.
Revision 1.97: 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.96: preferred, colored
Changes since revision 1.96: +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.96: download - view: text, markup, annotated - select for diffs
Thu Apr 4 20:34:48 2002 UTC (9 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +14 -0 lines
Delete the bogus d_boot[01] fields from struct disklabel. This shrinks the size 4 bytes on alpha, down to the same 276 bytes as all other platforms. Construct a hack to make old ioctls work on new kernels. Once world is recompiled only the new and correct sysctls will be used. This hack will become annoying around 1st of may to make people rebuild their worlds and it will be gone before 5.0.
Revision 1.95: 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.94: preferred, colored
Changes since revision 1.94: +1 -1 lines
Remove __P.
Revision 1.94: download - view: text, markup, annotated - select for diffs
Fri Mar 15 08:03:46 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +0 -8 lines
Giant pushdown for read/write/pread/pwrite syscalls. kern/kern_descrip.c: Aquire Giant in fdrop_locked when file refcount hits zero, this removes the requirement for the caller to own Giant for the most part. kern/kern_ktrace.c: Aquire Giant in ktrgenio, simplifies locking in upper read/write syscalls. kern/vfs_bio.c: Aquire Giant in bwillwrite if needed. kern/sys_generic.c Giant pushdown, remove Giant for: read, pread, write and pwrite. readv and writev aren't done yet because of the possible malloc calls for iov to uio processing. kern/sys_socket.c Grab giant in the socket fo_read/write functions. kern/vfs_vnops.c Grab giant in the vnode fo_read/write functions.
Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu Mar 14 01:32:30 2002 UTC (9 years, 11 months ago) by alfred
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +112 -114 lines
Fixes to make select/poll mpsafe. Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of recording the pid of the select()'ing process into the selinfo structure, actually record a pointer to the thread. To avoid dereferencing a bad address all the selinfo structures that are in use by a thread are kept in a list hung off the thread (protected by sellock). When a selwakeup occurs the selinfo is removed from that threads list, it is also removed on the way out of select or poll where the thread will traverse its list removing all the selinfos from its own list. Problem: Previously the PROC_LOCK was used to provide the mutual exclusion needed to ensure proper locking, this couldn't work because there was a single condvar used for select and poll and condvars can only be used with a single mutex. Solution: Introduce a global mutex 'sellock' which is used to provide mutual exclusion when recording events to wait on as well as performing notification when an event occurs. Interesting note: schedlock is required to manipulate the per-thread TDF_SELECT flag, however if given its own field it would not need schedlock, also because TDF_SELECT is only manipulated under sellock one doesn't actually use schedlock for syncronization, only to protect against corruption. Proc locks are no longer used in select/poll. Portions contributed by: davidc
Revision 1.92: download - view: text, markup, annotated - select for diffs
Sat Mar 9 22:44:37 2002 UTC (9 years, 11 months ago) by alfred
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +6 -6 lines
Remove __P
Revision 1.91: download - view: text, markup, annotated - select for diffs
Wed Jan 30 19:48:25 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -2 lines
Remove unused variables in select(2) from previous delta. Pointed out by: bde
Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Jan 29 22:54:19 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +9 -122 lines
Attempt to fixup select(2) and poll(2), this should fix some races with other threads as well as speed up the interfaces. To fix the race and accomplish the speedup, remove selholddrop and pollholddrop. The entire concept is somewhat bogus because holding the individual struct file pointers offers us no guarantees that another thread context won't close it on us thereby removing our access to our own reference. Selholddrop and pollholddrop also would do multiple locks and unlocks of mutexes _per-file_ in the fd arrays to be scanned, this needed to be sped up. Instead of using selholddrop and pollholddrop, simply hold the filedesc lock over the selscan and pollscan functions. This should protect us against close(2)'s on the files as reduce the multiple lock/unlock pairs per fd into a single lock over the filedesc.
Revision 1.89: download - view: text, markup, annotated - select for diffs
Wed Jan 23 08:28:15 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +0 -0 lines
forced commit, Previous revision also removed the holdfp() function from the kernel.
Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed Jan 23 08:22:59 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -27 lines
make pread use fget_read instead of holdfp.
Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Jan 19 01:03:54 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +9 -5 lines
undo a bit of the Giant pushdown. fdrop isn't SMP safe as it may call into the file's close routine which definetly is not SMP safe right now, so we hold Giant over calls to fdrop now.
Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Jan 16 21:33:41 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +2 -1 lines
Fix giant handling in pwrite(2), I forgot to release it when finishing the syscall.
Revision 1.85: download - view: text, markup, annotated - select for diffs
Mon Jan 14 00:13:44 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +4 -6 lines
Replace ffind_* with fget calls. Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
Revision 1.84: download - view: text, markup, annotated - select for diffs
Sun Jan 13 11:57:59 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +96 -37 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.83: 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.82: preferred, colored
Changes since revision 1.82: +33 -57 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.82: download - view: text, markup, annotated - select for diffs
Fri Sep 21 22:06:22 2001 UTC (10 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +21 -3 lines
The P_SELECT flag was moved from p->p_flag to td->td_flags, but p_flag was locked by the proc lock and td_flags is locked by the sched_lock. The places that read, set, and cleared TDF_SELECT weren't updated, so they read and modified td_flags w/o holding the sched_lock, meaning that they could corrupt the per-thread flags field. As an immediate band-aid, grab sched_lock while reading and manipulating td_flags in relation to TDF_SELECT. This will probably be cleaned up some later on.
Revision 1.81: 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.80: preferred, colored
Changes since revision 1.80: +178 -154 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.80: download - view: text, markup, annotated - select for diffs
Sat Sep 1 19:34:23 2001 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +121 -41 lines
Giant Pushdown:
read() pread() readv() write () pwrite() writev() ioctl() select ()
poll() openbsd_poll()
Revision 1.79: download - view: text, markup, annotated - select for diffs
Tue May 15 10:19:53 2001 UTC (10 years, 8 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +35 -3 lines
Back out scanning file descriptors with holding a process lock. selrecord() requires allproc sx in pfind(), resulting in lock order reversal between allproc and a process lock.
Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon May 14 05:26:45 2001 UTC (10 years, 9 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +132 -41 lines
- Convert msleep(9) in select(2) and poll(2) to cv_*wait*(9). - Since polling should not involve sleeping, keep holding a process lock upon scanning file descriptors. - Hold a reference to every file descriptor prior to entering polling loop in order to avoid lock order reversal between lockmgr and p_mtx upon calling fdrop() in fo_poll(). (NOTE: this work has not been done for netncp and netsmb yet because a socket itself has no reference counts.) Reviewed by: jhb
Revision 1.77: download - view: text, markup, annotated - select for diffs
Tue Apr 24 00:51:48 2001 UTC (10 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +6 -7 lines
Change the pfind() and zpfind() functions to lock the process that they find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
Revision 1.55.2.10: download - view: text, markup, annotated - select for diffs
Sat Mar 17 10:39:32 2001 UTC (10 years, 10 months ago) by peter
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, 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, RELENG_4_3_BP, RELENG_4_3_0_RELEASE
Branch point for: RELENG_4_8, RELENG_4_7, RELENG_4_6, RELENG_4_5, RELENG_4_4, RELENG_4_3
Diff to: previous 1.55.2.9: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.9: +19 -11 lines
MFC: revs 1.71, 1.73, 1.74, 1.75: Fix up bogus poll() pollfd array limits. Approved by: jkh
Revision 1.76: 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.75: preferred, colored
Changes since revision 1.75: +9 -3 lines
Grab the process lock while calling psignal and before calling psignal.
Revision 1.75: download - view: text, markup, annotated - select for diffs
Tue Feb 27 15:11:31 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +8 -8 lines
Correctly declare variables as u_int rather than doing typecasts. Kill some register declarations while I'm here. Submitted by: bde (1)
Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Feb 27 00:50:20 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -2 lines
Cast nfds to u_int before range checking it in order to catch negative values. PR: 25393
Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri Feb 9 08:10:22 2001 UTC (11 years ago) by peter
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +8 -9 lines
poll(2) array limits (take 2) - after some input from bde.
Revision 1.72: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:09:51 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +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.71: download - view: text, markup, annotated - select for diffs
Wed Feb 7 23:28:01 2001 UTC (11 years ago) by peter
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +16 -8 lines
The code I picked up from NetBSD in '97 had a nasty bug. It limited the index of the pollfd array to the number of fd's currently open, not the maximum number of fd's. ie: if you had 0,1,2 open, you could not use pollfd slots higher than 20. The specs say we only have to support OPEN_MAX [64] entries but we allow way more than that.
Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Jan 24 11:12:37 2001 UTC (11 years ago) by jhb
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +36 -15 lines
- Catch up to proc flag changes. - Add proc locking for selwakeup() and selrecord().
Revision 1.69: download - view: text, markup, annotated - select for diffs
Tue Jan 9 04:33:29 2001 UTC (11 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +2 -1 lines
select() DKI is now in <sys/selinfo.h>.
Revision 1.55.2.9: download - view: text, markup, annotated - select for diffs
Mon Dec 11 07:23:54 2000 UTC (11 years, 2 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.55.2.8: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.8: +5 -2 lines
MFC 1.67, 1.68 kern/sys_generic.c. Add appropriate bwillwrite()
calls, limit calls to file vnodes only.
Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Dec 7 23:45:57 2000 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -2 lines
Only call bwillwrite() for vnodes. Do not penalize devices or pipes.
Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed Dec 6 20:55:08 2000 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +2 -1 lines
Add necessary bwillwrite() in writev() entry point. Deal with excessive dirty buffers when msync() syncs non-contiguous dirty buffers by checking for the case in UFS *before* checking for clusterability.
Revision 1.66: download - view: text, markup, annotated - select for diffs
Thu Nov 30 20:23:14 2000 UTC (11 years, 2 months ago) by alfred
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -2 lines
only call bwillwrite() to stall on IO when dealing with VNODEs otherwise we will stall on non-disk IO for things like fifos and sockets
Revision 1.55.2.8: download - view: text, markup, annotated - select for diffs
Sun Nov 26 02:30:04 2000 UTC (11 years, 2 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.55.2.7: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.7: +60 -27 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.65: download - view: text, markup, annotated - select for diffs
Tue Nov 21 20:22:34 2000 UTC (11 years, 2 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +3 -1 lines
Protect p_wchan with sched_lock in selwakeup().
Revision 1.64: 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.63: preferred, colored
Changes since revision 1.63: +61 -27 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.55.2.7: 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_2_0_RELEASE, RELENG_4_1_1_RELEASE
Diff to: previous 1.55.2.6: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.6: +2 -3 lines
MFC: make getfp non static and make sendfile() use it
Revision 1.55.2.6: download - view: text, markup, annotated - select for diffs
Mon Aug 7 18:20:48 2000 UTC (11 years, 6 months ago) by peter
Branches: RELENG_4
Diff to: previous 1.55.2.5: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.5: +2 -2 lines
MFC: 1.63: fix warning.
Revision 1.63: download - view: text, markup, annotated - select for diffs
Fri Jul 28 22:17:42 2000 UTC (11 years, 6 months ago) by peter
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +2 -2 lines
Fix a warning that has been annoying me for some time: "kern/sys_generic.c:358: warning: cast discards qualifiers from pointer target type" The idea for using the uintptr_t intermediate cast for de-constifying a pointer was hinted at by bde some time ago.
Revision 1.43.2.4: download - view: text, markup, annotated - select for diffs
Thu Jul 27 04:04:12 2000 UTC (11 years, 6 months ago) by green
Branches: RELENG_3
Diff to: previous 1.43.2.3: preferred, colored; branchpoint 1.43: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43.2.3: +7 -3 lines
MFC: rev. 1.62, fix races
Revision 1.55.2.5: download - view: text, markup, annotated - select for diffs
Thu Jul 27 03:46:51 2000 UTC (11 years, 6 months ago) by green
Branches: RELENG_4
Diff to: previous 1.55.2.4: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.4: +7 -3 lines
MFC: rev. 1.62, race fixes
Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Jul 27 03:45:18 2000 UTC (11 years, 6 months ago) by green
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +7 -3 lines
Distinguish between whether ktraceing was enabled before an IO operation or after it. If the ktrace operation was enabled while the process was blocked doing IO, the race would allow it to pass down invalid (uninitialized) data and panic later down the call stack.
Revision 1.43.2.3: 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.43.2.2: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.2.2: +37 -16 lines
MFC: make ktrgenio() use a uio
Revision 1.55.2.4: 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.55.2.3: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.3: +37 -16 lines
MFC: convert ktrgenio() to use a uio to fix a DoS.
Revision 1.55.2.3: download - view: text, markup, annotated - select for diffs
Thu Jul 13 02:15:25 2000 UTC (11 years, 7 months ago) by jhb
Branches: RELENG_4
Diff to: previous 1.55.2.2: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.2: +7 -3 lines
MFC: Zero the tv_usec field in the atv timeval struct for infinite timeouts
in select() and poll().
Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Jul 13 02:12:25 2000 UTC (11 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +7 -3 lines
For infinite timeouts, set both the tv_sec and tv_usec fields to zero in poll() and select(). Noticed by: Wesley Morgan <morganw@chemicals.tacorp.com>
Revision 1.55.2.2: download - view: text, markup, annotated - select for diffs
Wed Jul 12 22:52:36 2000 UTC (11 years, 7 months ago) by jhb
Branches: RELENG_4
Diff to: previous 1.55.2.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.1: +3 -3 lines
MFC: Fix select() and poll() to handle timeouts correctly when called with
less than 1 second of uptime.
Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Jul 12 22:46:40 2000 UTC (11 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +3 -3 lines
Fix a very obscure bug in select() and poll() where the timeout would never expire if poll() or select() was called before the system had been in multiuser for 1 second. This was caused by only checking to see if tv_sec was zero rather than checking both tv_sec and tv_usec.
Revision 1.59: download - view: text, markup, annotated - select for diffs
Fri Jul 7 22:11:37 2000 UTC (11 years, 7 months ago) by green
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +3 -3 lines
Remove two micro-pessimizations I made. Bruce is teaching me well :) KTRPOINT(p, KTR_GENIO) is more uncommon than error == 0, so it should be first in the && statement.
Revision 1.58: 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.57: preferred, colored
Changes since revision 1.57: +37 -16 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.57: 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.56: preferred, colored
Changes since revision 1.56: +2 -3 lines
unstatic getfp() so that other subsystems can use it. make sendfile() use it. Approved by: dg
Revision 1.55.2.1: download - view: text, markup, annotated - select for diffs
Sat May 13 19:28:13 2000 UTC (11 years, 9 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +7 -4 lines
MFC 1.56, guarentee local buffer alignment for ioctl
Revision 1.56: download - view: text, markup, annotated - select for diffs
Tue May 9 17:43:20 2000 UTC (11 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +7 -4 lines
Some ioctl routines assume that the ioctl buffer is aligned, but a
char[] declaration makes no such guarentee. A union is used to force
alignment of the char buffer.
Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Feb 20 13:36:26 2000 UTC (11 years, 11 months ago) by peter
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +9 -7 lines
Fix select(2) for the Alpha. (!!) It was never returning true for fd's in the range of 32-63, 96-127 etc. The first problem was the FD_*() macros were shifting a 32 bit integer "1" left by more than 32 bits. The same problem happened in selscan(). ffs() also takes an int argument and causes failure. For cases where int == long (ie: the usual case for x86, but not always as gcc can have long being a 64 bit quantity) ffs() could be used. Reported by: Marian Stagarescu <marian@bile.skycache.com> Reviewed by: dfr, gallatin (sys/types.h only) Approved by: jkh
Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Jan 14 02:53:25 2000 UTC (12 years ago) by jasone
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -1 lines
Add aio_waitcomplete(). Make aio work correctly for socket descriptors. Make gratuitous style(9) fixes (me, not the submitter) to make the aio code more readable. PR: kern/12053 Submitted by: Chris Sedore <cmsedore@maxwell.syr.edu>
Revision 1.53: download - view: text, markup, annotated - select for diffs
Wed Jan 5 19:40:17 2000 UTC (12 years, 1 month ago) by peter
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +4 -2 lines
Export the nselcoll counter via the kern.nselcoll sysctl so we can see just how bad it gets in various situations. Reminded by: adrian
Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Oct 14 10:50:06 1999 UTC (12 years, 3 months ago) by green
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Missed the second argument of fdrop(). Submitted by: jhay
Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu Oct 14 05:37:52 1999 UTC (12 years, 4 months ago) by green
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +8 -3 lines
Fix a race condition with shared fd tables and writev(). It's still not safe to consider file table sharing secure. Submitted by: Ville-Pertti Keinonen <will@iki.fi>
Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:19:10 1999 UTC (12 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +1 -2 lines
Trim unused options (or #ifdef for undoc options). Submitted by: phk
Revision 1.49: 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.48: preferred, colored
Changes since revision 1.48: +11 -12 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.13.4.1: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:32:25 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:15:17 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.43.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:26:08 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.43.2.1: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.2.1: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:46:19 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.43.2.1: download - view: text, markup, annotated - select for diffs
Wed May 5 22:53:04 1999 UTC (12 years, 9 months ago) by dt
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +127 -36 lines
MFC: pread() and pwrite().
Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Apr 4 21:41:14 1999 UTC (12 years, 10 months ago) by dt
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.46: preferred, colored
Changes since revision 1.46: +89 -129 lines
Add standard padding argument to pread and pwrite syscall. That should make them NetBSD compatible. Add parameter to fo_read and fo_write. (The only flag FOF_OFFSET mean that the offset is set in the struct uio). Factor out some common code from read/pread/write/pwrite syscalls.
Revision 1.46: download - view: text, markup, annotated - select for diffs
Sat Mar 27 21:16:33 1999 UTC (12 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +132 -1 lines
Added pread and pwrite. These functions are defined by the X/Open Threads Extension. (Note: We use the same syscall numbers as NetBSD.) Submitted by: John Plevyak <jplevyak@inktomi.com>
Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Jan 29 08:10:35 1999 UTC (13 years ago) by bde
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -2 lines
Removed a bogus cast to c_caddr_t. This is part of terminating c_caddr_t with extreme prejudice. Here the point of the original cast to caddr_t was to break the warning about the const mismatch between write(2)'s `const void *buf' and `struct uio's `char *iov_base' (previous bitrot gave a gratuitous dependency on caddr_t being char *). Compiling with -Wcast-qual made the cast a full no-op. This change has no effect on the warning for discarding `const' on assignment to iov_base. The warning should not be fixed by splitting `struct iovec' into a non-const version for read() and a const version for write(), since correct const poisoning would affect all pointers to i/o addresses. Const'ness should probably be forgotten by not declaring it in syscalls.master.
Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Jan 27 21:49:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
Revision 1.43: download - view: text, markup, annotated - select for diffs
Thu Dec 10 01:53:26 1998 UTC (13 years, 2 months ago) by jkh
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_1_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +4 -2 lines
poll(2) sets POLLNVAL for descriptors passed in that are less than 0. This makes it difficult to do efficient manipulation of the struct pollfd since you can't leave a slot empty. PR: 8599 Submitted-by: Marc Slemko <marcs@znep.com>
Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Nov 11 10:03:55 1998 UTC (13 years, 3 months ago) by truckman
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +1 -32 lines
Installed the second patch attached to kern/7899 with some changes suggested by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
Revision 1.41: download - view: text, markup, annotated - select for diffs
Sat Sep 5 14:30:11 1998 UTC (13 years, 5 months ago) by bde
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +5 -5 lines
Fixed bogotification of pseudocode for syscall args by rev.1.53 of syscalls.master.
Revision 1.40: download - view: text, markup, annotated - select for diffs
Mon Aug 24 08:39:38 1998 UTC (13 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +12 -10 lines
Change various syscalls to use size_t arguments instead of u_int. Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Jun 10 10:29:31 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +3 -2 lines
64bit fixes: use u_long not int for ioctl command.
Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun May 17 11:52:51 1998 UTC (13 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +5 -5 lines
s/nanoruntime/nanouptime/g s/microruntime/microuptime/g Reviewed by: bde
Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Apr 5 10:03:52 1998 UTC (13 years, 10 months ago) by ache
Branches: MAIN
CVS tags: PRE_DEVFS_SLICE, POST_DEVFS_SLICE
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +3 -7 lines
Remove unused atv.tv_usec = 0; from select/poll code
Revision 1.36: download - view: text, markup, annotated - select for diffs
Sat Apr 4 13:25:32 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +37 -21 lines
Time changes mark 2:
* Figure out UTC relative to boottime. Four new functions provide
time relative to boottime.
* move "runtime" into struct proc. This helps fix the calcru()
problem in SMP.
* kill mono_time.
* add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!)
* nanosleep, select & poll takes long sleeps one day at a time
Reviewed by: bde
Tested by: ache and others
Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Apr 2 07:22:17 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +9 -11 lines
Try to fix poll & select after I broke them.
Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Mar 30 09:50:29 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +12 -16 lines
Eradicate the variable "time" from the kernel, using various measures. "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Nov 23 10:30:50 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, POST_SOFTUPDATE
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +8 -18 lines
Fixed some style bugs in the poll() code. Removed dead code to "Avoid inadvertently sleeping forever". hzto() never returns 0.
Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Nov 6 19:29:20 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +25 -34 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:02 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +4 -3 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
Sat Oct 11 18:31:24 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +4 -1 lines
Distribute and statizice a lot of the malloc M_* types. Substantial input from: bde
Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun Sep 14 02:30:32 1997 UTC (14 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +158 -6 lines
Implement poll(2). This is mostly taken from the NetBSD implementation (from some time ago) but with a few tweaks along the way. Obtained from: NetBSD
Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:05:52 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +1 -5 lines
Removed unused #includes.
Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Jun 16 00:29:31 1997 UTC (14 years, 7 months ago) by dyson
Branches: MAIN
CVS tags: WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +5 -1 lines
Modifications to existing files to support the initial AIO/LIO and kernel based threading support.
Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Mar 24 11:52:25 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -2 lines
Don't include <sys/ioctl.h> in the kernel. Stage 4: include <sys/ttycom.h> and sometimes <sys/filio.h> instead of <sys/ioctl.h> in miscellaneous files. Most of these files have nothing to do with ttys but need to include <sys/ttycom.h> to get the definitions of TIOC[SG]PGRP which are (ab)used to convert F[SG]ETOWN fcntls into ioctls.
Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Mar 23 03:36:23 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +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.24: download - view: text, markup, annotated - select for diffs
Sat Mar 22 08:03:36 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -2 lines
Removed `volatile' from declaration of `time', and removed the resulting null casts. `time' is nonvolatile for accesses within a region locked by splclock()/splx(). Accesses outside such a region are invalid, and splx() must have the side effect of potentially changing all global variables (since there are hundreds of sort of volatile variables like `time'), so declaring `time' as volatile didn't have any real benefits.
Revision 1.23: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:39:19 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not ready for it yet.
Revision 1.22: download - view: text, markup, annotated - select for diffs
Thu Feb 20 11:51:52 1997 UTC (14 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +51 -36 lines
Improved select(): - avoid malloc() if the number of fds is small. - pack the bits better so that `small' is quite large. - don't waste time generating zero bits for null fd_set pointers or scanning these bits. Possibly improved select(): - free malloc()ed storage before returning. This is simpler and I think huge select()s aren't worth optimizing since they are rare, relative gain would be small and there would be tiny costs for all selects(). Reviewed by: ache (first version by him too)
Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:43:54 1997 UTC (15 years 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 Aug 20 15:03:41 1996 UTC (15 years, 5 months ago) by smpatel
Branches: MAIN
CVS tags: RELENG_2_2_BP, RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE, RELENG_2_2_5_RELEASE, RELENG_2_2_2_RELEASE, 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: +2 -2 lines
Fix a minor style error in my code.
Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Aug 20 07:17:48 1996 UTC (15 years, 5 months ago) by smpatel
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +43 -15 lines
Remove the kernel FD_SETSIZE limit for select(). Make select()'s first argument 'int' not 'u_int'. Reviewed by: bde
Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Mar 11 20:01:42 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: +130 -123 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.18: download - view: text, markup, annotated - select for diffs
Wed Jan 3 21:42:17 1996 UTC (16 years, 1 month ago) by wollman
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -1 lines
Converted two options over to the new scheme: USER_LDT and KTRACE.
Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Dec 14 08:31:48 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +5 -4 lines
A Major staticize sweep. Generates a couple of warnings that I'll deal with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
Revision 1.16: download - view: text, markup, annotated - select for diffs
Sun Nov 12 06:43:05 1995 UTC (16 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +14 -1 lines
Included <sys/sysproto.h> to get central declarations for syscall args structs and prototypes for syscalls. Ifdefed duplicated decentralized declarations of args structs. It's convenient to have this visible but they are hard to maintain. Some are already different from the central declarations. 4.4lite2 puts them in comments in the function headers but I wanted to avoid the large changes for that.
Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Nov 11 06:57:34 1995 UTC (16 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -5 lines
Fixed the type of readv(). An args struct member name conflicted with the machine-generated one in <sys/sysproto.h>.
Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Oct 10 08:08:54 1995 UTC (16 years, 4 months ago) by swallace
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -29 lines
Remove the ugly COMPAT_IBCS2 hack to hide a return value through magic numbers. The new socksys support does not need this hack. I am against any magic practicing.
Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue May 30 08:05:56 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE, 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.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
Remove trailing whitespace.
Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Apr 13 18:24:33 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +4 -2 lines
Backed out previous change - it reduces performance. (oops).
Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Apr 13 15:27:51 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -4 lines
Slight optimization to select().
Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Oct 13 21:41:36 1994 UTC (17 years, 4 months ago) by sos
Branches: MAIN
CVS tags: RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +3 -3 lines
Damn, check in the wrong version, fixed. Reviewed by: Submitted by: Obtained from:
Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Oct 13 21:01:47 1994 UTC (17 years, 4 months ago) by sos
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +29 -1 lines
Made it possible for ioctl to return a value. Ifdef by COMPAT_IBCS2 (used by the socksys system). Submitted by: Mostyn Lewis (mostyn@mrl.com)
Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Oct 10 01:00:49 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -1 lines
Cosmetics. related to getting prototypes into view.
Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Oct 2 17:35:24 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -1 lines
All of this is cosmetic. prototypes, #includes, printfs and so on. Makes GCC a lot more silent.
Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Sep 25 19:33:48 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +10 -11 lines
While in the real world, I had a bad case of being swapped out for a lot of cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks.
Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Sep 2 15:06:39 1994 UTC (17 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -1 lines
Whoops, accidently left out some pieces of the munmapfd patch.
Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Sep 2 14:04:39 1994 UTC (17 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +5 -1 lines
Make sure that uio_resid isn't negative in read().
Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:42:38 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:04:42 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +9 -8 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:27 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:26 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision
