18 years agoAdd functionality to binutils 2.14's ld to scan /var/run/ld-elf.so.hints
Joerg Sonnenberger [Sun, 28 Mar 2004 16:26:33 +0000 (16:26 +0000)]
Add functionality to binutils 2.14's ld to scan /var/run/ld-elf.so.hints
for dependencies of shared libraries.

Submitted-By: Andreas Hauser <andy@splashground.de>
Obtained-From: FreeBSD / in-tree binutils 2.12

18 years agoAdd the pipe2 sysperf test. This test issues block writes from parent to
Matthew Dillon [Sun, 28 Mar 2004 09:21:53 +0000 (09:21 +0000)]
Add the pipe2 sysperf test.  This test issues block writes from parent to
child over a pipe and reports on the overhead and data rate.  The block size
is specified on the command line.

18 years agoUpdate to style(9) guidelines.
Chris Pressey [Sun, 28 Mar 2004 09:10:03 +0000 (09:10 +0000)]
Update to style(9) guidelines.

- Explicitly state that the ``register'' keyword should be avoided.
- Correct example and description of preferred indentation when wrapping
  function arguments over multiple lines.
- Resolve contradictions in guidelines for ``return''.
- Explicitly state whitespace rules for commas, semicolons, ``->'' and
  ``.'' operators.
- General clarifications.

Approved-by: dillon
18 years agoImport Alan Cox's /usr/src/sys/kern/sys_pipe.c 1.171. This rips out
Matthew Dillon [Sun, 28 Mar 2004 08:25:54 +0000 (08:25 +0000)]
Import Alan Cox's /usr/src/sys/kern/sys_pipe.c 1.171.  This rips out
writer-side KVA mappings and replaces them with writer-side vm_page wiring
(left intact from before) plus reader-side SF_BUF copies.

Import 1.141, which is a simple patch which removes a blocking condition
when space is available in the pipe's write buffer which was causing
non-blocking I/O select-based writes to spin-wait unnecessarily.  1.171
rips out writer-side KVA mappings and replaces them

Import FreeBSD-5.x's uiomove_fromphys(), which sys_pipe.c now uses.  This
procedure could become very useful in a number of DragonFly subsystems.

This greatly improves PIPE performance for the direct-mapped case (moderate
to large reads and writes).  Additionally, recent scheduler fixes greatly
improve PIPE performance for both the direct-mapped and small-buffer cases.

NOTE: wired page limits for pipes have not yet been imported, and the heavy
use of sf_buf's may require some tuning in the many-pipes case.

MBytes/s MBytes/s Tests on AMD64/3200+ FN85 MB
    ------- ------ ------ (64KB L1, 1MB L2)
    256KB 1900 2200
     64KB 1800 2200
     16KB 1650 2500-3000
      8KB 1400 2300
      4KB 1300 1400-1500 (note 1)

    note 1: The 4KB case is not a direct-write case, the results are due to
    the scheduler fixes only.

Obtained-from: FreeBSD-5.x / FreeBSD's Alan Cox

18 years agoDo some major performance tuning of the userland scheduler.
Matthew Dillon [Sun, 28 Mar 2004 08:03:05 +0000 (08:03 +0000)]
Do some major performance tuning of the userland scheduler.

When determining whether to reschedule, use a relative priority comparison
against PPQ rather then a queue index comparison to avoid the edge case
where two processes are only a p_priority of 1 apart, but fall into
different queues.  This reduces unnecessary preemptive context switches.
Also change the sense of test_resched() and document it.

Properly incriement p_ru.ru_nivcsw (involuntary context switches stat counter).

Fix uio_yield().  We have to call lwkt_setpri_self() to cycle our thread
to the end of its runq, and we do not need to call acquire_curproc() and
release_curproc() after switching.

When returning to userland, lower our priority and call lwkt_maybe_switch()
BEFORE acquiring P_CURPROC.  Before we called lwkt_maybe_switch() after we
acquired P_CURPROC which could result in us holding P_CURPROC, switching to
another thread which itself returns to usermode at a higher priority, and
that thread having to switch back to us to release P_CURPROC and then us back
to the other thread again.  This reduces the number of unnecessary context
switches that occur in certain situations.  In particular, this cuts the
number of context switches in PIPE situations by 50-75% (1/2 to 2/3).

18 years agoProtect v_usecount with a critical section for now (we depend on the BGL),
Matthew Dillon [Sun, 28 Mar 2004 07:54:00 +0000 (07:54 +0000)]
Protect v_usecount with a critical section for now (we depend on the BGL),
and assert that it does not drop below 0.

Suggested-by: David Rhodus <drhodus@machdep.com>
18 years agoStyle(9) cleanup.
Chris Pressey [Sun, 28 Mar 2004 01:02:54 +0000 (01:02 +0000)]
Style(9) cleanup.

- Remove ``register'' keyword.
- Remove casts to (void) when ignoring return values.
- Add ``static'' to internal function prototypes.
- Change an occurance of 1 to STDOUT_FILENO.
- Change an occurance of BUFSIZ to sizeof(ibuf).
- No functional changes.

18 years agoCorrect misspelling of "orphan" and fix up comment structure.
Chris Pressey [Sun, 28 Mar 2004 00:48:00 +0000 (00:48 +0000)]
Correct misspelling of "orphan" and fix up comment structure.

Obtained-from: NetBSD, src/sys/coda/coda_vfsops.c revision 1.32

18 years agoChange sendfile() to send the header out coaleseced with the data.
Jeffrey Hsu [Sat, 27 Mar 2004 21:01:03 +0000 (21:01 +0000)]
Change sendfile() to send the header out coaleseced with the data.

Inspired by Mike Silbersack's FreeBSD rev 1.171 to uipc_syscalls.c.

18 years agoPull out m_uiomove() functionality from sosend().
Jeffrey Hsu [Sat, 27 Mar 2004 11:50:45 +0000 (11:50 +0000)]
Pull out m_uiomove() functionality from sosend().

18 years agoGive UDP its own sosend() function.
Jeffrey Hsu [Sat, 27 Mar 2004 11:48:48 +0000 (11:48 +0000)]
Give UDP its own sosend() function.

18 years agoCorrect a typo that was introduced in revision 1.2.
Chris Pressey [Sat, 27 Mar 2004 01:46:10 +0000 (01:46 +0000)]
Correct a typo that was introduced in revision 1.2.
In makeargv(), 'margv' should have been 'margc'.
Compiles without warnings now.

Confirmed-with: FreeBSD CVSweb,
                /src/usr.sbin/timed/timedc/timedc.c revision 1.5

18 years agoStyle(9) cleanup: remove ``register'' keywords.
Chris Pressey [Sat, 27 Mar 2004 01:39:13 +0000 (01:39 +0000)]
Style(9) cleanup: remove ``register'' keywords.

18 years agoMake the .nx/.no native program helper binaries work and add some missing
Matthew Dillon [Fri, 26 Mar 2004 21:58:13 +0000 (21:58 +0000)]
Make the .nx/.no native program helper binaries work and add some missing
header file dependancies.

18 years agoThe NXCC (native C compiler) misnamed OBJFORMATPATH, it neesd to be
Matthew Dillon [Fri, 26 Mar 2004 21:57:23 +0000 (21:57 +0000)]
The NXCC (native C compiler) misnamed OBJFORMATPATH, it neesd to be
OBJFORMAT_PATH, causing 'missing crt1.o' from ld in the buildworld
includes stage.

18 years agoChange this vnode check inside of the VFS_BIO_DEBUG
David Rhodus [Fri, 26 Mar 2004 17:23:42 +0000 (17:23 +0000)]
Change this vnode check inside of the VFS_BIO_DEBUG
code path to check for erroneous hold counts from the
reference count check that was an el-relevant check here.

18 years agoUpdate rc.d scripts to use the correct path for the named pidfile.
David Rhodus [Fri, 26 Mar 2004 13:32:27 +0000 (13:32 +0000)]
Update rc.d scripts to use the correct path for the named pidfile.

Sent in by: Craig Dooley <craig@xlnx-x.net>

18 years agoStyle(9) cleanup.
Chris Pressey [Fri, 26 Mar 2004 00:30:13 +0000 (00:30 +0000)]
Style(9) cleanup.

- Convert K&R-style function definitions to ANSI style.
- Remove ``register'' keywords.
- Adjust whitespace and parens w.r.t. style(9) and remove casts to
  (void) when ignoring return values (time.c only.)

18 years agoFour new features and a bugfix.
Chris Pressey [Thu, 25 Mar 2004 23:55:13 +0000 (23:55 +0000)]
Four new features and a bugfix.

- Center the clock on the user's terminal.
- Check that the terminal is sufficiently large to fully display the
  clock (about 61x9.)  If not, exit immediately with an error.
- Introduce a short delay in the scrolling when -s is given, so that
  it can be better appreciated on syscons(4) and local xterm(1).  The
  default delay is 120 milliseconds.
- Add a new option, -d, to allow changing the scroll delay to any
  duration from 0 to 5000 milliseconds.  The -d option implies -s.
- Make it so that, when the optional argument is omitted, the clock
  really does run forever.  (Before this, it would have stopped after
  about 65536 seconds due to wraparound.)

18 years agoAttach mount_udf to the buildworld process now.
David Rhodus [Thu, 25 Mar 2004 22:07:21 +0000 (22:07 +0000)]
Attach mount_udf to the buildworld process now.

18 years agoFix a missing makewhatis related change so buildworld works again.
Matthew Dillon [Thu, 25 Mar 2004 20:52:43 +0000 (20:52 +0000)]
Fix a missing makewhatis related change so buildworld works again.

Reported-by: Chris Pressey <cpressey@catseye.mine.nu>
18 years agomake -j N support, the generated lib_gen.c and nomacros.h files depend
Matthew Dillon [Thu, 25 Mar 2004 18:07:27 +0000 (18:07 +0000)]
make -j N support, the generated lib_gen.c and nomacros.h files depend
on ncurses_def.h.

18 years agoReplace the Perl scripts makewhatis(1), makewhatis.local(8) and catman(1)
Joerg Sonnenberger [Thu, 25 Mar 2004 18:05:49 +0000 (18:05 +0000)]
Replace the Perl scripts makewhatis(1), makewhatis.local(8) and catman(1)
by C programs.

Submitted by: Dheeraj Reddy <dheerajs@comcast.net>
Taken from: FreeBSD

In contrast to FreeBSD, put makewhatis.local under src/libexec and put
makewhatis into src/usr.sbin. Update man pages accordingly.

18 years agoNext time I'll run cvs update to make sure I've added
David Rhodus [Thu, 25 Mar 2004 16:41:01 +0000 (16:41 +0000)]
Next time I'll run cvs update to make sure I've added
all the new files.

18 years agoChange whereis(1) over from a perl script to a C program.
David Rhodus [Thu, 25 Mar 2004 16:39:40 +0000 (16:39 +0000)]
Change whereis(1) over from a perl script to a C program.

Patch sent in by: Dheeraj Reddy <dheerajs@comcast.net>

18 years agoChange which(1) over from a perl script to a C program.
David Rhodus [Thu, 25 Mar 2004 16:18:40 +0000 (16:18 +0000)]
Change which(1) over from a perl script to a C program.

Patch sent in by: Dheeraj Reddy <dheerajs@comcast.net>

18 years agoCorrect obvious typo in comment.
Chris Pressey [Thu, 25 Mar 2004 07:30:45 +0000 (07:30 +0000)]
Correct obvious typo in comment.

18 years agoReturn a low priority for the "hostb%d" catch-all for pci busses, which will
Matthew Dillon [Thu, 25 Mar 2004 01:39:27 +0000 (01:39 +0000)]
Return a low priority for the "hostb%d" catch-all for pci busses, which will
allow compiled-in bus device drivers such as AGP to attach first.  Without
this the probe order is half hazzard and in particular SMP boxes may attach
"hostb" first, preventing AGP from attaching.

Note that AGP will still not load properly from loader.conf or after booting
with kldload.  Removing the "hostb" catch-all entirely solves that problem
but some additional investigation must be done first.

AGP-problems-reported-by: Adam K Kirchhoff <adamk@voicenet.com>
18 years agoDirectly call pru_control until copyin problem is resolved.
Jeffrey Hsu [Wed, 24 Mar 2004 21:58:44 +0000 (21:58 +0000)]
Directly call pru_control until copyin problem is resolved.

19 years agoNeed header file to deference proc structure.
Jeffrey Hsu [Wed, 24 Mar 2004 21:46:07 +0000 (21:46 +0000)]
Need header file to deference proc structure.

Reported by: drhodus

19 years agoFix malloc semantics (M_NOWAIT->M_INTWAIT/M_WAITOK).
Matthew Dillon [Wed, 24 Mar 2004 20:42:12 +0000 (20:42 +0000)]
Fix malloc semantics (M_NOWAIT->M_INTWAIT/M_WAITOK).

19 years agoagp_nvidia.c was not being linked into the module build.
Matthew Dillon [Wed, 24 Mar 2004 20:40:33 +0000 (20:40 +0000)]
agp_nvidia.c was not being linked into the module build.

19 years agoFix malloc semantics, M_NOWAIT->M_WAITOK.
Matthew Dillon [Wed, 24 Mar 2004 20:34:08 +0000 (20:34 +0000)]
Fix malloc semantics, M_NOWAIT->M_WAITOK.

19 years agoShould have been on last commit.
David Rhodus [Wed, 24 Mar 2004 20:26:10 +0000 (20:26 +0000)]
Should have been on last commit.
This allows LINT to build with UDF.

19 years agoStyle(9) cleanup.
Chris Pressey [Wed, 24 Mar 2004 18:23:47 +0000 (18:23 +0000)]
Style(9) cleanup.

- Convert K&R-style function definitions to ANSI style.
- Remove ``register'' keywords.
- (fdformat only) Remove/add whitespace around operators, add parens
  after sizeof and return, use NULL instead of O for null pointer,
  and remove (void) casts on ignored return values,
- Move local variable out of redundant inner block.
- Remove redundant return from end of void functions.
- *argv[] -> **argv.
- Correct wording of #endif hint-comment to __DragonFly__.

19 years agoStyle(9) cleanup.
Chris Pressey [Wed, 24 Mar 2004 17:46:23 +0000 (17:46 +0000)]
Style(9) cleanup.

- Convert K&R-style function definitions to ANSI style.
- Remove ``register'' keywords.
- Add needed static prototypes.
- Sort and space #include's as per style(9).
- Adjust indentation issues in a few places.
- Fix two typos in comments.
- Add $DragonFly$ tags.

19 years agoHook in UDF to the build process.
David Rhodus [Wed, 24 Mar 2004 17:39:51 +0000 (17:39 +0000)]
Hook in UDF to the build process.

19 years agoCorrect a bug in vm_page_cache(). We should make sure that a held
Hiten Pandya [Wed, 24 Mar 2004 17:06:44 +0000 (17:06 +0000)]
Correct a bug in vm_page_cache().  We should make sure that a held
page is not being added to the cache queue; they are no different
from wired or busy pages.

Do this by checking the page'hold_count' element.

19 years agomake -j N support, add a required dependancy.
Matthew Dillon [Wed, 24 Mar 2004 07:04:28 +0000 (07:04 +0000)]
make -j N support, add a required dependancy.

19 years agoEliminate use of curproc and curthread by propagating thread pointer down
Jeffrey Hsu [Wed, 24 Mar 2004 02:08:33 +0000 (02:08 +0000)]
Eliminate use of curproc and curthread by propagating thread pointer down
the call chain.

19 years agoPass the credentials along when available.
Jeffrey Hsu [Wed, 24 Mar 2004 01:58:01 +0000 (01:58 +0000)]
Pass the credentials along when available.

19 years agoANSIfication (procedure args) cleanup.
Matthew Dillon [Tue, 23 Mar 2004 22:54:32 +0000 (22:54 +0000)]
ANSIfication (procedure args) cleanup.

Submitted-by: Andre Nathan <andre@digirati.com.br>
19 years agoDo all the length checks before returning even if "ip_mthread_enable"
Jeffrey Hsu [Tue, 23 Mar 2004 22:30:49 +0000 (22:30 +0000)]
Do all the length checks before returning even if "ip_mthread_enable"
is not enabled.

19 years agoEliminate use of curthread in if_ioctl functions by passing down the
Jeffrey Hsu [Tue, 23 Mar 2004 22:19:08 +0000 (22:19 +0000)]
Eliminate use of curthread in if_ioctl functions by passing down the
ucred structure.

19 years agoStyle(9) cleanup.
Chris Pressey [Tue, 23 Mar 2004 18:34:41 +0000 (18:34 +0000)]
Style(9) cleanup.

- Split deeply nested code into its own function, draw_row().
- Remove pleonastic wrapper function movto().
- Convert K&R-style function declarations to ANSI style.
- Remove (void) cast when ignoring return value.
- Fix indentation and whitespace around operators.
- Remove once-humourous comments that have now fallen out of context.

19 years agoAdd -w, which prints the full width of the data being represented even if
Matthew Dillon [Tue, 23 Mar 2004 18:25:51 +0000 (18:25 +0000)]
Add -w, which prints the full width of the data being represented even if
it overflows the column, and do not truncate the base domain from displayed
host names.  This is for programmatic interfaces and for sysops
who really want to see the whole host name.

19 years agoMake the Destination and Gateway columns wider when printing FQDNs so
Matthew Dillon [Tue, 23 Mar 2004 18:00:48 +0000 (18:00 +0000)]
Make the Destination and Gateway columns wider when printing FQDNs so
the hostnames do not get cut-off too badly.

19 years agoAdd 'route show' to the route command, plus style cleanups.
Matthew Dillon [Tue, 23 Mar 2004 17:56:29 +0000 (17:56 +0000)]
Add 'route show' to the route command, plus style cleanups.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Taken-from: OpenBSD and NetBSD

19 years agoAdd hexdump and kill to the bootstrap list. Correct the tools path used
Matthew Dillon [Tue, 23 Mar 2004 17:21:09 +0000 (17:21 +0000)]
Add hexdump and kill to the bootstrap list.  Correct the tools path used
during a buildkernel.  There may still be other issues.

19 years agoAnother attempt to fix make -j N issues with this subdirectory.
Matthew Dillon [Tue, 23 Mar 2004 07:47:14 +0000 (07:47 +0000)]
Another attempt to fix make -j N issues with this subdirectory.

19 years agoStyle(9) cleanup.
Chris Pressey [Tue, 23 Mar 2004 07:45:34 +0000 (07:45 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords.
- Remove (void) casts when ignoring return values.
- Manually expand a one-use macro.
- Whitespace adjustment in variable declaration.

19 years agobuildworld subsystem update addendum. Hopefully fix buildkernel,
Matthew Dillon [Mon, 22 Mar 2004 23:49:06 +0000 (23:49 +0000)]
buildworld subsystem update addendum.  Hopefully fix buildkernel,
and fix the GROFF/TROFF environment paths (should solve an infinite loop
occuring in troff when building from FreeBSD-4.x).

19 years agoStyle(9) cleanup.
Chris Pressey [Mon, 22 Mar 2004 22:32:51 +0000 (22:32 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords and adjust a comment referencing them.
- Remove formfeeds.
- *argv[] -> **argv

19 years agoThis represents a major update to the buildworld subsystem.
Matthew Dillon [Mon, 22 Mar 2004 20:58:27 +0000 (20:58 +0000)]
This represents a major update to the buildworld subsystem.

    Compartmentalize the bootstrap/buildtools, the cross-build setup,
    and the world stage.  /usr/obj/usr/src is now far more readable
    (e.g. /usr/obj/usr/src/{btools_i386,ctools_i386_i386,world_i386}).

    Use a completely private command path for the world stage of the build.
    The bootstrap/buildtools stage compiles all required system programs
    (like rm, ln, chmod, etc).   At the moment the build compiles everything
    it needs, but this can be augmented later to 'cp' the required binaries
    into btools_<arch> instead of building them, including potentially copying
    the compiler binaries so the ctools_<arch> build could use a private
    path too).

    The 'buildworld' target now properly removes all object modules for
    all major stages.  Several new targets have been added to reduce
    build times, the most useful of which is 'quickworld', which skips
    the btools and ctools stages (they must have already been built).

    sys.mk has been augmented to support .nx binaries and .no object
    modules, which are built using ${NXCC} and friends, which always uses
    the system's native compiler rather then potentially using the
    cross-build compiler, for generating helper programs during the build.
    This way we do not have to special-case building the helper programs in
    an earlier stage as FreeBSD does.

    Fix a bug in 'wmake', which simulates the buildworld environment for
    piecemeal compilation/testing.  It was not using /usr/src/share/mk.

    Add additional .ORDER: constraints to better support make -j N
    (incomplete).  Note that recent changes to the DragonFly scheduler make
    it more likely for buildworld to trip over parallel make races.

    TOOLS_PREFIX was used to generate cross-compiler directory targets
    for exec'd utility binaries and access to libraries and include
    files.  However, in the new compartmentalized breakdown the cross
    compiler's utility binaries will reside in ctools_* while the
    include files and libraries are expected to be installed and accessed
    in world_*.  Add a USRDATA_PREFIX which defaults to TOOLS_PREFIX to
    allow the cross compilation stage to separate the two entities.

19 years agoChange to PCI_VENDOR_DELL
Joerg Sonnenberger [Mon, 22 Mar 2004 13:33:34 +0000 (13:33 +0000)]

19 years agoAdd device IDs of BCM5788, BCM5901 and BCM5901A2. Fix some spelling mistakes.
Joerg Sonnenberger [Mon, 22 Mar 2004 10:22:26 +0000 (10:22 +0000)]
Add device IDs of BCM5788, BCM5901 and BCM5901A2. Fix some spelling mistakes.

Obtained from FreeBSD.

Convert most PCI IDs to the pcidevs.h constants and leave only the BCM5788,
which isn't there, and alternative IDs for the BCM5702X and BCM5703X, which
couldn't be verified with www.pcidatabase.com.

19 years agoConsolidate length checks in ip_demux().
Jeffrey Hsu [Mon, 22 Mar 2004 06:38:17 +0000 (06:38 +0000)]
Consolidate length checks in ip_demux().

19 years agoStyle(9) cleanup.
Chris Pressey [Sun, 21 Mar 2004 22:41:24 +0000 (22:41 +0000)]
Style(9) cleanup.

- Convert K&R-style function declarations to ANSI style.
- Remove ``register'' keywords.
- Remove casts to (void) when ignoring return values.
- Minor indentation fixes.

19 years agogrr. fix bug in last commit. Use .ALLSRC instead of .OODATE
Matthew Dillon [Sun, 21 Mar 2004 17:33:19 +0000 (17:33 +0000)]
grr. fix bug in last commit.  Use .ALLSRC instead of .OODATE

19 years agoA large number of targets were doing a mkdir -p openssl. A parallel make
Matthew Dillon [Sun, 21 Mar 2004 17:15:41 +0000 (17:15 +0000)]
A large number of targets were doing a mkdir -p openssl.  A parallel make
may execute several of these simultaniously, causing mkdir -p to race against
itself.  mkdir -p is not atomic (it does a stat and then a later mkdir) and
can fail under these conditions, causing a buildworld -j N to fail, so move
it to its own dependancy.

19 years agoCosmetic cleanup.
Jeffrey Hsu [Sun, 21 Mar 2004 07:15:36 +0000 (07:15 +0000)]
Cosmetic cleanup.

19 years agoUndo part of the last commit. OBJFORMAT_PATH controls how the cross
Matthew Dillon [Sun, 21 Mar 2004 03:48:38 +0000 (03:48 +0000)]
Undo part of the last commit.  OBJFORMAT_PATH controls how the cross
compiler is exec'd, it is necessary for buildworld to find the correct
compiler and include file base directory.

19 years agocorrect a buildworld failure, fix the include file filter to allow the
Matthew Dillon [Sun, 21 Mar 2004 02:09:15 +0000 (02:09 +0000)]
correct a buildworld failure, fix the include file filter to allow the
primary directory names and filter most of the dummy softlinks that exist
for ports compatibility.

19 years agoNo changes. force commit / update timestamp so ioctl.c is regenerated.
Matthew Dillon [Sun, 21 Mar 2004 01:30:48 +0000 (01:30 +0000)]
No changes. force commit / update timestamp so ioctl.c is regenerated.

19 years agoAdd a missing resetpriority() which was causing all newly forked processes
Matthew Dillon [Sat, 20 Mar 2004 23:35:18 +0000 (23:35 +0000)]
Add a missing resetpriority() which was causing all newly forked processes
to get realtime priority until the next reschedule.  This permanently fixes
the 'jerky X pointer' problem.

Redo the parent estcpu inheritance code, make it much smarter by giving
child processes a small initial batch priority boost relative to the parent
and then allowing them to float back down if they are interactive, and
take this into account when aggregating the child's estcpu back into the
parent when the child exits.  This handles initial conditions for batch

19 years agoFix p_pctcpu and p_estcpu (addendum). Add a ESTCPUFREQ and set it to 10hz.
Matthew Dillon [Sat, 20 Mar 2004 19:21:08 +0000 (19:21 +0000)]
Fix p_pctcpu and p_estcpu (addendum).  Add a ESTCPUFREQ and set it to 10hz.
Change the systimer initialization to use the new constant.

19 years agoFix p_pctcpu and p_estcpu. When the new systimer stuff was put in the
Matthew Dillon [Sat, 20 Mar 2004 19:16:24 +0000 (19:16 +0000)]
Fix p_pctcpu and p_estcpu.  When the new systimer stuff was put in the
scheduler got its own clock interrupt for scheduling updates which was set
to 10Hz.  pctcpu was still being calculated based on 100hz, so change that
to 10hz.

The systimer stuff also broke estcpu, which in turn broke NICE.  Change
the estcpu equations to operate properly and get rid of some crufty comments.

Note that NICE really works now.  A cpu-bound nice +20 process will get
very little cpu relative to a cpu-bounce nice +0 process, and none relative
to a negatively-niced process.  From a standing start each nice level of
difference immediately shifts about 5% of the cpu between processes.  Once
the load and estcpu has stabilized (if the processes are cpu-bound), the
difference is around 2% per level, for two processes.  When starting a
highly-niced process in the face of lower-niced cpu-bound processes, the
highly-niced process may not get any cpu at all for up to 60 seconds.  This
is because the system 1-min loadav is used to scale estcpu.

19 years agoStyle(9) cleanup.
Chris Pressey [Sat, 20 Mar 2004 17:46:48 +0000 (17:46 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords.
- No space after ``sizeof''.
- Convert K&R-style function declarations to ANSI style.
- Remove (void) when ignoring return values.

19 years agoStyle(9) cleanup.
Chris Pressey [Sat, 20 Mar 2004 17:22:46 +0000 (17:22 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords.
- Convert K&R-style declarations to ANSI style.
- Fix typo in comment.

19 years agoStyle(9) cleanup.
Chris Pressey [Sat, 20 Mar 2004 17:09:44 +0000 (17:09 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords.
- Convert K&R-style declarations to ANSI style.
- Remove whitespace before EOL.

19 years agoStyle(9) cleanup.
Chris Pressey [Sat, 20 Mar 2004 17:00:52 +0000 (17:00 +0000)]
Style(9) cleanup.

- Remove ``register'' keywords.
- Add parentheses and remove space after ``sizeof'' and ``return''.

19 years agoStart removing the old build infrastructure for the a.out
David Rhodus [Sat, 20 Mar 2004 16:27:42 +0000 (16:27 +0000)]
Start removing the old build infrastructure for the a.out
binaries. MOst of the interface had already been depreciated
for a while now and we only had remnants remaining.

19 years ago64-byte-align the test functions so they appear on different cache lines.
Matthew Dillon [Sat, 20 Mar 2004 02:04:28 +0000 (02:04 +0000)]
64-byte-align the test functions so they appear on different cache lines.
It doesn't seem to make much of a difference through for some unknown
reason nop1() seems to have slightly lower overhead then nop2().

    dhcp62# /tmp/call3
    call nop() function through function pointer in loop
    call3/nop1-1 10.508s 1000000000 loops =  0.011uS/loop
    call3/nop1-2 14.610s 1000000000 loops =  0.015uS/loop
    call3/nop2-2  7.046s 1000000000 loops =  0.007uS/loop

19 years agoAdd some additional spaces so the ctl string does not bump the
Matthew Dillon [Sat, 20 Mar 2004 02:02:20 +0000 (02:02 +0000)]
Add some additional spaces so the ctl string does not bump the
timing values.

19 years agoAdd function call overhead tests for (1) direct calls, (2) indirect calls,
Matthew Dillon [Sat, 20 Mar 2004 01:51:01 +0000 (01:51 +0000)]
Add function call overhead tests for (1) direct calls, (2) indirect calls,
and (3) call(func) -> func() indirect calls where (a) function 1 is passed
to the call, (b) function 1 and function 2 alternate being passed to the
call, and (c) function 2 is passed to the call (as a double check).  i.e.
call3 is explicitly testing branch prediction misses.

19 years agoClean up the code in bin/ to reduce warnings from GCC3.
Chris Pressey [Fri, 19 Mar 2004 18:39:41 +0000 (18:39 +0000)]
Clean up the code in bin/ to reduce warnings from GCC3.

Stage 5 of 5: clean up sh.
- Add ``const'' to  appropriate variable declarations and casts.
- Add function prototypes and #include's as needed.
- Convert K&R style declarations to ANSI style.

Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
19 years agoMerge: FreeBSD (RELENG_4) ip_fw2.c rev.
Hiten Pandya [Fri, 19 Mar 2004 18:22:00 +0000 (18:22 +0000)]
Merge: FreeBSD (RELENG_4) ip_fw2.c rev.

IN_MULTICAST wants an address in host byte order.

19 years agoMerge: FreeBSD (HEAD) sys/kern/sysv_sem.c rev. 1.69
Hiten Pandya [Fri, 19 Mar 2004 18:00:25 +0000 (18:00 +0000)]
Merge: FreeBSD (HEAD) sys/kern/sysv_sem.c rev. 1.69

Adjust the number of processes waiting on a semaphore properly
if we are woken up in the middle of sleeping.

Reminded by: Colin Percival <cperciva@FreeBSD.org>

19 years agoClean up the code in bin/ to reduce warnings from GCC3.
Chris Pressey [Fri, 19 Mar 2004 17:47:49 +0000 (17:47 +0000)]
Clean up the code in bin/ to reduce warnings from GCC3.

Stage 4 of 5 or so: cleanups to ed and ps.
- Add ``const'' and ``static'' to  appropriate variable delcarations
  and casts.
- Fix signedness on appropriate ``int'' declarations.
- Convert appropriate ``int'' types to ``size_t''.
- Rename functions/variables to not conflict with globals.
- Add missing #include's.

Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
19 years agoClean up the code in bin/ to reduce warnings from GCC3.
Chris Pressey [Fri, 19 Mar 2004 17:30:59 +0000 (17:30 +0000)]
Clean up the code in bin/ to reduce warnings from GCC3.

Stage 3 of 5 or so: cleanups to cp, cpdup, and date.
- Add ``const'' to  appropriate variable declarations and casts.
- Convert ``quad'' types to ``long long''.
- Convert appropriate ``int'' types to ``size_t'' and ``dev_t''.
- Rename functions/variables to not conflict with globals.
- Add/remove function prototypes and #includes as appropriate.
- Split a long string constant.
- Convert K&R style declarations to ANSI style.

Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
19 years agoClean up the code in bin/ to reduce warnings from GCC3.
Chris Pressey [Fri, 19 Mar 2004 17:17:46 +0000 (17:17 +0000)]
Clean up the code in bin/ to reduce warnings from GCC3.

Stage 2 of 5 or so: small cleanups across several programs.
- Convert ``quad'' types to ``long long''.
- Convert appropriate ``int'' types to ``size_t''.
- Fix comment syntax to use /* */ instead of //.
- Initialize a variable before using it.
- Remove an unneeded cast.

Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
19 years agoGet rid of the obsolete SMP checks in SMBFS.
Matthew Dillon [Fri, 19 Mar 2004 17:06:08 +0000 (17:06 +0000)]
Get rid of the obsolete SMP checks in SMBFS.

19 years agoMake ALWAYS_MSG the default. This introduces an extra procedural call
Matthew Dillon [Fri, 19 Mar 2004 17:00:06 +0000 (17:00 +0000)]
Make ALWAYS_MSG the default.  This introduces an extra procedural call
level but has the advantage of making the so_pru_*() API functions uniform
across all builds, which we will need for things like the smbfs module.
We will fix up any performance issues down the line.

19 years agoClean up the code in bin/ to reduce warnings from GCC3.
Chris Pressey [Fri, 19 Mar 2004 16:37:24 +0000 (16:37 +0000)]
Clean up the code in bin/ to reduce warnings from GCC3.

Stage 1 of 5 or so: clean up usr.bin/prinf, as it gets included by
- Convert ``quad'' types to ``long long''.

Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
19 years agoFix minor formatting errors in cpdup(1)'s man page.
Chris Pressey [Fri, 19 Mar 2004 07:46:46 +0000 (07:46 +0000)]
Fix minor formatting errors in cpdup(1)'s man page.

19 years agoIf XL cannot properly attach it tries to detach to clean up. Unfortunately,
Matthew Dillon [Fri, 19 Mar 2004 06:30:08 +0000 (06:30 +0000)]
If XL cannot properly attach it tries to detach to clean up.  Unfortunately,
the detach code expects it to have gotten most of the way through the attach
and if it hasn't the system will crash.  This commit adds a flag that tells
the detach code whether the attach got far enough along for the detach to
be able to reset the card (and do certain other things).

19 years agoIncorporate NetBSD rev 1.111: Set the device address before reading the
Matthew Dillon [Fri, 19 Mar 2004 00:35:57 +0000 (00:35 +0000)]
Incorporate NetBSD rev 1.111:  Set the device address before reading the
device descriptor.  This makes certain non-conforming devices work.  Suggested
by Peter Burnett in [NetBSD]kern/24716.

19 years agoFix generation of USB_EVENT_DEVICE_DETACH, which was commented out in
Matthew Dillon [Fri, 19 Mar 2004 00:30:32 +0000 (00:30 +0000)]
Fix generation of USB_EVENT_DEVICE_DETACH, which was commented out in
FreeBSD.  Incorporate NetBSD rev 1.110 which fixes an access to freed
memory which was previously causing the detach event to crash the system.

Reported-By: Andreas Fuchs <asf@boinkor.net>
19 years agoBring in MODULE_VERSION from FreeBSD-5. Even though our kernel doesn't
Matthew Dillon [Thu, 18 Mar 2004 18:51:56 +0000 (18:51 +0000)]
Bring in MODULE_VERSION from FreeBSD-5.  Even though our kernel doesn't
check version numbers, the boot loader apparently does.

19 years agoAdjust the Makefile's to move the iconv files to libiconv, and add it to
Matthew Dillon [Thu, 18 Mar 2004 18:47:41 +0000 (18:47 +0000)]
Adjust the Makefile's to move the iconv files to libiconv, and add it to
the module build.

19 years agoRepository copy libkern/{Makefile,iconv*} -> libiconv, and modify the
Matthew Dillon [Thu, 18 Mar 2004 18:27:47 +0000 (18:27 +0000)]
Repository copy libkern/{Makefile,iconv*} -> libiconv, and modify the
Makefile appropriately.

19 years agoAdd lock.9 man page, it is also symlinked to: lockcount.9, lockinit.9,
Eirik Nygaard [Thu, 18 Mar 2004 15:18:02 +0000 (15:18 +0000)]
Add lock.9 man page, it is also symlinked to: lockcount.9, lockinit.9,
lockmgr.9, lockmgr_printinfo.9 and lockstatus.9.

Obtained from: FreeBSD

19 years agoPractice commit: learn how to use 'cvs remove', so that, should I need
Chris Pressey [Thu, 18 Mar 2004 02:52:44 +0000 (02:52 +0000)]
Practice commit: learn how to use 'cvs remove', so that, should I need
to use it someday, I won't accidentally burn down the entire CVS tree.

19 years agoAdd manual page for the busdma(9) API. It has detailed information on
Hiten Pandya [Thu, 18 Mar 2004 00:07:53 +0000 (00:07 +0000)]
Add manual page for the busdma(9) API.  It has detailed information on
the access methods of busdma and specifications for its usage.

Requested by: Joerg

19 years agoPre-test spot removal solutions in an inconspicuous area before use.
Chris Pressey [Wed, 17 Mar 2004 21:21:27 +0000 (21:21 +0000)]
Pre-test spot removal solutions in an inconspicuous area before use.

Suggested-by: dillon
19 years agoAdd additional default-generation entries for usb2-5, most new PCs these
Matthew Dillon [Wed, 17 Mar 2004 19:20:12 +0000 (19:20 +0000)]
Add additional default-generation entries for usb2-5, most new PCs these
days have more then two USB busses and EHCI also renumbers for companion

19 years agoAdd some USB specific documentation to make life easier for people
Matthew Dillon [Wed, 17 Mar 2004 19:19:17 +0000 (19:19 +0000)]
Add some USB specific documentation to make life easier for people
playing around with DragonFly/USB directly from the live CD.

19 years agoAdd some missing SRCS dependancies to the EHCI module.
Matthew Dillon [Wed, 17 Mar 2004 19:11:26 +0000 (19:11 +0000)]
Add some missing SRCS dependancies to the EHCI module.

19 years agoSeparate the pieces a bit. The usb.ko module does not build EHCI, and
Matthew Dillon [Wed, 17 Mar 2004 18:12:57 +0000 (18:12 +0000)]
Separate the pieces a bit.  The usb.ko module does not build EHCI, and
probably isn't stable enough to include EHCI by default yet, so
reorganize the Makefile's into subdirectories so we can build a separate
EHCI companion KLD.

19 years agoMerge FreeBSD ifconfig.c rev 1.94, strlcpy() cannot be used if the source
Matthew Dillon [Wed, 17 Mar 2004 09:32:18 +0000 (09:32 +0000)]
Merge FreeBSD ifconfig.c rev 1.94, strlcpy() cannot be used if the source
string is not terminated.  This is a clean rewrite of the (minor) patch and
not a direct MFC.

Reminded-by: Brooks Davis <brooks@one-eyed-alien.net>