Commit Graph

509 Commits

Author SHA1 Message Date
eivind
01dd6091ed Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
dyson
fc1a352788 Fix a recursive kernel_map lock problem in vm_zone allocator.
PR:	5298
1997-12-15 05:16:09 +00:00
dyson
e86cd387f8 Slight improvement to the vm_zone stats output. Also, some other superficial
cleanups.
1997-12-14 05:17:44 +00:00
dyson
738872cad6 After one of my analysis passes to evaluate methods for SMP TLB mgmt, I
noticed some major enhancements available for UP situations.  The number
of UP TLB flushes is decreased much more than significantly with these
changes.  Since a TLB flush appears to cost minimally approx 80 cycles,
this is a "nice" enhancement, equiv to eliminating between 40 and 160
instructions per TLB flush.

Changes include making sure that kernel threads all use the same PTD,
and eliminate unneeded PTD switches at context switch time.
1997-12-14 02:11:23 +00:00
dyson
043ed4f1ba Fix the prototype for swapout_procs();
Submitted by:	dima@best.net
1997-12-11 02:10:55 +00:00
dyson
9821c09585 Support an optional, sysctl enabled feature of idle process swapout. This
is apparently useful for large shell systems, or systems  with long running
idle processes.  To enable the feature:

	sysctl -w vm.swap_idle_enabled=1

Please note that some of the other vm sysctl variables have been renamed
to be more accurate.
Submitted by:	Much of it from Matt Dillon <dillon@best.net>
1997-12-06 02:23:36 +00:00
bde
efd51d84cf Don't include <sys/lock.h> in headers when only `struct simplelock' is
required.  Fixed everything that depended on the pollution.
1997-12-05 19:55:52 +00:00
dyson
b1d65d1edc Add new (very useful) tunable for pageout daemon. The flag changes
the maximum pageout rate:

sysctl -w vm.vm_maxlaunder=n

 1 < n < inf.

If paging heavily on large systems, it is likely that a performance
improvement can be achieved by increasing the parameter.  On a large
system, the parm is 32, but numbers as large as 128 can make a big
difference.  If paging is expensive, you might try decreasing the
number to 1-8.
1997-12-05 05:41:06 +00:00
dyson
cd720ec73b Support applications that need to resist or deny use of swap space.
sysctl -w vm.defer_swap_pageouts=1
	Causes the system to resist the use of swap space.  In low memory
	conditions, performance will decrease.
sysctl -w vm.disable_swap_pageouts=1
	Causes the system to mostly disable the use of swap space.  In
	low memory conditions, the system will likely start killing
	processes.
1997-12-04 19:00:56 +00:00
phk
a1bfb618d9 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
bde
17589a0467 Removed all traces of P_IDLEPROC. It was tested but never set. 1997-11-24 15:15:33 +00:00
bde
c729ff1df2 Don't #define max() to get a version that works with vm_ooffset's.
Just use qmax().

This should be fixed more generally using overloaded functions.
1997-11-24 15:03:13 +00:00
bde
e38ebd73b3 Removed unused #include of <sys/malloc.h>. This file now uses only
zalloc().  Many more cases like this are probably obscured by not
including <vm/zone.h> explicitly (it is spammed into <sys/malloc.h>).
1997-11-18 11:02:19 +00:00
tegge
08d3982b7d Simplify map entries during user page wire and user page unwire operations in
vm_map_user_pageable().

Check return value of vm_map_lock_upgrade() during a user page wire operation.
1997-11-14 23:42:10 +00:00
phk
ccc7e7fa9f Rename some local variables to avoid shadowing other local variables.
Found by: -Wshadow
1997-11-07 09:21:01 +00:00
phk
4d26888936 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
phk
4c8218a5c7 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.
1997-11-06 19:29:57 +00:00
dyson
bae55d2661 Fix the "missing page" problem. Also, improve the performance of page
allocation in common cases.
1997-11-06 08:35:50 +00:00
bde
fb826377ff Removed unused #includes. 1997-10-28 15:59:26 +00:00
dyson
56bd787cbb Support garbage collecting the pmap pv entries. The management doesn't
happen until the system would have nearly failed anyway, so no signficant
overhead is added.  This helps large systems with lots of processes.
1997-10-25 02:41:56 +00:00
dyson
bcae676793 Decrease the initial allocation for the zone allocations. 1997-10-24 23:41:04 +00:00
phk
36e7a51ea1 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
1997-10-12 20:26:33 +00:00
phk
645e7b2ab6 Distribute and statizice a lot of the malloc M_* types.
Substantial input from:	bde
1997-10-11 18:31:40 +00:00
peter
34c09ca6a9 Attempt to fix the previous fix to the contigmalloc1 prototype.
struct malloc_type isn't defined in all cases (eg: from ddb), and the line
wrapping was very badly mangled.
1997-10-11 10:39:19 +00:00
phk
a8f67509a6 Fix contigmalloc() and contigmalloc1() arguments. 1997-10-10 18:18:47 +00:00
dyson
9b2d1fdb85 Improve management of pages moving from the inactive to active queue. Additionally,
add some much needed comments.
1997-10-06 02:48:16 +00:00
dyson
df56983676 Relax the vnode locking for read only operations. 1997-10-06 02:38:30 +00:00
peter
9cb126eb6a Fix some style(9) and formatting problems. tabsize 4 formatting doesn't
look too great with 'more' etc.

Approved by: dyson (with a minor grumble :-)
1997-09-21 11:41:12 +00:00
dyson
e64b1984f9 Change the M_NAMEI allocations to use the zone allocator. This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.
1997-09-21 04:24:27 +00:00
peter
796eb5ce0a Update select -> poll in drivers. 1997-09-14 03:19:42 +00:00
peter
0a52445cc3 Print correct function name in panics 1997-09-13 15:04:52 +00:00
jlemon
0eba88d0be Do not consider VM_PROT_OVERRIDE_WRITE to be part of the protection
entry when handling a fault.  This is set by procfs whenever it wants
to write to a page, as a means of overriding `r-x COW' entries, but
causes failures in the `rwx' case.

Submitted by:	 bde
1997-09-12 15:58:47 +00:00
bde
bcade9a903 Removed yet more vestiges of config-time swap configuration and/or
cleaned up nearby cruft.
1997-09-07 16:21:11 +00:00
bde
a08aff2d02 Removed unused #includes. 1997-09-01 03:17:34 +00:00
bde
e11885cf92 Some staticized variables were still declared to be extern. 1997-09-01 02:55:50 +00:00
bde
98fcb3f476 Print a device number in hex instead of decimal. 1997-09-01 02:28:32 +00:00
phk
0b3a12b83e Change the 0xdeadb hack to a flag called VDOOMED.
Introduce VFREE which indicates that vnode is on freelist.
Rename vholdrele() to vdrop().
Create vfree() and vbusy() to add/delete vnode from freelist.
Add vfree()/vbusy() to keep (v_holdcnt != 0 || v_usecount != 0)
  vnodes off the freelist.
Generalize vhold()/v_holdcnt to mean "do not recycle".
Fix reassignbuf()s lack of use of vhold().
Use vhold() instead of checking v_cache_src list.
Remove vtouch(), the vnodes are always vget'ed soon enough
  after for it to have any measuable effect.
Add sysctl debug.freevnodes to keep track of things.
Move cache_purge() up in getnewvnodes to avoid race.
Decrement v_usecount after VOP_INACTIVE(), put a vhold() on
  it during VOP_INACTIVE()
Unmacroize vhold()/vdrop()
Print out VDOOMED and VFREE flags (XXX: should use %b)

Reviewed by:		dyson
1997-08-31 07:32:39 +00:00
peter
29e2c84e7a Allow non-page aligned file offset mmap's, providing that the system is
allowed to choose the address, or that the MAP_FIXED address has the same
remainder when modulo PAGE_SIZE as the file offset.  Apparently this is
posix1003.1b specified behavior.  SVR4 and the other *BSD's allow it too.
It costs us nothing to support and means we don't get EINVAL on some mmap
code that works perfectly elsewhere.

Obtained from: NetBSD
1997-08-30 18:50:06 +00:00
bde
c978fb3652 Fixed type mismatches for functions with args of type vm_prot_t and/or
vm_inherit_t.  These types are smaller than ints, so the prototypes
should have used the promoted type (int) to match the old-style function
definitions.  They use just vm_prot_t and/or vm_inherit_t.  This depends
on gcc features to work.  I fixed the definitions since this is easiest.
The correct fix may be to change the small types to u_int, to optimize
for time instead of space.
1997-08-25 22:15:31 +00:00
dyson
042ae4067b This is a trial improvement for the vnode reference count while on the vnode
free list problem.  Also, the vnode age flag is no longer used by the
vnode pager.  (It is actually incorrect to use then.)  Constructive
feedback welcome -- just be kind.
1997-08-22 03:56:37 +00:00
bde
6be005551f #include <machine/limits.h> explicitly in the few places that it is required. 1997-08-21 20:33:42 +00:00
fsmp
24a2d0d38a Added includes of smp.h for SMP.
This eliminates a bazillion warnings about implicit s_lock & friends.
1997-08-18 03:29:21 +00:00
dyson
cc823b6e73 Fix kern_lock so that it will work. Additionally, clean-up some of the
VM systems usage of the kernel lock (lockmgr) code.  This is a first
pass implementation, and is expected to evolve as needed.  The API
for the lock manager code has not changed, but the underlying implementation
has changed significantly.  This change should not materially affect
our current SMP or UP code without non-standard parameters being used.
1997-08-18 02:06:35 +00:00
dyson
a8d01f6338 The "cutsie" register parameter passing that I had mistakenly used breaks
profiling.  Since it doesn't really improve perf much, I have backed it
out.
1997-08-10 00:12:13 +00:00
dyson
85f902e519 More vm_zone cleanup. The sysctl now accounts for items better, and
counts the number of allocations.
1997-08-07 03:52:55 +00:00
dyson
5f9cb6429d Add exposure of some vm_zone allocation stats by sysctl. Also, change
the initialization parameters of some zones in VM map.  This contains
only optimizations and not bugfixes.
1997-08-06 04:58:05 +00:00
dyson
e150d815cc Fixed the commit botch that was causing crashes soon after system
startup.  Due to the error, the initialization of the zone for
pv_entries was missing.  The system should be usable again.
1997-08-05 23:03:24 +00:00
dyson
2649bd0b26 Another attempt at cleaning up the new memory allocator. 1997-08-05 22:24:31 +00:00
dyson
55205b3be5 Fix some bugs, document vm_zone better. Add copyright to vm_zone.h. Use
the new zone code in pmap.c so that we can get rid of the ugly ad-hoc
allocations in pmap.c.
1997-08-05 22:07:27 +00:00
dyson
96f688be11 Modify pmap to use our new memory allocator. Also, change the vm_map_entry
allocations to be interrupt safe.
1997-08-05 01:32:52 +00:00