dragonfly.git
20 years agoNon-semantic changing cleanups:
Jeffrey Hsu [Fri, 12 Sep 2003 12:26:04 +0000 (12:26 +0000)]
Non-semantic changing cleanups:
  remove used variable
  remove unneeded splnets
  use a stack variable instead of dynamically allocating it.

Request room for one more syncache entry to guarantee
successful allocation later.

Consulted with:  Jonathan Lemon <jlemon@flugsvamp.com>
Tested by:  drhodus

20 years agoCreate an emulation/43bsd directory and move the recently modified
David P. Reese, Jr. [Fri, 12 Sep 2003 00:43:31 +0000 (00:43 +0000)]
Create an emulation/43bsd directory and move the recently modified
compatibility syscalls there. Any future work on the COMPAT_43 code
should be split from the rest of the kernel and moved here.

Everything in the kernel that explicity uses the osockaddr structure
has been modified to include "emulation/43bsd/43bsd_socket.h".

There was one case where struct osockaddr was used in userland,
talk/talkd.  This commit has a temporary fix for talk/talkd.

20 years agoallow this to compile
Robert Garrett [Wed, 10 Sep 2003 22:45:50 +0000 (22:45 +0000)]
allow this to compile
From Joerg Sonnenbergh

20 years agoThe first a bug in pax and should be commited to FBSD, too.
Robert Garrett [Wed, 10 Sep 2003 22:43:54 +0000 (22:43 +0000)]
The first a bug in pax and should be commited to FBSD, too.
Further info in OpenBSD's system/3455.

From: Joerg Sonnenberg

20 years agoThe second fixes a dependency problem if compiling kernels
Robert Garrett [Wed, 10 Sep 2003 21:35:42 +0000 (21:35 +0000)]
The second fixes a dependency problem if compiling kernels
with ppp after "make depend".

from Joerg Sonnenberger

20 years agoAdd a cvsup tag, cvs-dfports
Matthew Dillon [Tue, 9 Sep 2003 17:02:07 +0000 (17:02 +0000)]
Add a cvsup tag, cvs-dfports

20 years agorename dport -> dfport
Matthew Dillon [Tue, 9 Sep 2003 16:59:26 +0000 (16:59 +0000)]
rename dport -> dfport

20 years agorename /usr/dports to /usr/dfports. Includes some CVS surgery.
Matthew Dillon [Tue, 9 Sep 2003 16:49:31 +0000 (16:49 +0000)]
rename /usr/dports to /usr/dfports.  Includes some CVS surgery.

20 years agoLinux emulation has been working well for a while now, remove notice.
Jeroen Ruigrok/asmodai [Tue, 9 Sep 2003 05:40:58 +0000 (05:40 +0000)]
Linux emulation has been working well for a while now, remove notice.

20 years agoAdd UPDATING note on /usr/dports
Matthew Dillon [Mon, 8 Sep 2003 23:50:34 +0000 (23:50 +0000)]
Add UPDATING note on /usr/dports

20 years agoadd relpath to the build Makefile
Matthew Dillon [Mon, 8 Sep 2003 23:47:21 +0000 (23:47 +0000)]
add relpath to the build Makefile

20 years agoAdd bsd.dport.mk, which Makefile's in /usr/dports will use instead of
Matthew Dillon [Mon, 8 Sep 2003 23:39:23 +0000 (23:39 +0000)]
Add bsd.dport.mk, which Makefile's in /usr/dports will use instead of
bsd.port.mk.  Modify bsd.port.mk to check for the existance of the same
port in /usr/dports and, if found, to cd into the dport and run the target
there.

NOTE: /usr/bin/relpath is required (see /usr/src/usr.bin/relpath).

20 years agoAdd the relpath utility which /usr/share/mk/bsd.port.mk will use to
Matthew Dillon [Mon, 8 Sep 2003 23:38:44 +0000 (23:38 +0000)]
Add the relpath utility which /usr/share/mk/bsd.port.mk will use to
figure out the relative port path so it can check for an override in
/usr/dports/

20 years agoCleanup some broken #include's for VESA.
Matthew Dillon [Mon, 8 Sep 2003 18:36:04 +0000 (18:36 +0000)]
Cleanup some broken #include's for VESA.

20 years agoAdd DIRECTIO to LINT
Matthew Dillon [Mon, 8 Sep 2003 18:35:44 +0000 (18:35 +0000)]
Add DIRECTIO to LINT

20 years agoConvert DIRECTIO code to DragonFly.
Matthew Dillon [Mon, 8 Sep 2003 18:26:39 +0000 (18:26 +0000)]
Convert DIRECTIO code to DragonFly.

20 years agoMake the linux emulator use the newly split listen(), getsockname(),
David P. Reese, Jr. [Sun, 7 Sep 2003 21:40:58 +0000 (21:40 +0000)]
Make the linux emulator use the newly split listen(), getsockname(),
getpeername(), and socketpair() syscalls.

Add a linux_copyout_sockaddr() function to make translation and copyout
of sockaddr structures painless.

20 years agoChange the split syscall naming convention from syscall1() to kern_syscall()
David P. Reese, Jr. [Sun, 7 Sep 2003 20:36:11 +0000 (20:36 +0000)]
Change the split syscall naming convention from syscall1() to kern_syscall()
while moving the prototypes from sys/syscall1.h to sys/kern_syscall.h.

Split the listen(), getsockname(), getpeername(), and socketpair() syscalls.

20 years agoMake sure a DiskOnKey never sends a sync_cache. This fixes the error
Jeroen Ruigrok/asmodai [Sun, 7 Sep 2003 17:43:12 +0000 (17:43 +0000)]
Make sure a DiskOnKey never sends a sync_cache.  This fixes the error
message when using my DiskOnKey.

Incidentally it also fixes FreeBSD/PR: 47793

20 years agoMdoc cleanup of section 4:
Hiten Pandya [Sun, 7 Sep 2003 17:04:00 +0000 (17:04 +0000)]
Mdoc cleanup of section 4:

- Remove hard sentence breaks

- Order sections per mdoc(7) manual page

- Correct spellings

20 years agoMake bind1() and accept1() non-static for linux emulator use.
Matthew Dillon [Sat, 6 Sep 2003 22:45:08 +0000 (22:45 +0000)]
Make bind1() and accept1() non-static for linux emulator use.
Matt: added fix to long standing bug in getsockaddr() that could allocate
too little space and overrun the structure.

Submitted-by: "David P. Reese Jr." <daver@gomerbud.com>
20 years agoAdd NETNS to the LINT config file.
David Rhodus [Sat, 6 Sep 2003 21:56:30 +0000 (21:56 +0000)]
Add NETNS to the LINT config file.

20 years agoInital cleanup work to make NETNS compile again
David Rhodus [Sat, 6 Sep 2003 21:51:12 +0000 (21:51 +0000)]
Inital cleanup work to make NETNS compile again
before someone tries to remove it. 8-)
Also fix a few small bugs and try to make
the code do the right thing.

20 years agoAdjust linux emulation calls for bind and listen to use the new broken-out
Matthew Dillon [Sat, 6 Sep 2003 20:36:42 +0000 (20:36 +0000)]
Adjust linux emulation calls for bind and listen to use the new broken-out
kernel-available syscalls rather then simulating BSD syscalls.

Submitted-by: "David P. Reese Jr." <daver@gomerbud.com>
20 years agoMake bind1() and accept1() non-static for linux emulator use.
Matthew Dillon [Sat, 6 Sep 2003 20:34:35 +0000 (20:34 +0000)]
Make bind1() and accept1() non-static for linux emulator use.
Matt: added fix to long standing bug in getsockaddr() that could allocate
too little space and overrun the structure.

Submitted-by: "David P. Reese Jr." <daver@gomerbud.com>
20 years agoAdd MLINK mount_ufs(8) to mount(8).
Hiten Pandya [Sat, 6 Sep 2003 18:27:57 +0000 (18:27 +0000)]
Add MLINK mount_ufs(8) to mount(8).

20 years agoGet rid of __P, the days of K&R support are long past.
Jeroen Ruigrok/asmodai [Sat, 6 Sep 2003 08:19:16 +0000 (08:19 +0000)]
Get rid of __P, the days of K&R support are long past.

20 years agoRemove 'register' keyword while I am here.
Jeroen Ruigrok/asmodai [Sat, 6 Sep 2003 08:10:46 +0000 (08:10 +0000)]
Remove 'register' keyword while I am here.
The days that we could make better guesses about its use than a compiler are
long past us.

Add DragonFly ID to getsubopt.c, heapsort.c, and radixsort.c.

20 years agoFix dependency that long is always 32 bits. This does not work on (I)LP64
Jeroen Ruigrok/asmodai [Sat, 6 Sep 2003 08:00:07 +0000 (08:00 +0000)]
Fix dependency that long is always 32 bits.  This does not work on (I)LP64
platforms.

This works for Itanium and i386, but on x86-64 and sparc64 it gives corrupted
values.

Submitted by: Hiroki Sato, FreeBSD PR 56502

20 years agoIntroduce the DDB_TRACE kernel config option to automatically print a stack
Jeffrey Hsu [Fri, 5 Sep 2003 17:46:54 +0000 (17:46 +0000)]
Introduce the DDB_TRACE kernel config option to automatically print a stack
trace on panic.  Use this in conjuction with DDB_UNATTENDED on machines
with a serial console to get a stack trace and immediately reboot the
machine on a panic.

Merged from FreeBSD-current.

20 years agoAdd a few more build options.
David Rhodus [Fri, 5 Sep 2003 17:44:58 +0000 (17:44 +0000)]
Add a few more build options.

20 years agoOK, fix build, while I am there, I will get some screw for my head
Hiten Pandya [Thu, 4 Sep 2003 23:46:59 +0000 (23:46 +0000)]
OK, fix build, while I am there, I will get some screw for my head
as well...

Reported by: DragonFly BuildBox

Reminded by: David Rhodus

20 years agoFix logic, flow and comments for previous (rev 1.9) change.
Hiten Pandya [Thu, 4 Sep 2003 19:42:12 +0000 (19:42 +0000)]
Fix logic, flow and comments for previous (rev 1.9) change.

Reminded by: Bruce Evans and Alfred Perlstein

20 years agoChange my e-mail.
Hiten Pandya [Thu, 4 Sep 2003 18:56:35 +0000 (18:56 +0000)]
Change my e-mail.

20 years agoI am not certain but I believe this is what was intended, this I do know
Robert Garrett [Wed, 3 Sep 2003 23:51:48 +0000 (23:51 +0000)]
I am not certain but I believe this is what was intended, this I do know
it fixes the generic kernel build.

basically changed

-       events = ap_events &
+       events = ap->a_events &

20 years agoAdding missing '|' from last commit.
Matthew Dillon [Wed, 3 Sep 2003 16:30:12 +0000 (16:30 +0000)]
Adding missing '|' from last commit.

20 years agoCheck when M_PREPEND returns an empty mbuf.
Hiten Pandya [Wed, 3 Sep 2003 14:30:57 +0000 (14:30 +0000)]
Check when M_PREPEND returns an empty mbuf.

This is just toe-dipping.  There are so many instances like this
across the source base that more work needs to be done on it.

I have added /* XXX-MBUF */ comments in places where I could not
add checks for empty mbufs; this is helpful for future work because
it is a potential error point.

It is better to put a comment than panic() messages because it can
be used when the mbuf allocator is rewritten or is taught how to
handle memory starvation situations.

20 years agoPass only one argument to vm_page_hold() as a sane person would do.
Hiten Pandya [Wed, 3 Sep 2003 14:19:06 +0000 (14:19 +0000)]
Pass only one argument to vm_page_hold() as a sane person would do.

Reported by: DragonFly BuildBox

20 years agoFix style nit.
Hiten Pandya [Wed, 3 Sep 2003 13:19:02 +0000 (13:19 +0000)]
Fix style nit.

20 years agoIntroduce a new poll operation bit, `POLLINGIGNEOF'. It is used for
Hiten Pandya [Wed, 3 Sep 2003 12:58:05 +0000 (12:58 +0000)]
Introduce a new poll operation bit, `POLLINGIGNEOF'.  It is used for
ignoring EOFs on a FIFO.  POLLIN/POLLRDNORM is converted withing the
FIFO implementation to effect the correct behaviour.

Yes... POLLINIGNEOF flag name is a bit hard on the eyes. :-(

Obtained from:   FreeBSD

More information: FreeBSD GNATS (PR #34020)

20 years agoReturn a more sane error code, EPIPE. The EBADF error code is
Hiten Pandya [Wed, 3 Sep 2003 11:49:27 +0000 (11:49 +0000)]
Return a more sane error code, EPIPE.  The EBADF error code is
misleading, since we have already got this far, and it's not a
bad file descriptor.

Obtained from: FreeBSD

20 years agoUse vm_page_hold() instead of vm_page_wire().
Hiten Pandya [Wed, 3 Sep 2003 11:47:04 +0000 (11:47 +0000)]
Use vm_page_hold() instead of vm_page_wire().

Obtained from: FreeBSD

20 years agoGeneral cleanup, ANSIfication, and documentation. Prep work for the VFS
Matthew Dillon [Tue, 2 Sep 2003 22:25:04 +0000 (22:25 +0000)]
General cleanup, ANSIfication, and documentation.  Prep work for the VFS
lookup overhaul.  No operational changes.

20 years agoDo a bit of Ansification, add some pmap assertions to catch the
Matthew Dillon [Tue, 2 Sep 2003 20:11:34 +0000 (20:11 +0000)]
Do a bit of Ansification, add some pmap assertions to catch the
improper use of certain pmap functions from an interrupt, similar to
FreeBSD-5, rewrite a number of comments, and surround some of the
pmap functions which manipulate per-cpu CMAPs with critical sections.

20 years agoDifferentiate between send and receive window variables.
Jeffrey Hsu [Tue, 2 Sep 2003 10:05:52 +0000 (10:05 +0000)]
Differentiate between send and receive window variables.

20 years agoAccount for when Limited Transmit is not congestion window limited.
Jeffrey Hsu [Tue, 2 Sep 2003 10:04:47 +0000 (10:04 +0000)]
Account for when Limited Transmit is not congestion window limited.

20 years agoRespect ps_showallprocs when using the Proc file system.
Hiten Pandya [Mon, 1 Sep 2003 01:14:55 +0000 (01:14 +0000)]
Respect ps_showallprocs when using the Proc file system.

Obtained from: FreeBSD GNATS (PR #42065) [needed cleanup]

20 years ago1) Add new tunable, kern.syncdelay:
Hiten Pandya [Mon, 1 Sep 2003 00:35:29 +0000 (00:35 +0000)]
1) Add new tunable, kern.syncdelay:

kern.syncdelay can be used to change the delay time between
file system data synchronization.  This is useful when you
have notebooks.

2) Document the following sysctls:

kern.dirdelay, kern.metadelay and kern.filedelay

20 years ago#include reorganization
David Rhodus [Sun, 31 Aug 2003 21:32:09 +0000 (21:32 +0000)]
#include reorganization

20 years agocleanup: remove register keyword, ANSIze procedure arguments.
Matthew Dillon [Sun, 31 Aug 2003 17:24:40 +0000 (17:24 +0000)]
cleanup: remove register keyword, ANSIze procedure arguments.

20 years agoreq->r_td can be NULL, remove KKASSERT() and fix check.
Matthew Dillon [Sat, 30 Aug 2003 18:49:28 +0000 (18:49 +0000)]
req->r_td can be NULL, remove KKASSERT() and fix check.

20 years agoFix sendfile() bug introduced by the message passing code. The call to
Matthew Dillon [Sat, 30 Aug 2003 18:29:23 +0000 (18:29 +0000)]
Fix sendfile() bug introduced by the message passing code.  The call to
writev() was extracting the return code from the wrong UAP.

20 years agoAdd device identification for Intel 82801EB (ICH5) SMBus Controller.
Hiten Pandya [Sat, 30 Aug 2003 16:57:22 +0000 (16:57 +0000)]
Add device identification for Intel 82801EB (ICH5) SMBus Controller.

20 years agoAdd device indentification for Intel 82801DC (ICH4) SMBus Controller.
Hiten Pandya [Sat, 30 Aug 2003 16:51:43 +0000 (16:51 +0000)]
Add device indentification for Intel 82801DC (ICH4) SMBus Controller.

Obtained from: FreeBSD (rev 1.4 of sys/dev/ichsmb/ichsmb_pci.c)

20 years agoAdd the RIPEMD-160 header file.
Jeroen Ruigrok/asmodai [Sat, 30 Aug 2003 15:21:57 +0000 (15:21 +0000)]
Add the RIPEMD-160 header file.

Obtained from: OpenBSD-CURRENT

20 years agoFix sorta critical bugs in fsdb(8); the @mtime and @atime reporting
Hiten Pandya [Fri, 29 Aug 2003 18:40:03 +0000 (18:40 +0000)]
Fix sorta critical bugs in fsdb(8); the @mtime and @atime reporting
functions used the value of the @ctime field of the on-disk inode.

Obtained from: FreeBSD GNATS (PR #44343)

20 years agoFix vmstat(1) diagnostic output.
Hiten Pandya [Fri, 29 Aug 2003 17:09:33 +0000 (17:09 +0000)]
Fix vmstat(1) diagnostic output.

Submitted by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

20 years agoAt Jeffrey Hsu's suggestion (who follows USENIX papers far more closely the
Matthew Dillon [Thu, 28 Aug 2003 17:24:38 +0000 (17:24 +0000)]
At Jeffrey Hsu's suggestion (who follows USENIX papers far more closely the
I do), change the offset for new allocations out of each new zone we create
in order to spread-out L1/L2 cache use.  Without this new allocations will
tend to front-load the cpu caches resulting in non-optimal memory accesses.

20 years agoFix the case when `-p' option of truss can be passed the pid of
Hiten Pandya [Thu, 28 Aug 2003 02:42:00 +0000 (02:42 +0000)]
Fix the case when `-p' option of truss can be passed the pid of
the truss process itself, thus resulting in a deadlock.

20 years agoAdd a `-q' option to killall(1). This is helpful when you don't
Hiten Pandya [Thu, 28 Aug 2003 02:35:54 +0000 (02:35 +0000)]
Add a `-q' option to killall(1).  This is helpful when you don't
want the nagging `no matching processes blah found' error message.

Obtained from: FreeBSD GNATS (PR #30542)

20 years agoOptimize split(1) by using dynamic allocation for buffers.
Hiten Pandya [Thu, 28 Aug 2003 02:22:38 +0000 (02:22 +0000)]
Optimize split(1) by using dynamic allocation for buffers.

Benchmark:

File: 300M file, 1024k splits

Old: 31.44 real 0.03 user 3.87 sys
New: 28.47 real 0.01 user 4.00 sys

In some cases, I have seen a difference of 10 to 20 for 'real'.

Originated from: FreeBSD GNATS (PR #22442)

20 years agoUse addalias() to track the vnode if it not of a regular type.
Hiten Pandya [Thu, 28 Aug 2003 02:03:18 +0000 (02:03 +0000)]
Use addalias() to track the vnode if it not of a regular type.

This commit fixes the panic that occurs when /dev is mounted
over null, or if any vnode that is not of type VREG is accessed.

20 years agoFix style issue.
Hiten Pandya [Thu, 28 Aug 2003 01:48:18 +0000 (01:48 +0000)]
Fix style issue.

20 years agoAdd two useful macros that I have been meaning to add for quite
Hiten Pandya [Wed, 27 Aug 2003 17:13:22 +0000 (17:13 +0000)]
Add two useful macros that I have been meaning to add for quite
some time.

__cachealign:

The __cachealign macro can be used for cache line aligning structures
of small to medium size.  It aligns the particular structure or
storage type to a system default cache line alignment, thus giving us
a much more better cache utilization by making the hardware work at
its best burst speeds.

__usereg:

The __usereg macro can/should be used when a function contains
arguments not more than 3.  It can be very useful to us due to the
message-passing nature of the kernel.

NOTE: I have not modified any other source files to make use of this
macro yet.  After I do some analysis, headers in sys/ which contain
small to medium sized structures will be modified to use the
__cachealign macro.

NOTE: No source files have been modified to make use of the __usereg
macro yet.  This process can be automated, because the maximum number
of arguments that apply to this macro is 3.

Reviewed by: Matt

20 years agooops. Forgot a commit.
Matthew Dillon [Wed, 27 Aug 2003 15:55:18 +0000 (15:55 +0000)]
oops.  Forgot a commit.

20 years agoRemove `YOUR'.
Hiten Pandya [Wed, 27 Aug 2003 13:49:39 +0000 (13:49 +0000)]
Remove `YOUR'.

20 years agoAdd USE_SLAB_ALLOCATOR into the config.
David Rhodus [Wed, 27 Aug 2003 13:27:47 +0000 (13:27 +0000)]
Add USE_SLAB_ALLOCATOR into the config.

20 years agofinal __P removal commit
Robert Garrett [Wed, 27 Aug 2003 11:42:34 +0000 (11:42 +0000)]
final __P removal commit
there gone....

20 years agofix __P
Robert Garrett [Wed, 27 Aug 2003 11:39:32 +0000 (11:39 +0000)]
fix __P

20 years agofix typo from adding $DragonFly$ keyword
Robert Garrett [Wed, 27 Aug 2003 11:09:52 +0000 (11:09 +0000)]
fix typo from adding $DragonFly$ keyword

20 years agoremove oldstyle __P prototypes
Robert Garrett [Wed, 27 Aug 2003 11:02:14 +0000 (11:02 +0000)]
remove oldstyle __P prototypes

20 years agoremove old ___P() prototypes
Robert Garrett [Wed, 27 Aug 2003 10:59:04 +0000 (10:59 +0000)]
remove old ___P() prototypes

20 years agoremove __P
Robert Garrett [Wed, 27 Aug 2003 10:47:13 +0000 (10:47 +0000)]
remove __P

20 years agoremove __P() from this directory
Robert Garrett [Wed, 27 Aug 2003 10:35:18 +0000 (10:35 +0000)]
remove __P() from this directory

20 years ago__P!= wanted
Robert Garrett [Wed, 27 Aug 2003 09:38:33 +0000 (09:38 +0000)]
__P!= wanted

20 years agoCleanup some debugging junk and fix a bug in the M_ZERO optimization code.
Matthew Dillon [Wed, 27 Aug 2003 07:00:27 +0000 (07:00 +0000)]
Cleanup some debugging junk and fix a bug in the M_ZERO optimization code.

20 years agolets go ahead and commit this before we hit the network interfaces
Robert Garrett [Wed, 27 Aug 2003 06:48:15 +0000 (06:48 +0000)]
lets go ahead and commit this before we hit the network interfaces
__P removal

20 years ago__P removal
Robert Garrett [Wed, 27 Aug 2003 06:30:04 +0000 (06:30 +0000)]
__P removal

20 years ago__P removal
Robert Garrett [Wed, 27 Aug 2003 06:07:11 +0000 (06:07 +0000)]
__P removal

20 years agoAdjust our kvm based utilities to use the _KERNEL_STRUCTURES define
Matthew Dillon [Wed, 27 Aug 2003 03:21:50 +0000 (03:21 +0000)]
Adjust our kvm based utilities to use the _KERNEL_STRUCTURES define
instead of _KERNEL to access kernel header files.

20 years agoA significant number of applications need access to kernel data
Matthew Dillon [Wed, 27 Aug 2003 02:03:23 +0000 (02:03 +0000)]
A significant number of applications need access to kernel data
structures.  Traditionally they have done a #define _KERNEL and
then #include'd the files.  Unfortunately this can create huge
conflicts between libc declarations and kernel declarations.  Also,
every time we create a new dependancy between kernel includes we might
windup causing another unexpected header file to be included into such
a user program, causing its build to fail due to a conflict.

This commit introduces _KERNEL_STRUCTURES.  A user program which needs
access to kernel data structures sets this instead of _KERNEL.  This
define will cause the kernel data structure but not the inlines or
extern's to be brought in.

Only those header files which directly impact buildworld have been
modified so far, but the intent is for all significant kernel header files
to use this feature.

20 years agoSLAB ALLOCATOR Stage 1. This brings in a slab allocator written from scratch
Matthew Dillon [Wed, 27 Aug 2003 01:43:08 +0000 (01:43 +0000)]
SLAB ALLOCATOR Stage 1.  This brings in a slab allocator written from scratch
by your's truely.  A detailed explanation of the allocator is included but
first, other changes:

* Instead of having vm_map_entry_insert*() and friends allocate the
  vm_map_entry structures a new mechanism has been emplaced where by
  the vm_map_entry structures are reserved at a higher level, then
  expected to exist in the free pool in deep vm_map code.  This preliminary
  implementation may eventually turn into something more sophisticated that
  includes things like pmap entries and so forth.  The idea is to convert
  what should be low level routines (VM object and map manipulation)
  back into low level routines.

* vm_map_entry structure are now per-cpu cached, which is integrated into
  the the reservation model above.

* The zalloc 'kmapentzone' has been removed.  We now only have 'mapentzone'.

* There were race conditions between vm_map_findspace() and actually
  entering the map_entry with vm_map_insert().  These have been closed
  through the vm_map_entry reservation model described above.

* Two new kernel config options now work.  NO_KMEM_MAP has been fleshed out
  a bit more and a number of deadlocks related to having only the kernel_map
  now have been fixed.  The USE_SLAB_ALLOCATOR option will cause the kernel
  to compile-in the slab allocator instead of the original malloc allocator.
  If you specify USE_SLAB_ALLOCATOR you must also specify NO_KMEM_MAP.

* vm_poff_t and vm_paddr_t integer types have been added.  These are meant
  to represent physical addresses and offsets (physical memory might be
  larger then virtual memory, for example Intel PAE).  They are not heavily
  used yet but the intention is to separate physical representation from
  virtual representation.

    SLAB ALLOCATOR FEATURES

The slab allocator breaks allocations up into approximately 80 zones based
on their size.  Each zone has a chunk size (alignment).  For example, all
allocations in the 1-8 byte range will allocate in chunks of 8 bytes.  Each
size zone is backed by one or more blocks of memory.  The size of these
blocks is fixed at ZoneSize, which is calculated at boot time to be between
32K and 128K.  The use of a fixed block size allows us to locate the zone
header given a memory pointer with a simple masking operation.

The slab allocator operates on a per-cpu basis.  The cpu that allocates a
zone block owns it.  free() checks the cpu that owns the zone holding the
memory pointer being freed and forwards the request to the appropriate cpu
through an asynchronous IPI.  This request is not currently optimized but it
can theoretically be heavily optimized ('queued') to the point where the
overhead becomes inconsequential.  As of this commit the malloc_type
information is not MP safe, but the core slab allocation and deallocation
algorithms, non-inclusive the having to allocate the backing block,
*ARE* MP safe.  The core code requires no mutexes or locks, only a critical
section.

Each zone contains N allocations of a fixed chunk size.  For example, a
128K zone can hold approximately 16000 or so 8 byte allocations.  The zone
is initially zero'd and new allocations are simply allocated linearly out
of the zone.  When a chunk is freed it is entered into a linked list and
the next allocation request will reuse it.  The slab allocator heavily
optimizes M_ZERO operations at both the page level and the chunk level.

The slab allocator maintains various undocumented malloc quirks such as
ensuring that small power-of-2 allocations are aligned to their size,
and malloc(0) requests are also allowed and return a non-NULL result.
kern_tty.c depends heavily on the power-of-2 alignment feature and ahc
depends on the malloc(0) feature.  Eventually we may remove the malloc(0)
feature.

    PROBLEMS AS OF THIS COMMIT

NOTE!  This commit may destabilize the kernel a bit.  There are issues
with the ISA DMA area ('bounce' buffer allocation) due to the large backing
block size used by the slab allocator and there are probably some deadlock
issues do to the removal of kmem_map that have not yet been resolved.

20 years agoThe game rogue(6) has a potential buffer overflow allowing
David Rhodus [Tue, 26 Aug 2003 23:52:50 +0000 (23:52 +0000)]
The game rogue(6) has a potential buffer overflow allowing
the attacker to gain gid games.

In addition, it includes a spelling fix.

20 years agowhat the heck one last one before i go take a nap...
Robert Garrett [Tue, 26 Aug 2003 21:42:19 +0000 (21:42 +0000)]
what the heck one last one before i go take a nap...

remove __P(); from the i386 directory

20 years agoM_PREPEND() can fail, meaning the returned mbuf
David Rhodus [Tue, 26 Aug 2003 21:32:57 +0000 (21:32 +0000)]
M_PREPEND() can fail, meaning the returned mbuf
can be NULL. Check for NULL in rip_output()
when prepending an IP header. This prevents
mbuf exhaustion from causing a kernel panic
when sending raw IP packets.

20 years ago__P() removal
Robert Garrett [Tue, 26 Aug 2003 21:09:02 +0000 (21:09 +0000)]
__P() removal

20 years ago__P(); not anymore in this directory
Robert Garrett [Tue, 26 Aug 2003 21:00:17 +0000 (21:00 +0000)]
__P(); not anymore in this directory

20 years ago__P() removal
Robert Garrett [Tue, 26 Aug 2003 20:49:49 +0000 (20:49 +0000)]
__P() removal

20 years agoRemove additional KKASSERT(p)'s that we do not need (fixes lint)
Matthew Dillon [Tue, 26 Aug 2003 08:28:25 +0000 (08:28 +0000)]
Remove additional KKASSERT(p)'s that we do not need (fixes lint)

20 years agoRemove unnecessary KKASSERT(p) checks for procedures which do not need
Matthew Dillon [Tue, 26 Aug 2003 05:30:29 +0000 (05:30 +0000)]
Remove unnecessary KKASSERT(p) checks for procedures which do not need
curproc.

20 years agoAdd the TINDERBOX kernel configuration file.
Hiten Pandya [Tue, 26 Aug 2003 04:00:38 +0000 (04:00 +0000)]
Add the TINDERBOX kernel configuration file.

Developers should feel free to add options into this file, which
they would like tested out by the DragonFly Tinderbox system.

In the future, it will allow us to maintain the build, by testing
the options in this file first, and then adding them to mainstream
GENERIC configuration file.

20 years agoRemove the documentation/ folder from under 'src' tree.
Hiten Pandya [Tue, 26 Aug 2003 03:03:41 +0000 (03:03 +0000)]
Remove the documentation/ folder from under 'src' tree.

Documentation related stuff will now live in the doc/ tree.
The contents of the src/documentation/ folder has been moved
to the doc/notes folder.

20 years agochange vn device from old style raw device to block device.
Robert Garrett [Mon, 25 Aug 2003 20:17:25 +0000 (20:17 +0000)]
change vn device from old style raw device to block device.
Submitted by: simon

20 years agoAdd the NO_KMEM_MAP kernel configuration option. This is a temporary option
Matthew Dillon [Mon, 25 Aug 2003 19:50:33 +0000 (19:50 +0000)]
Add the NO_KMEM_MAP kernel configuration option.  This is a temporary option
that will allow developers to test kmem_map removal and also the upcoming
(not this commit) slab allocator.  Currently this option removes kmem_map
and causes the malloc and zalloc subsystems to use kernel_map exclusively.

Change gd_intr_nesting_level.  This variable is now only bumped while we
are in a FAST interrupt or processing an IPIQ message.  This variable is
not bumped while we are in a normal interrupt or software interrupt thread.

Add warning printf()s if malloc() and related functions detect attempts to
use them from within a FAST interrupt or IPIQ.

Remove references to the no-longer-used zalloci() and zfreei() functions.

20 years agoAdd the 'eatmem' utility. eatmem is a memory stressor.
Matthew Dillon [Mon, 25 Aug 2003 19:41:00 +0000 (19:41 +0000)]
Add the 'eatmem' utility.  eatmem is a memory stressor.

20 years agoRemove now unused proc p variables.
Matthew Dillon [Mon, 25 Aug 2003 18:48:14 +0000 (18:48 +0000)]
Remove now unused proc p variables.

20 years agoAdd an alignment feature to vm_map_findspace(). This feature will be used
Matthew Dillon [Mon, 25 Aug 2003 17:01:13 +0000 (17:01 +0000)]
Add an alignment feature to vm_map_findspace().  This feature will be used
primarily by the upcoming slab allocator but has many applications.

Use the alignment feature in the buffer cache to hopefully reduce
fragmentation.

20 years agoAdd support for Protocol Independent Multicast.
Jeffrey Hsu [Sun, 24 Aug 2003 23:16:53 +0000 (23:16 +0000)]
Add support for Protocol Independent Multicast.

Submitted to FreeBSD by: Pavlin Radoslavov <pavlin@icir.org>

20 years agoAdd support for Protocol Independent Multicast.
Jeffrey Hsu [Sun, 24 Aug 2003 23:07:08 +0000 (23:07 +0000)]
Add support for Protocol Independent Multicast.

Submitted to FreeBSD by: Pavlin Radoslavov <pavlin@icir.org>

20 years agoFix typos in comments.
Jeffrey Hsu [Sun, 24 Aug 2003 22:36:43 +0000 (22:36 +0000)]
Fix typos in comments.