dragonfly.git
23 months agodoc - Fix previous commit.
Antonio Huete Jimenez [Fri, 3 Sep 2010 08:39:27 +0000 (10:39 +0200)]
doc - Fix previous commit.

23 months agodoc - Add some more porting notes regarding CVS ids.
Antonio Huete Jimenez [Fri, 3 Sep 2010 08:32:38 +0000 (10:32 +0200)]
doc - Add some more porting notes regarding CVS ids.

23 months agoAdd some notes I had lying in my tree.
Sascha Wildner [Thu, 25 Dec 2008 21:57:13 +0000 (22:57 +0100)]
Add some notes I had lying in my tree.

23 months agoLose LK_EXCLUSIVE in the lockinit example and a typo fix.
Peter Avalos [Sun, 6 Apr 2008 19:08:30 +0000 (19:08 +0000)]
Lose LK_EXCLUSIVE in the lockinit example and a typo fix.

23 months agoAdd some documentation on converting sleep mutexes and fix a couple of typos.
Sascha Wildner [Sat, 29 Dec 2007 18:35:59 +0000 (18:35 +0000)]
Add some documentation on converting sleep mutexes and fix a couple of typos.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
23 months agoAdd a section about renamed kernel functions and clean up a bit.
Sascha Wildner [Wed, 31 Oct 2007 04:52:52 +0000 (04:52 +0000)]
Add a section about renamed kernel functions and clean up a bit.

23 months agoAdd an internal document describing (in a very incomplete way at the moment) how...
Matthew Dillon [Sun, 3 Dec 2006 20:49:59 +0000 (20:49 +0000)]
Add an internal document describing (in a very incomplete way at the moment) how to port a driver from FreeBSD.

23 months agoDocument bus_setup_intr_descr(9)
François Tigeot [Fri, 7 Sep 2012 09:43:17 +0000 (11:43 +0200)]
Document bus_setup_intr_descr(9)

23 months agoVFS.9: Add a reference to VFS_SET(9).
Sascha Wildner [Fri, 7 Sep 2012 15:57:04 +0000 (17:57 +0200)]
VFS.9: Add a reference to VFS_SET(9).

Reported-by: Raimundo Santos <raitech@gmail.com>
23 months agokernel/ipx: Add a missing 'goto set_head;'.
Sascha Wildner [Fri, 7 Sep 2012 12:57:48 +0000 (14:57 +0200)]
kernel/ipx: Add a missing 'goto set_head;'.

23 months agoixgbe: Explicitely enable PCIe bus mastering
François Tigeot [Sat, 1 Sep 2012 17:25:04 +0000 (19:25 +0200)]
ixgbe: Explicitely enable PCIe bus mastering

23 months agokernel: Use NULL for pointers in some places.
Sascha Wildner [Thu, 6 Sep 2012 11:11:03 +0000 (13:11 +0200)]
kernel: Use NULL for pointers in some places.

23 months agokernel: Remove pcidevs_data.h. It serves no purpose.
Sascha Wildner [Wed, 5 Sep 2012 21:32:42 +0000 (23:32 +0200)]
kernel: Remove pcidevs_data.h. It serves no purpose.

23 months agokernel/ixgbe: Add missing braces.
Sascha Wildner [Tue, 4 Sep 2012 17:21:16 +0000 (19:21 +0200)]
kernel/ixgbe: Add missing braces.

23 months agotcp: Implement asynchronized pru_rcvd
Sepherosa Ziehau [Mon, 3 Sep 2012 09:46:58 +0000 (17:46 +0800)]
tcp: Implement asynchronized pru_rcvd

This mainly avoids extra scheduling cost on the reception path due to
lwkt_domsg().  lwkt_sendmsg() is now used to carry out TCP pru_rcvd.

Since TCP's pru_rcvd could be batched, one pru_rcvd netmsg is embedded
into struct socket to avoid pru_rcvd netmsg allocation for each pru_rcvd,
and this netmsg will be used by lwkt_sendmsg().  Whether this embedded
pcu_rcvd netmsg should be sent or not is determined by its MSG_DONE bit.
Since user thread and netisr thread could be on different CPUs, the
embedded pru_rcvd netmsg's MSG_DONE bit is protected by a spinlock.

To cope with the following race that could drop window updates,
tcp_usr_rcvd() replies asynchronized rcvd netmsg before tcp_output():

      netisr thread                     user thread

tcp_usr_rcvd()                   sorcvtcp()
{                                {
    tcp_output()                          :
          :                               :
          :                          sbunlinkmbuf()
          :                          if (rcvd & MSG_DONE) (2)
          :                              lwkt_sendmsg(rvcd)
          :                               :
    lwkt_replymsg(rcvd) (1)
}

At (2) window update is dropped, since rcvd netmsg is not replied yet at (1)

The result:
On i7-2600 (4C/8T, 3.4GHz):
32 parallel netperf -H 127.0.0.1 -t TCP_STREAM -P0 -l 30 (4 runs, unit: Mbps)

old   30253.88 30242.58 30162.55 30101.51
new   33962.74 33798.70 33499.92 33482.35

This gives ~12% performance improvement.

23 months agomsgport.9: Fix a path.
Nuno Antunes [Mon, 3 Sep 2012 04:30:05 +0000 (05:30 +0100)]
msgport.9: Fix a path.

* sys/kern/netisr.c -> sys/net/netisr.c

Pointed-out-by: Romick <yellowrabbit2010@gmail.com>
23 months agoacpi: Remove some unused files.
Sascha Wildner [Mon, 3 Sep 2012 04:04:38 +0000 (06:04 +0200)]
acpi: Remove some unused files.

23 months agoRemove another unused header (<machine/ultrasound.h>).
Sascha Wildner [Mon, 3 Sep 2012 03:04:55 +0000 (05:04 +0200)]
Remove another unused header (<machine/ultrasound.h>).

23 months agoRemove an unused old ral(4) firmware header.
Sascha Wildner [Mon, 3 Sep 2012 02:28:19 +0000 (04:28 +0200)]
Remove an unused old ral(4) firmware header.

23 months agoRemove an unused and empty header (<machine/mtpr.h>).
Sascha Wildner [Mon, 3 Sep 2012 02:18:05 +0000 (04:18 +0200)]
Remove an unused and empty header (<machine/mtpr.h>).

23 months agolibprop: Add two missing MLINKS.
Sascha Wildner [Sun, 2 Sep 2012 16:08:50 +0000 (18:08 +0200)]
libprop: Add two missing MLINKS.

23 months agotbridge: Sync NAME, SYNOPSIS and MLINKS.
Sascha Wildner [Sun, 2 Sep 2012 15:55:30 +0000 (17:55 +0200)]
tbridge: Sync NAME, SYNOPSIS and MLINKS.

23 months agolibm: Add missing MLINK.
Sascha Wildner [Sun, 2 Sep 2012 15:47:26 +0000 (17:47 +0200)]
libm: Add missing MLINK.

23 months agoBring in a VFS_SET(9) manual page (from FreeBSD).
Sascha Wildner [Sun, 2 Sep 2012 11:31:33 +0000 (13:31 +0200)]
Bring in a VFS_SET(9) manual page (from FreeBSD).

23 months agolink.2: Use .Fn and add .Nm linkat
Sascha Wildner [Sat, 1 Sep 2012 22:26:04 +0000 (00:26 +0200)]
link.2: Use .Fn and add .Nm linkat

23 months agoamr(4): Remove some unused code (amr_timeout()).
Sascha Wildner [Fri, 31 Aug 2012 22:06:05 +0000 (00:06 +0200)]
amr(4): Remove some unused code (amr_timeout()).

Taken-from: FreeBSD

23 months agoAdd CARP support to the GENERIC kernels.
Sascha Wildner [Fri, 31 Aug 2012 21:00:35 +0000 (23:00 +0200)]
Add CARP support to the GENERIC kernels.

http://leaf.dragonflybsd.org/mailarchive/users/2012-08/msg00086.html

Suggested-by: Charles Rapenne <charles.rapenne@gmail.com>
Approved-by: sephe
23 months agousched_bsd4 - topology sched: go for safe defaults
Alex Hornung [Thu, 30 Aug 2012 08:17:12 +0000 (08:17 +0000)]
usched_bsd4 - topology sched: go for safe defaults

 * When we don't know how to handle the level of the current CPU, go for
   safe defaults disabling both cache-coherent and SMT scheduling.

 * This seems to be the case on single-core machines where the level is
   the PACKAGE_LEVEL.

Reported-by: Max Herrgard, Ferruccio Zamuner, David Shao
Dragonfly-bug: http://bugs.dragonflybsd.org/issue2408
Dragonfly-bug: http://bugs.dragonflybsd.org/issue2413

23 months agosorecvtcp: Remove unapplied code
Sepherosa Ziehau [Thu, 30 Aug 2012 04:13:08 +0000 (12:13 +0800)]
sorecvtcp: Remove unapplied code

23 months agosocket: Replicate soreceive() to sorecvtcp() for cleanup and optimization
Sepherosa Ziehau [Thu, 30 Aug 2012 03:26:13 +0000 (11:26 +0800)]
socket: Replicate soreceive() to sorecvtcp() for cleanup and optimization

23 months agojme: RX interrupt to ~6000Hz, TX interrupt to ~4000Hz
Sepherosa Ziehau [Wed, 29 Aug 2012 09:51:35 +0000 (17:51 +0800)]
jme: RX interrupt to ~6000Hz, TX interrupt to ~4000Hz

23 months agojme: Record number of times that RX ring becomes empty
Sepherosa Ziehau [Wed, 29 Aug 2012 09:35:08 +0000 (17:35 +0800)]
jme: Record number of times that RX ring becomes empty

23 months agojme: Allow MSI-X be evenly spreaded across CPUs
Sepherosa Ziehau [Wed, 29 Aug 2012 09:10:43 +0000 (17:10 +0800)]
jme: Allow MSI-X be evenly spreaded across CPUs

23 months agoigb: Set default RX descriptor count to 512
Sepherosa Ziehau [Wed, 29 Aug 2012 08:40:29 +0000 (16:40 +0800)]
igb: Set default RX descriptor count to 512

23 months agoacpi/sci: Test ACPI MADT interrupt override entry's preferred mode first
Sepherosa Ziehau [Wed, 29 Aug 2012 02:25:47 +0000 (10:25 +0800)]
acpi/sci: Test ACPI MADT interrupt override entry's preferred mode first

23 months agowpa_supplicant(8): Use libpcap functions.
Sascha Wildner [Tue, 28 Aug 2012 22:16:01 +0000 (00:16 +0200)]
wpa_supplicant(8): Use libpcap functions.

23 months agokernel/acpi: Add smart battery support.
Sascha Wildner [Tue, 28 Aug 2012 22:08:24 +0000 (00:08 +0200)]
kernel/acpi: Add smart battery support.

I don't know which laptops have them, as far as I can tell, none of mine
do. But as some seem to have it, it's worth supporting.

https://en.wikipedia.org/wiki/Smart_Battery_System

This is the patch from the tracker with some later updates FreeBSD did.

Taken-from:    FreeBSD
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/1229>
Submitted-by: Dmitry Komissaroff <aunoor@gmail.com>
23 months agompt(4): We don't have MOD_QUIESCE.
Sascha Wildner [Tue, 28 Aug 2012 16:32:09 +0000 (18:32 +0200)]
mpt(4): We don't have MOD_QUIESCE.

23 months agotcp/ncr: Avoid using magic number
Sepherosa Ziehau [Tue, 28 Aug 2012 07:10:58 +0000 (15:10 +0800)]
tcp/ncr: Avoid using magic number

23 months agotcp: RFC3517bis is now officially RFC6675
Sepherosa Ziehau [Tue, 28 Aug 2012 07:00:28 +0000 (15:00 +0800)]
tcp: RFC3517bis is now officially RFC6675

23 months agoacpi/pcib: Guard against invalid GSI provided by PRT
Sepherosa Ziehau [Tue, 28 Aug 2012 06:30:47 +0000 (14:30 +0800)]
acpi/pcib: Guard against invalid GSI provided by PRT

23 months agoacpi/resource: Use legacy_intr_find to detect invalid IRQ configure
Sepherosa Ziehau [Tue, 28 Aug 2012 06:12:10 +0000 (14:12 +0800)]
acpi/resource: Use legacy_intr_find to detect invalid IRQ configure

23 months agopci: Guard against wrong user supplied IRQ assignment
Sepherosa Ziehau [Tue, 28 Aug 2012 06:02:10 +0000 (14:02 +0800)]
pci: Guard against wrong user supplied IRQ assignment

23 months agoacpi/fadt: Make sure that SCI IRQ is valid
Sepherosa Ziehau [Tue, 28 Aug 2012 05:43:35 +0000 (13:43 +0800)]
acpi/fadt: Make sure that SCI IRQ is valid

23 months agopci/pir: Make sure that the IRQ is allowed to be configured
Sepherosa Ziehau [Tue, 28 Aug 2012 04:46:20 +0000 (12:46 +0800)]
pci/pir: Make sure that the IRQ is allowed to be configured

If the IRQ is already configured into non-level/low mode, we should not
change the trigger and polarity

23 months agoMachIntr: Add two methods to find IRQ
Sepherosa Ziehau [Tue, 28 Aug 2012 04:23:26 +0000 (12:23 +0800)]
MachIntr: Add two methods to find IRQ

- Find IRQ conforming to the specified trigger and polarity, if it was
  configured.
- Find IRQ by GSI, the located IRQ must conform to the specified trigger
  and polarity if it was configured.

23 months agoacpi/intr: Fix comment, source index is GSI _not_ IRQ
Sepherosa Ziehau [Mon, 27 Aug 2012 02:43:48 +0000 (10:43 +0800)]
acpi/intr: Fix comment, source index is GSI _not_ IRQ

23 months agokernel: Turn the delay before mounting root into a tunable.
Sascha Wildner [Mon, 27 Aug 2012 18:00:46 +0000 (20:00 +0200)]
kernel: Turn the delay before mounting root into a tunable.

Submitted-by: Francis Gudin <fgudin@nerim.net>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2373>

23 months ago/boot/defaults/loader.conf: Adjust a comment.
Sascha Wildner [Mon, 27 Aug 2012 17:57:49 +0000 (19:57 +0200)]
/boot/defaults/loader.conf: Adjust a comment.

23 months agoixgbe: add tso_pullup function
François Tigeot [Sat, 25 Aug 2012 15:25:26 +0000 (17:25 +0200)]
ixgbe: add tso_pullup function

* This routine rearranges mbuf chains to get more continuous bytes,
  potentially increasing tcp send performance

* Single TCP streams are now able to push slightly more than 4Gb/s
  under the right circumstances

Taken-from: Sepherosa Ziehau's work on the igb(4) driver

23 months agoixgbe: enable existing FreeBSD IPv4 TSO code
François Tigeot [Sat, 25 Aug 2012 14:35:41 +0000 (16:35 +0200)]
ixgbe: enable existing FreeBSD IPv4 TSO code

* This is not perfect but increases sending speeds up to about 3.5 Gb/s
  by TCP connection

* Total throughput has been measured up to 9.22 Gb/s in the sending
  direction

23 months agokernel: IFCAP_TSO is really IPv4-specific
François Tigeot [Mon, 20 Aug 2012 19:59:03 +0000 (21:59 +0200)]
kernel: IFCAP_TSO is really IPv4-specific

* Rename IFCAP_TSO to IFCAP_TSO4 to make things crystal clear, keeping
  the old name for compatibility

* Add IFCAP_TSO6 for the future

23 months agokernel - reduce kern.maxvnodes default on 32 bit systems
Matthew Dillon [Sun, 26 Aug 2012 17:09:19 +0000 (10:09 -0700)]
kernel - reduce kern.maxvnodes default on 32 bit systems

* Reduce maximum kern.maxvnodes on standard-configured 32 bit systems
  from ~100K vnodes to ~80K vnodes to reduce kmem usage.

23 months agogrowfs(8)/ffsinfo(8): Use __func__
Sascha Wildner [Sun, 26 Aug 2012 11:15:35 +0000 (13:15 +0200)]
growfs(8)/ffsinfo(8): Use __func__

23 months agogrowfs(8): Fix building with -DFS_DEBUG.
Sascha Wildner [Sun, 26 Aug 2012 11:14:13 +0000 (13:14 +0200)]
growfs(8): Fix building with -DFS_DEBUG.

23 months agomake_dev.9: Fix typo.
Sascha Wildner [Sun, 26 Aug 2012 10:35:14 +0000 (12:35 +0200)]
make_dev.9: Fix typo.

23 months agokernel/ffs: Compare v_rdev directly when updating mounts.
Sascha Wildner [Sun, 26 Aug 2012 09:55:37 +0000 (11:55 +0200)]
kernel/ffs: Compare v_rdev directly when updating mounts.

Nowadays the vnode's v_rdev is always associated, so it can be used
directly to compare the devices.

Pointed-out-by: alexh
23 months agokernel/linprocfs: Implement /proc/devices.
Sascha Wildner [Sat, 25 Aug 2012 20:48:12 +0000 (22:48 +0200)]
kernel/linprocfs: Implement /proc/devices.

As close to Linux' format as I could get, and enough to make LSI's
MegaCli utility (for RAID configuration) work with mfi(4).

23 months agokernel/devfs: Fill out cdev_t's si_major field (and adjust one use case).
Sascha Wildner [Sun, 26 Aug 2012 10:12:46 +0000 (12:12 +0200)]
kernel/devfs: Fill out cdev_t's si_major field (and adjust one use case).

23 months agokernel/devfs: Pass more arguments to the callback for devfs_scan_callback.
Sascha Wildner [Sun, 26 Aug 2012 10:31:13 +0000 (12:31 +0200)]
kernel/devfs: Pass more arguments to the callback for devfs_scan_callback.

is_alias signals whether it is an alias or a real device. If true, name
is the alias name. If false, it is the device name.

Reviewed-by: alexh
23 months agokernel/devfs: Rename devfs_nodetype members (conflicts with {,lin}procfs.h).
Sascha Wildner [Thu, 23 Aug 2012 22:40:22 +0000 (00:40 +0200)]
kernel/devfs: Rename devfs_nodetype members (conflicts with {,lin}procfs.h).

23 months agoixgbe: enable VLAN code
François Tigeot [Sat, 25 Aug 2012 12:38:08 +0000 (14:38 +0200)]
ixgbe: enable VLAN code

23 months agokernel/devfs: Assert that the callback isn't NULL in devfs_scan_callback().
Sascha Wildner [Sat, 25 Aug 2012 06:04:39 +0000 (08:04 +0200)]
kernel/devfs: Assert that the callback isn't NULL in devfs_scan_callback().

23 months agoAdd a device_get_name(9) manual page (from FreeBSD).
Sascha Wildner [Sat, 25 Aug 2012 05:12:50 +0000 (07:12 +0200)]
Add a device_get_name(9) manual page (from FreeBSD).

23 months agokernel - Do not allow destroyed namecache entries to be re-resolved
Matthew Dillon [Sat, 25 Aug 2012 00:09:58 +0000 (17:09 -0700)]
kernel - Do not allow destroyed namecache entries to be re-resolved

* Do not allow a destroyed namecache entry to be re-resolved, as it
  might resolve as a completely different file, or even resolve as
  a file when it was originally a directory and so forth.

* Fixes inconsistencies in the current-dir fields in proc->p_fd.

* Note that most VFS's can't re-resolve a disconnected directory
  anyway but HAMMER1 actually can, so this was causing a problem
  in tests with HAMMER1 (the same tests that originally crashed
  tmpfs were also crashing HAMMER1, but for a different reason).

23 months agotmpfs - Fix numerous races and adjust to use cache_unlink()
Matthew Dillon [Fri, 24 Aug 2012 23:30:20 +0000 (16:30 -0700)]
tmpfs - Fix numerous races and adjust to use cache_unlink()

* Fix numerous issues when chdir'd into a directory that is then
  rmdir'd.

* Rewrite the link count handling code for directories, also removing
  two now unecessary recursions.

* Do not allow new files to be created in a directory which has been
  rmdir'd.

* Use the new cache_unlink facility.

23 months agokernel - Adjust devfs, hammer, and puffs to use the new cache_unlink()
Matthew Dillon [Fri, 24 Aug 2012 23:29:49 +0000 (16:29 -0700)]
kernel - Adjust devfs, hammer, and puffs to use the new cache_unlink()

* Adjust devfs, hammer, and puffs to use the new cache_unlink() mechanic.

23 months agokernel - add cache_unlink(), fix a rename issue.
Matthew Dillon [Fri, 24 Aug 2012 23:26:31 +0000 (16:26 -0700)]
kernel - add cache_unlink(), fix a rename issue.

* Add a rollup function called cache_unlink() to handle namecache
  effects when unlinking a file.

* Change namecache semantics a bit.  When a namecache entry is unlinked
  we allow it to be left in the topology as long as the vnode survives,
  but marked NCF_DESTROYED so it does not conflict with any new entries
  that might be named the same, and does not get returned in lookup results.

* This will solve the issue when renaming a file over an empty directory
  (destroying the directory) when one or more processes are chdir'd into
  that directory.  This would cause the process nchdir stuff to get out
  of sync with the retained directory vnode because the same namecache
  entry would get reused.

23 months agomutex.9: Misc updates and minor improvements.
Nuno Antunes [Fri, 24 Aug 2012 14:45:35 +0000 (15:45 +0100)]
mutex.9: Misc updates and minor improvements.

* mtx_spinlock_ex() and mtx_spinlock_sh() do not exist anymore. mtx_spinlock()
  replaced both.

* Add MLINKS for mtx_lock(), mtx_spinlock_try() and mtx_spinunlock().

* Use .Fn for function name mtx_lock_ex_quick().

* Add some text describing mtx_lock(), mtx_spinlock_try() and mtx_spinunlock().

* Start a sentence with capital letter but avoid starting with a function name.

* Add a missing .Fa.

* Add a cross reference to sleep(9) in the SEE ALSO section.

* Bump date.

Reviewed-by: swildner
23 months agokernel - Add additional clock_gettime() modes
Matthew Dillon [Fri, 24 Aug 2012 07:44:54 +0000 (00:44 -0700)]
kernel - Add additional clock_gettime() modes

* Add the following:
CLOCK_UPTIME (same as MONOTONIC)
CLOCK_UPTIME_PRECISE (same as MONOTONIC)
CLOCK_UPTIME_FAST (faster, less precise)
CLOCK_REALTIME_PRECISE (same as REALTIME)
CLOCK_REALTIME_FAST (faster, less precise)
CLOCK_MONOTONIC_PRECISE (same as MONOTONIC)
CLOCK_MONOTONIC_FAST (faster, less precise)
CLOCK_SECOND (just returns 'time_second')

Taken-from: FreeBSD

23 months agosysperf - Add tests for clock_gettime(CLOCK_*_FAST...) modes
Matthew Dillon [Fri, 24 Aug 2012 07:43:58 +0000 (00:43 -0700)]
sysperf - Add tests for clock_gettime(CLOCK_*_FAST...) modes

* Add tests for some of the new clock_gettime() modes.

23 months agousched_bsd4 - use wakeup_mycpu as appropriate
Alex Hornung [Fri, 24 Aug 2012 06:57:43 +0000 (06:57 +0000)]
usched_bsd4 - use wakeup_mycpu as appropriate

 * In the need_user_resched_remote we need to use wakeup_mycpu to avoid
   sending out IPIs triggering a deep IPI recursion panic.

 * In the setrunqueue case use wakeup_mycpu as an optimization, since we
   know that we are on the same CPU as the helper thread we want to wake
   up.

In-discussion-with: Matt Dillon
Reported-by: ftigeot
23 months agousched_bsd4 - fix incorrect use of PINTERLOCKED tsleep
Alex Hornung [Fri, 24 Aug 2012 06:44:43 +0000 (06:44 +0000)]
usched_bsd4 - fix incorrect use of PINTERLOCKED tsleep

 * The first tsleep in sched_thread has not been interlocked, so it is
   not valid to call tsleep(..., PINTERLOCKED, ...).

23 months agofastbulk - Exit w/success on more conditions
Matthew Dillon [Fri, 24 Aug 2012 04:53:28 +0000 (21:53 -0700)]
fastbulk - Exit w/success on more conditions

* If the binary package build succeeds but the pkg_add fails it is likely
  due to an install conflict.  Exit w/success for this case (since our goal
  is to generate the binary package, we succeeded!).

* Do an early check to see if the binary package has already been built
  and exit immediately if it has.

23 months agokernel - Fix pmap_remove() issue.
Matthew Dillon [Fri, 24 Aug 2012 03:44:53 +0000 (20:44 -0700)]
kernel - Fix pmap_remove() issue.

* When the inner loop of pmap_remove() broke out due to pmap_remove_pte()
  blocking it 'jumped' the sindex to pdnxt, thus any remaining pages in
  that page table page would get skipped.

* pmap_remove_pte() and friends used to return non-zero if they 'blocked'.
  Unfortunately they could actually block whether they returned 0 or non-zero,
  causing the problem.  Remove the check entirely.

* Adjust misc functions which we no longer need the return value for.

* I don't know if this had anything to do with the wire_count panic.
  The failure mode should have been caught by numerous other assertions
  in the code but wasn't.  get_ptbase() relies on a test of pmap->pm_cached
  to determine if a page directory page mapping changes so it should not
  have been possible for it to continue the loop and access a stale ptep.

  If it were possible it might account for a wire_count panic later on but
  it doesn't seem like it should be possible.

23 months agokernel - Implement Errata 721 for 32-bit kernels too
Matthew Dillon [Fri, 24 Aug 2012 03:41:26 +0000 (20:41 -0700)]
kernel - Implement Errata 721 for 32-bit kernels too

* The AMD errata 721 definitely happens on cpus running in cpu bit mode
  but I got a weird kernel crash on 32-bit (which I don't have time to
  follow up) so I decided, what the heck, might as well do it on 32-bit
  boxes too.

23 months agokernel - Do not allow the time to be set to { 0, 0 }
Matthew Dillon [Fri, 24 Aug 2012 03:39:05 +0000 (20:39 -0700)]
kernel - Do not allow the time to be set to { 0, 0 }

* The settimeofday() system call now fails with EINVAL if passed
  a { 0, 0 } tv structure.

* No need to allow this case, and it may fix some weird pkgsrc bulkbuild
  issues.  For some reason something in the bulk build calls settimeofday()
  with { 0, 0 } when linux.ko/linprocfs are not loaded.

23 months agofastbulk - Rework and clean up the Makefile
Matthew Dillon [Fri, 24 Aug 2012 03:36:15 +0000 (20:36 -0700)]
fastbulk - Rework and clean up the Makefile

* Rewrite the Makefile.  'make' with no arguments for more information.

* Proactively check and remove a dead /var/db/pkg directory after
  each build.

23 months agolinprocfs - Fix process exit / procfs vnode access race & stepping races
Matthew Dillon [Fri, 24 Aug 2012 00:00:49 +0000 (17:00 -0700)]
linprocfs - Fix process exit / procfs vnode access race & stepping races

* Taken from procfs, fix exit / vnode access races

* Fix stepping races.

23 months agolinprocfs - Fix missing PRELE()s.
Matthew Dillon [Thu, 23 Aug 2012 23:49:08 +0000 (16:49 -0700)]
linprocfs - Fix missing PRELE()s.

* The DFly pfind() API changed a while ago and now PHOLD()s the process,
  add missing PRELE()s to linprocfs that were missed during that
  change-over.

Reported-by: marino, alexh
23 months agomake_dev.9: devfs_scan_callback() takes an arg to pass to the callback.
Sascha Wildner [Thu, 23 Aug 2012 22:12:00 +0000 (00:12 +0200)]
make_dev.9: devfs_scan_callback() takes an arg to pass to the callback.

23 months ago<sys/devfs.h>: Fix comment typos.
Sascha Wildner [Thu, 23 Aug 2012 21:24:22 +0000 (23:24 +0200)]
<sys/devfs.h>: Fix comment typos.

23 months agomsgport.9: Sort cross references alphabetically.
Nuno Antunes [Thu, 23 Aug 2012 07:37:23 +0000 (08:37 +0100)]
msgport.9: Sort cross references alphabetically.

We sort SEE ALSOs first by section, then alphabetically.

Pointed-out-by: swildner
23 months agomsgport.9: Add cross reference to sleep(9).
Nuno Antunes [Thu, 23 Aug 2012 07:21:57 +0000 (08:21 +0100)]
msgport.9: Add cross reference to sleep(9).

23 months agosleep.9: Catch up with spin_{,un}lock_wr() -> spin_{,un}lock() rename of 2 years...
Nuno Antunes [Wed, 22 Aug 2012 06:47:11 +0000 (07:47 +0100)]
sleep.9: Catch up with spin_{,un}lock_wr() -> spin_{,un}lock() rename of 2 years ago.

* Accordingly rename function names in the ssleep() implementation example.

* We have only exclusive spinlocks, remove the "(write)" reference which was
  implicitly suggesting that we have another kind.

* While here, uncapitalize first letter of function a name.

23 months agovm: Put vm_page_alloc_contig debug prints under vm_contig_verbose
Sepherosa Ziehau [Thu, 23 Aug 2012 05:49:23 +0000 (13:49 +0800)]
vm: Put vm_page_alloc_contig debug prints under vm_contig_verbose

Tunable vm.contig_verbose could be used to control vm_contig_verbose.
It is disabled by default.

Well, it is too verbose even for bootverbose ...

23 months agojme: Add TSO support
Sepherosa Ziehau [Thu, 23 Aug 2012 05:27:15 +0000 (13:27 +0800)]
jme: Add TSO support

23 months agoroute: Routing table is replicated to all CPUs, not # of CPUs on power of 2
Sepherosa Ziehau [Thu, 23 Aug 2012 03:04:19 +0000 (11:04 +0800)]
route: Routing table is replicated to all CPUs, not # of CPUs on power of 2

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2355

23 months agokernel - Attempt to fix i386 wire_count panic (98)
Matthew Dillon [Wed, 22 Aug 2012 23:54:19 +0000 (16:54 -0700)]
kernel - Attempt to fix i386 wire_count panic (98)

* Previous patch missed a code path.

* Cleanup

23 months agokernel - Fix 32-bit build
Matthew Dillon [Wed, 22 Aug 2012 23:44:55 +0000 (16:44 -0700)]
kernel - Fix 32-bit build

* Fix kprintf format mismatches in usched_bsd4.c for 32-bit builds.

23 months agofastbulk - more work
Matthew Dillon [Wed, 22 Aug 2012 23:17:01 +0000 (16:17 -0700)]
fastbulk - more work

* Output start and end date stamps

* Do a manual checksum test and delete the distfile if it fails (and the
  distfile is over 4 hours old).

* Do a better job deleting conflicting versions of a package.

23 months agofastbulk - More fixes and improvements
Matthew Dillon [Wed, 22 Aug 2012 22:07:15 +0000 (15:07 -0700)]
fastbulk - More fixes and improvements

* Fix improper cleaning of the "${BUILDROOT}/usr/obj/work" directory

* Use lockf to lock the wildcard name for a package, serializing the
  builds of any related packages so they don't interfere with each
  other.

* Clean the work directory on success or failure instead of only on
  success, othrewise a large >10G tmpfs is needed.

23 months agofastbulk - Remove core files & empty dirs from /var/pkg/db
Matthew Dillon [Wed, 22 Aug 2012 19:40:47 +0000 (12:40 -0700)]
fastbulk - Remove core files & empty dirs from /var/pkg/db

* The presence of a core file prevents the pkg code from properly handling
  the directory, causing installs from packages to fail if any dependency
  has a broken /var/pkg/db directory.

* Clean out any core files and empty dirs before starting a build.

23 months agoAdd an MLINK for KTR_COND_LOG.
Sascha Wildner [Wed, 22 Aug 2012 14:30:13 +0000 (16:30 +0200)]
Add an MLINK for KTR_COND_LOG.

While here, sort the msgport.9 MLINKS alphabetically.

23 months agoktr.4 - add note about KTR_USCHED_BSD4
Alex Hornung [Wed, 22 Aug 2012 15:20:07 +0000 (15:20 +0000)]
ktr.4 - add note about KTR_USCHED_BSD4

23 months agousched_bsd4 - Topology-aware scheduling
Mihai Carabas [Wed, 22 Aug 2012 10:03:45 +0000 (10:03 +0000)]
usched_bsd4 - Topology-aware scheduling

 * Part of "Add SMT/HT awareness to DragonFly BSD scheduler" GSoC
   project.

 * Details at: http://leaf.dragonflybsd.org/mailarchive/kernel/2012-08/msg00009.html

Mentored-by: Alex Hornung (alexh@)
Sponsored-by: Google Summer of Code 2012
23 months agovkernel{,64} - CPU topology support
Mihai Carabas [Wed, 22 Aug 2012 10:03:12 +0000 (10:03 +0000)]
vkernel{,64} - CPU topology support

 * Part of "Add SMT/HT awareness to DragonFly BSD scheduler" GSoC
   project.

 * Details at: http://leaf.dragonflybsd.org/mailarchive/kernel/2012-08/msg00009.html

Mentored-by: Alex Hornung (alexh@)
Sponsored-by: Google Summer of Code 2012
23 months agoCPU topology support
Mihai Carabas [Wed, 22 Aug 2012 10:02:58 +0000 (10:02 +0000)]
CPU topology support

 * Part of "Add SMT/HT awareness to DragonFly BSD scheduler" GSoC
   project.

 * Details at: http://leaf.dragonflybsd.org/mailarchive/kernel/2012-08/msg00009.html

Mentored-by: Alex Hornung (alexh@)
Sponsored-by: Google Summer of Code 2012
23 months agoktr - add KTR_COND_LOG
Mihai Carabas [Wed, 22 Aug 2012 13:07:18 +0000 (13:07 +0000)]
ktr - add KTR_COND_LOG

 * KTR_COND_LOG provides conditional logging; the second parameter passed
   in is a condition which determines whether the entry is logged or
   not.

 * It provides a neater way to log conditionally than having to wrap a
   KTR in an if, which may then end up being empty if KTR is disbled.

23 months agomsgport.9: Fix some minor mdoc issues.
Sascha Wildner [Wed, 22 Aug 2012 13:18:31 +0000 (15:18 +0200)]
msgport.9: Fix some minor mdoc issues.