dragonfly.git
10 years agomdocml: refresh config.h and README.DRAGONFLY
Franco Fichtner [Sun, 6 Oct 2013 13:45:22 +0000 (15:45 +0200)]
mdocml: refresh config.h and README.DRAGONFLY

10 years agoMerge branch 'vendor/MDOCML'
Franco Fichtner [Sun, 6 Oct 2013 13:42:02 +0000 (15:42 +0200)]
Merge branch 'vendor/MDOCML'

Conflicts:
contrib/mdocml/mandoc.3
contrib/mdocml/mdoc_macro.c

10 years agoidr: Grow descriptor table as needed in idr_get_new_above()
François Tigeot [Sun, 6 Oct 2013 13:20:23 +0000 (15:20 +0200)]
idr: Grow descriptor table as needed in idr_get_new_above()

10 years agoidr: Protect data structures with a lwkt_token
François Tigeot [Sun, 6 Oct 2013 13:04:57 +0000 (15:04 +0200)]
idr: Protect data structures with a lwkt_token

Using spinlocks is not a good idea when you have to allocate memory

10 years agoman(1): fixup literal file suffix parsing
Franco Fichtner [Sat, 5 Oct 2013 16:45:33 +0000 (18:45 +0200)]
man(1): fixup literal file suffix parsing

Look for last slash and assume next dot is the suffix start.  Fixes
display of compressed pages as configured via man.conf(5), e.g.

    # man ./man.1.gz

10 years agoman(1): tweak literal file interpretation
Franco Fichtner [Sat, 5 Oct 2013 16:01:07 +0000 (18:01 +0200)]
man(1): tweak literal file interpretation

The previous behaviour would not catch the following invoke:

    # man usr.bin/man/man.1

Now, as a generalised rule, the literal interpretation is triggered by
any '/' character in the requested page(s).

10 years agoman(1): fix build and adapt for DragonFly
Franco Fichtner [Sat, 5 Oct 2013 01:27:24 +0000 (03:27 +0200)]
man(1): fix build and adapt for DragonFly

swildner suggested to get rid of the cat* magic, so let's try this out
for mandoc(1).  Still not hooked up to the build, but ready for testing.
Don't forget to manually install etc/man.conf to your system.

10 years agoman(1): import man(1) replacement
Franco Fichtner [Sat, 5 Oct 2013 01:04:20 +0000 (03:04 +0200)]
man(1): import man(1) replacement

Vanilla sources; not yet hooked up to the build.

Taken-from: NetBSD

10 years agoidr: Mark non-public functions as static
François Tigeot [Sun, 6 Oct 2013 09:11:42 +0000 (11:11 +0200)]
idr: Mark non-public functions as static

Remove idr_alloc()'s prototype, there was no function body

10 years agoidr: Remove non-standard function idr_init1()
François Tigeot [Sun, 6 Oct 2013 07:55:10 +0000 (09:55 +0200)]
idr: Remove non-standard function idr_init1()

It never was part of the Linux idr API.

10 years agoImport mdocml-1.12.2
Franco Fichtner [Sun, 6 Oct 2013 07:47:07 +0000 (09:47 +0200)]
Import mdocml-1.12.2

10 years agogdb(1), kgdb(1): Makefile framework updates for version 7.6.1
John Marino [Sat, 5 Oct 2013 17:41:17 +0000 (19:41 +0200)]
gdb(1), kgdb(1): Makefile framework updates for version 7.6.1

The updates for gdb(1) were straight-forwards and mainly consisted of
header updates although the gnu internal library is new, as well as
a new function for libiberty.  The main work was getting kgdb(1) to
work with libgdb.  As is typically, a lot of internal changes occurred
withing gdb that rendered kgdb broken (and unbuildable).  After much
angst, kgdb works with gdb 7.6.1.

10 years agogdb: Add modifications required for version 7.6.1
John Marino [Sat, 5 Oct 2013 17:29:29 +0000 (19:29 +0200)]
gdb: Add modifications required for version 7.6.1

THe majority of these modifications (the 4 "dfly" files and osabi.c)
are needed just to get the stock gdb to build.  The modification to
inferior.c was reintroduced so kgdb can handle the 0 PID swapper
process, but the modication is much less than with version 7.4.1.
The change to the ptid_t structure (ptid.h) was necessary because
kgdb uses the thread address as the thread id, so the type has to
cover the entire address space.

The DragonFly README files were also updated.

10 years agoMerge branch 'vendor/GDB'
John Marino [Sat, 5 Oct 2013 22:52:30 +0000 (00:52 +0200)]
Merge branch 'vendor/GDB'

10 years agogdb: Revert FAKE_PROCESS id code to prepare for gdb 7.6.1
John Marino [Thu, 3 Oct 2013 19:18:26 +0000 (21:18 +0200)]
gdb: Revert FAKE_PROCESS id code to prepare for gdb 7.6.1

This set of local modifications to support the swapper as an inferior
for kgdb is being reverted to ease the merge of the new gdb 7.6.1 code.
However, it appears that gdb 7.6.1 has implemented the concept of a
"fake" process ID independently, so it may not be necessary to add
these modifications back later.

10 years agoUpgrade GDB from 7.4.1 to 7.6.1 on the vendor branch origin/vendor/GDB
John Marino [Sat, 5 Oct 2013 17:18:38 +0000 (19:18 +0200)]
Upgrade GDB from 7.4.1 to 7.6.1 on the vendor branch

10 years agomdocml: mandoc(1) now imitates groff(1)'s header and footer
Franco Fichtner [Thu, 3 Oct 2013 19:09:00 +0000 (21:09 +0200)]
mdocml: mandoc(1) now imitates groff(1)'s header and footer

While there, commit the autogenerated config.h as well as
version and OS name string to make maintenance of the
libmandoc(3) and mandoc(1) Makefile easier when the next
upstream version hits the repo.

10 years agotest: first commit
Franco Fichtner [Sat, 5 Oct 2013 20:43:04 +0000 (22:43 +0200)]
test: first commit

10 years agodrm: Use Linux idr functions in drm_crtc code
François Tigeot [Sat, 5 Oct 2013 14:25:20 +0000 (16:25 +0200)]
drm: Use Linux idr functions in drm_crtc code

Reducing differences with Linux 3.8

10 years agodrm: Add a linux/idr.h compatibility file
François Tigeot [Sat, 5 Oct 2013 14:14:10 +0000 (16:14 +0200)]
drm: Add a linux/idr.h compatibility file

10 years agoidr: Increase default size to 256 elements
François Tigeot [Sat, 5 Oct 2013 14:08:03 +0000 (16:08 +0200)]
idr: Increase default size to 256 elements

The old value of 32 was way too small for the drm subsystem.

10 years agokernel - Add if_iwn to the default build
Matthew Dillon [Sat, 5 Oct 2013 00:59:42 +0000 (17:59 -0700)]
kernel - Add if_iwn to the default build

* Add the IWN wifi driver to the default build

10 years agokernel - Fix minor ipv6 mbuf memory leak
Matthew Dillon [Sat, 5 Oct 2013 00:53:51 +0000 (17:53 -0700)]
kernel - Fix minor ipv6 mbuf memory leak

* Fix a minor ipv6 mbuf memory leak.

Reported-by: logan bug 2593
10 years agodrm: Manage reference counts with Linux kref functions
François Tigeot [Fri, 4 Oct 2013 17:35:35 +0000 (19:35 +0200)]
drm: Manage reference counts with Linux kref functions

Reduce differences with Linux 3.8

10 years agodrm: Import linux/kref.h from the FreeBSD OFED stack
François Tigeot [Fri, 4 Oct 2013 16:44:37 +0000 (18:44 +0200)]
drm: Import linux/kref.h from the FreeBSD OFED stack

10 years agodate(1): Fix the default format.
Sascha Wildner [Fri, 4 Oct 2013 06:44:06 +0000 (08:44 +0200)]
date(1): Fix the default format.

The correct format string for national representation of date(1)'s default
output is "date_fmt" (see /usr/src/share/timedef/*), which is not returned
by any standard nl_langinfo() constant. Previously, we defined our own
_DATE_FMT constant and handled it as an extension of nl_langinfo().

The locale upgrade removed nl_langinfo()'s _DATE_FMT handling and at the
same time brought in a change that causes "date_fmt" to be returned when
using "%+" as strftime()'s format.

That means, a nl_langinfo() call in date(1) is no longer needed, even
wrong (there is no constant returning the representation date(1) needs),
since strftime() can handle it all by itself directly and we can just use
"%+", like FreeBSD does, too.

10 years agolibc: Raise WARNS to 2.
Sascha Wildner [Tue, 1 Oct 2013 03:30:08 +0000 (05:30 +0200)]
libc: Raise WARNS to 2.

10 years agotic.1: mdoc(7) conversion
Franco Fichtner [Sat, 14 Sep 2013 09:53:15 +0000 (11:53 +0200)]
tic.1: mdoc(7) conversion

10 years agogdb: revert local modification to handle wchar_t
John Marino [Thu, 3 Oct 2013 18:20:20 +0000 (20:20 +0200)]
gdb: revert local modification to handle wchar_t

This local modification has been a real pain to maintain as each version
of gdb modifies charset.c to the point it doesn't merge cleanly.  Now
that the base iconv has been updated, the original gdb code should work
fine.  The config header has also been updated to reflect the new iconv
capabilities.

10 years agodrm: Manage drm_local_map structures with linux list functions
François Tigeot [Thu, 3 Oct 2013 18:22:43 +0000 (20:22 +0200)]
drm: Manage drm_local_map structures with linux list functions

Keep things as close to Linux 3.5 as possible

10 years agokernel - Fix a SMP race in the 64-bit pmap code (2)
Matthew Dillon [Wed, 2 Oct 2013 17:42:48 +0000 (10:42 -0700)]
kernel - Fix a SMP race in the 64-bit pmap code (2)

* Last commit had an extra vm_page_spin_unlock() call, removing.

* Fix an improper spin_unlock() which was supposed to be a
  spin_unlock_shared().  This appears to be an old bug.

Reported-by: profmakx, ftigeot
10 years agohammer2 - Move write thread from hmp to pmp
Matthew Dillon [Wed, 2 Oct 2013 04:43:34 +0000 (21:43 -0700)]
hammer2 - Move write thread from hmp to pmp

* Move the write thread from struct hammer2_mount to struct hammer2_pfsmount.
  Logical buffers for files are associated with the PFS, not the HMP.  A PFS
  can be backed by multiple HMPs.

10 years agokernel - Fix a SMP race in the 64-bit pmap code
Matthew Dillon [Tue, 1 Oct 2013 23:53:38 +0000 (16:53 -0700)]
kernel - Fix a SMP race in the 64-bit pmap code

* Some of the pmap code was assuming that pv_entry's would remain stable
  under circumstance where they might not actually remain stable.

  Specifically, when the vm_page spinlock is held while issuing a
  pv_hold_try() call on the pv, the pv is not necessarily stable
  and its pmap and pindex must be double-checked after a successful
  lock is acquired.  This case occurs in two places in the code.

* Do this check in all cases (when the pmap spinlock OR the vm_page spin
  lock is used to access a pv_entry), just to be sure that we have covered
  all the bases.

* This SMP race is virtually impossible to reproduce on 8-thread boxes
  but appears to be easy to reproduce on monster (48-way opteron).

* As of this commit it is not 100% clear if the patch fixes the assertion
  seen, but it probably fixes some things.

  panic: bad *ptep 000000078592b425 sva 00007ffffffff000 pte_pv NULL

Reported-by: ftigeot
10 years agohammer2 - cleanup, write path work
Matthew Dillon [Tue, 1 Oct 2013 05:48:20 +0000 (22:48 -0700)]
hammer2 - cleanup, write path work

* Code synchronous and asynchronous b*write() in the write path based on
  request flags, instead of just using bdwrite().

* Document a bunch of stuff.

* Remove dead code.

10 years agostdlib/libc : don't bring back DragonFly cvs ids
Joris Giovannangeli [Tue, 1 Oct 2013 22:49:06 +0000 (00:49 +0200)]
stdlib/libc : don't bring back DragonFly cvs ids

10 years agolibc/stdlib : revert to dragonfly implementation
Joris Giovannangeli [Tue, 1 Oct 2013 22:31:50 +0000 (00:31 +0200)]
libc/stdlib : revert to dragonfly implementation

 * Revert to 2d5c7e410ffcb72d10994a0d1d324b7265e29647. The dragonfly
   version shares code for the various functions of the strtol familly,
   using macros.

 * add locale aware version for the functions the strtol familly. Only
   isspace calls are concerned.

10 years agokernel: don't allow proplib to redefine bool
François Tigeot [Tue, 1 Oct 2013 19:35:15 +0000 (21:35 +0200)]
kernel: don't allow proplib to redefine bool

10 years agostdbool.h: Move to sys/sys
François Tigeot [Tue, 1 Oct 2013 19:01:20 +0000 (21:01 +0200)]
stdbool.h: Move to sys/sys

It's bad style for the kernel to use the same headers as userland
programs.

Requested-by: dillon
10 years agodrm/i915: Make intel_gtt_get() return type the same as on Linux 3.5
François Tigeot [Tue, 1 Oct 2013 13:33:18 +0000 (15:33 +0200)]
drm/i915: Make intel_gtt_get() return type the same as on Linux 3.5

10 years agohammer2 - Revamp snapshot code
Matthew Dillon [Tue, 1 Oct 2013 00:40:40 +0000 (17:40 -0700)]
hammer2 - Revamp snapshot code

* Change the snapshot code to not use chain_duplicate().  Instead
  get the thing working by flushing the original sub-tree, creating
  a new directory under the super-root, and then simply copying the
  blockset.

  The previous code called chain_duplicate() to create the snapshot
  but the coding still required a flush.  Doing it without a flush
  is possible for a read-only snapshot but very difficult otherwise.

* This will simplify coding down the line.

10 years agohammer2 - Revamp hammer2_cluster structure part 1
Matthew Dillon [Mon, 30 Sep 2013 22:31:14 +0000 (15:31 -0700)]
hammer2 - Revamp hammer2_cluster structure part 1

* Adjust the hammer2_cluster structure to track multiple chains (and thus
  multiple mount points).  Use cases still just pull out one chain.

* Remove schain from hammer2_mount, leaving just sroot.  The cached chain
  structure isn't useful because it doesn't track delete-duplicate
  operations.  Use sroot for basing functions.

* Mark pfs-mount chains with the PFSROOT flag and propagate through
  duplications to detect when a snapshot should inherit the PFS
  cluster id or not.

10 years agoSet ICONV_CONST to "const" for various GNU software
John Marino [Mon, 30 Sep 2013 21:59:27 +0000 (23:59 +0200)]
Set ICONV_CONST to "const" for various GNU software

The prototype of iconv changed to match FreeBSD and NetBSD with the
recent locales update.

10 years agolibarchive: Disable iconv the statically-built version
John Marino [Mon, 30 Sep 2013 21:14:14 +0000 (23:14 +0200)]
libarchive: Disable iconv the statically-built version

The iconv in base uses dlopen(3) which only works on dynamically-built
binaries.  Use the new SHARED_CFLAGS variable to set ICONV conditionally
for dynamic libraries only.  This fixes the "Service Unavailable"
message that pkg started emitting after the locales/iconv update.

10 years agobsd.lib.mk: Recognize {SHARED,STATIC}_{C,CXX}FLAGS variables
John Marino [Mon, 30 Sep 2013 20:48:45 +0000 (22:48 +0200)]
bsd.lib.mk: Recognize {SHARED,STATIC}_{C,CXX}FLAGS variables

Four new variables are recognized by bsd.lib.mk:
  STATIC_CFLAGS
  STATIC_CXXFLAGS
  SHARED_CFLAGS
  SHARED_CXXFLAGS

This allows for the possibility to compile the objects with unique flags
depending if the library is shared or not, and/or c versus c++.

10 years agodate(1): Choose a better format constant
John Marino [Mon, 30 Sep 2013 19:58:56 +0000 (21:58 +0200)]
date(1): Choose a better format constant

After the locales patch, date(1) would return something like "09/30/13"
depending on your locale.  This is a different format that omits the
time component that was there before.  Changing the D_FMT constant for
D_T_FMT will return something like "Mon Sep 30 21:55:26 2013" which is
much closer to how it was before the locales patch was committed.

10 years agolibc: Ansify again, de-register again.
Sascha Wildner [Mon, 30 Sep 2013 04:22:18 +0000 (06:22 +0200)]
libc: Ansify again, de-register again.

* Remove all the K&R crap that was carelessly copied over our ansified
  source in the so called locale "sync" (0d5acd7467c4e95).

* Also remove a lot of old unused gunk in stdtime/ again that had already
  been removed. We really don't want it back.

* De-register again (while here, do that in resolv/ too).

10 years agolibm: Update erf, add imprecise versions of missing c++11 functions
John Marino [Sun, 29 Sep 2013 23:29:20 +0000 (01:29 +0200)]
libm: Update erf, add imprecise versions of missing c++11 functions

Provide updates to erf and erff functions.

Also add weak versions of the missing c++11 long double functions by
using taking arguments of type double.  Use of these versions will
result in a linker warning to discourage program that really need
extra precision from using them.

Note that since the c/c++ specs only guarantee that long double has
precision equal to double, code that relies on these functions having
greater precision is unportable at best and broken at worst.

Taken-from: FreeBSD

10 years agoActivate Native Language Support (NLS) for error messages
John Marino [Sun, 29 Sep 2013 19:18:52 +0000 (21:18 +0200)]
Activate Native Language Support (NLS) for error messages

Error messages have been in English regardless of the locale selected by
the user.  NLS support has always been possible, but it's never been
activated.  A simple CFLAG (-DNLS) does that now.  At the same time, NLS
support was added for network messages.

10 years agonvi: Upgrade from version 1.79 to 2.1.1 (multibyte support)
John Marino [Sun, 29 Sep 2013 17:33:57 +0000 (19:33 +0200)]
nvi: Upgrade from version 1.79 to 2.1.1 (multibyte support)

The DragonFly NVI ("new" vi and ex) has been at version 1.79 which,
according to the FreeBSD repository, was imported nearly 18 years
ago in October 1996.

A 2011 Summer of Code project of FreeBSD added multibyte encoding
support with iconv.  With the recent update to the base iconv
support, DragonFly users can enjoy multibyte support. Language
catalogs are still based on English, French, German, Dutch,
Spanish, Chinese, Russian, Polish, and Swedish.  FreeBSD brought
this NVI update into their HEAD in August 2013.  Local
modifications to nvi 1.79 were incorporated directly on top of
this sync.

Repository: <https://github.com/lichray/nvi2>

10 years agodirfs - Lower debug level to 0
Antonio Huete Jimenez [Sun, 29 Sep 2013 15:25:26 +0000 (08:25 -0700)]
dirfs - Lower debug level to 0

10 years agodirfs - Fix a panic on shutdown.
Antonio Huete Jimenez [Sun, 29 Sep 2013 15:14:25 +0000 (08:14 -0700)]
dirfs - Fix a panic on shutdown.

* Do not attempt to release root inode if there was no call
  to VFS_ROOT()

10 years agolocales, libconv: Sync with FreeBSD (extensive reach)
John Marino [Sat, 21 Sep 2013 10:45:03 +0000 (12:45 +0200)]
locales, libconv: Sync with FreeBSD (extensive reach)

What started out as a relatively simply upgrade to libiconv finally
resulted in a simultaneous overhaul to locales, strings, and stdio.
All of these are interdependent and there is no way to upgrade them
individually or in steps.

These cases are similar to what happened with libm where significant
syncing came from NetBSD previously, rendering contributions from
FreeBSD difficult.  Libiconv and locales (both ancient) are now in
sync with FreeBSD HEAD.

As several headers were signficantly updated and the mtree was updated
to accommodate the new include/xlocale directory, this commit will
require a full world build.  It also may cause some dports to no longer
build due to prototype differences, but the dports will be adjusted.

The regexp library was not being used.  It was removed from FreeBSD four
years ago.  Since it required collate updates, I took the opportunity to
remove it completely by adding re_comp functionality to 4.3 compat
library like FreeBSD did.

__DragonFly_version has been bumped to 500300.

10 years agokeylogin(1): Fix a warning and raise WARNS to 6.
Sascha Wildner [Sun, 29 Sep 2013 11:14:03 +0000 (13:14 +0200)]
keylogin(1): Fix a warning and raise WARNS to 6.

10 years agoagp/intel: Add ValleyView and Haswell devices
François Tigeot [Sun, 29 Sep 2013 09:36:28 +0000 (11:36 +0200)]
agp/intel: Add ValleyView and Haswell devices

10 years agoagp/intel: Fix pci_get_subdevice() / pci_get_device() confusion
François Tigeot [Sun, 29 Sep 2013 08:43:49 +0000 (10:43 +0200)]
agp/intel: Fix pci_get_subdevice() / pci_get_device() confusion

The IDs are the sames with Intel chipsets but it's best to check
for the right thing anyway.

Spotted-by: swildner
10 years agoagp/intel: Minor cleanups
François Tigeot [Sun, 29 Sep 2013 07:23:39 +0000 (09:23 +0200)]
agp/intel: Minor cleanups

* Do not limit the device probe check to "display" devices

* Stop storing the vendor ID in the match list, all the devices we care
  about are Intel ones.

10 years agohammer2 - Redo refactor code, fix races, add assertions
Matthew Dillon [Sun, 29 Sep 2013 06:30:11 +0000 (23:30 -0700)]
hammer2 - Redo refactor code, fix races, add assertions

* Redo the refactor code which is used to detect when a chain
  has been delete-duplicated so the caller can translate a stale
  chain pointer into an up-to-date chain pointer.

  The new code uses a simple chain flag, HAMMER2_CHAIN_DUPLICATED,
  to flag that the original chain is now stale.  The old code was
  unnecessarily complex.

* Close several holes in the hardlink code where stale chains
  were improperly being used as starting points for modifications,
  resulting in filesystem corruption.

* Assert the a delete-duplicate is not performed on a stale chain.

10 years agovkernel - Update usage options.
Antonio Huete Jimenez [Sat, 28 Sep 2013 16:25:42 +0000 (09:25 -0700)]
vkernel - Update usage options.

* This was overlooked in the previous commit.

10 years agoMakefile.inc1: Fix build when MAKEOBJDIRPREFIX is provided
John Marino [Sat, 28 Sep 2013 09:02:49 +0000 (11:02 +0200)]
Makefile.inc1: Fix build when MAKEOBJDIRPREFIX is provided

While testing a patch that removed symbols from libc, Joris found his
build would break on leaf with MAKEOBJDIRPREFIX set in the command-line.
While this is a misuse of the feature per bsd.obj.mk comments, the issue
was reproduced on my machine.  The object files from btools, ctools, and
world were getting placed in common directories, so world binaries were
being built with bootstrap and crosstools objects.

I do not know if this has always been the case, or if this started
happening when bmake replaced legacy make.  In any case, changing the
way DESTDIRBASE is defined solved the build issues on the local machine.

10 years agovkernel - Add -d option to disable vmm.
Antonio Huete Jimenez [Sat, 28 Sep 2013 09:06:44 +0000 (02:06 -0700)]
vkernel - Add -d option to disable vmm.

  In some cases we might need to be able to disable vmm per-vkernel.
  Add a command-line option to allow that.

10 years agovkernel - Remove unused getopt option.
Antonio Huete Jimenez [Fri, 27 Sep 2013 12:16:37 +0000 (05:16 -0700)]
vkernel - Remove unused getopt option.

10 years agovkernel64 - Report VMM status at startup.
Antonio Huete Jimenez [Fri, 27 Sep 2013 11:58:28 +0000 (04:58 -0700)]
vkernel64 - Report VMM status at startup.

10 years agohammer2 - Rewrite internal chain algorithms - stabilization
Matthew Dillon [Sat, 28 Sep 2013 05:57:54 +0000 (22:57 -0700)]
hammer2 - Rewrite internal chain algorithms - stabilization

* Add temporary guards on a few structures for debugging purposes.

* Verify that blocktables are ordered.

* live_zero is multi-homed, move it out of the chain_core structure and
  into the chain structure.  Also move the COUNTEDBREFS flag

* Unlock the spinlock prior to issuing the atomic fetchadd to decrement
  hammer2_core->sharecnt.  Clean up any hanging chain_layer's when freeing
  a core structure.

* Initialize live_zero to 0 when base is NULL (i.e. if the chain structure
  is in the INITIAL stage).

* Refactor hammer2_chain_find(), hammer2_base_find(), and add
  hammer2_combined_find().  Fix numerous bugs in the key_next
  calculation and ensure that the combined find returns exhaustion
  if the element it finds is outside the requested range.

* Close a delete-duplicate race in hammer2_chain_getparent() and
  in hammer2_chain_lookup().  A delete-duplicate could weasle its
  way in during the parent lock transition.

10 years agohammer2 - Rewrite internal chain algorithms
Matthew Dillon [Fri, 27 Sep 2013 14:50:53 +0000 (07:50 -0700)]
hammer2 - Rewrite internal chain algorithms

* These are big changes designed to make it easier for the flusher to
  order media writes and as a requirement for upcoming 'copies' and other
  work.  H2 will be somewhat unstable for a short while.

* Replace the single-layer RBTREE per topological level with a stack of
  RBTREEs per topological level.  This allows conflicts to be stacked
  vertically roughly by flush synchronization group instead of trying
  to arrange everything in a single 2D RBTREE.  Conflicts arise because
  the in-memory tree can represent multiple synchronization points with
  live and deleted-flagged chains.

  The RBTREE compare function is actually simplified by this change, but
  the code must contend with a list of RBTREEs (built as conflicts arise)
  instead of just one.

* The block table for any given topological layer is now ordered, and this
  will now be reflected and required on-media as well.  That is, it is
  sorted.  It is still effectively set-associative in that the dynamic
  radix tree model is still being used, but elements must now be sorted.

  This improves I/O but more importantly it will allow H2 to use cursors
  to track multiple mounts used in 'copies' and later on in clustering.
  Running multiple media topologies concurrently was impossible when the
  block sets were unordered.

  This makes implementing a merged search (blocktable and in-memory chains)
  easier.

* Remove chain->index tracking.  We used to track the block table index
  that each in-memory chain intended to use which worked 'ok' when the
  block table (such as in an inode or an indirect block) was unordered,
  but requires excessive (and unnecessary) coding when the block table
  is ordered.

  Instead of tracking indices we track the total number of 'live' (not
  deleted) elements that will end up in the block table in hammer2_chain_core
  and use that to determine when indirect blocks need to be created or not.

  Block table entries are now only assigned by the flusher itself when it
  determines that an entry must be added or deleted.

* The flusher now operates more deterministically by scanning the stacked
  RBTREEs backwards (earliest to most recent).  The stacks are not specifically
  broken down by flush group (instead stacking only occurs if there is a
  key range conflict), so the flusher still checks the modify_tid and
  delete_tid for each chain it scans, but there should no longer be any
  chance of media updates being misordered.

  Because block table indices are now assigned by the flusher, each RBTREE
  stack is scanned three times instead of twice.  One for the recursion down
  and two for the finalization on the way back up which updates the block
  table.  The block table scan was broken into two passes to handle deletions
  in the first pass and insertions/updates in the second pass which allows
  the block table to be updated on the fly without having to assign specific
  array indices to chains.

* Replace the first_parent/next_parent linkages used to deal with multi-homed
  chains (chains with multiple parents which can arise due to renames,
  moves into or out of indirect blocks ,etc).  Use a queue instead.

  Remove the additional ref count used in the old linkage model.  We must
  still ensure that the final 'live' chain does not get removed when its
  refs drops to 0.

10 years agotest: Test commit from new box xanadu2
Sepherosa Ziehau [Fri, 27 Sep 2013 03:57:14 +0000 (11:57 +0800)]
test: Test commit from new box xanadu2

10 years agotest: Test commit from new box xanadu1
Sepherosa Ziehau [Fri, 27 Sep 2013 03:19:10 +0000 (11:19 +0800)]
test: Test commit from new box xanadu1

10 years agokernel - Fix ifnet scan race in ipv6
Matthew Dillon [Thu, 26 Sep 2013 17:16:04 +0000 (10:16 -0700)]
kernel - Fix ifnet scan race in ipv6

* Fix situations where an ifnet scan can catch an interface as it is still
  being initialized, before ifp->if_afdata[AF_INET6] is assigned.

* Add a global ifnet_token to protect if_index and the ifnet list.

  WARNING, there are still SMP races in the ifnet scans, they have
  not yet been instrumented with the new token.

* Also reorder the TAILQ_INSERT of a new if into the ifnet list to occur
  after all the domain initialization has been done rather than before.

10 years agoFix i386 buildworld.
Sascha Wildner [Thu, 26 Sep 2013 09:21:48 +0000 (11:21 +0200)]
Fix i386 buildworld.

REALLY_X86_64 needs to be defined in order to be checked later in the
Makefile.

10 years agomxge: Remove more useless code under IFNET_BUF_RING
Sepherosa Ziehau [Thu, 26 Sep 2013 08:51:42 +0000 (16:51 +0800)]
mxge: Remove more useless code under IFNET_BUF_RING

10 years agomxge: When MSI interrupt handler is triggered, 'valid' probably is set
Sepherosa Ziehau [Thu, 26 Sep 2013 01:27:07 +0000 (09:27 +0800)]
mxge: When MSI interrupt handler is triggered, 'valid' probably is set

10 years agodrm: Use an include directory hierarchy similar to the Linux one
François Tigeot [Tue, 24 Sep 2013 07:25:06 +0000 (09:25 +0200)]
drm: Use an include directory hierarchy similar to the Linux one

10 years agomxge: Add macro for RX small buf length
Sepherosa Ziehau [Wed, 25 Sep 2013 09:06:32 +0000 (17:06 +0800)]
mxge: Add macro for RX small buf length

10 years agomxge: Mark TX queue no longer over-active earlier
Sepherosa Ziehau [Wed, 25 Sep 2013 08:36:53 +0000 (16:36 +0800)]
mxge: Mark TX queue no longer over-active earlier

10 years agodrm: Reduce differences with Linux a bit
François Tigeot [Wed, 25 Sep 2013 07:06:27 +0000 (09:06 +0200)]
drm: Reduce differences with Linux a bit

* drm_internal.h is no longer present in Linux

10 years agodrm: Remove unused files
François Tigeot [Wed, 25 Sep 2013 06:34:28 +0000 (08:34 +0200)]
drm: Remove unused files

10 years agomxge: Cache align TX and RX struct
Sepherosa Ziehau [Wed, 25 Sep 2013 07:58:18 +0000 (15:58 +0800)]
mxge: Cache align TX and RX struct

10 years agomxge: mxge_tx_buffer_state and mxge_rx_buffer_state are same now; merge them
Sepherosa Ziehau [Wed, 25 Sep 2013 06:00:40 +0000 (14:00 +0800)]
mxge: mxge_tx_buffer_state and mxge_rx_buffer_state are same now; merge them

10 years agomxge: Nuke the flag field in mxge_tx_buffer_state
Sepherosa Ziehau [Wed, 25 Sep 2013 05:57:44 +0000 (13:57 +0800)]
mxge: Nuke the flag field in mxge_tx_buffer_state

Instead of using flag to mark the end of the TX packet chain, we now
save mbuf in the last tx_buffer_state and use the mbuf pointer to mark
the end of the TX packet.

10 years agomxge: Remove cnt from RX done ring struct; which serves no purpose
Sepherosa Ziehau [Wed, 25 Sep 2013 03:24:48 +0000 (11:24 +0800)]
mxge: Remove cnt from RX done ring struct; which serves no purpose

10 years agomxge: Move busdma information for RX done ring out of the hot path
Sepherosa Ziehau [Wed, 25 Sep 2013 03:01:45 +0000 (11:01 +0800)]
mxge: Move busdma information for RX done ring out of the hot path

These information is rarely accessed

10 years agohammer2 - Add missing header file linkage
Matthew Dillon [Wed, 25 Sep 2013 06:57:10 +0000 (23:57 -0700)]
hammer2 - Add missing header file linkage

* Add vfs/hammer2 to the BSD.include.dist mtree.

Reported-by: swildner
10 years agohammer2 - Add missing header file linkage
Matthew Dillon [Wed, 25 Sep 2013 06:55:25 +0000 (23:55 -0700)]
hammer2 - Add missing header file linkage

* Add vfs/hammer2 to the list of directories for /usr/obj softlinked
  headers.

Reported-by: swildner
10 years agomgxe: Remove some fields from RX and TX ring struct
Sepherosa Ziehau [Wed, 25 Sep 2013 02:30:29 +0000 (10:30 +0800)]
mgxe: Remove some fields from RX and TX ring struct

This packs RX and TX ring struct a little bit.

10 years agohammer2 - Add hammer2 boot support
Matthew Dillon [Tue, 24 Sep 2013 22:14:26 +0000 (15:14 -0700)]
hammer2 - Add hammer2 boot support

* Add hammer2 boot loader support.  The hammer2 boot loader accesses the
  hammer2 mount starting at the super-root.  To use hammer2 boot support
  you need to have a PFS called 'boot', which will be seen as "/boot" by
  the boot loader.

  The 'boot' PFS can be created either by creating a boot-specific H2
  partition with 'newfs_hammer2 -L boot ...', or by using
  'hammer2 pfs-create boot' to create a PFS called 'boot'.

  You can access any super-root if desired.

* Since boot is a super-root you can mix boot PFS's and other PFS's on the
  same hammer2 filesystem, including creating a boot PFS far later on.

* WARNING!!!!!  The 'boot' PFS must be configured without compression.
  i.e. 'hammer2 setcomp autozero /boot' (assuming you've mounted it on /boot),
  before you install anything.  The newfs_hammer2 utility will automatically
  handle this if you specify a label name of 'boot' (i.e. -L boot).

* WARNING!!!!!  The BIOS may not be able to reliably access very high
  sector numbers on large hard drives, so to be safe we recommend creating
  a small 'a' partition anyway, unless the drive / main hammer2 filesystem
  is small enough to not cause problems.

* Add %qx support to boot2's mini printf().

* Fix ipdata->comp_algo propagation bug in hammer2_inode_create()

* newfs_hammer2 and the pfs_create ioctl will set comp_algo to AUTOZERO
  for PFS's called "boot" automatically.

10 years agokernel/drm: Reapply 6d6a80766ccb6c27388c1d0d0db443b0ecd0f2f2
Sascha Wildner [Tue, 24 Sep 2013 17:22:42 +0000 (19:22 +0200)]
kernel/drm: Reapply 6d6a80766ccb6c27388c1d0d0db443b0ecd0f2f2

10 years agomxge: Remove mlen field from rx ring
Sepherosa Ziehau [Tue, 24 Sep 2013 16:10:04 +0000 (00:10 +0800)]
mxge: Remove mlen field from rx ring

This field actually serves no purpose

10 years agomxge: Remove unused stats
Sepherosa Ziehau [Tue, 24 Sep 2013 15:54:55 +0000 (23:54 +0800)]
mxge: Remove unused stats

10 years agomxge: Make callout on the same CPU which handles interrupt
Sepherosa Ziehau [Tue, 24 Sep 2013 14:00:05 +0000 (22:00 +0800)]
mxge: Make callout on the same CPU which handles interrupt

This avoids main serialize contention

10 years agomxge: There is no need to hold TX serialize to check pkt_done
Sepherosa Ziehau [Tue, 24 Sep 2013 13:18:49 +0000 (21:18 +0800)]
mxge: There is no need to hold TX serialize to check pkt_done

Since pkt_done is only updated by mxge_tx_done(), which is only called
from the interrupt handler, checking pkt_done from the interrupt handler
does not need TX serialize at all.  This reduce TX serialize contention.

10 years agomxge: Split one shared serializer into TX, RX and main serializers
Sepherosa Ziehau [Tue, 24 Sep 2013 09:08:00 +0000 (17:08 +0800)]
mxge: Split one shared serializer into TX, RX and main serializers

This one gives ~150Mbps transmission performance improvement.

10 years agoacpi: Be lenient about unknown revision of FADT, MADT, XSDT and RSDT
Sepherosa Ziehau [Tue, 24 Sep 2013 05:52:41 +0000 (13:52 +0800)]
acpi: Be lenient about unknown revision of FADT, MADT, XSDT and RSDT

Revision 5 FADT is found on on ASRock H77 Pro4-M, which is beyond the
revision even in ACPI-4.0a.  Since length is checked for these tables,
this commit should be safe.

10 years agohammer2 - Cleanup and bugfix pass to hammer2 setcomp paths
Matthew Dillon [Mon, 23 Sep 2013 22:18:35 +0000 (15:18 -0700)]
hammer2 - Cleanup and bugfix pass to hammer2 setcomp paths

* HAMMER2 will attempt to use LZ4 compression by default now.

* hammer2 setcomp now accepts text labels for the compression type and
  accepts a compression level of 0 to set the default, which is simply
  passed through to the VFS.

* Specify force and recursion flags in hammer2's main options rather than
  after the setcomp command.

* Allow a list of paths to be specified rather than just one.

* The HAMMER2IOC_INODE_SET ioctl now only sets field elements which can
  actually be modified by userland i.e. only the comp_algo field.  It
  used to set everything, including the indirect block table.

* Do not modify the hammer2_inode if the compression method is not being
  changed.

* Change the zero-block testing logic a little, with related code cleanups.

10 years agolibc/x86_64: Fix yet another (x86_64 specific) warning.
Sascha Wildner [Mon, 23 Sep 2013 19:47:06 +0000 (21:47 +0200)]
libc/x86_64: Fix yet another (x86_64 specific) warning.

10 years agolibc: Raise WARNS to 1 and fix warnings.
Sascha Wildner [Mon, 23 Sep 2013 18:33:02 +0000 (20:33 +0200)]
libc: Raise WARNS to 1 and fix warnings.

* Raise the priorities of our constructor functions from 0 to 101 because
  0-100 are reserved priorities. This results in no change in object code
  (as per comparison using hexdump(1)).

* Provide a prototype for _pthread_init_early().

* Be less strict in the exclusion of gdtoa's files to also match the files
  outside contrib/ (in lib/libc/gdtoa/). Do the same for libc_rtld.

* Also fix an ignored attribute warning due to __thread being defined
  empty in libc_rtld.

Note that the most important aspect of this commit is that it causes libc
to no longer be built with -w (suppress all warnings). This was the result
of a hack we have to ignore warnings for gdtoa (which resides in contrib/).
But in conjunction with WARNS being 0 it led to -w being set for _all_
files of libc.

Removing -w causes all the warnings which are enabled by default (even
without any -W options) to trigger again, in addition the few -W options
that WARNS=1 actually sets.

Thanks to aggelos for useful clues.

10 years agomxge: Group RX related fields together
Sepherosa Ziehau [Mon, 23 Sep 2013 16:22:25 +0000 (00:22 +0800)]
mxge: Group RX related fields together

Prepare for upcoming serializer spliting

10 years agokernel - fix vkernel64 startup when no hw virtualization present
Mihai Carabas [Mon, 23 Sep 2013 14:14:53 +0000 (17:14 +0300)]
kernel - fix vkernel64 startup when no hw virtualization present

10 years agokernel: disable VMM for AMD SVM to not break the vkernel64
Mihai Carabas [Mon, 23 Sep 2013 07:54:38 +0000 (10:54 +0300)]
kernel: disable VMM for AMD SVM to not break the vkernel64

10 years agokmalloc.9: Mention M_NULLOK in RETURN VALUE section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:47:52 +0000 (09:47 +0800)]
kmalloc.9: Mention M_NULLOK in RETURN VALUE section

10 years agokmalloc.9: Add kmalloc_raise_limit to NAME section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:46:36 +0000 (09:46 +0800)]
kmalloc.9: Add kmalloc_raise_limit to NAME section

10 years agoem/emx: On attach path, perform another reset if the first one fails
Sepherosa Ziehau [Mon, 23 Sep 2013 01:41:34 +0000 (09:41 +0800)]
em/emx: On attach path, perform another reset if the first one fails

The second reset fixes the 82573L attaching failure.

Reported-and-Tested-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>