Commit Graph

5767 Commits

Author SHA1 Message Date
John Dyson
c44013cde6 Get rid of PIPE_NBIO, cleaning up the code a bit.
Reviewed by:	bde
1996-07-04 04:36:56 +00:00
Poul-Henning Kamp
41e4eb70b4 Comment out rootdev & rrootdev so a ls -l doesn't panic the machine. 1996-07-03 03:48:46 +00:00
John Dyson
688bbd5b76 Implement locking for pfs nodes, when at the leaf. Concurrent access
to information from a single process causes hangs.  Specifically, this
fixes problems (hangs) with concurrent ps commands, when the system is under
heavy memory load.
Reviewed by:	davidg
1996-07-02 13:38:10 +00:00
John Dyson
a6e6bcc5f4 Properly set the PG_MAPPED and PG_WRITEABLE flags. This fixes some potential
problems with vm_map_remove/vm_map_delete.
1996-07-02 02:08:02 +00:00
John Dyson
c6c4b08e59 Fix a serious problem, with a window where an object lock is needed,
but not there.  The extent of the object lock is expanded to be over the
range that it is needed.  Additionally, clean up the code so that it conforms
to better coding style.
1996-07-02 01:40:52 +00:00
Bruce Evans
f6b4ae3c82 Added or restored #include of <machine/md_var.h>. Some declarations
moved from <machine/cpufunc.h> to better places.
1996-07-01 20:29:10 +00:00
Bruce Evans
7baccf64d3 Fixed lots of warnings about unportable casts of pointers to volatile
variables: don't depend on the compiler generating atomic code to set
the variables - use inline asm to specify the atomic instruction(s)
explicitly.
1996-07-01 20:16:10 +00:00
Bruce Evans
a111a7f827 Moved declarations of non-cpu things from <machine/cpufunc.h> to better
places.
1996-07-01 18:12:24 +00:00
Bruce Evans
d2700ee639 Use the standard timer (interrupt) frequency while calibrating the clocks.
Testing with the high frequency of 20000 Hz (to find problems) only found
the problem that this frequency is too high for slow i386's.

Disable interrupts while setting the timer frequency.  This was unnecessary
before rev.1.57 and forgotten in rev.1.57.  The critical (i8254) interrupts
are disabled in another way at boot time but not in the sysctl to change
the frequency.
1996-07-01 18:00:47 +00:00
Jordan K. Hubbard
68e00b9233 Fix the ordering dependency I broke. 1996-06-30 22:16:19 +00:00
John Dyson
877329e059 Make -current consistant with -stable regarding time that a process
sleeps before being swapped out.  The time is increased from 4 secs to
10 secs.  Originally I had decreased it from 20 to 4, but that is a bit
severe.  20 is too long though.
1996-06-30 21:16:18 +00:00
Joerg Wunsch
c683ac7c95 Enable ktrace by default, accompanied by a small reminder about the
implications (4 KB bloat, slight slowdown of syscalls).

Reviewed by:	freebsd-hackers
1996-06-30 09:39:29 +00:00
David Greenman
7c818168d5 Fixed a major bug that caused various pmap related panics, hangs, and reboots.
The i386 pmap module uses a special area of kernel virtual memory for mapping
of page tables pages when it needs to modify another process's virtual
address space. It's called the 'alternate page table map'. There is only one
of them and it's expected that only one process will be using it at once and
that the operation is atomic.
When the merged VM/buffer cache was implemented over a year ago, it became
necessary to rundown VM pages at I/O completion. The unfortunate and
unforeseen side effect of this is that pmap functions are now called at bio
interrupt time. If there happend to be a process using the alternate page
table map when this I/O completion occurred, it was possible for a different
process's address space to be switched into the alternate page table map -
leaving the current pmap process with the wrong address space mapped when
the interrupt completed. This resulted in BAD things happening like pages
being mapped or removed from the wrong address space, etc.. Since a very
common case of a process modifying another process's address space is during
fork when the kernel stack is inserted, one of the most common manifestations
of this bug was the kernel stack not being mapped properly, resulting in a
silent hang or reboot. This made it VERY difficult to troubleshoot this bug
(I've been trying to figure out the cause of this for >6 months). Fortunately,
the set of conditions that must be true before this problem occurs is
sufficiently rare enough that most people never saw the bug occur. As I/O
rates increase, however, so does the frequency of the crashes. This problem
used to kill wcarchive about every 10 days, but in more recent times when
the traffic exceeded >100GB/day, the machine could barely manage 6 hours of
uptime.
The fix is to make certain that no process has the pages mapped that are
involved in the I/O, before the I/O is started. The pages are made busy, so
no process will be able to map them, either, until the I/O has finished.
This side-steps the issue by still allowing the pmap functions to be called
at interrupt time, but also assuring that the alternate page table map won't
be switched.
Unfortunately, this appears to not be the only cause of this problem. :-(

Reviewed by:	dyson
1996-06-30 05:17:08 +00:00
Peter Wemm
dcca5a532d Fix typo that prevented the initial/lock state devices from working
correctly (accessing the lock device was not possible).
1996-06-30 04:56:05 +00:00
David Greenman
01155bd720 Make sure we have an object in the map entry before trying to trim pages
from it.
1996-06-29 09:17:17 +00:00
Alexander Langer
32fb6c089b Reject rules which try to mix ports with incompatible protocols. 1996-06-29 03:33:20 +00:00
Joerg Wunsch
a9e9062ca1 Bump various timeouts in scprobe(). This finally fixes the broken
keyboard reset one of my earlier commits has been causing.
1996-06-27 21:36:11 +00:00
Gary Palmer
2aba17b378 Correct comment relating to pty's. There can be 256 (probably
higher actually, but that's all our MAKEDEV supports at this time)
1996-06-26 19:42:06 +00:00
Søren Schmidt
da040b2280 Fixed bug in pasting 8bit char (ache).
Added linefeeds in cuts that extend beyond one line.
Prepared for the mousefunctions to be used in nontext modes.
1996-06-26 13:04:53 +00:00
John Dyson
4b83b27fea Fix a problem that caused system crashes after physio. This problem
was due to non-aligned 64K transfers taking 17 pages.  We currently
do not support >16 page transfers.  The transfer is unfortunately truncated,
but since buffers are usually malloced, this is a problem only once in
a while.  Savecore is a culprit, but tar/cpio usually aren't.  This
is NOT the final fix (which is likely a bouncing scheme), but will at
least keep the system from crashing.
1996-06-26 05:52:15 +00:00
John Dyson
38efa82b23 This commit does a couple of things:
Re-enables the RSS limiting, and the routine is now tail-recursive,
	making it much more safe (eliminates the possiblity of kernel stack
	overflow.) Also, the RSS limiting is a little more intelligent about
	finding the likely objects that are pushing the process over the limit.

	Added some sysctls that help with VM system tuning.

New sysctl features:
	1)	Enable/disable lru pageout algorithm.
		vm.pageout_algorithm = 0, default algorithm that works
			well, especially using X windows and heavy
			memory loading.  Can have adverse effects,
			sometimes slowing down program loading.

		vm.pageout_algorithm = 1, close to true LRU.  Works much
			better than clock, etc.  Does not work as well as
			the default algorithm in general.  Certain memory
			"malloc" type benchmarks work a little better with
			this setting.

		Please give me feedback on the performance results
		associated with these.

	2)	Enable/disable swapping.
		vm.swapping_enabled = 1, default.

		vm.swapping_enabled = 0, useful for cases where swapping
			degrades performance.

		The config option "NO_SWAPPING" is still operative, and
		takes precedence over the sysctl.  If "NO_SWAPPING" is
		specified, the sysctl still exists, but "vm.swapping_enabled"
		is hard-wired to "0".

Each of these can be changed "on the fly."
1996-06-26 05:39:27 +00:00
John Dyson
f43467241e When page table pages were removed from process address space, the
resident page stats were not being decremented.  This mode corrects
that problem.
1996-06-26 05:05:52 +00:00
Bruce Evans
c673fe98d7 Added #include of <machine/md_var.h>. This will be needed when
some declarations are moved from <machine/cpufunc.h> to better
places.
1996-06-25 20:31:01 +00:00
Bruce Evans
c11bd94104 Fixed the `machine' link. It pointed to the wrong place, and was created
too late to be used in all cases.  It should probably be created (early)
in bsd.kmod.mk for all LKMs.

Use cc instead of cpp | as for the same reasons as in the kernel makefile.
CFLAGS isn't split up as well as in the kernel makefile, but cc doesn't
pass compiler warning flags to cpp, so there is no need to split it.
1996-06-25 20:13:12 +00:00
Bruce Evans
79df6d8597 trap.c:
Fixed profiling of system times.  It was pre-4.4Lite and didn't support
statclocks.  System times were too small by a factor of 8.

Handle deferred profiling ticks the 4.4Lite way: use addupc_task() instead
of addupc().  Call addupc_task() directly instead of using the ADDUPC()
macro.

Removed vestigial support for PROFTIMER.

switch.s:
Removed addupc().

resourcevar.h:
Removed ADDUPC() and declarations of addupc().

cpu.h:
Updated a comment.  i386's never were tahoe's, and the deferred profiling
tick became (possibly) multiple ticks in 4.4Lite.

Obtained from:	mostly from NetBSD
1996-06-25 20:02:16 +00:00
Bruce Evans
93f4b1bf1b Save John Polstra's initial fix for profiling for reference. The
multiplication in addupc() overflowed for addresses >= 256K, assuming
the usual profil(2) scale parameter of 0x8000.  addupc() will go away
soon.

Submitted by:	John Polstra <jdp@polstra.com>
1996-06-25 19:25:25 +00:00
Søren Schmidt
ad0c0c784f Change the way moused talk to syscons, now its only delivering mouseevents
via an ioctl (MOUSE_ACTION).
Fixed a couple of bugs (destructive cursor, uncut, jitter).
Now applications can use the mouse via the MOUSE_MODE ioctl, its
possible to have a signal sent on mouseevents, makeing an event loop
in the application take over mouseevents.
1996-06-25 08:54:57 +00:00
David Greenman
b9355dedd9 Fixed end condition for clustered reads.
Submitted by:	Kirk McKusick via Lite-2 and email
1996-06-25 03:00:44 +00:00
John Dyson
cb87c9be58 Limit the scan for preloading pte's to the end of an object. 1996-06-25 00:39:21 +00:00
John Dyson
f0e2953e5e Fix some serious problems with limits checking in the sbrk(2)/brk(2)
code.
Reviewed by:	bde
1996-06-25 00:36:46 +00:00
Alexander Langer
830b0d3039 Allow fragment checking to work with specific protocols.
Reviewed by:	phk

Reject the addition of rules that will never match (for example,
1.2.3.4:255.255.255.0).  User level utilities specify the policy by either
masking the IP address for the user (as ipfw(8) does) or rejecting the
entry with an error.  In either case, the kernel should not modify chain
entries to make them work.
1996-06-25 00:22:20 +00:00
Gary Palmer
545f9f440b Remove another extraneous setting of if_lastchange 1996-06-24 21:56:39 +00:00
Justin T. Gibbs
6a2631bf25 Ensure that media protection is released before attempting to eject the
media in all cases.

Remove SCSI_2_MAX_DENSITY_CODE definition and rely on the device to tell
us if we attempt an invalid setting.

Closes PR 1245.

Submitted by:	fredriks@mcs.com a few changes by me.
1996-06-24 04:54:32 +00:00
John Dyson
a001376dc3 Remove RSS limiting until I rewrite the code to be non-recursive. The
code can overrun the kernel stack under very stressful conditions.
1996-06-24 04:30:24 +00:00
Jordan K. Hubbard
cd9a2f5c28 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00
Justin T. Gibbs
356cbcce49 Fix problem with scb flag handing that crept in with the SCB paging support.
This only affected userland initiated device resets (using the reset command
from cdplay for instance).

Convert some spaces to tabs.
1996-06-23 20:02:37 +00:00
Andrey A. Chernov
e72a188ebc Oops, forget the fact that LINT compiles (fixing previos PAS commi) 1996-06-23 19:46:46 +00:00
Andrey A. Chernov
5839779af2 Describe the way how to add OPL for PAS without conflict 1996-06-23 19:41:34 +00:00
Bruce Evans
cc3d522683 Unstaticize psratio and staticize profprocs. psratio needs to be exported
to trap.c to fix user profiling.
1996-06-23 17:40:47 +00:00
Bruce Evans
8cd5acbce0 Don't truncate minor or major numbers in the nfsv3 client. 1996-06-23 17:19:25 +00:00
Bruce Evans
ea959743cb Moved declarations of static functions to the correct file. This fixes
hundreds of warnings from -Wunused in lkm/syscons/*.
1996-06-23 17:12:05 +00:00
Bruce Evans
6fe10f76c3 Removed unused #include. Linux doesn't support SCO consoles. 1996-06-23 17:08:11 +00:00
Bruce Evans
946a489fe1 Forward-declare a struct tag so that this doesn't depend on a side effect
of indirectly including <i386/isa/isa_device.h>.
1996-06-23 15:02:02 +00:00
Bruce Evans
488ed21e9f Don't add -I/sys to CFLAGS. bsd.kmod.mk adds the correct (relative)
path.
1996-06-23 14:58:14 +00:00
Bruce Evans
e0ddbefc46 Don't claim to be a VFS_LKM - generate vnode_if.h by putting it in SRCS.
Don't add -I/sys to CFLAGS.  bsd.kmod.mk adds the correct (relative)
path.
1996-06-23 14:56:04 +00:00
Bruce Evans
a7d87a6714 Don't (re)define ACTUALLY_LKM_NOT_KERNEL. It wasn't even used by the
joy driver proper.

Don't add -I/sys to CFLAGS.  bsd.kmod.mk adds the correct (relative)
path.
1996-06-23 14:52:20 +00:00
Bruce Evans
fb2604799e Finished converting ipfw to use opt_ipfw.h. 1996-06-23 14:43:55 +00:00
Bruce Evans
5c496ee31e Don't (re)define or use ACTUALLY_LKM_NOT_KERNEL - use the existing
definition of QCAM_MODULE for everything involving LKM'ness.

Makefile:
Don't add -I/sys to CFLAGS.  bsd.kmod.mk adds the correct (relative)
path.
1996-06-23 14:41:55 +00:00
Bruce Evans
7472e2e0f8 Use IPFIREWALL_MODULE instead of ACTUALLY_LKM_NOT_KERNEL to indicate
LKM'ness.  ACTUALLY_LKM_NOT_KERNEL is supposed to be so ugly that it
only gets used until <machine/conf.h> goes away.  bsd.kmod.mk should
define a better-named general macro for this.  Some places use
PSEUDO_LKM.  This is another bad name.

Makefile:
Added IPFIREWALL_VERBOSE_LIMIT option (commented out).
1996-06-23 14:28:02 +00:00
Bruce Evans
a24ed11695 Disabled unusable union lkm. 1996-06-23 13:31:20 +00:00