dragonfly.git
17 years agoUse the correct cast, ns_ifra_addr -> ns_ifaddr.
Hiten Pandya [Tue, 4 May 2004 11:54:40 +0000 (11:54 +0000)]
Use the correct cast, ns_ifra_addr -> ns_ifaddr.

Noticed-by: LINT
17 years agoClean warnings under DIAGNOSTIC.
Hiten Pandya [Tue, 4 May 2004 11:53:26 +0000 (11:53 +0000)]
Clean warnings under DIAGNOSTIC.

Noticed-by: LINT
17 years agoMerge with FreeBSD (RELENG_4) src/sys/msdosfs/msdosfs_vfsops.c,
Chris Pressey [Mon, 3 May 2004 19:08:08 +0000 (19:08 +0000)]
Merge ... FreeBSD (RELENG_4) src/sys/msdosfs/msdosfs_vfsops.c,
revision 1.60.2.8:

Handle the "next free cluster" field of an FSInfo block more
intelligently when it has the value 0xFFFFFFFF (details in FreeBSD
PR kern/62826).

Reviewed-by: hmp
17 years agoMerge with FreeBSD (RELENG_4) src/bin/mv/mv.c, revision 1.24.2.6:
Chris Pressey [Mon, 3 May 2004 18:54:37 +0000 (18:54 +0000)]
Merge ... FreeBSD (RELENG_4) src/bin/mv/mv.c, revision 1.24.2.6:

Fix a bug that would not allow a symbolic link to be moved if its
destination was a mount point (details in FreeBSD PR bin/64430).

Reviewed-by: hmp
17 years agoStyle(9) cleanup to src/sys/vfs, stage 17/21: specfs.
Chris Pressey [Mon, 3 May 2004 18:46:34 +0000 (18:46 +0000)]
Style(9) cleanup to src/sys/vfs, stage 17/21: specfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoipstat needs thread2.h for MP stuff and mycpu.
Matthew Dillon [Mon, 3 May 2004 18:43:22 +0000 (18:43 +0000)]
ipstat needs thread2.h for MP stuff and mycpu.

Reported-by: David Rhodus <drhodus@machdep.com>
17 years agoPOSIX lock resource limit part 3/4
Joerg Sonnenberger [Mon, 3 May 2004 16:06:27 +0000 (16:06 +0000)]
POSIX lock resource limit part 3/4

This splits "struct lockf" into the general book-keeping of ranges and
blocked request and the "struct lockf_range" which constists of the data
for a specific range. Adjust the interface of lf_advlock to remove one
level of pointer indirection and embedded "struct lockf" directly in the
inodes. Don't mess with wait channels any more.

Change the algorithm for determing locks to a more direct approach, which
both simplifies the lock acquisition and proper book-keeping of the number
of ranges currently used. The later is necessary to prevent local resource
exhaustion.

The code is not fully malloc block-safe, but as good or bad as
the old code.

Add the kernel part of the posixlocks rlimit. This is the maximum number of
POSIX lock ranges any user can acquire. These numbers are tracked for each
user and process and checked at lock/unlock time. If a process changes uid,
its locks are transfered to the new uid which can effectivly boost that
number above the limit.

This is based on the patch set from Devon H. O'Dell <dodell@sitetronics.com>
for the general infrastructure with some adjustment to better integrate with
the new lockf code.

17 years agoMake IP statistics counters per-CPU so they can be updated safely.
Hiten Pandya [Mon, 3 May 2004 15:18:25 +0000 (15:18 +0000)]
Make IP statistics counters per-CPU so they can be updated safely.

* For SMP, we index into the array with the current CPU's
  as ipstats_ary[gd->gd_cpuid], and for UP we just return
  struct at ipstats_ary[0] (CPU-0).

* Rename the structure from ipstat to ip_stats.

* Wrap function definition of CPU counter aggregation in a
  macro called CPU_STATS_FUNC() to avoid duplication.

* Retain support for resetting the counters using netstat(1).

17 years agoStyle(9) cleanup to src/sys/vfs, stage 16/21: smbfs.
Chris Pressey [Mon, 3 May 2004 05:19:50 +0000 (05:19 +0000)]
Style(9) cleanup to src/sys/vfs, stage 16/21: smbfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years ago(non bug) The hash routines are never called with a size of 1, but make
Matthew Dillon [Sun, 2 May 2004 07:59:34 +0000 (07:59 +0000)]
(non bug) The hash routines are never called with a size of 1, but make
the minimum size 2 to avoid a degenerate masking case.

17 years agoWe must pmap_qremove() pages that we previously pmap_qenter()'d before
Matthew Dillon [Sun, 2 May 2004 07:57:45 +0000 (07:57 +0000)]
We must pmap_qremove() pages that we previously pmap_qenter()'d before
we can safely call kmem_free().  This corrects a serious corruption issue
that occured when using PIPE algorithms other then the default.

The default SFBUF algorithm was not effected by this bug.

17 years agoStyle(9) cleanup to src/sys/vfs, stage 15/21: procfs.
Chris Pressey [Sun, 2 May 2004 03:05:11 +0000 (03:05 +0000)]
Style(9) cleanup to src/sys/vfs, stage 15/21: procfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoCommit an update to the pipe code that implements various pipe algorithms.
Matthew Dillon [Sat, 1 May 2004 18:16:46 +0000 (18:16 +0000)]
Commit an update to the pipe code that implements various pipe algorithms.
Note that the newer algorithms are either experimental or only exist for
testing purposes.  The default remains the same (sfbuf mode), which is
considered to be stable.  The code is just too useful not to commit it.

Add pmap_qenter2() for installing cpu-localized KVM mappings.

Add pmap_page_assertzero() which will be used in a later diagnostic commit.

17 years agoAdd bcopyb() back in for the PCVT driver. bcopyb() is explicitly
Matthew Dillon [Sat, 1 May 2004 03:38:36 +0000 (03:38 +0000)]
Add bcopyb() back in for the PCVT driver.  bcopyb() is explicitly
byte-granular for the few (one?) memory mapped device which cannot always
handle 16 or 32 bit ops.

Reported-by: David Rhodus
17 years agoClear npxthread before setting CR0_TS.
Matthew Dillon [Sat, 1 May 2004 00:28:55 +0000 (00:28 +0000)]
Clear npxthread before setting CR0_TS.

Turn off MMX/XMM copy support by default until I track down all the bugs.
It can be turned on by setting kern.mmxopt=1 in /boot/loader.conf.

17 years agoFix another bug in the recent bcopy revamp. The range checking was
Matthew Dillon [Fri, 30 Apr 2004 09:44:16 +0000 (09:44 +0000)]
Fix another bug in the recent bcopy revamp.   The range checking was
branching to the wrong copyin_fault/copyout_fault address.

17 years agoFix a race in the FP copy code. If we setup our temporary FP save area
Matthew Dillon [Fri, 30 Apr 2004 02:59:14 +0000 (02:59 +0000)]
Fix a race in the FP copy code.  If we setup our temporary FP save area
before we check npxthread it is possible for a one-instruction-window
interrupt to come along and save the application FP state to our temporary
area and then clear npxthread, causing the application FP state to be thrown
away.

Also, if there is no app FP state (npxthread is NULL), it is possible
once we set npxthread=curthread for an interrupt to come along and save
bogus FP state to our temporary save area before we have a chance to
fninit (one instruction window since we clts just prior to the fninit),
causing the fninit to fault and npxdna to restore the bogus state.

Use a critical section to prevent these cases from occuring.

17 years agoFix a race in npxdna(). If an interrupt occurs after we have set npxthread
Matthew Dillon [Fri, 30 Apr 2004 02:52:28 +0000 (02:52 +0000)]
Fix a race in npxdna().  If an interrupt occurs after we have set npxthread
but before we call fxrstor() the thread switch would save someone else's
FP state to our PCB.

Fix a minor link problem when using CPU_DISABLE_SSE.

17 years agoCorrect a bug in the last FPU optimized bcopy commit. The user FPU state
Matthew Dillon [Fri, 30 Apr 2004 00:59:55 +0000 (00:59 +0000)]
Correct a bug in the last FPU optimized bcopy commit.  The user FPU state
was being corrupted by interrupts.

Fix the bug by implementing a feature described as a missif in the original
FreeBSD comments... add a pointer to the FP saved state in the thread
structure so routines which 'borrow' the FP unit can simply revector the
pointer temporarily to avoid corruption of the original user FP state.

The MMX_*_BLOCK macros in bcopy.s have also been simplified somewhat.  We
can simplify them even more (in the future) by reserving FPU save space in
the per-cpu structure instead of on the stack.

17 years agoRemove the (now non existant) i486_bzero assignment for I486_CPU.
Matthew Dillon [Thu, 29 Apr 2004 19:43:35 +0000 (19:43 +0000)]
Remove the (now non existant) i486_bzero assignment for I486_CPU.

17 years agoMake SF_BUF_HASH() into an inline routine, sf_buf_hash(), and add an
Matthew Dillon [Thu, 29 Apr 2004 17:31:02 +0000 (17:31 +0000)]
Make SF_BUF_HASH() into an inline routine, sf_buf_hash(), and add an
additional offset to avoid folding that might occur due to cache line
selection effects.  This does not appear to make much of a difference but
I decided to keep it anyway.

17 years agoMake hash tables one power of 2 larger so they don't (generally) fold
Matthew Dillon [Thu, 29 Apr 2004 17:29:16 +0000 (17:29 +0000)]
Make hash tables one power of 2 larger so they don't (generally) fold
nodes as much.  Before if you requested a hash table of 63 elements
it would create a 32 entry hash table.  Now it creates a 64 entry hash
table (and 128 entry if you specify 65 elements).

17 years agoRewrite the optimized memcpy/bcopy/bzero support subsystem. Rip out the
Matthew Dillon [Thu, 29 Apr 2004 17:25:03 +0000 (17:25 +0000)]
Rewrite the optimized memcpy/bcopy/bzero support subsystem.  Rip out the
old FreeBSD code almost entirely.

* Add support for stacked ONFAULT routines, allowing copyin and copyout to
  call the general memcpy entry point instead of rolling their own.

* Split memcpy/bcopy and bzero into their own files

* Add support for XMM (128 bit) and MMX (64 bit) media instruction copies

* Rewrite the integer code.  Also note that most of the previous integer
  and FP special case support had been ripped out of DragonFly long ago
  in that the assembly was no longer being referenced.  It doesn't make
  sense to have a dozen different zeroing/copying routines so focus on
  the ones that work well with recent (last ~5 years) cpus.

* Rewrite the FP state handling code.  Instead of restoring the FP state
  let it hang, which allows userland to make multiple syscalls and/or for
  the system to make multiple bcopy()/memcpy() calls without having to
  save/restore the FP state on each call.  Userland will take a fault when
  it needs the FP again.

  Note that FP optimized copies only occur for block sizes >= 2048 bytes,
  so this is not something that userland, or the kernel, will trip up on
  every time it tries to do a bcopy().

* LWKT threads need to be able to save the FP state, add the simple
  conditional and 5 lines of assembly required to do that.

AMD Athlon notes: 64 bit media instructions will get us 90% of the way
there.  It is possible to squeeze out slightly more memory bandwidth from
the 128 bit XMM instructions (SSE2).  While it does not exist in this commit
there are two additional features that can be used:  prefetching and
non-temporal writes.  Prefetching is a 3dNOW instruction and can squeeze
out significant additionaL performance if you fetch ~128 bytes ahead of
the game, but I believe it is AMD-only.  Non-temporal writes can double
UNCACHED memory bandwidth, but they have a horrible effect on L1/L2
performance and you can't mix non-temporal writes with normal writes without
completely destroying memory performance (e.g. multiple GB/s -> less then
100 MBytes/sec).

Neither prefetching nor non-temporal writes are implemented in this commit.

17 years agoAdd mem1 and mem2 .... memory copying and zeroing test suites, making it
Matthew Dillon [Thu, 29 Apr 2004 16:14:53 +0000 (16:14 +0000)]
Add mem1 and mem2 .... memory copying and zeroing test suites, making it
fairly easy for anyone to test various copying and zeroing memory algorithms
and compare them against other algorithms.

17 years agoDue to pipe buffer chunking the reader side of the pipe was not traversing
Matthew Dillon [Thu, 29 Apr 2004 16:05:21 +0000 (16:05 +0000)]
Due to pipe buffer chunking the reader side of the pipe was not traversing
its entire buffer, creating skewed statistics for block sizes > 64K.

Reduce the timing interval from 6 seconds to 3.

17 years agoMove the Plug'n'Play BIOS support into a separate file. This is included
Joerg Sonnenberger [Thu, 29 Apr 2004 12:11:16 +0000 (12:11 +0000)]
Move the Plug'n'Play BIOS support into a separate file. This is included
with "device pnpbios" instead of "options PNPBIOS".

This is still not included by default in GENERIC.

While at it, convert some u_intXX_t, u_short and u_int to uintXX_t in
preparation for AMD64.

17 years ago1) Move the tcp_stats structure back to netinet/tcp_var.h.
Hiten Pandya [Thu, 29 Apr 2004 10:06:41 +0000 (10:06 +0000)]
1) Move the tcp_stats structure back to netinet/tcp_var.h.
2) Remove netinet/tcp_stats.h because it is no longer needed.

Requested by: Jeffrey Hsu

17 years agoFix compilation of profiling.
Hiten Pandya [Wed, 28 Apr 2004 22:05:09 +0000 (22:05 +0000)]
Fix compilation of profiling.

Requested by: David Rhodus <drhodus@machdep.com>

17 years agoRemember if an inpcb was entered into the wildcard table to save
Jeffrey Hsu [Wed, 28 Apr 2004 08:00:35 +0000 (08:00 +0000)]
Remember if an inpcb was entered into the wildcard table to save
some cycles when a connection is closed.

17 years agoConditionalize accept_filter variable on defined(INET).
Joerg Sonnenberger [Wed, 28 Apr 2004 06:59:27 +0000 (06:59 +0000)]
Conditionalize accept_filter variable on defined(INET).

17 years agoRevamp the PIPE test a bit. Use a calibration loop to make the test always
Matthew Dillon [Wed, 28 Apr 2004 00:08:55 +0000 (00:08 +0000)]
Revamp the PIPE test a bit.  Use a calibration loop to make the test always
run for a consistent period of time (around 6 seconds) no matter what the
specified block size is.  Allow a third 'label' argument to be specified
and reformat the MB/sec output to include the label and block size
to make it easier to pick off results for gnuplot.  Finally, use mmap()
instead of malloc() to create a cache-friendly read and write buffer to
reduce noise in the performance results.

17 years agoBring in the following revs from FreeBS-4:
Matthew Dillon [Mon, 26 Apr 2004 20:26:59 +0000 (20:26 +0000)]
Bring in the following revs from FreeBS-4:

    1.250.2.25  +3 -2      src/sys/i386/i386/pmap.c
    1.33.2.6    +2 -2      src/sys/vm/pmap.h
    1.187.2.25  +3 -2      src/sys/vm/vm_map.c

Suggested-by: Alan Cox <alc@cs.rice.edu>
17 years agonextsoftcheck must be a volatile pointer, not a pointer to a volatile.
Matthew Dillon [Mon, 26 Apr 2004 20:06:28 +0000 (20:06 +0000)]
nextsoftcheck must be a volatile pointer, not a pointer to a volatile.

Reported-by: YONETANI Tomokazu <qhwt+dragonfly-commits@les.ath.cx>
17 years agoFix a bug noted by David Rhodus and removes minor redundancy.
Matthew Dillon [Mon, 26 Apr 2004 19:57:18 +0000 (19:57 +0000)]
Fix a bug noted by David Rhodus and removes minor redundancy.

Submitted-by: Sascha Wildner <saw@online.de>
17 years agoIf the server goes away while the client is trying to copy a message from
Matthew Dillon [Mon, 26 Apr 2004 17:06:18 +0000 (17:06 +0000)]
If the server goes away while the client is trying to copy a message from
it, the kernel may panic with a null-pointer indirection through the caps
ci_td field (which becomes NULL).  The field is properly becoming NULL,
the culprit was some debugging code that indirected through it without
checking first.

Reported-by: Chris Pressey <cpressey@catseye.mine.nu>
17 years agoAdd missing function prototype.
Chris Pressey [Sun, 25 Apr 2004 18:54:32 +0000 (18:54 +0000)]
Add missing function prototype.

17 years agoCosmetic changes.
David Rhodus [Sun, 25 Apr 2004 18:18:43 +0000 (18:18 +0000)]
Cosmetic changes.

17 years agoLeave out acpica5 from the device build path for a little longer, well
David Rhodus [Sun, 25 Apr 2004 17:40:21 +0000 (17:40 +0000)]
Leave out acpica5 from the device build path for a little longer, well
at least until the stabilization faze is over.

17 years agoCosmetic changes.
David Rhodus [Sun, 25 Apr 2004 17:28:34 +0000 (17:28 +0000)]
Cosmetic changes.

17 years agoSync libcr with libc.
Joerg Sonnenberger [Sun, 25 Apr 2004 12:40:50 +0000 (12:40 +0000)]
Sync libcr with libc.

17 years agoSmall style fix
Joerg Sonnenberger [Sun, 25 Apr 2004 12:22:14 +0000 (12:22 +0000)]
Small style fix

17 years agoFix bsd.port.subdir.mk by adding the normal environment hacks
Joerg Sonnenberger [Sun, 25 Apr 2004 11:02:18 +0000 (11:02 +0000)]
Fix bsd.port.subdir.mk by adding the normal environment hacks

17 years agoSupport for more video modes: accept mode names like MODE_<NUMBER> where
Matthew Dillon [Sun, 25 Apr 2004 06:35:32 +0000 (06:35 +0000)]
Support for more video modes: accept mode names like MODE_<NUMBER> where
<NUMBER> is the video mode number from the vidcontrol -i mode output.
MODE_13 is 320x200, for example...

Change the default geometry of raster modes: calculate rows and columns
using the font width and height. This results in the row * col geometry
being as large as possible if no geometry is specified by the user. If
no font is specified the current font's height is used. The old
vidcontrol used a default geometry of 80x25 for raster modes.

Remove restrictions on the range of background colors for graphics modes.

Implement a cleaner revert mechanism: in case something goes wrong we
restore the previous settings and give a message telling what exactly
went wrong. Unfortunately, there are several parameters that cannot
(yet) be saved and restored due to restrictions in the syscons driver:
screen saver timeout, cursor type, mouse character, mouse show/hide
state, vty switching on/off state, history buffer size and history
buffer contents are not saved because the syscons driver doesn't provide
ioctl()s to read those parameters. Font maps are not restored because
the syscons driver won't let us load a font map without setting it.

Submitted-by: Sascha Wildner <saw@online.de>
17 years agoThe "Hashed Timers and Hierarchical Wheels: Data Structures for the
Hiten Pandya [Sun, 25 Apr 2004 04:04:59 +0000 (04:04 +0000)]
The "Hashed Timers and Hierarchical Wheels: Data Structures for the
Efficient Implementation of a Timer Facility" paper was co-author'ed
by T. Lauk, not A. Lauk.

Adjust nearby whitespace at the same time.

17 years ago#ifdef out the PCATCH/CURSIG code for userland (libcaps), it only applies
Matthew Dillon [Sat, 24 Apr 2004 20:59:10 +0000 (20:59 +0000)]
#ifdef out the PCATCH/CURSIG code for userland (libcaps), it only applies
to kernelland.

include <machine/cpufunc.h> in order to get the memory barrier functions.

17 years agoPartial sync with kernel to get libcaps compilable again.
Joerg Sonnenberger [Sat, 24 Apr 2004 09:26:25 +0000 (09:26 +0000)]
Partial sync with kernel to get libcaps compilable again.

17 years agoCosmetic changes.
Jeffrey Hsu [Sat, 24 Apr 2004 07:05:56 +0000 (07:05 +0000)]
Cosmetic changes.

17 years agoThe default protocol threads also need the check for
Jeffrey Hsu [Sat, 24 Apr 2004 06:55:57 +0000 (06:55 +0000)]
The default protocol threads also need the check for
same thread synchronous execution.

Reported by: YONETANI Tomokazu <qhwt+dragonfly-bugs@les.ath.cx>

17 years agoReplicate the TCP listen table to give each cpu its own copy.
Jeffrey Hsu [Sat, 24 Apr 2004 04:47:29 +0000 (04:47 +0000)]
Replicate the TCP listen table to give each cpu its own copy.

17 years agoRename the sysctl handler for nchstats to reflect reality; I named it
Hiten Pandya [Sat, 24 Apr 2004 04:43:06 +0000 (04:43 +0000)]
Rename the sysctl handler for nchstats to reflect reality; I named it
nchstats_agg() originally because it was aggregating the counters in
the handler and than exporting the result; the reality is that it
exports them without aggregation so CPU affectiveness can be analysed.

The handler is now called sysctl_nchstats().

17 years agoGeneral update:
David Rhodus [Sat, 24 Apr 2004 04:38:49 +0000 (04:38 +0000)]
General update:
Remove unused notes about upgrading a system from a.out to elf.
Clear out the old checks for performing an a.out to elf upgrade.

17 years agoMerge with FreeBSD (RELENG_4) src/sys/dev/syscons/syscons.c,
Chris Pressey [Sat, 24 Apr 2004 04:32:19 +0000 (04:32 +0000)]
Merge ... FreeBSD (RELENG_4) src/sys/dev/syscons/syscons.c,
revisions 1.336.2.16 and 1.336.2.17.

This fixes two bell-related bugs in syscons(4):

- Do not attempt to ring the audible bell if either the frequency
or duration is zero, as these values indicate that the bell is off,
yet can produce odd sounds on some hardware.  (1.336.2.16)

- Do not prevent processes on currently inactive VTY's from waking
up from waiting for the output queue when the visible bell rings on
the currently active VTY.  (1.336.2.17)

Reviewed-by: Hiten Pandya <hmp@backplane.com>
17 years agoRemove the VREF() macro and uses of it.
David Rhodus [Sat, 24 Apr 2004 04:32:06 +0000 (04:32 +0000)]
Remove the VREF() macro and uses of it.
Remove uses of 0x20 before ^I inside vnode.h

17 years agoAdd in the new acpica5 to the device build path.
David Rhodus [Sat, 24 Apr 2004 04:11:10 +0000 (04:11 +0000)]
Add in the new acpica5 to the device build path.

17 years agoCount statistics for exec calls.
David Rhodus [Sat, 24 Apr 2004 04:09:22 +0000 (04:09 +0000)]
Count statistics for exec calls.

17 years agoDrop packet if the length checks fail in ip_demux().
Jeffrey Hsu [Sat, 24 Apr 2004 01:40:34 +0000 (01:40 +0000)]
Drop packet if the length checks fail in ip_demux().

17 years agoUse a message structure off the stack for a synchronous call.
Jeffrey Hsu [Sat, 24 Apr 2004 00:33:15 +0000 (00:33 +0000)]
Use a message structure off the stack for a synchronous call.

17 years agoFix a client tail -f vs server-appended file data corruption case by
Matthew Dillon [Fri, 23 Apr 2004 18:01:07 +0000 (18:01 +0000)]
Fix a client tail -f vs server-appended file data corruption case by
invalidating client-side cached data on detection of a server based
file size change.

Taken-from: FreeBSD-5
Patch-Prepared-by: Chris Pressey <cpressey@catseye.mine.nu>
17 years agoStyle(9) cleanup.
Chris Pressey [Fri, 23 Apr 2004 17:55:11 +0000 (17:55 +0000)]
Style(9) cleanup.

- Normalize spacing, indentation, and comment-formatting.
- Change (ptr == 0) tests and (!ptr) tests to (ptr == NULL) tests.
- No functional changes.

17 years agoClean up style(9) issues that were missed in previous commit to this
Chris Pressey [Fri, 23 Apr 2004 17:39:53 +0000 (17:39 +0000)]
Clean up style(9) issues that were missed in previous commit to this
file.

- Remove `register' keywords.
- Convert K&R-style function definitions to ANSI style.
- No functional changes.

17 years agoStyle(9) cleanup to src/sys/vfs, stage 14/21: portal.
Chris Pressey [Fri, 23 Apr 2004 17:35:58 +0000 (17:35 +0000)]
Style(9) cleanup to src/sys/vfs, stage 14/21: portal.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoPass more information down to the protocol-specific socket dispatch function
Jeffrey Hsu [Fri, 23 Apr 2004 10:21:08 +0000 (10:21 +0000)]
Pass more information down to the protocol-specific socket dispatch function
to use if desired.

17 years agomsync(..., MS_INVALIDATE) will incorrectly remove dirty pages without
Matthew Dillon [Fri, 23 Apr 2004 06:23:46 +0000 (06:23 +0000)]
msync(..., MS_INVALIDATE) will incorrectly remove dirty pages without
synchronizing them to their backing store under certain circumstances,
and can also cause struct buf's to become inconsistent.  This can be
particularly gruesome when MS_INVALIDATE is used on a range of memory that
is mmap()'d to be read-only.

Fix MS_INVALIDATE's operation (1) by making UFS honor the invalidation
request when flushing to backing store to destroy the related struct buf
and (2) by never removing pages wired into the buffer cache and never
removing pages that are found to still be dirty.

Note that NFS was already coded to honor invalidation requests in
nfs_write().  Filesystems other then NFS and UFS do not currently support
buffer-invalidation-on-write but all that means now is that the pages
will remain in cache, rather then be incorrectly removed and cause corruption.

Reported-by: Stephan Uphoff <ups@tree.com>, Julian Elischer <julian@elischer.org>
17 years agobuildiso was assuming a native obj hierarchy when running the make distribute
Matthew Dillon [Fri, 23 Apr 2004 02:14:07 +0000 (02:14 +0000)]
buildiso was assuming a native obj hierarchy when running the make distribute
for etc, but buildworld's obj hierarchy is in a buildworld-special place, so
this was creating a failure.

Give nrelease its own custom hierarchy for any manual make distribute's that
it decides to issue (of which there is exactly one right now: etc for
sendmail's CF generation).

17 years agoRevamp UPDATING with separate instructions for upgrading from sources
Matthew Dillon [Thu, 22 Apr 2004 23:24:19 +0000 (23:24 +0000)]
Revamp UPDATING with separate instructions for upgrading from sources
on a FreeBSD platform, installing fresh from the CD, and installing/upgrading
from sources on an existing DragonFly platform.

17 years agoStyle(9) cleanup.
Chris Pressey [Thu, 22 Apr 2004 18:33:52 +0000 (18:33 +0000)]
Style(9) cleanup.

- Remove `register' keywords.
- Remove casts to void when ignoring return values.
- No space after sizeof.
- *argv[] -> **argv
- No functional changes.

17 years agoStyle(9) cleanup to src/sys/vfs, stage 13/21: nwfs.
Chris Pressey [Thu, 22 Apr 2004 17:56:44 +0000 (17:56 +0000)]
Style(9) cleanup to src/sys/vfs, stage 13/21: nwfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoposixlocks resource limit part 2/4: Add support to /usr/bin/limits.
Matthew Dillon [Thu, 22 Apr 2004 17:08:07 +0000 (17:08 +0000)]
posixlocks resource limit part 2/4: Add support to /usr/bin/limits.
This brings in Devon's:
lockfix-usr.bin.dfly.patch (which a number of formatting and
   backwards compatibility fixes added)

Submitted-by: "Devon H. O'Dell" <dodell@sitetronics.com>
17 years agoSplit the suggested invocation of fdisk (which is failing for some
Chris Pressey [Thu, 22 Apr 2004 16:53:17 +0000 (16:53 +0000)]
Split the suggested invocation of fdisk (which is failing for some
people) into two seperate invocations (which seems to work for them.)

The real solution would be to find out why fdisk -IB is troublesome,
but in the interim, this should save some frustration.

Problem-experienced-by: geekgod.com, Devon H. O'Dell, Dave Leimbach
Workaround-stumbled-upon-by: cpressey
17 years agoposixlocks resource limit part 1/4: Add support to the login.conf database,
Matthew Dillon [Thu, 22 Apr 2004 16:52:55 +0000 (16:52 +0000)]
posixlocks resource limit part 1/4: Add support to the login.conf database,
sh, and csh, and update manual pages.

This brings in Devon's:

lockfix-bin.dfly.patch (with minor nextopt() bug fixed)
lockfix-contrib.dfly.patch
lockfix-etc.dfly.patch
lockfix-lib.dfly.patch (w/ #ifdef added around RLIMIT_POSIXLOCKS)

Submitted-by: "Devon H. O'Dell" <dodell@sitetronics.com>
17 years agoMore M_NOWAIT -> M_INTWAIT | M_NULLOK conversions, primarily atm and ipsec.
Matthew Dillon [Thu, 22 Apr 2004 05:09:51 +0000 (05:09 +0000)]
More M_NOWAIT -> M_INTWAIT | M_NULLOK conversions, primarily atm and ipsec.
NOTE: the atm code uses malloc(M_DEVBUF, ..).  It should probably have its
own malloc domain.

17 years agoCorrect type-o in last commit. oops.
Matthew Dillon [Thu, 22 Apr 2004 04:37:07 +0000 (04:37 +0000)]
Correct type-o in last commit.  oops.

17 years agoM_NOWAIT to mostly M_INTWAIT conversions, with a splattering of
Matthew Dillon [Thu, 22 Apr 2004 04:35:45 +0000 (04:35 +0000)]
M_NOWAIT to mostly M_INTWAIT conversions, with a splattering of
M_NULLOK to prevent exhaustion attacks from crashing the system.

Note in patricular that the MALLOC tseg_qent for the tcp reassembly
queue went from M_NOWAIT to M_INTWAIT | M_NULLOK.

17 years agoThe temporary message allocated to execute a connect request is not
Matthew Dillon [Thu, 22 Apr 2004 04:31:27 +0000 (04:31 +0000)]
The temporary message allocated to execute a connect request is not
optional (M_NOWAIT -> M_INTWAIT).

17 years agoUse M_INTWAIT instead of M_NOWAIT in the ip messaging redispatch case to
Matthew Dillon [Thu, 22 Apr 2004 04:26:28 +0000 (04:26 +0000)]
Use M_INTWAIT instead of M_NOWAIT in the ip messaging redispatch case to
avoid random drops.

17 years agoM_NOWAIT -> M_WAITOK or M_INTWAIT conversions. There is a whole lot of net
Matthew Dillon [Thu, 22 Apr 2004 04:22:06 +0000 (04:22 +0000)]
M_NOWAIT -> M_WAITOK or M_INTWAIT conversions.  There is a whole lot of net
code that is improperly using M_NOWAIT.  Also remove now unneeded NULL checks
since malloc will panic rather then return NULL when M_NULLOK is not set.

Use M_INTWAIT|M_NULLOK in some cases (such as route table allocation) in
order to allow malloc to return NULL when the limit for the malloc type
is reached.

17 years agoFix a race in user_ldt_free() against an interrupt (which attempts to
Matthew Dillon [Thu, 22 Apr 2004 03:39:43 +0000 (03:39 +0000)]
Fix a race in user_ldt_free() against an interrupt (which attempts to
save and restore the ldt) while it is being freed.  Reorder the free and use
a critical section to prevent the race.

Reported-by: Andrew Atrens <atrens@nortelnetworks.com>
17 years agoStyle(9) cleanup.
Chris Pressey [Wed, 21 Apr 2004 21:29:55 +0000 (21:29 +0000)]
Style(9) cleanup.

- Remove `register' keyword.
- Remove casts to void when ignoring return values.
- No functional changes.

17 years agoFix a netmsg memory leak in the ARP code. Adjust all ms_cmd function
Matthew Dillon [Wed, 21 Apr 2004 18:14:04 +0000 (18:14 +0000)]
Fix a netmsg memory leak in the ARP code.  Adjust all ms_cmd function
dispatches to return a proper error code.

Reported-by: multiple people
17 years agoFix symlink ordering issue with the less man page.
David Rhodus [Wed, 21 Apr 2004 16:59:51 +0000 (16:59 +0000)]
Fix symlink ordering issue with the less man page.
This was causing the quickworld process or error out.

Reported by: walt

17 years agoStyle(9) cleanup to src/sys/vfs, stage 12/21: nullfs.
Chris Pressey [Wed, 21 Apr 2004 16:55:09 +0000 (16:55 +0000)]
Style(9) cleanup to src/sys/vfs, stage 12/21: nullfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoAdded short descriptions for kern.acct_suspend, kern.acct_resume, and
Justin C. Sherrill [Wed, 21 Apr 2004 15:39:02 +0000 (15:39 +0000)]
Added short descriptions for kern.acct_suspend, kern.acct_resume, and
kern.acct_chkfreq, for use with sysctl -d.

Suggested-by/Corrections-from: Chris Pressey

17 years agoFollowup commit, redo the way the root file descriptor slop is calculated
Matthew Dillon [Wed, 21 Apr 2004 06:09:53 +0000 (06:09 +0000)]
Followup commit, redo the way the root file descriptor slop is calculated
to avoid doing a divison in falloc(), and reorder the conditional to avoid
evaluating the more complex predicate most of the time.

17 years agoAdd a KKASSERT to mount(2) to make sure we have a proc pointer.
Hiten Pandya [Wed, 21 Apr 2004 04:49:00 +0000 (04:49 +0000)]
Add a KKASSERT to mount(2) to make sure we have a proc pointer.

17 years agoMerge: FreeBSD (RELENG_4) vfs_syscalls.c rev. 1.151.2.19
Hiten Pandya [Wed, 21 Apr 2004 04:47:28 +0000 (04:47 +0000)]
Merge: FreeBSD (RELENG_4) vfs_syscalls.c rev. 1.151.2.19

* Prohibit mount/umount operations inside a jail.

* Respect vfs.usermount sysctl for umount(2).

17 years agoMerge: FreeBSD (RELENG_4) kern_event.c rev. 1.2.2.10
Hiten Pandya [Wed, 21 Apr 2004 04:32:29 +0000 (04:32 +0000)]
Merge: FreeBSD (RELENG_4) kern_event.c rev. 1.2.2.10

Finish initializing a knote before we pass it to a callout.  This had
resulted in panics if large numbers of events were created with short
timeouts.

Reference: PR kern/64121 from FreeBSD GNATS repository.

17 years agoMerge: FreeBSD (RELENG_4) msdosfs_vfsops.c rev. 1.60.2.9
Hiten Pandya [Wed, 21 Apr 2004 04:28:00 +0000 (04:28 +0000)]
Merge: FreeBSD (RELENG_4) msdosfs_vfsops.c rev. 1.60.2.9

    Don't reject FAT file systems with a number of "Heads" greater than
    255; USB keychains exist that use 256 as the number of heads.

17 years agoMerge: FreeBSD (RELENG_4) kern_descrip.c rev. 1.81.2.19
Hiten Pandya [Wed, 21 Apr 2004 04:17:58 +0000 (04:17 +0000)]
Merge: FreeBSD (RELENG_4) kern_descrip.c rev. 1.81.2.19

* Update $FreeBSD$ CVS tag to indicate this and previous merges.

* Reserve the last 5% of file descriptors for root use.  This
  should allow systems to fail more gracefully when exhaustion
  occurs; report exhaustion has a rate-limited message.
  (Revision 1.201 - 1.203 of sys/kern_descrip.c from FreeBSD)

17 years agoMerge: FreeBSD (RELENG_4) aac_pci.c rev. 1.3.2.19
Hiten Pandya [Wed, 21 Apr 2004 03:28:07 +0000 (03:28 +0000)]
Merge: FreeBSD (RELENG_4) aac_pci.c rev. 1.3.2.19

Remove erroneous PCI Id.

17 years agoRemove two unused GEOM function prototypes. They were hangovers from
Chris Pressey [Wed, 21 Apr 2004 02:32:41 +0000 (02:32 +0000)]
Remove two unused GEOM function prototypes.  They were hangovers from
the boot code sync from FreeBSD-5.x.

17 years agoClean up typos and punctuation in comment.
Chris Pressey [Wed, 21 Apr 2004 02:17:13 +0000 (02:17 +0000)]
Clean up typos and punctuation in comment.

17 years agoFix an symlink ordering issue that was causing the install
David Rhodus [Tue, 20 Apr 2004 22:00:47 +0000 (22:00 +0000)]
Fix an symlink ordering issue that was causing the install
of the new less program to fail.

Pointed out by: JXrg Anslik

17 years agoNew logo of the DragonFly logo instead of the BSD Beastie. The old
Justin C. Sherrill [Tue, 20 Apr 2004 20:33:27 +0000 (20:33 +0000)]
New logo of the DragonFly logo instead of the BSD Beastie.  The old
version has been moved to src/sys/dev/misc/syscons/bsdlogo/ .

Idea from/Art converted by: Matt Emmerton <memmerto@yahoo.com>
Repo-copy help from: Matt Dillon <dillon@backplane.com>

17 years agoStyle(9) cleanup to src/sys/vfs, stage 11/21: ntfs.
Chris Pressey [Tue, 20 Apr 2004 19:59:30 +0000 (19:59 +0000)]
Style(9) cleanup to src/sys/vfs, stage 11/21: ntfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
17 years agoUpdate less to version 381.
Eirik Nygaard [Tue, 20 Apr 2004 17:43:33 +0000 (17:43 +0000)]
Update less to version 381.

17 years agoMerge from vendor branch LESS:
Eirik Nygaard [Tue, 20 Apr 2004 17:34:50 +0000 (17:34 +0000)]
Merge from vendor branch LESS:
Import of less 381

17 years agoImport of less 381
Eirik Nygaard [Tue, 20 Apr 2004 17:34:50 +0000 (17:34 +0000)]
Import of less 381

17 years agoWhen an mpipe was being destroyed, each element in the array was being
Matthew Dillon [Tue, 20 Apr 2004 16:58:32 +0000 (16:58 +0000)]
When an mpipe was being destroyed, each element in the array was being
freed, but the array itself was not.  Free the array as well.

Also do some minor tidying up of mpipe_done().

Reported-by: Craig Dooley <craig@xlnx-x.net>
17 years agom_tag_alloc illegally passed the mbuf flags to malloc, hitting the
Joerg Sonnenberger [Tue, 20 Apr 2004 07:35:22 +0000 (07:35 +0000)]
m_tag_alloc illegally passed the mbuf flags to malloc, hitting the
diagnostic panic there. Do the same as the other mbuf allocation
routines and check for M_WAIT explicitly.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
17 years agoRevamp the initial lwkt_abortmsg() support to normalize the abstraction. Now
Matthew Dillon [Tue, 20 Apr 2004 01:52:28 +0000 (01:52 +0000)]
Revamp the initial lwkt_abortmsg() support to normalize the abstraction.  Now
a message's primary command is always processed by the target even if an
abort is requested before the target has retrieved the message from the
message port.  The message will then be requeued and the abort command copied
into lwkt_msg_t->ms_cmd.  Thus the target is always guarenteed to see the
original message and then a second, abort message (the same message with
ms_cmd = ms_abort) regardless of whether the abort was requested before
or after the target retrieved the original message.

ms_cmd is now an opaque union.  LWKT makes no assumptions as to its contents.
The NET code now stores nm_handler in ms_cmd as a function vector, and
nm_handler has been removed from all netmsg structures.

The ms_cmd function vector support nominally returns an integer error code
which is intended to support synchronous/asynchronous optimizations in the
future (to bypass messaging queueing and dequeueing in those situations
where they can be bypassed, without messing up the messaging abstraction).

The connect() predicate for which signal/abort support was added in the last
commit now uses the new abort mechanism.  Instead of having the handler
function check whether a message represents an abort or not, a different
handler vector is stored in ms_abort and run when an abort is processed
(making for an easy separation of function).

The large netmsg switch has been replaced by individual function vectors
using the new ms_cmd function vector support.  This will soon be removed
entirely in favor of direct assignment of LWKT-aware PRU vectors to the
messages command vector.

NOTE ADDITIONAL: eventually the SYSCALL, VFS, and DEV interfaces will use
the new message opaque ms_cmd 'function vector' support instead of a
command index.

Work by: Matthew Dillon and Jeffrey Hsu