Commit Graph

816 Commits

Author SHA1 Message Date
Peter Wemm
3f7efdf30d Change the 'int len' args in the mmap/msync/mincore/etc class syscalls
to 'size_t' as per bde's request.
1996-03-02 16:51:25 +00:00
John Dyson
6538dda3dc 1) Fix a bug that a buffer is removed from a queue, but the
queue type is not set to QUEUE_NONE.  This appears to have
	caused a hang bug that has been lurking.
2)	Fix bugs that brelse'ing locked buffers do not "free" them, but the
	code assumes so.  This can cause hangs when LFS is used.
3)	Use malloced memory for directories when applicable.  The amount
	of malloced memory is seriously limited, but should decrease the
	amount of memory used by an average directory to 1/4 - 1/2 previous.
	This capability is fully tunable.  (Note that there is no config
	parameter, and might never be.)
4)	Bias slightly the buffer cache usage towards non-VMIO buffers.  Since
	the data in VMIO buffers is not lost when the buffer is reclaimed, this
	will help performance.  This is adjustable also.
1996-03-02 04:40:56 +00:00
John Dyson
91477adc6e Enable VMIO for non-VDIR metadata and block device. 1996-03-02 03:45:12 +00:00
John Dyson
33309c7fc0 More b_flags fixes. 1996-03-02 01:49:51 +00:00
John Dyson
f5d1e6dae6 Fix a bug that b_flags was getting unnecessarily modified by
the slice code.  The effect up to now has been insignficant, but
improved buffer allocation code will break with this problem.
1996-03-01 19:01:04 +00:00
Gary Palmer
5ccab2afa9 Add a new option: DDB_UNATTENDED. Stops machine dropping into DDB
when it panics, but leaving activation of DDB from the console
unaffected.
1996-02-28 21:42:15 +00:00
John Dyson
3eb77c8302 Fix a problem with tracking the modified bit. Eliminate the
ugly inline-asm code, and speed up the page-table-page tracking.
1996-02-25 03:02:53 +00:00
Peter Wemm
99ac3bc8da Add two sysctl variables that can be read by libutil and libkvm so that
they can adapt to simple kernel VM layout changes.
1996-02-24 14:32:53 +00:00
Poul-Henning Kamp
09bb5f7589 Make getsockopt() capable of handling more than one mbuf worth of data.
Use this to read rules out of ipfw.
Add the lkm code to ipfw.c
1996-02-24 13:38:28 +00:00
Peter Wemm
dedb7b623c Garrett pointed out that the correct place for unix system call args
is <sys/unistd.h>, with the prototype in <unistd.h>.  sys/unistd.h
is visible to the kernel compile, and is #included by unistd.h.

Also, I missed a reference to a static int in the midst of my other diffs.
1996-02-23 19:44:10 +00:00
Peter Wemm
dabee6fecc kern_descrip.c: add fdshare()/fdcopy()
kern_fork.c: add the tiny bit of code for rfork operation.
kern/sysv_*: shmfork() takes one less arg, it was never used.
sys/shm.h: drop "isvfork" arg from shmfork() prototype
sys/param.h: declare rfork args.. (this is where OpenBSD put it..)
sys/filedesc.h: protos for fdshare/fdcopy.
vm/vm_mmap.c: add minherit code, add rounding to mmap() type args where
it makes sense.
vm/*: drop unused isvfork arg.

Note: this rfork() implementation copies the address space mappings,
it does not connect the mappings together.  ie: once the two processes
have split, the pages may be shared, but the address space is not. If one
does a mmap() etc, it does not appear in the other.  This makes it not
useful for pthreads, but it is useful in it's own right for having
light-weight threads in a static shared address space.

Obtained from: Original by Ron Minnich, extended by OpenBSD
1996-02-23 18:49:25 +00:00
Peter Wemm
e89de7b5c3 Run makesyscalls to regen the tables. 1996-02-23 18:31:34 +00:00
Peter Wemm
96ac07ef3a Add hooks for rfork/minherit pair, and reset args of vfork in preperation
for adding the syscalls.
1996-02-23 18:20:44 +00:00
Peter Wemm
4f9a71f6a0 Note the syscall numbers used in BSD/OS 2.x. We dont want to
accidently use one of these ourselves as it'd make it harder to run
their binaries.
Also, remove the now-defunct #include "opt_sysvipc.h".
1996-02-23 18:03:08 +00:00
John Dyson
6e20683c9d Fix a problem that select did not work with direct writes. Make
wakeup channels more consistant also.
1996-02-22 03:33:52 +00:00
Peter Wemm
add3bbdaef Add missing prototype for pipeselwakeup (a recently added function) - gcc
bitches about it..
1996-02-17 14:47:16 +00:00
Garrett Wollman
dc915e7cfc Kill XNS.
While we're at it, fix socreate() to take a process argument.  (This
was supposed to get committed days ago...)
1996-02-13 18:16:31 +00:00
Poul-Henning Kamp
c9c37b27d1 rewrap some long lines. 1996-02-13 14:16:36 +00:00
John Dyson
f3e79aa705 Add ifdefs for non-freebsd system usage. Add missing select wakeups,
and make the select wakup code a little neater.
1996-02-11 22:09:50 +00:00
John Dyson
5af564b4f4 Add some missing requests for the read-side to wakeup the write-side. Also
add some missing wakeups by the write side to the read side.
1996-02-09 04:36:36 +00:00
Garrett Wollman
b135805469 Define a new socket option, SO_PRIVSTATE. Getting it returns the state
of the SS_PRIV flag in so_state; setting it always clears same.
1996-02-07 16:19:19 +00:00
John Dyson
26d2f00960 Apparent fix for a pipe hang problem. 1996-02-07 06:41:56 +00:00
John Dyson
f29e1bd629 More fixes from bde.
Only modify times on success.
	splhigh() around time variable usage.
	Make atomic writes more posix compliant.
	Spelling errors.
Submitted by:	bde
1996-02-05 05:50:34 +00:00
John Dyson
96cc6b1011 Kva space allocated for direct buffer wasn't quite big enough. The
system can panic easily without this patch.
1996-02-05 05:17:15 +00:00
John Dyson
dca5129987 Changed vm_fault_quick in vm_machdep.c to be global. Needed for
new pipe code.
1996-02-04 22:09:12 +00:00
John Dyson
2834ceec7c Improve the performance for pipe(2) again. Also include some
fixes for previous version of new pipes from Bruce Evans.  This
new version:

Supports more properly the semantics of select (BDE).
Supports "OLD_PIPE" correctly (kern_descrip.c, BDE).
Eliminates incorrect EPIPE returns (bash 'pipe broken' messages.)
Much faster yet, currently tuned relatively conservatively -- but now
	gives approx 50% more perf than the new pipes code did originally.
	(That was about 50% more perf than the original BSD pipe code.)

Known bugs outstanding:
	No support for async io (SIGIO).  Will be included soon.

Next to do:
	Merge support for FIFOs.

Submitted by: bde
1996-02-04 19:56:35 +00:00
Justin T. Gibbs
f6f6004c29 Properly calculate the amount of the devconf to output in SYSCTL_OUT.
The code outputs the dc then calls the device specific externalize
routines to fill in the dc_data area.  The old code assumed that dc_data
started one byte from the end of the dc, but with the compiler optimizing
alignment and padding, this isn't always the case.  Do an explicit
&(dc.dc_data) - &dc.  This fixes lsdev -c which must have been broken
for some time.
1996-01-31 18:05:19 +00:00
David Greenman
729b1e5149 Improved killproc() log message and made it and the other similar message
tolerant of p_ucred being invalid. Starting using killproc() where
appropriate.
1996-01-31 12:44:33 +00:00
John Dyson
4ab7a1a6c7 Fix another problem with the new pipe code, pointed out by Bruce Evans.
This one fixes a problem with interactions with signals.
1996-01-31 06:00:45 +00:00
John Dyson
56363b79a9 Fix some problems with return codes on the new pipe stuff. Bruce Evans
found the problems, and this commit will fix the "first batch" :-).
1996-01-31 02:05:12 +00:00
David Greenman
07bbd7f1bb Implement what I mentioned in rev 1.18: limit per-bucket allocations to
60% of physical memory or 60% of malloc area size, whichever is smaller.
1996-01-29 11:12:37 +00:00
David Greenman
54e7152c15 Fixed two bugs in the calculation of the malloc area (kmem_map) size:
1) The calculation didn't account for NMBCLUSTERS, so if a large number of
   clusters was specified, it would leave little or no space for kernel
   malloc.
2) It was bogusly restricted to v_page_count. This doesn't take into
   account the sparseness of the malloc area and would have caused
   problems on machines with small amounts of memory. It should probably
   instead be changed to set the malloc limit to be constrained by
   the amount of memory, but I didn't do this.
1996-01-29 09:58:34 +00:00
Justin T. Gibbs
65ed8cbd4e Kernel printf now returns int. 1996-01-29 03:18:05 +00:00
John Dyson
4fd00d508b Fixed an uninitialized variable (argument to vm_map_find) -- problem
that DG detected, and promptly found a fix.
Submitted by:	davidg
1996-01-29 02:57:33 +00:00
John Dyson
f982721359 Enable the new fast pipe code. The old pipes can be used with the
"OLD_PIPE" config option.
1996-01-28 23:41:40 +00:00
John Dyson
10c5615c1d Added new files to support the new fast pipes. After the follow-on
commits, pipe performance should increase significantly.  The pipe(2)
system call is currently supported, while fifofs will be added later.
1996-01-28 23:38:26 +00:00
John Dyson
44196d615f An earlier modification had decreased CPU usage, but also
decreased performance.  This essentially undoes that change.
1996-01-28 18:25:54 +00:00
Bruce Evans
80f9be1460 Fixed dangling pointer bugs in DIOCSDINFO.
Enabled DEVFS support.  It doesn't work while devfs is mounted
(add_devfs_devsw() doesn't work then), but seems to be safe.
1996-01-28 08:15:44 +00:00
Bruce Evans
af4cb3a1c4 [Oops, forgot to commit this together with things that depend on it.]
First attempt at creating devfs entries for sliced devices.  Doesn't
quite work yet, so the heart of it is disabled.

Added bdev and cdev args to dsopen().

Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times.  DEVFS is #undefed at the start so
that this shouldn't cause problems.
1996-01-27 09:34:21 +00:00
Poul-Henning Kamp
16cf781eed Fix a bug I made in the devfs. 1996-01-26 12:42:39 +00:00
Poul-Henning Kamp
e8cbe8fa47 Avoid local sprintfs and other printf'isms. 1996-01-25 07:21:50 +00:00
Bruce Evans
bf124e256b Restored newline at the end of panic messages. 1996-01-25 00:17:22 +00:00
Poul-Henning Kamp
120f078334 Remove %r hack, we have vprintf() now.
Add %D for "dumping" data.  Good for ethernet/MAC addresses and such.
Handle 1 < radix < 37.
1996-01-24 20:56:20 +00:00
Peter Wemm
b0281cef04 Major fixes for ptrace()...
PT_ATTACH/PT_DETACH implemented now and fully operational.
PT_{GET|SET}{REGS|FPREFS} implemented now, using code shared with procfs
PT_{READ|WRITE}_{I|D} now uses code shared with procfs
ptrace opcodes now fully permission checked, including ownerships.
doing an operation to the u-area on a swapped process should no longer
panic.
running gdb as root works for me now, where it didn't before.
general cleanup..

Note, that this has some tightening of permissions/access checks etc.
Some of these may be going too far..  In particular, the "owner" of the
traced process is enforced.  The process that created or attached to
the traced process is now the only one that can "do" things to it.
1996-01-24 18:29:00 +00:00
Poul-Henning Kamp
b4b2f81ef3 bounds check the radix, just in case. 1996-01-22 13:21:33 +00:00
John Dyson
f69170e601 Previous commit to vfs_cluster accidentally disabled read-ahead. Problem
fixed by initializing "alreadyincore" to 0 in the case of
sequential reads.
1996-01-20 23:24:16 +00:00
Bruce Evans
9f29a57754 Removed stale #includes of "opt_sysvipc.h". 1996-01-20 21:36:31 +00:00
Poul-Henning Kamp
ed71c34200 Imake %.*s really work. :-( 1996-01-19 21:05:52 +00:00
Poul-Henning Kamp
fe96d47d8e Make result of sprintf zero terminated. Fix %r for sprintf case. 1996-01-19 11:38:18 +00:00
John Dyson
bd7e5f992e Eliminated many redundant vm_map_lookup operations for vm_mmap.
Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish
	overhead for merged cache.
Efficiency improvement for vfs_cluster.  It used to do alot of redundant
	calls to cluster_rbuild.
Correct the ordering for vrele of .text and release of credentials.
Use the selective tlb update for 486/586/P6.
Numerous fixes to the size of objects allocated for files.  Additionally,
	fixes in the various pagers.
Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs.
Fixes in the swap pager for exhausted resources.  The pageout code
	will not as readily thrash.
Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into
	page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE),
	thereby improving efficiency of several routines.
Eliminate even more unnecessary vm_page_protect operations.
Significantly speed up process forks.
Make vm_object_page_clean more efficient, thereby eliminating the pause
	that happens every 30seconds.
Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the
	case of filesystems mounted async.
Fix a panic with busy pages when write clustering is done for non-VMIO
	buffers.
1996-01-19 04:00:31 +00:00