19 years agoRemove some __P macros in sbin that my script missed.
Eirik Nygaard [Mon, 3 Nov 2003 19:51:05 +0000 (19:51 +0000)]
Remove some __P macros in sbin that my script missed.

Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>

19 years agoRemove __P macros from src/usr.bin and src/usr.sbin.
Eirik Nygaard [Mon, 3 Nov 2003 19:31:44 +0000 (19:31 +0000)]
Remove __P macros from src/usr.bin and src/usr.sbin.

Reviewed by: David Rhodus <drhodus@catpa.com> and
             Matthew Dillon <dillon@apollo.backplane.com>

19 years agoAdd some missing $DragonFly$ keywords.
Eirik Nygaard [Mon, 3 Nov 2003 19:14:37 +0000 (19:14 +0000)]
Add some missing $DragonFly$ keywords.

Reviewed by: Jeroen Ruigrok <asmodai@wxs.nl>

19 years agoFix a minor compile-time bug introduced in 1.22 when DEBUG_VFS_LOCKS is
Matthew Dillon [Mon, 3 Nov 2003 18:49:23 +0000 (18:49 +0000)]
Fix a minor compile-time bug introduced in 1.22 when DEBUG_VFS_LOCKS is
turned on.

19 years agoDo a minor update of getconf to deal with the addition of intmax_t and
Matthew Dillon [Mon, 3 Nov 2003 17:15:31 +0000 (17:15 +0000)]
Do a minor update of getconf to deal with the addition of intmax_t and
friends in the 64 bit address cleanup commit.

19 years agoDo a minor update of Groff to deal with the addition of intmax_t and
Matthew Dillon [Mon, 3 Nov 2003 17:15:26 +0000 (17:15 +0000)]
Do a minor update of Groff to deal with the addition of intmax_t and
friends in the 64 bit address cleanup commit.

19 years ago64 bit address space cleanups which are a prerequisit for future 64 bit
Matthew Dillon [Mon, 3 Nov 2003 17:11:23 +0000 (17:11 +0000)]
64 bit address space cleanups which are a prerequisit for future 64 bit
address space work and PAE.  Note: this is not PAE.  This patch basically
adds vm_paddr_t, which represents a 'physical address'.  Physical addresses
may be larger then virtual addresses and on IA32 we make vm_paddr_t a 64
bit quantity.

Submitted-by: Hiten Pandya <hmp@backplane.com>
19 years agoSplit wait4(), setrlimit(), getrlimit(), statfs(), fstatfs(), chdir(),
David P. Reese, Jr. [Mon, 3 Nov 2003 15:57:34 +0000 (15:57 +0000)]
Split wait4(), setrlimit(), getrlimit(), statfs(), fstatfs(), chdir(),
open(), mknod(), link(), symlink(), unlink(), lseek(), access(), stat(),
lstat(), readlink(), chmod(), chown(), lchown(), utimes(), lutimes(),
futimes(), truncate(), rename(), mkdir(), rmdir(), getdirentries(),

Trash the 4.3BSD numeric filesystem type support in mount().

Move ocreat(), olseek(), otruncate(), ostat(), olstat(), owait(),
ogetrlimit(), and osetrlimit() to the 43bsd subtree and reimplement
using split syscalls.  Move ogetdirentries() to the subtree without
change because it is such a mess.

Convince linux_waitpid(), linux_wait(), linux_setrlimit(),
linux_old_getrlimit(), and linux_getrlimit() to use split syscalls.

The file kern/vfs_syscalls.c is now completely free of COMPAT_43 code.
I believe that execve() is the only pending split before I can tackle
stackgap usage in the linux emulator's CHECKALT{EXIST,CREAT}() macros.

19 years agoAugment the LWKT thread creation APIs to allow a cpu to be specified. This
Matthew Dillon [Mon, 3 Nov 2003 02:08:38 +0000 (02:08 +0000)]
Augment the LWKT thread creation APIs to allow a cpu to be specified.  This
will be used by upcoming netisr and interrupt thread work to create protocol
and interrupt threads on specified cpus rather then cpu #0.

19 years agoBetter documentation of the MP lock state for new threads.
Matthew Dillon [Mon, 3 Nov 2003 00:39:07 +0000 (00:39 +0000)]
Better documentation of the MP lock state for new threads.

19 years ago* Nuke ~771 __P()'s from our tree.
David Rhodus [Sat, 1 Nov 2003 17:16:02 +0000 (17:16 +0000)]
* Nuke ~771 __P()'s from our tree.

Work sent-in by: Eirik Nygaard <eirikn@kerneled.com>

19 years agoRemove the matching for the host to PCI bridge, since this is actually
Jeroen Ruigrok/asmodai [Fri, 31 Oct 2003 22:00:13 +0000 (22:00 +0000)]
Remove the matching for the host to PCI bridge, since this is actually
an AGP controller/host to PCI bridge and thus gets dealt with in a
different way.

19 years agoAdd identifier for the nForce2 PCI to ISA bridge.
Jeroen Ruigrok/asmodai [Fri, 31 Oct 2003 21:51:23 +0000 (21:51 +0000)]
Add identifier for the nForce2 PCI to ISA bridge.

19 years agoAdd nForce AGP support, taken from FreeBSD with some minor changes to get
Jeroen Ruigrok/asmodai [Fri, 31 Oct 2003 21:49:23 +0000 (21:49 +0000)]
Add nForce AGP support, taken from FreeBSD with some minor changes to get
it to work with DragonFly.

19 years agoProperly detect and print the nForce2 Host to PCI bridge and PCI-PCI
Jeroen Ruigrok/asmodai [Fri, 31 Oct 2003 21:12:07 +0000 (21:12 +0000)]
Properly detect and print the nForce2 Host to PCI bridge and PCI-PCI

19 years agoChange # comments to /* */ equivalents.
Jeroen Ruigrok/asmodai [Fri, 31 Oct 2003 13:53:02 +0000 (13:53 +0000)]
Change # comments to /* */ equivalents.

Idea submitted by: Craig Dooley <cd5697@albany.edu>

19 years agoGet rid of DDB, INVARIANTS, and INVARIANT_SUPPORT in the boot floppies.
Jeroen Ruigrok/asmodai [Thu, 30 Oct 2003 07:14:18 +0000 (07:14 +0000)]
Get rid of DDB, INVARIANTS, and INVARIANT_SUPPORT in the boot floppies.

19 years agoMake our manual pages report that they are part of DragonFly.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 18:13:47 +0000 (18:13 +0000)]
Make our manual pages report that they are part of DragonFly.

Assumption that our first release will be called 1.0.

19 years agoChange 'nvidianf2' to 'nforce2' to be more explanatory.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 07:30:37 +0000 (07:30 +0000)]
Change 'nvidianf2' to 'nforce2' to be more explanatory.

19 years agoAdd the NVIDIA nForce3 chipset.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 07:28:36 +0000 (07:28 +0000)]
Add the NVIDIA nForce3 chipset.

19 years agoAdd NVIDIA nForce3 OHCI USB support.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 07:28:10 +0000 (07:28 +0000)]
Add NVIDIA nForce3 OHCI USB support.

19 years agoAdd a bunch of Intel USB controllers.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 06:54:49 +0000 (06:54 +0000)]
Add a bunch of Intel USB controllers.

19 years agoAdd the AMD-766, Apple KeyLargo, and SiS 5571.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 06:50:15 +0000 (06:50 +0000)]
Add the AMD-766, Apple KeyLargo, and SiS 5571.

19 years agoReorder to alphabetical order.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 06:47:30 +0000 (06:47 +0000)]
Reorder to alphabetical order.

19 years agoAdd NVIDIA's nForce2.
Jeroen Ruigrok/asmodai [Tue, 28 Oct 2003 06:46:45 +0000 (06:46 +0000)]
Add NVIDIA's nForce2.

19 years agoDeal with multicast packets in a manner similar to Solaris, RFC 3376, and
Matthew Dillon [Tue, 28 Oct 2003 03:51:51 +0000 (03:51 +0000)]
Deal with multicast packets in a manner similar to Solaris, RFC 3376, and
draft-ietf-magma-msf-api-05.txt.   Multicast packets are not sent to
multicast-unaware sockets or to sockets not bound to the interface the
packet came in on.

The sysctl net.inet.udp.strict_mcast_mship enables the new requirements
by default.  Original operation may be recovered by setting the sysctl to 0.

There is a relatively minor scaling issue with the per-PCB membership
array scan, which is linear.  It is not a show stopper though.

Submitted by: "William A. Carrel" <william.a@carrel.org>
Reviewed by: Jeffrey Hsu <hsu@FreeBSD.org>, dillon

19 years agoAdd OHCI support for the NVIDIA nForce 2 chipset.
Jeroen Ruigrok/asmodai [Mon, 27 Oct 2003 21:39:27 +0000 (21:39 +0000)]
Add OHCI support for the NVIDIA nForce 2 chipset.

FreeBSD PR: kern/47311
Submitted by: Mike Hibler <mike@cs.utah.edu>

19 years agoAllow NVIDIA's nForce 2 chipset to use proper ATA DMA modes.
Jeroen Ruigrok/asmodai [Mon, 27 Oct 2003 21:12:29 +0000 (21:12 +0000)]
Allow NVIDIA's nForce 2 chipset to use proper ATA DMA modes.

FreeBSD PR: kern/47311
Submitted by: Mike Hibler <mike@cs.utah.edu>

19 years agoFix a bug introduced when I redid the stray interrupt arary. The
Matthew Dillon [Mon, 27 Oct 2003 16:42:17 +0000 (16:42 +0000)]
Fix a bug introduced when I redid the stray interrupt arary.  The
initial loading of the vectors by isa_defaultirq() wound up being a nop
because I broke the intr_handler[] check in icu_unset().  This caused
stray interrupts doing boot (e.g. a stray irq 7 / printer interrupt being
the most common) to generate trap 30's and drop into DDB on boot.

Mucho Thanks to: David Rhodus <drhodus@catpa.com>

19 years agoBackout last commit, oops! SIGCKPT had already been added and it was redundant.
Matthew Dillon [Mon, 27 Oct 2003 15:31:19 +0000 (15:31 +0000)]
Backout last commit, oops! SIGCKPT had already been added and it was redundant.

19 years agoRemove unneeded XXX, to rename lwkt_create() as it was named
Hiten Pandya [Sun, 26 Oct 2003 13:59:58 +0000 (13:59 +0000)]
Remove unneeded XXX, to rename lwkt_create() as it was named
lwkt_create() since rev 1.6.

19 years agoSimplify the lazy-release code for P_CURPROC, removing the TDF_RUNQ
Matthew Dillon [Sat, 25 Oct 2003 17:39:22 +0000 (17:39 +0000)]
Simplify the lazy-release code for P_CURPROC, removing the TDF_RUNQ
optimization because it wasn't actually getting hit often enough to matter.

19 years agoAdd a DEBUG_INTERRUPTS option for debugging unexpected (trap 30) interrupts.
Matthew Dillon [Sat, 25 Oct 2003 17:36:22 +0000 (17:36 +0000)]
Add a DEBUG_INTERRUPTS option for debugging unexpected (trap 30) interrupts.
This might be useful in the upcoming AMD64 port as well so it's worth

19 years agoFix two bugs in split in split revealed after my optimization in
Hiten Pandya [Sat, 25 Oct 2003 14:14:52 +0000 (14:14 +0000)]
Fix two bugs in split in split revealed after my optimization in
last revision of this file.

Check for new file at the beginning and not at the end to avoid
the internal buffer getting confused.

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

19 years agoInterrupt threads could block in free waiting for kernel_map(). Add a
Matthew Dillon [Sat, 25 Oct 2003 00:48:03 +0000 (00:48 +0000)]
Interrupt threads could block in free waiting for kernel_map().  Add a
check for TDF_INTTHREAD to avoid this scenario.  This makes free() compatible
with assumptions made by softupdates().

19 years agoFix type-o's, minor documentation update.
Matthew Dillon [Fri, 24 Oct 2003 17:47:51 +0000 (17:47 +0000)]
Fix type-o's, minor documentation update.

Submitted-by: Eirik Nygaard <eirikn@kerneled.com>
19 years agoHonor MODULES_OVERRIDE if defined.
Matthew Dillon [Fri, 24 Oct 2003 17:22:15 +0000 (17:22 +0000)]
Honor MODULES_OVERRIDE if defined.

Submitted-by: Skip Ford <skip.ford@verizon.net>
19 years agoThis is FreeBSD 5.x's code to dump the kernel's identifier through
Matthew Dillon [Fri, 24 Oct 2003 17:19:16 +0000 (17:19 +0000)]
This is FreeBSD 5.x's code to dump the kernel's identifier through
either the 'kern.ident' oid or with uname -i.

Submitted-by: Skip Ford <skip.ford@verizon.net>
19 years agoAdd SIGCKPT support to tcsh's built-in kill.
Matthew Dillon [Fri, 24 Oct 2003 17:14:14 +0000 (17:14 +0000)]
Add SIGCKPT support to tcsh's built-in kill.

Submitted-by: Emiel Kollof <coolvibe@hackerheaven.org>
19 years agoRemove the FreeBSD 3.x signal code. This includes osendsig(),
David P. Reese, Jr. [Fri, 24 Oct 2003 14:10:46 +0000 (14:10 +0000)]
Remove the FreeBSD 3.x signal code.  This includes osendsig(),
osigreturn() and a couple of structures that these syscalls depended

Split the sigaction(), sigprocmask(), sigpending(), sigsuspend(),
sigaltstack() and kill() syscalls.

Move the 4.3BSD signal syscalls osigvec(), osigblock(), osigsetmask(),
osigstack() and okillpg() to the 43bsd subtree.  I'm not too sure
if these will even work with the FreeBSD-4 signal trampoline code,
but they do compile and link.

Implement linux_signal(), linux_rt_sigaction(), linux_sigprocmask(),
linux_rt_sigprocmask(), linux_sigpending(), linux_kill(),
linux_sigaction(), linux_sigsuspend(), linux_rt_sigsuspend(),
linux_pause(), and linux_sigaltstack() with the new in-kernel syscalls.
This patch kills 7 stackgap allocations in the Linuxolator.

19 years agoHook i386/vesa up to the module build
Matthew Dillon [Thu, 23 Oct 2003 17:32:54 +0000 (17:32 +0000)]
Hook i386/vesa up to the module build

19 years agomakesyscalls.sh wants comments to be on their own line. Move the Checkpoint
David P. Reese, Jr. [Thu, 23 Oct 2003 00:04:58 +0000 (00:04 +0000)]
makesyscalls.sh wants comments to be on their own line.  Move the Checkpoint
comment to its own line.

19 years ago* Un-break buildworld
David Rhodus [Wed, 22 Oct 2003 17:00:53 +0000 (17:00 +0000)]
* Un-break buildworld

19 years agoMSGF_DONE needs to be cleared when a message is to be handled asynchronously.
Matthew Dillon [Wed, 22 Oct 2003 01:01:16 +0000 (01:01 +0000)]
MSGF_DONE needs to be cleared when a message is to be handled asynchronously.
Nobody uses lwkt_waitmsg() yet so the bug didn't effect anything.

Noticed-by: Galen Sampson <galen_sampson@yahoo.com>
19 years agoAdd support for SIGCKPT to csh/tcsh's internal 'kill' command.
Matthew Dillon [Wed, 22 Oct 2003 01:00:16 +0000 (01:00 +0000)]
Add support for SIGCKPT to csh/tcsh's internal 'kill' command.

Submitetd-by: Kenneth Culver <culverk@sweetdreamsracing.biz>
19 years agoUse sys_nsig instead of NSIG so libc-suspplied arrays match up.
Matthew Dillon [Wed, 22 Oct 2003 00:51:15 +0000 (00:51 +0000)]
Use sys_nsig instead of NSIG so libc-suspplied arrays match up.

19 years agoFix bug in last commit, flags were not being passed to fo_write() which
Matthew Dillon [Tue, 21 Oct 2003 20:06:47 +0000 (20:06 +0000)]
Fix bug in last commit, flags were not being passed to fo_write() which
broke pwrite().  This caused samba to stop working (amoung other things).

Samba problem reported by: David Rhodus <drhodus@catpa.com>

19 years agoA hackish fix to a bug uio_yield().
Matthew Dillon [Tue, 21 Oct 2003 04:14:58 +0000 (04:14 +0000)]
A hackish fix to a bug uio_yield().

19 years agoCreate the kern_fstat() and kern_ftruncate() in-kernel syscalls.
David P. Reese, Jr. [Tue, 21 Oct 2003 01:05:09 +0000 (01:05 +0000)]
Create the kern_fstat() and kern_ftruncate() in-kernel syscalls.

Implement fstat(), nfstat() and ftruncate() using the in-kernel syscalls.

Move ofstat() and oftruncate() to the 43bsd emulation tree and implement
with in-kernel syscalls.

Create the linux_ftruncate() syscall in the linux emulation layer.  This
replaces a direct use of oftruncate() in the linux syscall map.  Rewrite
linux_newfstat() and linux_fstat64() with the in-kernel syscalls.

19 years agoYah yah. Always good to commit the header file needed for the last fix.
Matthew Dillon [Mon, 20 Oct 2003 16:50:39 +0000 (16:50 +0000)]
Yah yah.  Always good to commit the header file needed for the last fix.

19 years agoFix a bug introduced by recent INVARIANTS debugging additions, sometimes
Matthew Dillon [Mon, 20 Oct 2003 16:09:00 +0000 (16:09 +0000)]
Fix a bug introduced by recent INVARIANTS debugging additions, sometimes
the first word of M_ZERO'd memory isn't zero'd.

19 years agoFix an error message.
Matthew Dillon [Mon, 20 Oct 2003 07:01:05 +0000 (07:01 +0000)]
Fix an error message.

19 years agoDo a bit of cleanup and add a bit of debugging to the checkpoint module.
Matthew Dillon [Mon, 20 Oct 2003 06:50:51 +0000 (06:50 +0000)]
Do a bit of cleanup and add a bit of debugging to the checkpoint module.

Fix a bug in the offset calculations in the ELF checkpoint file descriptor
writeout code... one loop was skipping descriptors 0,1,2, another loop
was not.  This bug had prevented 'primes' from being properly checkpointed.

19 years agoAdd the checkpt module to the system tree. Currently this may only be
Matthew Dillon [Mon, 20 Oct 2003 04:48:42 +0000 (04:48 +0000)]
Add the checkpt module to the system tree.  Currently this may only be
loaded as a module, not configured into the kernel directly.

19 years agoAdditional checkpoint suppor for vmspace info. In particular, the data size
Matthew Dillon [Mon, 20 Oct 2003 04:47:35 +0000 (04:47 +0000)]
Additional checkpoint suppor for vmspace info.  In particular, the data size
is used by sbrk and must be restored for programs to work properly.

19 years agoAdd the 'checkpt' utility to support the process checkpoint module. This
Matthew Dillon [Mon, 20 Oct 2003 04:46:14 +0000 (04:46 +0000)]
Add the 'checkpt' utility to support the process checkpoint module.  This
originated from Kip Macy with cleanups and modifications by Matt Dillon.

Note: currently i386-specific.  The system calls have not been integrated
into libc yet.

Submitted-by: Kip Macy <kmacy@fsmware.com>
19 years agoAdd the 'checkpt' utility to support the process checkpoint module. This
Matthew Dillon [Mon, 20 Oct 2003 04:45:54 +0000 (04:45 +0000)]
Add the 'checkpt' utility to support the process checkpoint module.  This
originated from Kip Macy with cleanups and modifications by Matt Dillon.

Submitted-by: Kip Macy <kmacy@fsmware.com>
19 years agoAdd a fp_vpopen() function to kern_fp.c, and add reserved fields to
Matthew Dillon [Sun, 19 Oct 2003 23:23:29 +0000 (23:23 +0000)]
Add a fp_vpopen() function to kern_fp.c, and add reserved fields to
various checkpoint structures.

19 years agoUn-initialise (i.e free) the HPFS inode hash; previously, unloading
Hiten Pandya [Sun, 19 Oct 2003 21:24:55 +0000 (21:24 +0000)]
Un-initialise (i.e free) the HPFS inode hash; previously, unloading
the HPFS module led to stray number of bytes still being allocated.
32K almost.

Related to:

   malloc_uninit: 32768 bytes of 'HPFS hphash' still allocated on cpu0

19 years agoEnhance the fp_*() API. Reorganize the ELF dump code using the fp_*()
Matthew Dillon [Sun, 19 Oct 2003 19:24:20 +0000 (19:24 +0000)]
Enhance the fp_*() API.  Reorganize the ELF dump code using the fp_*()
API and adding hooks to make checkpointing easier.

Submitted-by: Kip Macy <kmacy@fsmware.com>
19 years agoFix the INVARIANTS memuse test, the memuse for each cpu must be aggregated
Matthew Dillon [Sun, 19 Oct 2003 18:18:50 +0000 (18:18 +0000)]
Fix the INVARIANTS memuse test, the memuse for each cpu must be aggregated
and the final total used.  Array entries cannot be used individually.

19 years agoFix a ``missing free''.
Hiten Pandya [Sun, 19 Oct 2003 18:11:37 +0000 (18:11 +0000)]
Fix a ``missing free''.

The NTFS Inode hashing code did not free the inode hash, which caused
the following warning at unload time.  This is only noticed when NTFS
is loaded as a KLD module:

   malloc_uninit: 32768 bytes of 'NTFS nthash' still allocated on cpu0

Use vfs_uninit() entry point to solve this issue, by calling (new)
ntfs_nthash_uninit() function to release the NT inode hash.

19 years agoUnravel a nested conditional.
Jeffrey Hsu [Sun, 19 Oct 2003 05:19:21 +0000 (05:19 +0000)]
Unravel a nested conditional.
Same as FreeBSD rev 1.185.

19 years agoEntirely remove the old kernel malloc and kmem_map code. The slab allocator
Matthew Dillon [Sun, 19 Oct 2003 00:23:30 +0000 (00:23 +0000)]
Entirely remove the old kernel malloc and kmem_map code.  The slab allocator
is now mandatory.  Also remove the related conf options, USE_KMEM_MAP and

19 years agoHack up param.h even more so sys/socket.h can include portions of it without
Matthew Dillon [Sun, 19 Oct 2003 00:13:18 +0000 (00:13 +0000)]
Hack up param.h even more so sys/socket.h can include portions of it without
polluting the namespace (like it did before), but without preventing another
header or source file from including it directly, as well.

19 years agoDon't try to call an ipiq function with a UP build when the cpuid doesn't
Matthew Dillon [Sat, 18 Oct 2003 23:59:58 +0000 (23:59 +0000)]
Don't try to call an ipiq function with a UP build when the cpuid doesn't
match, panic instead.

19 years agoAdd the pim(4) and multicast(4) manual pages, following
Hiten Pandya [Sat, 18 Oct 2003 21:40:41 +0000 (21:40 +0000)]
Add the pim(4) and multicast(4) manual pages, following
Jeffrey Hsu's recent addition of the Protocol Independent Multicasting

Both manual pages by: Pavlin Radoslavov <pavlin@icir.org>

19 years agoRemove a diagnostic message that detected PHOLD() vs exit()/process-reaping
Matthew Dillon [Sat, 18 Oct 2003 20:41:08 +0000 (20:41 +0000)]
Remove a diagnostic message that detected PHOLD() vs exit()/process-reaping
races.  The races are handled just fine, the message was just to see if they
could even occur (and they can).

19 years agoFix races in ihashget that were introduced when I introduced the
Matthew Dillon [Sat, 18 Oct 2003 20:15:10 +0000 (20:15 +0000)]
Fix races in ihashget that were introduced when I introduced the
lwkt_gettoken() API to interlock the vnode and hash table ops.

Report-by: David Rhodus.
19 years agoUpdate sysinstall's NFS module:
Hiten Pandya [Sat, 18 Oct 2003 20:12:26 +0000 (20:12 +0000)]
Update sysinstall's NFS module:

* Add ability to select NFSv3 version (default)

* Add ability to use TCP as protocol.  TCP is
  not made default to retain automatic compatiblity
  with a wider range of NFS servers.

* Fix argument processing in mediaInitNFS(), variable_get()
  cannot be used in a conditional statement because it returns
  a "char *" string; instead, use variable_cmp().

* Update I/O block sizes in the case when NFS_SLOW is not
  set to "YES".  Previously, the NFS_SLOW case had a bigger
  block size than the fast case which defaulted to 512b,
  whereas the former was 1024.  The new block size used is
  4096, which is reasonable for the lowest of connection

Reviewed by: dillon, drhodus

19 years agomachine/param.h has to be included outside of _KERNEL for MAXCPU.
Matthew Dillon [Sat, 18 Oct 2003 20:07:32 +0000 (20:07 +0000)]
machine/param.h has to be included outside of _KERNEL for MAXCPU.

19 years agoMake vmstat -m understand the new per-cpu aggregation for
Matthew Dillon [Sat, 18 Oct 2003 19:59:45 +0000 (19:59 +0000)]
Make vmstat -m understand the new per-cpu aggregation for
malloc_type statistics.

19 years agoUse vnconfig(8) instead of mdconfig(8) to enable ${swapfile},
Hiten Pandya [Sat, 18 Oct 2003 14:17:30 +0000 (14:17 +0000)]
Use vnconfig(8) instead of mdconfig(8) to enable ${swapfile},
as the latter is not available.

Submitted by: Skip Ford <skip.ford@verizon.net>

19 years agoAdd SysV IPC regression suite.
Hiten Pandya [Sat, 18 Oct 2003 12:13:01 +0000 (12:13 +0000)]
Add SysV IPC regression suite.

Obtained from: NetBSD

19 years agoFix build by not attempting to compile libc's malloc directly.
Hiten Pandya [Sat, 18 Oct 2003 11:53:43 +0000 (11:53 +0000)]
Fix build by not attempting to compile libc's malloc directly.

Submitted by: Skip Ford <skip.ford@verizon.net>

19 years agoFix memory leaks in the namecache code commited so far to stabilize its
Matthew Dillon [Sat, 18 Oct 2003 05:53:57 +0000 (05:53 +0000)]
Fix memory leaks in the namecache code commited so far to stabilize its
memory use.  These are temporary fixes.

19 years agoMake malloc_type statistics per-cpu, which fixes statistics update races
Matthew Dillon [Sat, 18 Oct 2003 05:48:44 +0000 (05:48 +0000)]
Make malloc_type statistics per-cpu, which fixes statistics update races
in the slab allocator that would result in malloc statistics being way off.

19 years agoFix a uni-processor bug with the last commit... we weren't rescheduling on
Matthew Dillon [Fri, 17 Oct 2003 07:44:18 +0000 (07:44 +0000)]
Fix a uni-processor bug with the last commit... we weren't rescheduling on
priority changes.

19 years agoCleanup P_CURPROC and P_CP_RELEASED handling. P_CP_RELEASED prevents the
Matthew Dillon [Fri, 17 Oct 2003 07:30:43 +0000 (07:30 +0000)]
Cleanup P_CURPROC and P_CP_RELEASED handling.  P_CP_RELEASED prevents the
userland scheduler from messing with a process and must be set (in a lazy
fashion) when a thread that came in from userland is about to block in
the kernel.  P_CURPROC is used to manage which threads belonging to
processes controlled by the userland scheduler are scheduled by LWKT.
The userland scheduler has also been streamlined considerably.

p_priority now has a rollup priority that can be compared directly,
regardless of the realtime/idle/whatever queue a process is on.
p_priority has been changed from an unsigned char to a signed short.

schedclock is now distributed, so 'top' shows the correct values.

A huge amount of cpu affinity code has been added to the scheduler.  It is
not working 100% yet, but the framework is there (see kern/kern_switch.c).
globaldata now has gd_upri to support remote reschedule requests issued
by the affinity code.  There are two goals to the new scheduling code for
MP boxes: (1) so niced/idleprio cpu bound programs do not interfere
*at* *all* with other things (like, say, a buildworld).  (2) to reduce
the flip-flopping of processes between cpus.

lwkt_gettoken() now increments the generation number unconditionally so
kernel code can detect when other processes have used a token.

lwkt_send_ipiq_mask() removes stopped cpus from the mask automatically.

19 years agoCreate kern_readv() and kern_writev() and use them to split read(), pread(),
David P. Reese, Jr. [Fri, 17 Oct 2003 05:25:45 +0000 (05:25 +0000)]
Create kern_readv() and kern_writev() and use them to split read(), pread(),
readv(), write(), pwrite(), and writev().

Also, rewrite linux_pread() and linux_pwrite() using the in-kernel syscalls.

19 years agoRemove PUSER entirely. Since p_priority has nothing to do with kernel
Matthew Dillon [Thu, 16 Oct 2003 23:59:15 +0000 (23:59 +0000)]
Remove PUSER entirely.  Since p_priority has nothing to do with kernel
thread priorities, the userland scheduler can now use the entire range 0-127.

Document the estcpu and other macros related to the p_priority calculation.

Adjust the default values such that a cpu bound nice -20 process will not
completely starve a nice +0 process (though it gets close!).  Note that a
nice +2 process will not run at all in the face of a cpu bound nice -20

19 years agoFix the userland scheduler. When the scheduler releases the P_CURPROC
Matthew Dillon [Thu, 16 Oct 2003 22:26:42 +0000 (22:26 +0000)]
Fix the userland scheduler.  When the scheduler releases the P_CURPROC
designation it unconditionally handed it off to the highest priority
process on the userland process queue, ignoring the fact that the 'current'
process might have had a higher priority.  There was also a missing call to
lwkt_maybe_switch() in the resched_wanted() case that could cause interrupt
threads to stall for a long period of time when they could not preempt.

In SMP there are still some issues.  Niced processes work better, but at
the moment the P_CURPROC handoff does not take into account the fact that
the new higher priority process might better be handed off to another cpu
that is running a lower priority process then the current cpu.

19 years agocorrect the .PATH for access to scvesactl.c
Matthew Dillon [Thu, 16 Oct 2003 01:18:00 +0000 (01:18 +0000)]
correct the .PATH for access to scvesactl.c

Report-by: David Rhodus <drhodus@catpa.com>
19 years agoHave lwkt_reltoken() return the generation number to facilitate checks
Matthew Dillon [Wed, 15 Oct 2003 23:27:06 +0000 (23:27 +0000)]
Have lwkt_reltoken() return the generation number to facilitate checks
for stolen tokens.  Cleanup, optimize, and better document lwkt_gentoken().

19 years agoFix an inherited bug in ptrace's PT_IO. The wrong thread was being assigned
Matthew Dillon [Wed, 15 Oct 2003 21:52:38 +0000 (21:52 +0000)]
Fix an inherited bug in ptrace's PT_IO.  The wrong thread was being assigned
to the UIO.

19 years agoSecond contigmalloc() cleanup:
Hiten Pandya [Wed, 15 Oct 2003 16:48:04 +0000 (16:48 +0000)]
Second contigmalloc() cleanup:

* Move the contigmalloc/vm_contig_pg API into its own
  file, vm_contig.c.

* Give contigmalloc1() a more sensible to reflect its
  purpose, contigmalloc_map().

19 years agoMajor contigmalloc() API cleanup:
Hiten Pandya [Wed, 15 Oct 2003 16:03:04 +0000 (16:03 +0000)]
Major contigmalloc() API cleanup:

    * split the contigmalloc() function into two distinct

        - vm_contig_pg_alloc(): this function does the alloc
          of contiguous pages.

        - vm_contig_pg_kmap(): this function maps the allocated
          range of pages into a VM map (i.e. kernel map).

    * remove the duplicated page queue flush management handling
      and put it into a separate function, vm_contig_pg_clean().

The split is important for some special case drivers, which
like to allocated >2G contig memory, and then mmpa(2) it to
userland for various purposes.

By splitting, the contigmalloc/vm_contig_pg API does not
enforce the client to map the contiguous pages into the
KVA, which would have otherwise failed the allocation.

These functions will probably be moved to their own file
some time soon.

Reviewed/Approved/Tested by: Matt Dillon

19 years agoRemove zalloci/zfreei from the Makefile too.
Hiten Pandya [Wed, 15 Oct 2003 15:37:58 +0000 (15:37 +0000)]
Remove zalloci/zfreei from the Makefile too.

19 years agoNuke the zalloci() and zfree() stuff sky-high. We no longer have
Hiten Pandya [Wed, 15 Oct 2003 15:36:44 +0000 (15:36 +0000)]
Nuke the zalloci() and zfree() stuff sky-high.  We no longer have
those functions as zalloc/zfree are interrupt and MP safe.

19 years agoI wasn't properly checking for rollover in iovec_copyin(). Remove code
David P. Reese, Jr. [Wed, 15 Oct 2003 08:43:37 +0000 (08:43 +0000)]
I wasn't properly checking for rollover in iovec_copyin().  Remove code
that ineffectively checks for rollover by checking if a size_t was ever
less than zero (duh).

Add the proper error checking to kern_sendmsg() and kern_recvmsg() which
recieve a uio structure that was populated with the aid of iovec_copyin().

19 years agoRename do_dup() to kern_dup() and pull in some changes from FreeBSD-CURRENT.
David P. Reese, Jr. [Wed, 15 Oct 2003 06:38:46 +0000 (06:38 +0000)]
Rename do_dup() to kern_dup() and pull in some changes from FreeBSD-CURRENT.
Implement dup(), dup2() and fcntl(F_DUPFD) with kern_dup().

Split fcntl() into fcntl() and kern_fcntl().

Implement linux_fcntl() using kern_fcntl() and replace a call to fcntl()
in linux_accept() with a call to kern_fcntl().

19 years agoUpdate the sys_sig* manual page to include portability suggestions.
Matthew Dillon [Tue, 14 Oct 2003 23:13:05 +0000 (23:13 +0000)]
Update the sys_sig* manual page to include portability suggestions.

19 years agoNSIG is now 64. Extend the siglist arrays to match.
Matthew Dillon [Tue, 14 Oct 2003 23:04:10 +0000 (23:04 +0000)]
NSIG is now 64.  Extend the siglist arrays to match.

19 years ago/bin/sh needs to use sys_nsig, not NSIG, when accessing static arrays
Matthew Dillon [Tue, 14 Oct 2003 23:03:08 +0000 (23:03 +0000)]
/bin/sh needs to use sys_nsig, not NSIG, when accessing static arrays
defined in libc.  /bin/sh also needs to check for NULL entries.

19 years agoMake sure PORTSDIR is not in the environment when bootstrapping a
Matthew Dillon [Mon, 13 Oct 2003 23:57:41 +0000 (23:57 +0000)]
Make sure PORTSDIR is not in the environment when bootstrapping a
DragonFly port from a FreeBSD port.

19 years agoAdd checkpoint tty signaling support to stty and tcsh. The signal
Matthew Dillon [Mon, 13 Oct 2003 21:24:29 +0000 (21:24 +0000)]
Add checkpoint tty signaling support to stty and tcsh.  The signal
defaults to '^E'.

19 years agoOops, I gave Kip bad advise. The checkpoint execution code is supposed
Matthew Dillon [Mon, 13 Oct 2003 21:16:42 +0000 (21:16 +0000)]
Oops, I gave Kip bad advise.  The checkpoint execution code is supposed
to be in issignal(), not psignal()!

19 years agoStart separating the ucred from NDINIT.
Matthew Dillon [Mon, 13 Oct 2003 21:16:10 +0000 (21:16 +0000)]
Start separating the ucred from NDINIT.

19 years agoFix miscellanious kern_fp.c bugs.
Matthew Dillon [Mon, 13 Oct 2003 21:15:48 +0000 (21:15 +0000)]
Fix miscellanious kern_fp.c bugs.

19 years agoUse the one remaining free termios control character slot for a tty
Matthew Dillon [Mon, 13 Oct 2003 21:08:50 +0000 (21:08 +0000)]
Use the one remaining free termios control character slot for a tty
checkpoint capability, which defaults to ^E and sends the SIGCKPT signal.