Commit Graph

912 Commits

Author SHA1 Message Date
dyson
428f960220 Change the *evil* allocation of memory from kmem_map to the kernel_map.
This will mess things up especially recently.
1996-05-24 01:39:50 +00:00
dyson
3130798e2b Minor performance improvement to kern_malloc.c that increases the
probability of reuse of recently freed memory.  This improves cache
hit stats on cached memory, and improves at least fork speed consistancy.
1996-05-18 22:33:13 +00:00
dyson
242e10df11 This set of commits to the VM system does the following, and contain
contributions or ideas from Stephen McKay <syssgm@devetir.qld.gov.au>,
Alan Cox <alc@cs.rice.edu>, David Greenman <davidg@freebsd.org> and me:

	More usage of the TAILQ macros.  Additional minor fix to queue.h.
	Performance enhancements to the pageout daemon.
		Addition of a wait in the case that the pageout daemon
		has to run immediately.
		Slightly modify the pageout algorithm.
	Significant revamp of the pmap/fork code:
		1) PTE's and UPAGES's are NO LONGER in the process's map.
		2) PTE's and UPAGES's reside in their own objects.
		3) TOTAL elimination of recursive page table pagefaults.
		4) The page directory now resides in the PTE object.
		5) Implemented pmap_copy, thereby speeding up fork time.
		6) Changed the pv entries so that the head is a pointer
		   and not an entire entry.
		7) Significant cleanup of pmap_protect, and pmap_remove.
		8) Removed significant amounts of machine dependent
		   fork code from vm_glue.  Pushed much of that code into
		   the machine dependent pmap module.
		9) Support more completely the reuse of already zeroed
		   pages (Page table pages and page directories) as being
		   already zeroed.
	Performance and code cleanups in vm_map:
		1) Improved and simplified allocation of map entries.
		2) Improved vm_map_copy code.
		3) Corrected some minor problems in the simplify code.
	Implemented splvm (combo of splbio and splimp.)  The VM code now
		seldom uses splhigh.
	Improved the speed of and simplified kmem_malloc.
	Minor mod to vm_fault to avoid using pre-zeroed pages in the case
		of objects with backing objects along with the already
		existant condition of having a vnode.  (If there is a backing
		object, there will likely be a COW...  With a COW, it isn't
		necessary to start with a pre-zeroed page.)
	Minor reorg of source to perhaps improve locality of ref.
1996-05-18 03:38:05 +00:00
phk
e27ee568ac Ups, I removed NMB_INIT too.
Complained about by:	asami
1996-05-12 07:48:47 +00:00
phk
a27724a359 Nail down NCL_INIT = 1, and put a comment there telling what it is. 1996-05-11 20:43:23 +00:00
bde
c926fa02cd Hide options for emulators and static file systems in opt_dontuse.h.
These options only apply at config time.  Using them at compile time
would break the corresponding lkms.
1996-05-11 04:39:53 +00:00
wollman
a28a8481af Allocate mbufs from a separate submap so that NMBCLUSTERS works as
expected.
1996-05-10 19:28:55 +00:00
wollman
9ea36adbec Make it possible to return more than one piece of control information
(PR #1178).
Define a new SO_TIMESTAMP socket option for datagram sockets to return
packet-arrival timestamps  as control information (PR #1179).

Submitted by:	Louis Mamakos <loiue@TransSys.com>
1996-05-09 20:15:26 +00:00
gpalmer
86058739b9 Correct a comment. There is no fn `kprintf' 1996-05-09 18:58:06 +00:00
wollman
577771db62 Our new-old mbugf allocator. This is actually something of a blast from
the past, since it returns to the old system of allocating mbufs out of
a private area rather than using the kernel malloc().  While this may seem
like a backwards step to some, the new allocator is some 20% faster than
the old one and has much better caching properties.

Written by: John Wroclawski <jtw@lcs.mit.edu>
1996-05-08 19:38:27 +00:00
gpalmer
c79cc630ed Clean up various compiler warnings. Most (if not all) were benign
Reviewed by:	bde
1996-05-08 04:29:08 +00:00
phk
05b36227ad An old typo MCLBYTES/CLBYTES became more obvious bogus now.
Submitted by:		wollman
1996-05-06 17:18:12 +00:00
joerg
ecfc9b829b uninitialized auto variable shmseg is used in ...
Closes PR #kern/1174

Submitted by:	enami@ba2.so-net.or.jp
1996-05-05 13:53:48 +00:00
phk
5d01dc3d50 Another sweep over the pmap/vm macros, this time with more focus on
the usage.  I'm not satisfied with the naming, but now at least there is
less bogus stuff around.
1996-05-03 21:01:54 +00:00
phk
04c1e3cc5c disksort() is gone, all drivers now use tqdisksort(). 1996-05-03 15:05:17 +00:00
phk
5a6fb3a7da removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
        ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
        NPDEPG

Major macro cleanup.
1996-05-02 14:21:14 +00:00
peter
df35ab2846 Fix a nasty bug that causes random crashes and lockups particularly on
very busy servers (eg: news, web).  This is an interaction between
embryonic processes that have not yet finished forking, and happen to
cause the kernel VM space to grow, hitting the uninitialised variable.

It was possible for this to strike at any time, depending on the size of
your kernel and load patterns.  One machine had paniced occasionally
when cron launches a job since before the 2.1 release.

If you had "options DIAGNOSTIC", you may have seen references to bogus
addresses like 0xdeadc142 and the like.

This is a minimal change to fix the problem, it will probably be done
better by reordering p_vmspace to be in the startzero section, but it
becomes harder to validate then.

It's been vulnerable since pmap.c rev 1.40 (Jan 9, 1995), so it's been a
cause of problems since well before 2.0.5.  This was when the merged
VM/buffer cache and the dynamic growing kernel VM space were first
committed.  This probably fixes a few of PR's.
1996-05-02 11:38:05 +00:00
phk
779840c457 First pass at cleaning up macros relating to pages, clusters and all that. 1996-05-02 10:43:17 +00:00
phk
7bfc0101cb KGDB is dead. It may come back one day if somebody does it. 1996-05-02 09:34:51 +00:00
bde
8ff8e22ec9 Removed unused #include. 1996-05-01 03:32:46 +00:00
bde
f92cdcae99 Removed unnecessary #includes from <sys/imgact.h> so that it is
self-sufficient and added explicit #includes where required.
1996-05-01 02:43:13 +00:00
smpatel
cc39b8d5e5 Fixed two typos in the comment.
Pointed out by:	davidg
1996-04-29 15:07:59 +00:00
bde
8831d940d6 Yet more b_flags fixes. The previous ones broke the clearing of B_DONE
and B_READ before writing.  This was was fatal.  They also broke the
clearing of B_INVAL before doing i/o.  This didn't actually matter.

Submitted by:	mostly by joerg
1996-04-19 19:34:19 +00:00
bde
e5094c363b Fixed removal of devfs entries for the real slice corresponding to the
compatibility slice.  They were forgotten on last-close and then
creating them on first-open failed.

Devfs entries for slices other than the one containing the root file
system are still invisible unless you open a non-devfs inode on the
slice.
1996-04-19 19:22:29 +00:00
smpatel
191537cd0c Implement the RFNOWAIT flag for rfork(). If set this flag will cause the
forked child to be dissociated from the parent).

Cleanup fork1(), implement vfork() and fork() in terms of rfork() flags.

Remove RFENVG, RFNOTEG, RFCNAMEG, RFCENVG which are Plan9 specific and cannot
possibly be implemented in FreeBSD.

Renumbered the flags to make up for the removal of the above flags.

Reviewed by:	peter, smpatel
Submitted by:	Mike Grupenhoff <kashmir@umiacs.umd.edu>
1996-04-17 17:05:08 +00:00
dg
f248f3aa32 Fix for PR #1146: the "next" pointer must be cached before calling soabort
since the struct containing it may be freed.
1996-04-16 03:50:08 +00:00
phk
52978a6ce9 Fix a longstanding bug and a buglet of no significance.
Now net.ipx works.

Noticed by:	John Hay -- John.Hay@csir.co.za
1996-04-13 13:28:54 +00:00
bde
23914989a4 Spell cpu_switch() with an i in a comment. 1996-04-11 20:56:29 +00:00
bde
f48cd2e7e2 Fixed the PF_REMOTE case of ptcwrite(). I broke it in rev.1.22. Output
was duplicated until the canq filled up, and write() normally returned 0.
This case is apparently rare.  It was reported for Jove's shell buffer in
PR 1130.
1996-04-11 18:43:37 +00:00
dg
d1862b5655 Killed sections 3 and 4 of my copyright as I don't agree with it (I believe
it to be unnecessarily restrictive). For tty_subr.c, update to my standard
copyright.
1996-04-08 01:22:00 +00:00
bde
b4a0a5c2e5 Use rdtsc() function instead of inline essembler. 1996-04-07 18:16:26 +00:00
bde
d75a1370e4 Removed never-used #includes of <machine/cpu.h>. Many were apparently
copied from bad examples.
1996-04-07 17:39:28 +00:00
bde
cfdfb3c281 Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
bde
50c6f44d2e Declared pgrpdump() properly. 1996-04-07 16:16:05 +00:00
bde
76bf9ad082 Cleaned up naming and formatting in recent changes. 1996-04-07 14:32:14 +00:00
bde
aa05872301 Don't generate code for the unused function sleep(). 1996-04-07 13:35:58 +00:00
phk
f7f7113b0b Move the "mib" variables out to their own file. 1996-04-07 13:03:06 +00:00
scrappy
6233a36953 Fixed a bug in DEVFS code that was producing "name slot allocation failed"
messages.
1996-04-05 19:12:01 +00:00
scrappy
99d214961d changed from using dev_link() to devfs_link() 1996-04-02 04:52:03 +00:00
scrappy
dd0ca9fc5d Convert from using dev_link() to dev_linkf() 1996-04-01 21:03:07 +00:00
jkh
ed7401f29f Remove bogus architectures to allow make tags to work.
Submitted-by: Andreas Klemm <andreas@knobel.gun.de>
1996-03-31 18:53:43 +00:00
peter
2659e4abf8 Correct the handling of NOCLDSTOP when using sigvec()
Make the SA_NODEFER handling more correct, previously if you called
sigaction to set a handler and had SA_NODEFER set, and manually masked
the signal itself in sa_mask, and when you read the settings back later,
you'd find SA_NODEFER incorrectly cleared.

Pointed out by: bde
1996-03-30 15:15:30 +00:00
peter
72d37bed2c Because of the way that ptrace() now calls procfs routines to read/write
the process's memory, it was possible for the procfs_domem() call to
return a residual leftover, but with no errno.  Since this is no good for
ptrace which ignored the the residual, remap a leftover amount into an
errno rather than fooling the caller into thinking it was successful when
in fact it was not.

Submitted by: bde (a very long time ago :-)
1996-03-30 15:02:58 +00:00
bde
9c3ddb1006 Undid the last 2 commits. Rev.1.43 reversed the changes in rev.1.42 and
rev.1.44 was a subset of them.
1996-03-28 15:03:41 +00:00
scrappy
85dc41d2a0 Switched from using devfs_add_devsw() to devfs_add_devswf()
Reviewed by:	julian@freebsd.org
1996-03-28 14:31:42 +00:00
scrappy
415585985c Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by:	julian@freebsd.org
1996-03-28 14:29:52 +00:00
dyson
a68eed7d53 Remove a now unnecessary prototype from pmap.c. Also remove now
unnecessary vm_fault's of page table pages in trap.c.
1996-03-28 05:40:58 +00:00
bde
5d47fb52e7 Fixed name of /dev/fs/klog (it's not "log").
Submitted by:	"Marc G. Fournier" <scrappy@ki.net> and edited by me
1996-03-27 19:45:28 +00:00
bde
9041dff38e Fixed permissions of /devfs/lkm. 1996-03-27 19:42:14 +00:00
bde
d88e11ffe2 Fixed the unit numbers of the devfs `fd' devices.
Made the devfs `fd' devices bug for bug compatible with the ones created
by MAKEDEV:
- ownership is bin.bin, not root.wheel, except for std*.  The devfsext
  interface doesn't seem to allow specifying the ownership of /devfs/fd,
  so it's still incompatible.
- std* aren't links to fd/[0-2].
1996-03-27 19:19:58 +00:00