summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* A few misc forkbomb defenses:silby2002-02-191-2/+5
| | | | | | | | | | | | | | | - Leave 10 processes for root-only use, the previous value of 1 was insufficient to run ps ax | more. - Remove the printing of "proc: table full". When the table really is full, this would flood the screen/logs, making the problem tougher to deal with. - Force any process trying to fork beyond its user's maximum number of processes to sleep for .5 seconds before returning failure. This turns 2000 rampaging fork monsters into 2000 harmlessly snoozing fork monsters. Reviewed by: dillon, peter MFC after: 1 week
* Add stub syscalls and definitions for KSE calls.julian2002-02-194-3/+58
| | | | "Book'em Danno"
* Add 5 KSE syscalls. Two will be implemented with the next KSEjulian2002-02-191-0/+6
| | | | | | | | step and the others are reservations for coming code. All will be stubbed in this kernel in the next commit. This will allow people to easily make KSE binaries for userland testing (the syscalls will be in libc) but they will still need a real KSE kernel to test it. (libc looks in /sys to decide what it should add stubs for).
* Load the current timecounter into tc. The timecounter global can changedillon2002-02-181-1/+2
| | | | | | | at any time and we do not want to call one timercounter's function with another timecounter's structural pointer. MFC after: 3 days
* Add kern_giant_ucred to instrument Giant around ucred related operationsdillon2002-02-182-0/+4
| | | | such a getgid(), setgid(), etc...
* Make v_addpollinfo() visible and non-inline.phk2002-02-181-5/+5
| | | | | | | Have callers only call it as needed. Add necessary call in ufs_kqfilter(). Test-case found by: Andrew Gallatin <gallatin@cs.duke.edu>
* Rehash of 1.43: simply remove the comment, since it's highly redundantrwatson2002-02-181-13/+0
| | | | and only partially correct.
* Add the braces missed by revision 1.131.iedowse2002-02-181-1/+2
| | | | Pointy hat to: rwatson
* Take the common case of gettimeofday(&tv, NULL) out from under Giant.phk2002-02-181-8/+4
|
* Remove yet a redundant VN_KNOTE() macro.phk2002-02-181-3/+0
|
* The ICANON flag is an lflag, not an iflag.dillon2002-02-181-2/+2
| | | | | Submitted by: Neelkanth Natu <neelnatu@yahoo.com> MFC after: 3 days
* When vn_open() is failing because it cannot allocate a vm object, callrwatson2002-02-181-1/+1
| | | | | | VOP_CLOSE() on the vnode, so that VOP_OPEN() and VOP_CLOSE() calls are symmetric in all failure cases. This prevents an 'open' reference from being leaked in that unlikely failure scenario.
* style(9) prefers formatted comments in '/*' ... '*/' as opposed torwatson2002-02-181-12/+12
| | | | #if 0'd.
* Per discussion at BSDCon, note that the vop_getattr locking protocolrwatson2002-02-181-1/+1
| | | | | | should require a shared lock, rather than an exclusive lock, which can improve performance. No actual code change here, since a number of VFS locking fixes are in the works.
* Move the stuff related to select and poll out of struct vnode.phk2002-02-171-23/+43
| | | | | | | | | The use of the zone allocator may or may not be overkill. There is an XXX: over in ufs/ufs/ufs_vnops.c that jlemon may need to revisit. This shaves about 60 bytes of struct vnode which on my laptop means 600k less RAM used for vnodes.
* Remove cache_purgeleafdirs(), it has been #if 0 for quite some time.phk2002-02-171-60/+0
|
* Regenerate these files after change to syscalls.master.deischen2002-02-172-2/+2
|
* Fix prototype to sigreturn to use struct __ucontext instead of ucontext_t.deischen2002-02-171-1/+1
|
* replace the embedded cr_mtx in the ucred structure with cr_mtxp (a mutexdillon2002-02-171-9/+11
| | | | | pointer), and use the mutex pool routines. This greatly reduces the size of the ucred structure.
* If the credential on an incoming thread is correct, don't botherjulian2002-02-173-3/+27
| | | | | | | | reaquiring it. In the same vein, don't bother dropping the thread cred when goinf ot userland. We are guaranteed to nned it when we come back, (which we are guaranteed to do). Reviewed by: jhb@freebsd.org, bde@freebsd.org (slightly different version)
* (Doing that whole test-immediately-after-commit-thing like obrien sez:)green2002-02-161-0/+2
| | | | Forgot to include lock.h and mutex.h for GIANT_REQUIRED.
* Add revoke_and_destroy_dev(), to be used by devices which decide whengreen2002-02-161-0/+13
| | | | | they choose to destroy themselves without regard to whether or not they are open.
* Fixed a typo in rev.1.65 that gave a reference to a nonexistent variable.bde2002-02-151-1/+1
| | | | This was not detected by LINT because LINT is missing COMPAT_SUNOS.
* Make this compile after changes to kse structures.luigi2002-02-151-1/+1
| | | | | | | | | This escaped because DEVICE_POLLING is disabled in LINT being not compatible with SMP. In fact, it is only a runtime problem, so if we could recognize that we are building a LINT kernel we could as well disable the check for SMP being defined. Reported-by: Joe Clarke
* o Clearing p/td_retval[0] after aio_newproc() is unnecessary. (We stoppedalc2002-02-121-6/+1
| | | | | calling rfork() to create aio threads in revision 1.46.) o Don't recompute the FILE * when it's already stored in the kernel's AIOCB.
* The previous commit included a change to fill_kinfo_proc() that resultsalc2002-02-121-1/+1
| | | | in a NULL pointer dereference. Repair this mistake.
* MFS: synchronize the code with the version in -stable, specifically:luigi2002-02-113-67/+102
| | | | | | + SYSCTL_ULONG -> SYSCTL_UINT + some procedure renaming and variable rearrangement + fix the 'interface going deaf' problem same as in -stable.
* In a threaded world, differnt priorirites become properties ofjulian2002-02-1114-101/+101
| | | | | | different entities. Make it so. Reviewed by: jhb@freebsd.org (john baldwin)
* Allow one to specify the AWK used in the environment(commandline).obrien2002-02-111-1/+1
| | | | | Gawk is blowing up when run natively on the sparc64 -- leading to totally bogus kernel values (all "0x0"). Good ole BWK awk works fine however.
* GC the unused einval()phk2002-02-101-11/+0
| | | | Obtained from: ~bde/sys.dif.gz
* Style(9) nits.phk2002-02-101-9/+9
| | | | Obtained from: ~bde/sys.dif.gz
* Add a comment indicating that the locking protocol should be updatedrwatson2002-02-101-0/+2
| | | | | to be 'L L L' for vop_getattr(). Don't update it yet, because there are still many offenders.
* Add a comment indicating that VOP_GETATTR() is called without appropriaterwatson2002-02-101-0/+2
| | | | locking in the core dump code. This should be fixed.
* Make sure to hold vnode lock when calling into VOP_GETATTR().rwatson2002-02-103-1/+12
| | | | Discussed with: mckusick, phk
* Add a comment indicating that the vnode locking in this section of therwatson2002-02-101-0/+3
| | | | | kernel linker code may be wrong: it fails to hold a lock across the call to VOP_GETATTR(), and vn_rdwr() with IO_NODELOCKED.
* Make sure to grab vnode lock on a vnode before calling VOP_GETATTR()rwatson2002-02-102-10/+18
| | | | | | | | to perform an ownership test in revoke(). This is also required for MAC hooks so that the vnode lock is held during a call to the MAC framework. Release the lock before calling VOP_REVOKE(). Discussed with: phk, mckusick
* Remove a stray 'const' that slept into extattr_set_vp(), and couldrwatson2002-02-102-2/+2
| | | | result in compiler warnings.
* Part II: Update system calls for extended attributes. Rebuild ofrwatson2002-02-102-2/+2
| | | | generated files.
* Part I: Update extended attribute API and ABI:rwatson2002-02-105-171/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | o Modify the system call syntax for extattr_{get,set}_{fd,file}() so as not to use the scatter gather API (which appeared not to be used by any consumers, and be less portable), rather, accepts 'data' and 'nbytes' in the style of other simple read/write interfaces. This changes the API and ABI. o Modify system call semantics so that extattr_get_{fd,file}() return a size_t. When performing a read, the number of bytes read will be returned, unless the data pointer is NULL, in which case the number of bytes of data are returned. This changes the API only. o Modify the VOP_GETEXTATTR() vnode operation to accept a *size_t argument so as to return the size, if desirable. If set to NULL, the size will not be returned. o Update various filesystems (pseodofs, ufs) to DTRT. These changes should make extended attributes more useful and more portable. More commits to rebuild the system call files, as well as update userland utilities to follow. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Replace accidentally removed setrunqueue()julian2002-02-091-0/+1
| | | | | solves problem with machines failing to sync in booting. Submitted by: Tor.Egge@cvsup.no.freebsd.org
* Use the mtx_owner() macro in one spot in _mtx_lock_sleep() to make thejhb2002-02-092-2/+2
| | | | code easier to read.
* Fix a bug introduced in r. 1.28: when copy{in,out} would fail for antmm2002-02-081-1/+2
| | | | | | | iovec that was not the last one in the uio, the error would be ignored silently. Bug found and fix proposed by: jhb
* Fix broken Giant locking protocol introduced in rev 1.114. You cannotpeter2002-02-081-0/+1
| | | | | unlock Giant if it is not locked in the first place. This make the nfstat(2) syscall (#278) a nice panic(2) implementation.
* Bah, I managed to turn cosmetic things into real bugs. Fix shadowedpeter2002-02-081-12/+12
| | | | variable declarations. :-( Definately not my day today.
* o Merge various recent fixes from the MAC branch relating to extattrctl():rwatson2002-02-082-12/+20
| | | | | | | | | | | | | | | - Fix null-pointer dereference introduced when snapshotting was introduced. This occured because unlike the previous code, vn_start_write() doesn't always return a non-NULL mp, as filesystems may not support the VOP_GETWRITEMOUNT() call. For now, rely on two pointers, so that vn_finished_write() works properly. - Fix locking problems on exit, introduced at some past time, some when snapshots came in, where a vnode might not be unlocked before being vrele'd in various error situations. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Fix a fatal trap when using ksched_setscheduler() (eg: mozilla, netscapepeter2002-02-081-1/+1
| | | | etc) which use: td->td_last_kse->ke_flags |= KEF_NEEDRESCHED;
* remove superfluous blank linejulian2002-02-081-1/+0
|
* Fix a couple of style bugs introduced (or touched by) previous commit.peter2002-02-075-6/+5
|
* Fix a whole bunch of long lines introduced by previous commit by usingpeter2002-02-071-11/+15
| | | | | td = FIRST_THREAD_IN_PROC(p) once, after we have identified the process that we are operating on.
* Revise timercounters to use binary fixed point format internally.phk2002-02-072-109/+61
| | | | | | | | | | | | | | The binary format "bintime" is a 32.64 format, it will go to 64.64 when time_t does. The bintime format is available to consumers of time in the kernel, and is preferable where timeintervals needs to be accumulated. This change simplifies much of the magic math inside the timecounters and improves the frequency and time precision by a couple of bits. I have not been able to measure a performance difference which was not a tiny fraction of the standard deviation on the measurements.
OpenPOWER on IntegriCloud