Commit Graph

249 Commits

Author SHA1 Message Date
David Greenman ec2bb6ade1 Increase maxfiles to NPROC*2. This makes the per-process open file limit
highly bogus, however, and this needs to be fixed.
1995-01-12 03:38:12 +00:00
David Greenman c3d05da5e3 MFS doesn't bother to associate a struct mount with the vnode...so work
around this by not trying to cluster this type of I/O.

Submitted by:	John Dyson
1995-01-11 01:53:18 +00:00
David Greenman 5943df8331 PG_FAKE is no longer used - so don't bother to clear it. 1995-01-10 09:20:34 +00:00
David Greenman 480dff540b Fixed some formatting weirdness that I overlooked in the previous commit. 1995-01-10 07:32:52 +00:00
David Greenman 0d94caffca These changes embody the support of the fully coherent merged VM buffer cache,
much higher filesystem I/O performance, and much better paging performance. It
represents the culmination of over 6 months of R&D.

The majority of the merged VM/cache work is by John Dyson.

The following highlights the most significant changes. Additionally, there are
(mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to
support the new VM/buffer scheme.

vfs_bio.c:
Significant rewrite of most of vfs_bio to support the merged VM buffer cache
scheme.  The scheme is almost fully compatible with the old filesystem
interface.  Significant improvement in the number of opportunities for write
clustering.

vfs_cluster.c, vfs_subr.c
Upgrade and performance enhancements in vfs layer code to support merged
VM/buffer cache.  Fixup of vfs_cluster to eliminate the bogus pagemove stuff.

vm_object.c:
Yet more improvements in the collapse code.  Elimination of some windows that
can cause list corruption.

vm_pageout.c:
Fixed it, it really works better now.  Somehow in 2.0, some "enhancements"
broke the code.  This code has been reworked from the ground-up.

vm_fault.c, vm_page.c, pmap.c, vm_object.c
Support for small-block filesystems with merged VM/buffer cache scheme.

pmap.c vm_map.c
Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of
kernel PTs.

vm_glue.c
Much simpler and more effective swapping code.  No more gratuitous swapping.

proc.h
Fixed the problem that the p_lock flag was not being cleared on a fork.

swap_pager.c, vnode_pager.c
Removal of old vfs_bio cruft to support the past pseudo-coherency.  Now the
code doesn't need it anymore.

machdep.c
Changes to better support the parameter values for the merged VM/buffer cache
scheme.

machdep.c, kern_exec.c, vm_glue.c
Implemented a seperate submap for temporary exec string space and another one
to contain process upages. This eliminates all map fragmentation problems
that previously existed.

ffs_inode.c, ufs_inode.c, ufs_readwrite.c
Changes for merged VM/buffer cache.  Add "bypass" support for sneaking in on
busy buffers.

Submitted by:	John Dyson and David Greenman
1995-01-09 16:06:02 +00:00
Bruce Evans 4c5e4b09a7 Fix error handling for new TIOCSDRAINWAIT ioctl. 1995-01-06 14:56:42 +00:00
Stefan Eßer 623976474c Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Reviewed by: <wollman>
First hooks and defines for the ISDN driver,
that soon will see the light ...
1995-01-05 19:51:51 +00:00
Andrey A. Chernov 33c38bd574 Fight against hanging modems: add timeout to ttywait.
Reviewed by: Bruce
1995-01-05 00:01:07 +00:00
Jordan K. Hubbard 95da7f140e Another part of Bill Paul's fix to swapgeneric to properly use the -a flag.
Submitted by:	wpaul
1994-12-31 17:15:16 +00:00
Bruce Evans 62f603b64d Change an 0 to WHOLE_DISK_SLICE. 1994-12-30 12:19:11 +00:00
Bruce Evans 2336b9d7d7 Print "(null)" instead of "<null>" for NULL string args for consistency
with the libc and ddb printf's.

Print "(fmt null)\n" for NULL formats.
1994-12-30 12:17:42 +00:00
David Greenman 8f5067ba28 Make printf() a bit more robust and allow NULL strings (print them as
"<null>"). It bad to have diagnostic printfs cause panics when they are
trying to tell you about another problem.
1994-12-28 06:28:34 +00:00
David Greenman be6a1d148e Fixed multiple bugs that cause null pointers to be followed or FREEed data
to be accessed if a process blocks when it is being run down.
1994-12-28 06:15:08 +00:00
Bruce Evans 13d7c724ca Obtained from: 1.1.5
Fix single-stepping of emulated FPU instructions.

Don't panic if an FPU instruction is attempted but there is no FPU
and no FPU emulator is configured.
1994-12-24 07:22:58 +00:00
David Greenman 602d2b481a Protect vnode buffer chain manipulation with splbio to prevent list
corruption..
1994-12-23 04:52:55 +00:00
Bruce Evans 222d875bec Print `slicename' and not a bogus pointer in diskerr() 1994-12-22 04:42:31 +00:00
Joerg Wunsch 91c38cb885 Ooops, i forgot one NVT > 0 in a previous commit. Now pcvt will also
work as the system's console.
1994-12-18 19:42:41 +00:00
Joerg Wunsch 00e82d39d7 Move the code providing the equivalent of ICRNL for console input from
the device driver(s) to cons.c.
1994-12-18 19:35:59 +00:00
Guido van Rooij f81fcd410f Fix bug in sysctl_string so that when a string has a length that is to
short, it gets filled uop to its length. This matches the getdomainname
and gethostname manual pages.
(getbootfile also uses this function and I think it should have the same
behaviour)

This also fixes a bug with keyinit where the seed was not saved in
/etc/skeykeys. So S/Key should be fully functional again.

Reviewed by:
Submitted by:
Obtained from:
1994-12-18 13:56:50 +00:00
David Greenman 8a8d90d871 Fix possible off by one in b_save allocation size. 1994-12-18 03:05:49 +00:00
David Greenman 763424fcf0 Changed splimp to splhigh to close a potential hole that could lead
to corrupted malloc data structures caused by frees occurring at other
than splimp.
1994-12-17 04:04:42 +00:00
Bruce Evans fb72042b5c Duplicate readdisklabel() and writedisklabel() and remove DOS stuff from
from the copies to create correct_readdisklabel() and
correct_writedisklabel().

Print the slice number in diskerr() if it is nonzero.
1994-12-16 16:31:23 +00:00
Bruce Evans 9af6068321 Separate go-away code from dsinit() to produce dsgone().
Call correct_writedisklabel() instead of writedisklabel() (temporary
compatibility hack).

Remove kludge for allowing a label on slice 0.
1994-12-16 16:14:39 +00:00
Garrett Wollman 23f6ed01aa Actually enable NTP kernel PLL. (Oops!)
Noticed by Pete Carah.
1994-12-14 17:57:47 +00:00
Bruce Evans 20989d2d64 Obtained from: my fix for 1.1.5
Remove compatibility hack so that dup(fd) isn't interpreted as
dup2(fd & 0x3f, random_junk_on_stack_fd) when (fd & 0x3f) != 0.
1994-12-12 12:27:39 +00:00
Bruce Evans 6976af69e8 Obtained from: my old fix for 1.1.5
Improve hzto():

Round up instead of down and then add 1 tick.  This fixes sleep(1)
sometimes sleeping for < 1 second and usleep(10000) sometimes sleeping
for as little as 1 usec + syscall time.

Don't do all the calculations at splhigh().

Don't depend on `tick' being a multiple of 1000.

Don't lose accuracy for `sec' between 0x7fffffff / 1000 - 1000 and
0x7fffffff / hz.

Don't assume that longs are 32 bits or that ints have the same size as
longs.
1994-12-12 11:58:46 +00:00
David Greenman e8cdac9bfd Don't mess with already freed structures when a process is being run
down.
1994-12-12 06:04:27 +00:00
Bruce Evans 0300a965c8 diskslice_machdep.c implements reading and checking of DOS slice tables.
It will eventually replace readMBR.c.
1994-12-12 00:22:30 +00:00
Bruce Evans d1f35d579f subr_diskslice.c implements everything related to slices and labels except
reading and writing the slice tables and labels.

subr_dkbad.c implements everything related to bad sector remapping using
the bad144 format.
1994-12-12 00:20:34 +00:00
Bruce Evans a81b757af0 Don't allow negative limits at all. Convert them to RLIM_INFINITY instead
of returning EINVAL since something may depend on them being broken.
Allowing negative limits caused bugs almost everywhere.  The recent
fixes for MAXSSIZ checked the limits too late to stop anyone defeating
limits set by root...
1994-12-06 22:53:37 +00:00
Poul-Henning Kamp 54213fd84a Implemented a "TEXT_SET" called 'cleanup_set' which will be called before
the reboot takes place (if not RB_NOSYNC that is).  The vn driver needs this.
Other places might benefit too.
1994-12-04 19:58:43 +00:00
Andrey A. Chernov cdbbd9cfaf don't allow ctty to be set to ctty - infinite kernel recursion
Obtained from: 1.1.5.1
1994-12-04 01:46:13 +00:00
Andrey A. Chernov 73a361245d Call d_stop in ttyflush not only for WRITE but for READ too
Obtained from: 1.1.5.1
1994-12-04 01:01:45 +00:00
Andreas Schulz 06935b59e5 Add one forgotten u_quad_t typecast in dosetrlimit. 1994-12-02 23:00:40 +00:00
Andreas Schulz a7d72265c4 The values for setrlimit in the data size and stack size case are
used as an address value. Then all comparisons should be done unsigned
and not signed. Fix it with a typecast of u_quad_t.
Error can be demonstrated with the current bash in port, do a
ulimit -s unlimited and the machine hangs. bash delivers through
an internal error a large negative value for the stacksize, the
comparison saw this smaller than MAXSSIZ and then tried to expand
the stack to this size.
1994-12-01 20:20:21 +00:00
Bruce Evans d1a795a280 Fix cblock starvation bugs by reserving enough cblocks for minimal
operation of each clist.  Limit the growth of each clist.  Clists
can only grow larger than the reserved minimum if there are free
cblocks in a shared pool.  The size of this pool is now fixed
(this could be improved).  The reserved and maximum sizes are more
carefully allocated for slip and ppp, depending on the mtu.  A maximum
MTU of 16384 is now enforced for ppp.
1994-11-26 19:24:13 +00:00
Bruce Evans ba77d4e47b Don't block for output in non-blocking mode if clists run out.
Remove an unnecessary test (if the output queue is above high water
then it is nonempty).
1994-11-26 18:54:25 +00:00
David Greenman eadf9e27cd These changes fix a couple of lingering VM problems:
1.	The pageout daemon used to block under certain
	circumstances, and we needed to add new functionality
	that would cause the pageout daemon to block more often.
	Now, the pageout daemon mostly just gets rid of pages
	and kills processes when the system is out of swap.
	The swapping, rss limiting and object cache trimming
	have been folded into a new daemon called "vmdaemon".
	This new daemon does things that need to be done for
	the VM system, but can block.  For example, if the
	vmdaemon blocks for memory, the pageout daemon
	can take care of it.  If the pageout daemon had
	blocked for memory, it was difficult to handle
	the situation correctly (and in some cases, was
	impossible).

2.	The collapse problem has now been entirely fixed.
	It now appears to be impossible to accumulate unnecessary
	vm objects.  The object collapsing now occurs when ref counts
	drop to one (where it is more likely to be more simple anyway
	because less pages would be out on disk.)  The original
	fixes were incomplete in that pathological circumstances
	could still be contrived to cause uncontrolled growth
	of swap.  Also, the old code still, under steady state
	conditions, used more swap space than necessary.  When
	using the new code, users will generally notice a
	significant decrease in swap space usage, and theoretically,
	the system should be leaving fewer unused pages around
	competing for memory.

Submitted by:	John Dyson
1994-11-25 07:58:29 +00:00
Bruce Evans 6124ac44aa Move declarations of public functions to <sys/sysctl.h>.
Make some private data static.

Comment about MAXPATHLEN bytes of bloat for the kernel name.
1994-11-14 13:58:30 +00:00
Poul-Henning Kamp e113d7633d Make a kernel sans FFS possible. 1994-11-12 01:47:43 +00:00
Andreas Schulz 94e6bbfc64 pick up the changes from a makesyscall.sh run. The multiple lkmnosys
declarations should now be gone.
1994-11-10 23:59:47 +00:00
Poul-Henning Kamp 4385de1699 Added "const" to the arguments here and there. 1994-11-07 20:48:35 +00:00
Andreas Schulz f0e1ab7bc7 Put a small hack into a large hack named makeyscall.sh. Generate only
one lkmnosys() entry in init_sysent.c.
1994-11-06 21:57:16 +00:00
Andrey A. Chernov 08ee5d13ae Security nitpicking: don't make *.core world readable 1994-11-06 11:13:02 +00:00
David Greenman cf17350a73 Added support for starting the experimental "vmdaemon" system process.
Enabled via REL2_1.

Submitted by:	John Dyson
1994-11-06 05:01:58 +00:00
David Greenman c4a7b7e10c From tim@cs.city.ac.uk (Tim Wilkinson):
Find enclosed a short bugfix to get the union filesystem up and running
in FreeBSD-current.  We don't think we've got all the problems yet but
these fixes sort out the major ones (which mostly concert bad locking
of vnodes), no doubt we'll post others as necessary.  Known problems
include the inability of the umount command (not the system call) to unmount
unions in certain circumstances (this is due the way "realpath" works),
and the failure of direntries to always get all available files in
unioned subdirectories.  We are, as they say, working on it.

Submitted by:	tim@cs.city.ac.uk (Tim Wilkinson)
1994-11-04 14:41:46 +00:00
Bruce Evans e8b7f39747 Return immediately from ttwrite() if the ttysleep()s that wait for
a clist return with an error.  There are some clist starvation/deadlock
bugs elsewhere and killing clist hogs didn't help because the breaks
only exited from the inner loops.
1994-11-01 22:23:29 +00:00
Joerg Wunsch 0cdf7aff6d Added hooks for an easy drop-in of the pcvt concole driver.
Don't panic:-), this is simple stuff just doing exactly the same as for syscons.
(files.i386 did already contain the necessary stuff.)
1994-10-31 17:20:15 +00:00
Bruce Evans ab4bc4b293 Fix selector arg to match the (missing) prototype for sdtossd().
Cosmetic.

Return from trap() if trap_fatal() returns.  trap_fatal() isn't
fatal if you have ddb.  Returning from trap() is usually the right
thing to do and much better than falling through.
1994-10-30 20:25:21 +00:00
Bruce Evans a6a21d9edf Don't attempt to free null cblocks. There may be less to free than
normal due to cblock resource starvation or malloc() failing when
the device is opened.
1994-10-30 19:43:49 +00:00