dragonfly.git
11 years 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.

11 years 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.

11 years 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.

11 years 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.

11 years 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

11 years 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
11 years 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
11 years 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
11 years 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.

11 years 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.

11 years agofastbulk - Adjustments to fix various issues (2)
Matthew Dillon [Wed, 22 Aug 2012 06:46:58 +0000 (23:46 -0700)]
fastbulk - Adjustments to fix various issues (2)

* Use tmpfs for /usr/obj, this speeds up builds by a lot.
  make w/ -DNOTMPFS will use the hard drive if your tmpfs
  isn't big enough.

* Cleanup {chroot}/tmp/logs/run/* when restarting

* When restarting handle the case where the correct package has
  already been installed.

* When restarting handle the case where the binary package already
  exists.

* Use pkg_add -f when adding existing packages.

11 years agofastbulk - Adjustments to fix various issues
Matthew Dillon [Wed, 22 Aug 2012 05:18:40 +0000 (22:18 -0700)]
fastbulk - Adjustments to fix various issues

* We weren't properly installing the binary packages we were creating,
  resulting in parallel build races.  Fixing this fixes most of the
  issues fastbulk was having.

* Change the way pkgsrc is mounted... copy it to /build/fastbulk and add
  code to ensure that it is clean.

* resident the bmake binary to speed things up a bit.

11 years agokernel - Attempt to fix i386 wire_count panic
Matthew Dillon [Wed, 22 Aug 2012 05:15:47 +0000 (22:15 -0700)]
kernel - Attempt to fix i386 wire_count panic

* Finally found what could be the issue.  get_pv_entry() calls zalloc()
  which can fall through to zget() which obtains a zalloc-related LWKT
  token.

  This can temporarily break the vm_token and allow another thread to get
  in and change the pmap pte entry out from under a pmap_enter(), causing
  the pmap_enter() to potentially remove an extra wire_count from the
  page table page.

* Fix by pre-allocating the pv entry, taking it out of the critical path,
  and adjusting a few other bits of code to test the *pte closer to
  the code which replaces it for the purposes of adjusting the wire_count.

11 years agojme: Let the software to check hardware supplied hash
Sepherosa Ziehau [Wed, 22 Aug 2012 01:23:09 +0000 (09:23 +0800)]
jme: Let the software to check hardware supplied hash

As far as I have tested, these chips could generate wrong hash under
certain situation.

11 years agoether: Add instrument to detect wrong hardware supplied hash
Sepherosa Ziehau [Wed, 22 Aug 2012 01:19:25 +0000 (09:19 +0800)]
ether: Add instrument to detect wrong hardware supplied hash

If wrong hardware supplied hash is detected, the packet will be
redispatched to the correct netisr

11 years agokernel/linprocfs: Fix accessing files in /proc (such as /proc/meminfo).
Sascha Wildner [Tue, 21 Aug 2012 18:57:19 +0000 (20:57 +0200)]
kernel/linprocfs: Fix accessing files in /proc (such as /proc/meminfo).

It is the same fix that was applied to procfs with 198c0ff2.

11 years agokernel/linprocfs: Fix a panic when accessing /proc/<pid>/maps.
Sascha Wildner [Tue, 21 Aug 2012 20:44:09 +0000 (22:44 +0200)]
kernel/linprocfs: Fix a panic when accessing /proc/<pid>/maps.

Analogous to procfs.

11 years agoixgbe: Rework ixgbe_xmit()
François Tigeot [Tue, 21 Aug 2012 19:42:33 +0000 (21:42 +0200)]
ixgbe: Rework ixgbe_xmit()

* Use bus_dmamap_load_mbuf_segment()

* Clean up error handling code, following the example of the igb(4)
  driver

11 years agokernel/procfs: Remove some unneeded parentheses.
Sascha Wildner [Tue, 21 Aug 2012 15:39:02 +0000 (17:39 +0200)]
kernel/procfs: Remove some unneeded parentheses.

11 years agokernel/linprocfs: Remove an unreached return.
Sascha Wildner [Tue, 21 Aug 2012 13:04:43 +0000 (15:04 +0200)]
kernel/linprocfs: Remove an unreached return.

11 years agotools: Remove old script for installing 3rd party source drivers.
Sascha Wildner [Tue, 21 Aug 2012 00:02:12 +0000 (02:02 +0200)]
tools: Remove old script for installing 3rd party source drivers.

11 years agomdoc: Add a msgport(9) manual page documenting LWKT message passing interface.
Nuno Antunes [Tue, 14 Aug 2012 17:48:10 +0000 (18:48 +0100)]
mdoc: Add a msgport(9) manual page documenting LWKT message passing interface.

11 years agoip: Put fast dispatch/slow dispatch and hashing done by IP under RSS_DEBUG
Sepherosa Ziehau [Tue, 21 Aug 2012 02:45:01 +0000 (10:45 +0800)]
ip: Put fast dispatch/slow dispatch and hashing done by IP under RSS_DEBUG

While im here, using atomic operation to increment debug counters

11 years agortld: Perform reloc before filtree dependency object init
John Marino [Mon, 20 Aug 2012 19:27:06 +0000 (21:27 +0200)]
rtld: Perform reloc before filtree dependency object init

Ensure that for the object which is a dependency of some filtree,
relocations are performed before the object's initializer is called.
While dlopen()ing an object, relocate the whole DAG rooted in the
object instead of only relocating the object itself and list of newly
loaded dependencies.

Reversed sequence currently can occur if the same object is a
dependency for both filtree and filter since filtrees are loaded typically
during the relocation processing when some filter dependencies might be
already loaded but not yet relocated.

Taken-from: FreeBSD SVN 237659 (27 June 2012)

11 years agortld: Delay DF_1_NODELETE process until object DAG loaded
John Marino [Mon, 20 Aug 2012 18:26:43 +0000 (20:26 +0200)]
rtld: Delay DF_1_NODELETE process until object DAG loaded

The current code can miss searching dependencies that haven't been loaded
yet.  Delay DF_1_NODELETE processing until object DAG is fully loaded.

Taken-from: FreeBSD SVN 239253 (14 Aug 2012)

11 years agokernel: Set kern.ipc.shm_use_phys to 1 by default
François Tigeot [Mon, 20 Aug 2012 06:17:29 +0000 (08:17 +0200)]
kernel: Set kern.ipc.shm_use_phys to 1 by default

* The only known user of SYSV shared memory is PostgreSQL

* It really needs physical allocation to perform well with high
  numbers of clients

* Physical allocation is now used by default

11 years agojme: Cache align RX/TX data structure
Sepherosa Ziehau [Sun, 19 Aug 2012 23:53:11 +0000 (07:53 +0800)]
jme: Cache align RX/TX data structure

11 years agojme: Only main serializer is needed for timeout callback
Sepherosa Ziehau [Sun, 19 Aug 2012 23:43:11 +0000 (07:43 +0800)]
jme: Only main serializer is needed for timeout callback

This reduces periodic contention against TX/RX path.

11 years agodhclient - Assume link is up when IFM_AVALID isn't set.
Antonio Huete Jimenez [Wed, 15 Aug 2012 01:19:51 +0000 (03:19 +0200)]
dhclient - Assume link is up when IFM_AVALID isn't set.

- This is what the late interface_link_status() did.
- Allows drivers who cannot tell what the link state is to get
  dhcp leases.

Taken-from: OpenBSD

11 years agodhclient - Have only one timeout at once.
Antonio Huete Jimenez [Wed, 15 Aug 2012 01:15:12 +0000 (03:15 +0200)]
dhclient - Have only one timeout at once.

- Terminate with extreme prejudice the multiple timeout queuing
  mechanism that was a holdover from when dhclient handled multiple
  interfaces at once.

- Also move calculation of current time to just before check to see
  if the timeout has expired.

Taken-from: OpenBSD

11 years agodhclient - Add some more paranoia and make code clearer.
Antonio Huete Jimenez [Tue, 14 Aug 2012 23:06:26 +0000 (01:06 +0200)]
dhclient - Add some more paranoia and make code clearer.

- Check that the required length field for the option
  is present before using it. Reject lease if no length
  field is present.

Taken-from: OpenBSD

11 years agodhclient - Delete trailing NUL's when parsing NVT ASCII options.
Antonio Huete Jimenez [Tue, 14 Aug 2012 22:54:02 +0000 (00:54 +0200)]
dhclient - Delete trailing NUL's when parsing NVT ASCII options.

- RFC 2132 says "Options containing NVT ASCII data SHOULD NOT include
  a trailing NULL; however, the receiver of such options MUST be
  prepared to delete trailing nulls if they exist."
- Should fix odd results when 'append'ing info to such options via
  dhclient.conf.

Taken-from: OpenBSD

11 years agodhclient - Nuke interface_link_status().
Antonio Huete Jimenez [Tue, 14 Aug 2012 22:44:47 +0000 (00:44 +0200)]
dhclient - Nuke interface_link_status().

- Make use of interface_status() (check IFF_UP|IFF_RUNNING
  and media status). The interface is forced up when dhclient
  starts so the flags should be correct.

Taken-from: OpenBSD

11 years agodhclient - Change return code test logic.
Antonio Huete Jimenez [Sat, 4 Aug 2012 19:08:44 +0000 (21:08 +0200)]
dhclient - Change return code test logic.

Taken from: OpenBSD

11 years agodhclient - Set state to S_REBOOTING when calling state_reboot().
Antonio Huete Jimenez [Sat, 4 Aug 2012 19:05:11 +0000 (21:05 +0200)]
dhclient - Set state to S_REBOOTING when calling state_reboot().

- Also set state inside state_reboot() to S_INIT when calling
  state_init(). Rather than the other way around.
  Makes for more consistant idiom and might reduce state confusion.

Taken-from: OpenBSD

11 years agodhclient - Cancel all timeouts in state_reboot().
Antonio Huete Jimenez [Sat, 4 Aug 2012 18:59:03 +0000 (20:59 +0200)]
dhclient - Cancel all timeouts in state_reboot().

- We can get there from any state if a link state change happens.
  Fixes a problem where we'd continue to send (corrupted) discover
  packets after binding.

Taken-from: OpenBSD

11 years agodhclient - Try harder to re-initialize parsing state.
Antonio Huete Jimenez [Sat, 4 Aug 2012 18:55:19 +0000 (20:55 +0200)]
dhclient - Try harder to re-initialize parsing state.

- Attempt that nothing accidentally carries over when
  a new file (i.e. leases after config) is parsed.
  May help with mysterious "Corrupt lease file" messages.

Taken-from: OpenBSD

11 years agodhclient - Tweak parsing.
Antonio Huete Jimenez [Sat, 4 Aug 2012 18:47:39 +0000 (20:47 +0200)]
dhclient - Tweak parsing.

- No need to declare, assign and then ignore the token
  value when only the token id is required.

Taken-from: OpenBSD

11 years agodhclient - Tweak leases file handling.
Antonio Huete Jimenez [Sat, 4 Aug 2012 18:36:23 +0000 (20:36 +0200)]
dhclient - Tweak leases file handling.

- Write out new leases file every time a lease is obtained. i.e. don't
  append 20 leases before cleaning it up.
- Write new leases file after calling dhclient-script to implement
  new info. Gets interface configured first, and makes it more likely
  the leases file reflects most current configuration.

Taken-from: OpenBSD

11 years agodhclient - Sequential options processing more friendly.
Antonio Huete Jimenez [Sat, 4 Aug 2012 18:23:47 +0000 (20:23 +0200)]
dhclient - Sequential options processing more friendly.

- Starting DHCP packet options with DHO_DHCP_MESSAGE_TYPE. Now
  DHCP-specific options always come after the option identifying
  the packet as DHCP rather than BOOTP. Makes at least Nortel NetIP
  DHCP server happier. Clean up some code and parameter passing.

Taken-from: OpenBSD

11 years agodhclient - Only warn on unknown options when appropiate.
Antonio Huete Jimenez [Fri, 3 Aug 2012 23:26:33 +0000 (01:26 +0200)]
dhclient - Only warn on unknown options when appropiate.

- By default we ignore unknown dhcp server options, so don't bother
  warning unless we ask dhclient to reject leases with unknown options.

Taken-from: OpenBSD

11 years agodhclient - Properly handle zero-length option hints.
Antonio Huete Jimenez [Fri, 3 Aug 2012 23:07:20 +0000 (01:07 +0200)]
dhclient - Properly handle zero-length option hints.

- There was a possible division by zero if a server
  sends us a broken option hints for the proper fix.

Taken-from: OpenBSD

11 years agodhclient - Remove wrong processing of option 33 (static routes).
Antonio Huete Jimenez [Fri, 3 Aug 2012 22:55:50 +0000 (00:55 +0200)]
dhclient - Remove wrong processing of option 33 (static routes).

- We are incorrectly processing option 33 (static route), treating
  is as a host route rather than a classful network route. Too much
  trouble to fix such an obsolete feature, so ignore option 33 info.

Taken-from: OpenBSD

11 years agodhclient-script(8) - Align man page with current reality.
Antonio Huete Jimenez [Fri, 3 Aug 2012 22:46:34 +0000 (00:46 +0200)]
dhclient-script(8) - Align man page with current reality.

Taken-from: OpenBSD

11 years agodhclient - Stray '$medium' missed in last commit.
Antonio Huete Jimenez [Fri, 3 Aug 2012 22:31:40 +0000 (00:31 +0200)]
dhclient - Stray '$medium' missed in last commit.

Taken-from: OpenBSD

11 years agodhclient - Drop medium/alias useless utilization.
Antonio Huete Jimenez [Fri, 3 Aug 2012 22:26:45 +0000 (00:26 +0200)]
dhclient - Drop medium/alias useless utilization.

- Dump some useless calls to dhclient-script. i.e. MEDIUM, PREINIT,
  ARPSEND, ARPCHECK. Drop support for 'media', 'medium' and 'alias'
  specifications in dhclient.conf.
- Old leases still parse but these options now have no effect.
- Be more polite and decline all offers we don't accept.
- Fix a IMSG length check.
- Many expressions of support at various bars.

Taken-from: OpenBSD

11 years agodhclient - Fix interval handling.
Antonio Huete Jimenez [Thu, 2 Aug 2012 19:26:34 +0000 (21:26 +0200)]
dhclient - Fix interval handling.

- Start at initial_interval instead of exponentially backed
  off initial_interval.
- Don't hallucinate that we can send ARP packets without waiting.
- Don't claim to be waiting for ARP packets when not doing so.
- Correctly detect expiry of selecting period.
- Speeds up negotiations.

Taken-from: OpenBSD

11 years agodhclient.conf(5) - New sentence, new line.
Antonio Huete Jimenez [Thu, 2 Aug 2012 19:17:32 +0000 (21:17 +0200)]
dhclient.conf(5) - New sentence, new line.

Taken-from: OpenBSD

11 years agodhclient.conf(5) - Few fixes. Reword a sentence.
Antonio Huete Jimenez [Thu, 2 Aug 2012 19:15:43 +0000 (21:15 +0200)]
dhclient.conf(5) - Few fixes. Reword a sentence.

Taken-from: OpenBSD

11 years agodhclient - Make sure an interface is registered before we start using it.
Antonio Huete Jimenez [Thu, 2 Aug 2012 18:15:28 +0000 (20:15 +0200)]
dhclient - Make sure an interface is registered before we start using it.

Taken-from: OpenBSD

11 years agodhclient - Add and ignore DHCP option 66/0x42 TFTP server name.
Antonio Huete Jimenez [Thu, 2 Aug 2012 18:13:02 +0000 (20:13 +0200)]
dhclient - Add and ignore DHCP option 66/0x42 TFTP server name.

Taken-from: OpenBSD

11 years agodhclient(8) - Remove NOTES section.
Antonio Huete Jimenez [Thu, 2 Aug 2012 17:55:19 +0000 (19:55 +0200)]
dhclient(8) - Remove NOTES section.

Taken from: OpenBSD

11 years agodhclient - Add 'egress' command-line option.
Antonio Huete Jimenez [Thu, 2 Aug 2012 17:39:08 +0000 (19:39 +0200)]
dhclient - Add 'egress' command-line option.

- It can be used to refetch a lease without remembering
which interface dhclient was actually active on.

Taken-from: OpenBSD

11 years agodhclient - Remove unused function.
Antonio Huete Jimenez [Thu, 2 Aug 2012 09:50:39 +0000 (11:50 +0200)]
dhclient - Remove unused function.

Taken-from: OpenBSD

11 years agodhclient - Use strdup() instead of malloc/strlcpy.
Antonio Huete Jimenez [Thu, 2 Aug 2012 09:46:36 +0000 (11:46 +0200)]
dhclient - Use strdup() instead of malloc/strlcpy.

Taken-from: OpenBSD

11 years agodhclient - Be more strict in check_option().
Antonio Huete Jimenez [Wed, 1 Aug 2012 19:43:24 +0000 (21:43 +0200)]
dhclient - Be more strict in check_option().

ISC dhclient had a buffer overflow: http://www.kb.cert.org/vuls/id/410676 and
while our dhclient is not vulnerable to that, it got us looking at how the
subnet mask option is handled.
This limits specific ip address options to length 4 in conformance with RFC 2132.

Taken-from: OpenBSD

11 years agodhclient - Silence dhclient by immediately exiting if the interface doesn't exist.
Antonio Huete Jimenez [Wed, 1 Aug 2012 19:25:29 +0000 (21:25 +0200)]
dhclient - Silence dhclient by immediately exiting if the interface doesn't exist.

Taken-from: OpenBSD

11 years agodhclient - Make room for trailing \0 on prepend/append for dhcp options.
Antonio Huete Jimenez [Wed, 1 Aug 2012 19:12:15 +0000 (21:12 +0200)]
dhclient - Make room for trailing \0 on prepend/append for dhcp options.

Taken-from: OpenBSD

11 years agodhclient - Use addr_eq() when possible.
Antonio Huete Jimenez [Wed, 1 Aug 2012 19:07:59 +0000 (21:07 +0200)]
dhclient - Use addr_eq() when possible.

Taken-from: OpenBSD

11 years agodhclient - Lets state_panic() check the rest of valid leases.
Antonio Huete Jimenez [Wed, 1 Aug 2012 19:06:34 +0000 (21:06 +0200)]
dhclient - Lets state_panic() check the rest of valid leases.

Taken-from: OpenBSD

11 years agodhclient - Print out debug messages only when DEBUG is defined.
Antonio Huete Jimenez [Wed, 1 Aug 2012 18:36:59 +0000 (20:36 +0200)]
dhclient - Print out debug messages only when DEBUG is defined.

Taken-from: OpenBSD

11 years agodhclient - Remove unneeded ARGSUSED
Antonio Huete Jimenez [Wed, 1 Aug 2012 18:10:47 +0000 (20:10 +0200)]
dhclient - Remove unneeded ARGSUSED

Taken-from: OpenBSD

11 years agodhclient - Fix old bug that could cause lease mangling.
Antonio Huete Jimenez [Wed, 1 Aug 2012 18:06:32 +0000 (20:06 +0200)]
dhclient - Fix old bug that could cause lease mangling.

Taken-from: OpenBSD

11 years agodhclient - Error out if _dhcp user is missing.
Antonio Huete Jimenez [Wed, 1 Aug 2012 17:51:25 +0000 (19:51 +0200)]
dhclient - Error out if _dhcp user is missing.

Taken-from: OpenBSD

11 years agodhclient - Add 6-byte MAC address to the log entries for DHCP ACK/NAK/OFFER.
Antonio Huete Jimenez [Tue, 31 Jul 2012 20:29:29 +0000 (22:29 +0200)]
dhclient - Add 6-byte MAC address to the log entries for DHCP ACK/NAK/OFFER.

- Log the packets before checking the client state. Makes it easy to find
  MACs for 'surprise' DHCP servers.
- Swap ifi status check logic to be the first one.

11 years agodhclient - Improve comment about resolv.conf creation.
Antonio Huete Jimenez [Tue, 31 Jul 2012 20:05:41 +0000 (22:05 +0200)]
dhclient - Improve comment about resolv.conf creation.

Taken-from: OpenBSD

11 years agodhclient - Term consistency about the config script.
Antonio Huete Jimenez [Tue, 31 Jul 2012 19:59:00 +0000 (21:59 +0200)]
dhclient - Term consistency about the config script.

- Also fix manpage section for dhclient-scripts.

Taken-from: OpenBSD

11 years agodhclient - Fix typo.
Antonio Huete Jimenez [Tue, 31 Jul 2012 19:53:54 +0000 (21:53 +0200)]
dhclient - Fix typo.

Taken-from: OpenBSD

11 years agodhclient - Clarify discussion of option modifiers.
Antonio Huete Jimenez [Tue, 31 Jul 2012 19:53:05 +0000 (21:53 +0200)]
dhclient - Clarify discussion of option modifiers.

They only affect values passed to dhclient-script. Our default script
only uses a few options so others are unaffected by option modifiers.

Taken-from: OpenBSD

11 years agodhclient - Fix spurious 'got link'
Antonio Huete Jimenez [Tue, 31 Jul 2012 19:44:12 +0000 (21:44 +0200)]
dhclient - Fix spurious 'got link'

Taken-from: OpenBSD

11 years agodhclient - Fix OpenBSD CVS ids to match current version.
Antonio Huete Jimenez [Tue, 31 Jul 2012 19:28:36 +0000 (21:28 +0200)]
dhclient - Fix OpenBSD CVS ids to match current version.

Also remove DFly ones.

11 years agoposix_memalign.3: Uncomment conformance sentence for aligned_alloc().
Sascha Wildner [Sun, 19 Aug 2012 11:53:39 +0000 (13:53 +0200)]
posix_memalign.3: Uncomment conformance sentence for aligned_alloc().

11 years agojme: Don't immediately recycle the TX descriptor even if it is owned by us.
Sepherosa Ziehau [Sun, 19 Aug 2012 07:56:21 +0000 (15:56 +0800)]
jme: Don't immediately recycle the TX descriptor even if it is owned by us.

This chip will always update the TX descriptor's 32bits fields in order,
so even if the status field has been updated, i.e. OWN is cleared, it still
does not mean that the buflen field has been updated.  To avoid this race
we don't immediately recycle the currently checking TX descriptor.  Instead,
next TX descriptor's OWN bit is checked, if it is cleared, then the updating
of the currently checked TX descrptor is really done.

This is intended to fix the seldom watchdog timeout that was observed on this
chip.

Thank devinchiu@jmicron.com very much for providing necessary information.

11 years agounlock_return.cocci: Add vm_object_{hold,drop}().
Sascha Wildner [Thu, 16 Aug 2012 17:53:40 +0000 (19:53 +0200)]
unlock_return.cocci: Add vm_object_{hold,drop}().

11 years agoAdd running 'mandoc -Tlint' to the manlint target.
Sascha Wildner [Sat, 18 Aug 2012 22:26:20 +0000 (00:26 +0200)]
Add running 'mandoc -Tlint' to the manlint target.

Also ignore the exit status here.

Suggested-by: nant
11 years agoSuppress printing of the commands for the manlint target.
Sascha Wildner [Sat, 18 Aug 2012 22:23:14 +0000 (00:23 +0200)]
Suppress printing of the commands for the manlint target.

11 years agolibc: Comment out documentation of svc_control() which we don't have.
Sascha Wildner [Sat, 18 Aug 2012 22:10:48 +0000 (00:10 +0200)]
libc: Comment out documentation of svc_control() which we don't have.

11 years agobce: Dispatch callouts to interrupt's target CPU
Sepherosa Ziehau [Sat, 18 Aug 2012 07:17:50 +0000 (15:17 +0800)]
bce: Dispatch callouts to interrupt's target CPU

11 years agobce: Rework MSI checkout for 5706 and 5708
Sepherosa Ziehau [Sat, 18 Aug 2012 06:49:37 +0000 (14:49 +0800)]
bce: Rework MSI checkout for 5706 and 5708

11 years agobge: Use MPSAFE callout
Sepherosa Ziehau [Sat, 18 Aug 2012 03:16:47 +0000 (11:16 +0800)]
bge: Use MPSAFE callout

11 years agobge: Always configure MII mode register
Sepherosa Ziehau [Sat, 18 Aug 2012 03:15:44 +0000 (11:15 +0800)]
bge: Always configure MII mode register

11 years agobnx: Enable 500Khz MII management interface frequency
Sepherosa Ziehau [Sat, 18 Aug 2012 02:29:18 +0000 (10:29 +0800)]
bnx: Enable 500Khz MII management interface frequency

This stablizes MII read/write, thus avoid MII probing failure

Reported-by: jaydg on #dragonflybsd
Tested-by: jaydg on #dragonflybsd
11 years agokernel - Fix condvar races
Matthew Dillon [Fri, 17 Aug 2012 19:40:09 +0000 (12:40 -0700)]
kernel - Fix condvar races

* Interlocked sleep was not using the PINTERLOCKED flag.

* Misc other adjustments.

11 years agopuffs - Comment out namecache purge for now
Matthew Dillon [Fri, 17 Aug 2012 19:39:14 +0000 (12:39 -0700)]
puffs - Comment out namecache purge for now

* Comment out a namecache purge that deadlocks for now.

11 years agopci: Enable PCIe memory mapped configuration again
Sepherosa Ziehau [Fri, 17 Aug 2012 15:13:33 +0000 (23:13 +0800)]
pci: Enable PCIe memory mapped configuration again

bd7ad9e91e71693907a00c74ab8dfc457cd655c9 should have fixed the
system hanging seen by y0netan1@

11 years agopci: Disable memory address decoding before writing 0xffffffff to BAR
Sepherosa Ziehau [Fri, 17 Aug 2012 15:10:46 +0000 (23:10 +0800)]
pci: Disable memory address decoding before writing 0xffffffff to BAR

This makes PCIe memory mapped configuration works.

Submitted-by: Romick Romick
Tested-by: y0netan1@
11 years agonewfs_hammer.8: Mdoc fix
Sascha Wildner [Fri, 17 Aug 2012 13:26:29 +0000 (15:26 +0200)]
newfs_hammer.8: Mdoc fix

11 years agoixgbe: remove unneeded lockuninit call
François Tigeot [Wed, 15 Aug 2012 14:05:20 +0000 (16:05 +0200)]
ixgbe: remove unneeded lockuninit call

11 years agokernel - Adjust UFS and HAMMER to use uiomovebp()
Matthew Dillon [Fri, 17 Aug 2012 00:54:16 +0000 (17:54 -0700)]
kernel - Adjust UFS and HAMMER to use uiomovebp()

* Add uiomovebp(), a version of uiomove() which is aware of a locked bp
  representing the to or from buffer and can work-around issues related
  to VM faults causing recursions and deadlocks on the user buffer.

  uiomovebp() does not yet detect or handle deadlocks.  Implementing
  deadlock handling will require a certain degree of finess related to
  the vnode and bp locks and we don't want to have to do it unless we
  actually deadlock.  TODO.

* Adjust UFS, HAMMER, TMPFS, MSDOSFS, NFS, NTFS to use uiomovebp().

11 years agokernel - Change lockmgr LK_SHARED behavior to fix improper recursion return
Matthew Dillon [Fri, 17 Aug 2012 00:40:38 +0000 (17:40 -0700)]
kernel - Change lockmgr LK_SHARED behavior to fix improper recursion return

* When obtaining a LK_SHARED lock in a situation where you already own the
  lock LK_EXCLUSIVE, lockmgr would downgrade the lock to shared.

  This creates a very serious problem when large procedural recursions get
  a lock that is already being held exclusively but request a shared lock.
  When these recursions return the original top level will find its lock is
  no longer exclusive.

* This problem occured with vnode locks when a VOP_WRITE operation on a mmap'd
  space causes a VM fault which then turns around and issues a read().
  When the fault returns the vnode wound up locked shared instead of
  exclusive.

* Fix the problem by NOT downgrading an exclusive lock to shared when
  recursing on LK_SHARED.  Simply add another count to the exclusive
  lock.

11 years agokernel - Fix incorrect dirty/reprotect code in pageout
Matthew Dillon [Thu, 16 Aug 2012 18:42:25 +0000 (11:42 -0700)]
kernel - Fix incorrect dirty/reprotect code in pageout

* vm_object_page_collect_flush() was trying to re-protect VM pages that
  were still marked dirty after pageout I/O was initiated without owning
  the BUSY bit on the page.  This operation could race whatever I/O was
  going on and multiple issues.  Remove the re-protect.

  Just don't do it.  It's an unnecessary operation.  We still re-set
  PG_CLEANCHK on the page and that should be fine insofar as the pageout
  daemon goes.

* Note that the pageout_flush code protects the VM pages properly (to
  read-only) prior to initiating I/O .

* Should fix bug #2350

* Might be related to the wire-count bug considering that we were messing
  with the page's pmap without owning the BUSY bit.  Small chance.

11 years agokernel - Fix long-standing vm_map token panic
Matthew Dillon [Thu, 16 Aug 2012 17:46:33 +0000 (10:46 -0700)]
kernel - Fix long-standing vm_map token panic

* Bug turned out to be an error path in vm_map_find().

* This bug ate a lot of hours from several people, but Antonio was able
  to instrument the token path in a way that allowed us to narrow down
  and locate the problem.

Submitted-by: tuxillo, vsrinivas
Debugging-by: tuxillo
11 years agokernel - Stop KTR logging during panic
Matthew Dillon [Thu, 16 Aug 2012 16:11:07 +0000 (09:11 -0700)]
kernel - Stop KTR logging during panic

* Stop all KTR logging when a panic occurs so the KTR buffer doesn't
  get wiped out by events during the panic & core dump.  This gives
  us a KTR buf snapshot as of the panic entry.

11 years agokernel/linprocfs: Add a missing header for spin_{,un}lock().
Sascha Wildner [Thu, 16 Aug 2012 14:05:38 +0000 (16:05 +0200)]
kernel/linprocfs: Add a missing header for spin_{,un}lock().

11 years agokernel/linprocfs: Remove useless .PATH in the Makefile.
Sascha Wildner [Thu, 16 Aug 2012 14:04:10 +0000 (16:04 +0200)]
kernel/linprocfs: Remove useless .PATH in the Makefile.

11 years agotcp: Stringent TSO segment length assertion.
Sepherosa Ziehau [Thu, 16 Aug 2012 02:31:31 +0000 (10:31 +0800)]
tcp: Stringent TSO segment length assertion.

11 years agokernel - Fix numerous procfs/ptrace issues (3)
Matthew Dillon [Thu, 16 Aug 2012 01:17:43 +0000 (18:17 -0700)]
kernel - Fix numerous procfs/ptrace issues (3)

* Add a safety spin-lock around adjustments to p_stops so it hopefully
  interacts better with the event processing side of things.

11 years agokernel - Fix two UFS+softupdates bugs
Matthew Dillon [Thu, 16 Aug 2012 01:14:27 +0000 (18:14 -0700)]
kernel - Fix two UFS+softupdates bugs

* The softdep sema_*() functions (the ones in ffs_softdep.c, not the sysv
  functions) were not MPSAFE for the case where the passed interlock is
  NULL.  Use a spinlock for that case.

* getdirtybuf()'s semantics were broken and could return success even
  after having released &lk with the bp still unlocked.

  Fixing this should fix most of the reported softdep panics.

11 years agokernel - Fix exit races which can lead to a corrupt p_children list
Matthew Dillon [Thu, 16 Aug 2012 01:11:11 +0000 (18:11 -0700)]
kernel - Fix exit races which can lead to a corrupt p_children list

* There are a few races when getting multiple tokens where a threaded
  process is wait*()ing for exiting children from multiple threads
  at once.

  Fix the problem by serializing the operation on a per-child basis,
  and by using PHOLD/PRELE prior to acquiring the child's p_token.
  Then re-check the conditions before accepting the child.

* There is a small chance this will also reduce or fix VM on-exit races
  in i386, as this bug could result in an already-destroyed process
  being pulled off by the racing wait*().  Maybe 25% chance.

11 years agoKernel - Fix numerous procfs/ptrace issues (2)
Matthew Dillon [Thu, 16 Aug 2012 00:49:47 +0000 (17:49 -0700)]
Kernel - Fix numerous procfs/ptrace issues (2)

* The last fix wasn't quite right.  Fix it for real.