dragonfly.git
12 years agoFix logic to avoid a potential deadlock in ahd_run_qoutfifo()
Peter Avalos [Tue, 3 Jul 2007 21:13:35 +0000 (21:13 +0000)]
Fix logic to avoid a potential deadlock in ahd_run_qoutfifo()
if we happen to catch the DMA engine in just the right state.

Obtained-from:  FreeBSD

12 years agoConvert to use cam_calc_geometry().
Peter Avalos [Tue, 3 Jul 2007 20:55:42 +0000 (20:55 +0000)]
Convert to use cam_calc_geometry().

Obtained-from:  FreeBSD

12 years agoRemove last usb_port.h defines usages from the tree - selwakeuppri(),
Hasso Tepper [Tue, 3 Jul 2007 19:28:16 +0000 (19:28 +0000)]
Remove last usb_port.h defines usages from the tree - selwakeuppri(),
config_pending_*(), config_detach(), clalloc(), clfree(), usb_malloc_type
and usb_proc_ptr.

Move some defines to bus/usb/usb.h and remove bus/usb/usb_port.h include
from there. Drivers that want to use portability macros have to include
<bus/usb/usb_port.h> directly.

12 years agoFrom FreeBSD's log:
Peter Avalos [Tue, 3 Jul 2007 18:51:45 +0000 (18:51 +0000)]
From FreeBSD's log:

Log:
Fixed about 50 million errors of infinity ulps and about 3 million errors
of between 1.0 and 1.8509 ulps for lgammaf(x) with x between -2**-21 and
-2**-70.

As usual, the cutoff for tiny args was not correctly translated to
float precision.  It was 2**-70 but 2**-21 works.  Not as usual, having
a too-small threshold was worse than a pessimization.  It was just a
pessimization for (positive) args between 2**-70 and 2**-21, but for
the first ~50 million (negative) args below -2**-70, the general code
overflowed and gave a result of infinity instead of correct (finite)
results near 70*log(2).  For the remaining ~361 million negative args
above -2**21, the general code gave almost-acceptable errors (lgamma[f]()
is not very accurate in general) but the pessimization was larger than
for misclassified tiny positive args.

Now the max error for lgammaf(x) with |x| < 2**-21 is 0.7885 ulps, and
speed and accuracy are almost the same for positive and negative args
in this range.  The maximum error overall is still infinity ulps.

A cutoff of 2**-70 is probably wastefully small for the double precision
case.  Smaller cutoffs can be used to reduce the max error to nearly
0.5 ulps for tiny args, but this is useless since the general algrorithm
for nearly-tiny args is not nearly that accurate -- it has a max error of
about 1 ulp.

Obtained-from:  FreeBSD

12 years agoAdd a section on how to build the world inside a virtual kernel.
Matthew Dillon [Tue, 3 Jul 2007 18:05:55 +0000 (18:05 +0000)]
Add a section on how to build the world inside a virtual kernel.

12 years agoFix an issue which arises with the TAP interface when the highly
Matthew Dillon [Tue, 3 Jul 2007 17:40:51 +0000 (17:40 +0000)]
Fix an issue which arises with the TAP interface when the highly
experimental kern.intr_mpsafe is set.  TAP has to obtain the MP lock
when handling SIGIO.

Reported-by: Pawel Biernacki <kaktus@acn.pl>
12 years agoFix a number of races in the controlling terminal open/close code.
Matthew Dillon [Tue, 3 Jul 2007 17:22:14 +0000 (17:22 +0000)]
Fix a number of races in the controlling terminal open/close code.
This does not completely fix issue 715 but it should help reduce the
problem set.

* Integrate the revoke into ttyclosesession() so it can be issued as part
  of the same locking op.
* Check for races after acquiring the vnode lock and retry if necessary.
* Use vhold/vdrop to prevent destruction of the vnode during a possible
  race while we are attempting to obtain the lock.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk> added the comment:
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue715>

12 years agoFix typo.
Hasso Tepper [Tue, 3 Jul 2007 07:21:08 +0000 (07:21 +0000)]
Fix typo.

12 years agoNuke USB_DO_ATTACH and remove device_t dv, since it is no longer needed.
Hasso Tepper [Tue, 3 Jul 2007 06:58:50 +0000 (06:58 +0000)]
Nuke USB_DO_ATTACH and remove device_t dv, since it is no longer needed.

Obtained-from: FreeBSD

12 years agoNuke the code specific to other BSDs.
Hasso Tepper [Tue, 3 Jul 2007 06:38:36 +0000 (06:38 +0000)]
Nuke the code specific to other BSDs.

12 years agoOptimizations, expanded comments, and accuracy fixes.
Peter Avalos [Tue, 3 Jul 2007 04:54:07 +0000 (04:54 +0000)]
Optimizations, expanded comments, and accuracy fixes.

For in-depth comments, see the FreeBSD cvs logs:
s_cbrt.c:  1.8-1.14
s_sbrtf.c: 1.8-1.17

Obtained-from:  FreeBSD

12 years agoNuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.
Hasso Tepper [Mon, 2 Jul 2007 23:52:05 +0000 (23:52 +0000)]
Nuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.

12 years agoOops, forgot space.
Sascha Wildner [Mon, 2 Jul 2007 19:32:34 +0000 (19:32 +0000)]
Oops, forgot space.

12 years agoAdd break after parsing the -n option.
Joe Talbott [Mon, 2 Jul 2007 17:44:00 +0000 (17:44 +0000)]
Add break after parsing the -n option.

12 years agoIf more then 2 virtual cpus are present, dedicate one to handle I/O
Matthew Dillon [Mon, 2 Jul 2007 17:15:10 +0000 (17:15 +0000)]
If more then 2 virtual cpus are present, dedicate one to handle I/O
processing.

12 years agoAdd usched_mastermask - a master cpu mask specifying which cpus user
Matthew Dillon [Mon, 2 Jul 2007 17:06:56 +0000 (17:06 +0000)]
Add usched_mastermask - a master cpu mask specifying which cpus user
processes can run on.  Default to all cpus.

12 years agoThe vkernel's copyin/copyout implementation is not MP safe, acquire and
Matthew Dillon [Mon, 2 Jul 2007 16:52:25 +0000 (16:52 +0000)]
The vkernel's copyin/copyout implementation is not MP safe, acquire and
release the MP lock.

12 years agoImplement an architecture call for contended spinlocks so the vkernel can
Matthew Dillon [Mon, 2 Jul 2007 16:52:01 +0000 (16:52 +0000)]
Implement an architecture call for contended spinlocks so the vkernel can
insert a usleep().

12 years agoA virtual kernel can cause a vm_page's hold_count to exceed 32768. Make
Matthew Dillon [Mon, 2 Jul 2007 15:57:48 +0000 (15:57 +0000)]
A virtual kernel can cause a vm_page's hold_count to exceed 32768.  Make
the field an int like it should have been in the first place.

12 years agoGive virtual kernels access to sysctl() prototypes and clean up warnings.
Matthew Dillon [Mon, 2 Jul 2007 15:18:53 +0000 (15:18 +0000)]
Give virtual kernels access to sysctl() prototypes and clean up warnings.

12 years agoMake the virtual kernel's systimer work with SMP builds. Have it
Matthew Dillon [Mon, 2 Jul 2007 14:47:27 +0000 (14:47 +0000)]
Make the virtual kernel's systimer work with SMP builds.  Have it
use the real system's systimer instead of gettimeofday().

12 years agoThere is no need to have ETHER_ALIGN define here.
Hasso Tepper [Mon, 2 Jul 2007 07:07:08 +0000 (07:07 +0000)]
There is no need to have ETHER_ALIGN define here.

12 years agoNuke USB_GET_SC and USB_GET_SC_OPEN macros.
Hasso Tepper [Mon, 2 Jul 2007 06:43:31 +0000 (06:43 +0000)]
Nuke USB_GET_SC and USB_GET_SC_OPEN macros.

12 years agoBecause the objcache caches up to two magazines on each cpu some pretty
Matthew Dillon [Mon, 2 Jul 2007 06:34:26 +0000 (06:34 +0000)]
Because the objcache caches up to two magazines on each cpu some pretty
bad degenerate conditions will be hit if the cluster limit is set too small
or the magazine size is set too large.

Detect the problem and reduce the magazine size to compensate.  If we hit
the minimum magazine size (16), increase the cluster limit to compensate.
Report the corrections on the console.

We also have the option of stealing magazines from other cpus, or reducing
the magazine size even further to handle extreme cases.

This should solve most of the objcache issues when ncpus is set to 31.

12 years agoPut a timeout on the umtx_sleep() in the idle loop and add conditional
Matthew Dillon [Mon, 2 Jul 2007 06:30:26 +0000 (06:30 +0000)]
Put a timeout on the umtx_sleep() in the idle loop and add conditional
debugging code to try to detect races.

12 years agoExhaust the virtual kernel network interface even if we cannot allocate
Matthew Dillon [Mon, 2 Jul 2007 05:38:28 +0000 (05:38 +0000)]
Exhaust the virtual kernel network interface even if we cannot allocate
mbufs, otherwise we stop getting interrupts and the packets just build up
in the TUN device.

12 years agosigwinch has to run with the big giant lock so use the DragonFly
Matthew Dillon [Mon, 2 Jul 2007 04:19:14 +0000 (04:19 +0000)]
sigwinch has to run with the big giant lock so use the DragonFly
interrupt API to handle it rather then running it directly from the
signal handler.  Fixes a panic.

12 years agoIncrease SMP_MAXCPU to 31. Can't do 32 (boo hoo!) because spinlocks need
Matthew Dillon [Mon, 2 Jul 2007 03:44:12 +0000 (03:44 +0000)]
Increase SMP_MAXCPU to 31.  Can't do 32 (boo hoo!) because spinlocks need
a bit in the cpumask.

Add DELAY()'s (usleep()'s) in the AP startup code where we spin on the MP
lock.  This greatly improves startup speed when you specify 31 cpus.

Fix a bug in the kqueue interrupt init.  The kqueue code was not registering
its interrupt soon enough which could cause the timer to stop generating
interrupts.

12 years agoAdd an option (-n ncpus) to specify the number of cpus a virtual kernel
Matthew Dillon [Mon, 2 Jul 2007 02:37:05 +0000 (02:37 +0000)]
Add an option (-n ncpus) to specify the number of cpus a virtual kernel
should simulate.  The virtual kernel must be built with options SMP.
1-32 cpus may be simulated regardless of the number of real cpus.  The
virtual kernel will create a thread for each cpu.

12 years agoThe real-kernel madvise and mcontrol system calls handle SMP interactions
Matthew Dillon [Mon, 2 Jul 2007 02:23:00 +0000 (02:23 +0000)]
The real-kernel madvise and mcontrol system calls handle SMP interactions
when manipulating virtual page tables.  Construct a new set of functions
for the virtual kernel to take advantage of this.

Add a cpu cache mask to the pmap structure for the virtual kernel which
allows us to invalidate per-cpu page table mappings simply by clearing
the mask.  Also reload PT1pde after a successful cache hit if the cpu
mask bit is found to be 0.

Redo most of the PTE handling code for the virtual kernel.  Use the new
invalidation function set and carefully deal with race conditions between
cpus.  Race conditions are far more serious with a SMP virtual kernel then
with a real kernel because there are effectively two levels of page table
caching instead of one, since the real kernel maintains a separate pmap
for each VM space under the virtual kernel's control in addition to the
standard TLB interactions.

12 years agoThe kernel perfmon support (options PERFMON) was trying to initialize its
Matthew Dillon [Mon, 2 Jul 2007 02:14:32 +0000 (02:14 +0000)]
The kernel perfmon support (options PERFMON) was trying to initialize its
device way too early in the boot sequence, resulting in a panic on SMP
boxes.  Move initialization to a bit later in the boot sequence.

Reported-by: Thomas Nikolajsen <sinknull@crater.dragonflybsd.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue714>

12 years agosched_ithd() must be called from within a critical section.
Matthew Dillon [Mon, 2 Jul 2007 01:47:22 +0000 (01:47 +0000)]
sched_ithd() must be called from within a critical section.

12 years agoCopy a junk file from pc32 needed for <time.h>
Matthew Dillon [Mon, 2 Jul 2007 01:43:30 +0000 (01:43 +0000)]
Copy a junk file from pc32 needed for <time.h>

12 years agoOnly use the symbol returned by dladdr() if its address is <= the
Matthew Dillon [Mon, 2 Jul 2007 01:42:07 +0000 (01:42 +0000)]
Only use the symbol returned by dladdr() if its address is <= the
address we are trying to decode.

12 years agoClean up a kprintf() that was missing a newline.
Matthew Dillon [Mon, 2 Jul 2007 01:41:26 +0000 (01:41 +0000)]
Clean up a kprintf() that was missing a newline.

Submitted-by: Joe Talbott <josepht@cstone.net>
12 years agoImplement an architecture function cpu_mplock_contested() which is
Matthew Dillon [Mon, 2 Jul 2007 01:37:11 +0000 (01:37 +0000)]
Implement an architecture function cpu_mplock_contested() which is
called by the LWKT thread scheduler when the only thread(s) it can
schedule need the MP lock and the scheduler was unable to acquire the
MP lock.

On real systems this function just executes the cpu 'pause' instruction,
and on virtual systems this functions sleeps for a millisecond.

Use umtx_sleep() instead of sigpause() in the virtual kernel's idle loop
to interlock threads scheduled via a signal with the idle loop sleep.
This fixes a race condition that caused the vkernel to stop scheduling
(but there may be more issues, stay tuned).

12 years agoDo not allow umtx_sleep() to restart on a restartable signal. We want to
Matthew Dillon [Mon, 2 Jul 2007 01:30:07 +0000 (01:30 +0000)]
Do not allow umtx_sleep() to restart on a restartable signal.  We want to
return EINTR so the caller can handle side effects from the signal.

12 years agoNuke USB_MATCH*, USB_ATTACH* and USB_DETACH* macros.
Hasso Tepper [Sun, 1 Jul 2007 21:24:04 +0000 (21:24 +0000)]
Nuke USB_MATCH*, USB_ATTACH* and USB_DETACH* macros.

12 years agoRemove .Pp before .Sh.
Sascha Wildner [Sun, 1 Jul 2007 17:23:25 +0000 (17:23 +0000)]
Remove .Pp before .Sh.

12 years agoAdd markup and clean up a bit.
Sascha Wildner [Sun, 1 Jul 2007 10:49:36 +0000 (10:49 +0000)]
Add markup and clean up a bit.

12 years agoAlso credit lots of help from Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Matthew Dillon [Sun, 1 Jul 2007 04:02:33 +0000 (04:02 +0000)]
Also credit lots of help from Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
in the SMP virtual kernel commit.

12 years agoUse dladdr() to obtain symbol names when possible and try to dump the
Matthew Dillon [Sun, 1 Jul 2007 03:28:54 +0000 (03:28 +0000)]
Use dladdr() to obtain symbol names when possible and try to dump the
entire stack backtrace instead of just the first call.

12 years agoConditionalize SMP bits for non-SMP builds.
Matthew Dillon [Sun, 1 Jul 2007 03:04:15 +0000 (03:04 +0000)]
Conditionalize SMP bits for non-SMP builds.

12 years agoBring in all of Joe Talbott's SMP virtual kernel work to date, which makes
Matthew Dillon [Sun, 1 Jul 2007 02:51:45 +0000 (02:51 +0000)]
Bring in all of Joe Talbott's SMP virtual kernel work to date, which makes
virtual kernel builds with SMP almost get through a full boot.  This work
includes:

    * Creation of 'cpu' threads via libthread_xu
    * Globaldata initialization
    * AP synchronization
    * Bootstrapping to the idle thread
    * SMP pmap (mmu) functions
    * IPI handling

My part of this commit:

    * Bring all the signal interrupts under DragonFly's machine independant
      interrupt handler API.  This will properly deal with the MP lock
      and critical section handling.

    * Some additional pmap bits to handle SMP invalidation issues.

Submitted-by: Joe Talbott <josepht@cstone.net>
Additional-bits-by: Matt Dillon
12 years agoMore multi-threaded support for virtualization. Move the save context
Matthew Dillon [Sun, 1 Jul 2007 01:11:38 +0000 (01:11 +0000)]
More multi-threaded support for virtualization.  Move the save context
from the process structure to the lwp structure, cleaning up the vmspace
support structures at the same time.  This allows multiple LWPs in the
same process to be running a virtualization context at the same time.

12 years agomi_switch() and cpu_switch() are gone. Remove manpage and prototype.
Sascha Wildner [Sun, 1 Jul 2007 00:03:49 +0000 (00:03 +0000)]
mi_switch() and cpu_switch() are gone. Remove manpage and prototype.

12 years agoA signal is sent to a particular LWP must be delivered to that LWP and never
Matthew Dillon [Sat, 30 Jun 2007 23:38:31 +0000 (23:38 +0000)]
A signal is sent to a particular LWP must be delivered to that LWP and never
posted to the process generically.  Otherwise things like seg faults can
end up being posted to the wrong LWP.

12 years agoUse the actual function name in the message.
Sascha Wildner [Sat, 30 Jun 2007 21:52:19 +0000 (21:52 +0000)]
Use the actual function name in the message.

12 years agotvtohz() was split into tvtohz_low() and tvtohz_high() in Jan 2004.
Sascha Wildner [Sat, 30 Jun 2007 21:47:54 +0000 (21:47 +0000)]
tvtohz() was split into tvtohz_low() and tvtohz_high() in Jan 2004.

Update the manual page with some words from the comments in kern_clock.c.

12 years agoNuke PROC_(UN)LOCK, usb_callout_t, usb_kthread_create* and uio_procp.
Hasso Tepper [Sat, 30 Jun 2007 20:39:22 +0000 (20:39 +0000)]
Nuke PROC_(UN)LOCK, usb_callout_t, usb_kthread_create* and uio_procp.

12 years agoFix KASSERT messages.
Hasso Tepper [Sat, 30 Jun 2007 20:17:36 +0000 (20:17 +0000)]
Fix KASSERT messages.

12 years agoClean up a bit.
Sascha Wildner [Sat, 30 Jun 2007 19:20:48 +0000 (19:20 +0000)]
Clean up a bit.

12 years agoUse .Va for errno.
Sascha Wildner [Sat, 30 Jun 2007 19:03:52 +0000 (19:03 +0000)]
Use .Va for errno.

12 years agoTry to avoid accidental foot shooting by not allowing a virtual kernel
Matthew Dillon [Sat, 30 Jun 2007 05:54:03 +0000 (05:54 +0000)]
Try to avoid accidental foot shooting by not allowing a virtual kernel
to be installed unless DESTDIR is explicitly specified.

12 years agoMove the P_WEXIT check from lwpsignal() to kern_kill(). That is, disallow
Matthew Dillon [Sat, 30 Jun 2007 02:33:04 +0000 (02:33 +0000)]
Move the P_WEXIT check from lwpsignal() to kern_kill().  That is, disallow
signals to exiting processes but allow signals to threads that have not gone
through the exit interlock yet.  This allows exit1() to interlock the process
and still signal its LWPs.

Fix a bug in exit1() which was improperly using lwp_signotify() to wake up
LWPs to force the to exit.  This function is basically a NOP if there are
no signals pending to the LWP.  Send a real SIGKILL to the LWP instead.

This fixes a bug where vkernels get stuck in an exiting state and cannot be
killed.

Reported-by: Joe Talbott <josepht@cstone.net>
12 years agoUpdate the documentation for sys_checkpoint().
Matthew Dillon [Sat, 30 Jun 2007 01:59:41 +0000 (01:59 +0000)]
Update the documentation for sys_checkpoint().

12 years agoAdd MLINKS for checkpoint.1, because most point looking for information
Matthew Dillon [Sat, 30 Jun 2007 01:40:56 +0000 (01:40 +0000)]
Add MLINKS for checkpoint.1, because most point looking for information
out of the cold on checkpointing will probably try 'man checkpoint' more
often then 'man checkpt'.

12 years agoFlag the checkpoint descriptor so on restore we can identify it and use the
Matthew Dillon [Fri, 29 Jun 2007 23:40:00 +0000 (23:40 +0000)]
Flag the checkpoint descriptor so on restore we can identify it and use the
descriptor for the restore rather then trying to look up the original
checkpoint file.  This issue occurs when a program calls sys_checkpoint()
manually.

This allows a checkpoint-resume to be done on a copied checkpoint file,
or a gzipped (then gunzipped) checkpoint file, etc.  The original checkpoint
file no longer needs to remain intact.

Requested-by: _why <why@ruby-lang.org>
12 years agoNuke usb_ callout macros.
Hasso Tepper [Fri, 29 Jun 2007 22:56:31 +0000 (22:56 +0000)]
Nuke usb_ callout macros.

12 years agoImplement struct lwp->lwp_vmspace. Leave p_vmspace intact. This allows
Matthew Dillon [Fri, 29 Jun 2007 21:54:15 +0000 (21:54 +0000)]
Implement struct lwp->lwp_vmspace.  Leave p_vmspace intact.  This allows
vkernels to run threaded and to run emulated VM spaces on a per-thread basis.
struct proc->p_vmspace is left intact, making it easy to switch into and out
of an emulated VM space.  This is needed for the virtual kernel SMP work.

This also gives us the flexibility to run emulated VM spaces in their own
threads, or in a limited number of separate threads.  Linux does this and
they say it improved performance.  I don't think it necessarily improved
performance but its nice to have the flexibility to do it in the future.

12 years agoAdd some useful references to various manual pages which deal with random
Sascha Wildner [Fri, 29 Jun 2007 19:34:41 +0000 (19:34 +0000)]
Add some useful references to various manual pages which deal with random
numbers.

Suggested-by: Robin Carey <robin_carey5@yahoo.co.uk>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue708>

12 years agoThis is a simple little syslink test program which ping-pongs a 64K
Matthew Dillon [Fri, 29 Jun 2007 17:18:42 +0000 (17:18 +0000)]
This is a simple little syslink test program which ping-pongs a 64K
buffer around.

12 years agoClean up syslink a bit and add an abstraction that will eventually allow
Matthew Dillon [Fri, 29 Jun 2007 05:14:00 +0000 (05:14 +0000)]
Clean up syslink a bit and add an abstraction that will eventually allow
zero-copy support for I/O on syslink DMA bufs.

12 years agoAdd O_MAPONREAD (not yet implemented). This will have the semantics of
Matthew Dillon [Fri, 29 Jun 2007 05:12:40 +0000 (05:12 +0000)]
Add O_MAPONREAD (not yet implemented).  This will have the semantics of
replacing the underlying VM with a copy-on-write page mapping when possible.
Ultimately when used with syslink this will have the semantics of allowing
a fully shared mapping for syslink DMA buffers.

12 years agoAdd a new flag, XIOF_VMLINEAR, which requires that the buffer being mapped
Matthew Dillon [Fri, 29 Jun 2007 05:09:15 +0000 (05:09 +0000)]
Add a new flag, XIOF_VMLINEAR, which requires that the buffer being mapped
be contiguous within a single VM object.

12 years agoGet out-of-band DMA buffers working for user<->user syslinks. This
Matthew Dillon [Fri, 29 Jun 2007 00:18:05 +0000 (00:18 +0000)]
Get out-of-band DMA buffers working for user<->user syslinks.  This
allows the syslink protocol to operate in a manner very similar to the
way sophisticated DMA hardware works, where you have a DMA buffer attached
to a command.

Augment the syslink protocol to implement read, write, and read-modify-write
style commands.

Obtain the MP lock in places where needed because fileops are called without
it held now.  Our VM ops are not MP safe yet.

Use an XIO to map VM pages between userland processes.  Add additional
XIO functions to aid in copying data to and from a userland context.  This
removes an extra buffer copy from the path and allows us to manipulate pure
vm_page_t's for just about everything.

12 years agoClarify cpu localization requirements when using callout_stop() and
Matthew Dillon [Thu, 28 Jun 2007 20:24:57 +0000 (20:24 +0000)]
Clarify cpu localization requirements when using callout_stop() and
callout_reset().

Fix a SMP race in callout_stop() where the callout structure was being
modified in an unsafe manner.

12 years agoNuke SIMPLEQ_* and logprintf.
Hasso Tepper [Thu, 28 Jun 2007 13:55:13 +0000 (13:55 +0000)]
Nuke SIMPLEQ_* and logprintf.

12 years agoRemove duplicate.
Hasso Tepper [Thu, 28 Jun 2007 09:33:33 +0000 (09:33 +0000)]
Remove duplicate.

12 years agoNuke device_ptr_t, USBBASEDEVICE, USBDEVNAME(), USBDEVUNIT(), USBGETSOFTC(),
Hasso Tepper [Thu, 28 Jun 2007 06:32:33 +0000 (06:32 +0000)]
Nuke device_ptr_t, USBBASEDEVICE, USBDEVNAME(), USBDEVUNIT(), USBGETSOFTC(),
USBDEVPTRNAME() and Static with help from sed(1).

12 years agoFix a bug-a-boo, the type uuid was being printed instead of the storage
Matthew Dillon [Wed, 27 Jun 2007 18:15:57 +0000 (18:15 +0000)]
Fix a bug-a-boo, the type uuid was being printed instead of the storage
uuid (so the type was being printed twice).

12 years agoUse kernel functions. I don't understand how I could miss these ...
Hasso Tepper [Wed, 27 Jun 2007 13:26:18 +0000 (13:26 +0000)]
Use kernel functions. I don't understand how I could miss these ...

12 years agoNuke the code specific to NetBSD/OpenBSD/FreeBSD at first. I doubt anyone
Hasso Tepper [Wed, 27 Jun 2007 12:28:00 +0000 (12:28 +0000)]
Nuke the code specific to NetBSD/OpenBSD/FreeBSD at first. I doubt anyone
will update these pieces and I don't intend to review macros for all
platforms.

There is the chance though that I might kill something which should stay
in the code in form "TODO: port it to DF". So, please review and kick me.

12 years agoFix files that included the posix scheduling headers that were merged earlier.
Joe Talbott [Tue, 26 Jun 2007 23:30:05 +0000 (23:30 +0000)]
Fix files that included the posix scheduling headers that were merged earlier.

12 years agoImplement jscan -o. Take the patch from Steve and add some additional
Matthew Dillon [Tue, 26 Jun 2007 20:47:58 +0000 (20:47 +0000)]
Implement jscan -o.  Take the patch from Steve and add some additional
checks to the write() to deal with EINTR and EAGAIN.

Submitted-by: "Steve O'Hara-Smith" <steve@sohara.org>
12 years agoA file descriptor of -1 is legal when accessing journal status. Just allow
Matthew Dillon [Tue, 26 Jun 2007 20:39:33 +0000 (20:39 +0000)]
A file descriptor of -1 is legal when accessing journal status.  Just allow
it generally, the journal command switch will recheck it on a per-command
basis.

12 years agoNuke USBDEV().
Hasso Tepper [Tue, 26 Jun 2007 19:52:10 +0000 (19:52 +0000)]
Nuke USBDEV().

12 years agoRepo-copy numerous files from sys/emulation/posix4 to sys/sys and sys/kern
Matthew Dillon [Tue, 26 Jun 2007 19:31:10 +0000 (19:31 +0000)]
Repo-copy numerous files from sys/emulation/posix4 to sys/sys and sys/kern
and adjust the build to suit.  posix scheduling is here to stay.

Submitted-by: Joe Talbott <josepht@cstone.net>
12 years agoIf RX csum calculation with pseudo header is enabled, bge(4)'s will
Sepherosa Ziehau [Tue, 26 Jun 2007 15:10:23 +0000 (15:10 +0000)]
If RX csum calculation with pseudo header is enabled, bge(4)'s will
miscalculate csum of frames carrying UDP datagrams.  If UDP datagrams
are not fragmented by IP, then the rate of miscalculation is low, but
if UDP datagrams are fragmented by IP, then most of the frames will be
delivered to the upper layer with wrong hardware csum, which is quite
common for NFS.

Disable hardware RX csum calculation with pseudo header; it will be
better than doing software csum if hardware csum error happens, since
the error rate is too high.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
12 years agoOne callout_stop() is enough.
Hasso Tepper [Tue, 26 Jun 2007 14:56:50 +0000 (14:56 +0000)]
One callout_stop() is enough.

Suggested-by: Joerg
12 years agomalloc -> kmalloc
Hasso Tepper [Tue, 26 Jun 2007 11:53:16 +0000 (11:53 +0000)]
malloc -> kmalloc

12 years ago- Fix headphone jack sensing support for Olivetti Olibook 610-430 XPSE.
Hasso Tepper [Tue, 26 Jun 2007 11:04:50 +0000 (11:04 +0000)]
- Fix headphone jack sensing support for Olivetti Olibook 610-430 XPSE.
- Drain all callout handlers during driver detach appropriately.
- M_NOWAIT -> M_WAITOK

Obtained-from: FreeBSD

12 years agoClean up sys/bus/usb/usb_port.h. Remove not used/dead/old code.
Hasso Tepper [Tue, 26 Jun 2007 08:36:24 +0000 (08:36 +0000)]
Clean up sys/bus/usb/usb_port.h. Remove not used/dead/old code.

12 years agoNuke "is is" stammering.
Hasso Tepper [Tue, 26 Jun 2007 07:47:28 +0000 (07:47 +0000)]
Nuke "is is" stammering.

12 years agoAdd a new option (-i) that allows the insane deviation value to be set, and
Matthew Dillon [Tue, 26 Jun 2007 02:40:20 +0000 (02:40 +0000)]
Add a new option (-i) that allows the insane deviation value to be set, and
change the default to 0.5 seconds.  For example, -i 0.025 would set the test
to be 25ms.

Change the insane check... just map out a server deemed to be insane for 60
minutes, do not disconnect or reset it (which might lead to excessive packet
traffic).

Update the documentation.

12 years agoCreate a default dntpd.conf file for DragonFly using three pool.ntp.org
Matthew Dillon [Tue, 26 Jun 2007 01:41:38 +0000 (01:41 +0000)]
Create a default dntpd.conf file for DragonFly using three pool.ntp.org
hosts as the time source.

12 years agoAdjust debug output so columns line up better.
Matthew Dillon [Tue, 26 Jun 2007 00:40:35 +0000 (00:40 +0000)]
Adjust debug output so columns line up better.

12 years agoRecode the state machine to make it a bit less confusing. Collapse the
Matthew Dillon [Mon, 25 Jun 2007 21:33:36 +0000 (21:33 +0000)]
Recode the state machine to make it a bit less confusing.  Collapse the
two failure states into a single failure state and handle failure processing
in each state.

Handle DNS failures by having dntpd relookup failed DNSes occassionally.

dntpd will now relookup the server name if a server fails, allowing you
to specify domains which front pools of ntp servers.  dntpd will also
check for duplicate IPs and relookup again (up to a point).

Add a sanity check.  If two or more servers are specified a quorum of
servers must agree that the selected time offset is reasonable.  For the
moment do a +/- 30 second check (though we can probably make this +/- 2
seconds).   If a server is determined to be broken, scrap its data and
reconnect.  If it is still broken, permanently disable it.  This is
primarily to handle severely broken servers that are occassionally present
in ntp pools.

12 years agoFix rts_input() which is the only procedure which calls raw_input(). As
Matthew Dillon [Sun, 24 Jun 2007 20:00:00 +0000 (20:00 +0000)]
Fix rts_input() which is the only procedure which calls raw_input().  As
with other packet input routines, the mbuf must be demuxed and forwarded
to the correct protocol thread so it can be cpu-localized for processing.

This allow anyone, including interrupt code, to write to the routing
socket.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
12 years agoAdd missing name.
Sascha Wildner [Sun, 24 Jun 2007 17:42:58 +0000 (17:42 +0000)]
Add missing name.

12 years agoFix typo in a diagnostic message.
Sascha Wildner [Sun, 24 Jun 2007 17:37:35 +0000 (17:37 +0000)]
Fix typo in a diagnostic message.

12 years agoFix HISTORY.
Sascha Wildner [Sun, 24 Jun 2007 10:50:43 +0000 (10:50 +0000)]
Fix HISTORY.

12 years agoAdd a slightly modified ataraid(4) manpage from FreeBSD as nataraid(4).
Sascha Wildner [Sun, 24 Jun 2007 10:47:48 +0000 (10:47 +0000)]
Add a slightly modified ataraid(4) manpage from FreeBSD as nataraid(4).

12 years agoFrom FreeBSD:
Peter Avalos [Sun, 24 Jun 2007 05:17:51 +0000 (05:17 +0000)]
From FreeBSD:

Fixed the threshold for using the simple Taylor approximation.

In e_log.c, there was just a off-by-1 (1 ulp) error in the comment
about the threshold.  The precision of the threshold is unimportant,
but the magic numbers in the code are easier to understand when the
threshold is described precisely.

In e_logf.c, mistranslation of the magic numbers gave an off-by-1
(1 * 16 ulps) error in the intended negative bound for the threshold
and an off-by-7 (7 * 16 ulps) error in the intended positive bound for
the threshold, and the intended bounds were not translated from the
double precision bounds so they were unnecessarily small by a factor
of about 2048.

The optimization of using the simple Taylor approximation for args
near a power of 2 is dubious since it only applies to a relatively
small proportion of args, but if it is done then doing it 2048 times
as often _may_ be more efficient.  (My benchmarks show unexplained
dependencies on the data that increase with further optimizations
in this area.)

12 years agoRemove trailing whitespace.
Sascha Wildner [Sat, 23 Jun 2007 20:52:41 +0000 (20:52 +0000)]
Remove trailing whitespace.

12 years agoAdd markup for DIOCGPART.
Sascha Wildner [Sat, 23 Jun 2007 20:51:42 +0000 (20:51 +0000)]
Add markup for DIOCGPART.

12 years agoFix markup.
Sascha Wildner [Sat, 23 Jun 2007 20:39:10 +0000 (20:39 +0000)]
Fix markup.

12 years agoActually process rc_info.
Sascha Wildner [Sat, 23 Jun 2007 10:13:39 +0000 (10:13 +0000)]
Actually process rc_info.

12 years agoUse .Va for rc variables.
Sascha Wildner [Sat, 23 Jun 2007 09:37:24 +0000 (09:37 +0000)]
Use .Va for rc variables.

12 years ago- Add hw.skcX.imtime sysctl node and hw.skc.imtime tunable for interrupt
Sepherosa Ziehau [Sat, 23 Jun 2007 09:25:02 +0000 (09:25 +0000)]
- Add hw.skcX.imtime sysctl node and hw.skc.imtime tunable for interrupt
  moderation time.  Adjusting of hw.skcX.imtime will be committed to NIC
  immediately.
- Increase default interrupt moderation time from 100 usec to 160 usec.
  This reduces host interrupt load without noticable performance impact.