dragonfly.git
10 years agomdocml: upstream sync of lib.in
Franco Fichtner [Sun, 13 Oct 2013 20:38:42 +0000 (22:38 +0200)]
mdocml: upstream sync of lib.in

Heh, Ingo fetched our lib.in/st.in changes already.  Cheers!
Here are some more library definitions from NetBSD and FreeBSD.

Taken-from: OpenBSD

10 years agodrm: Sync drm_hashtab files with Linux 3.8
François Tigeot [Sun, 13 Oct 2013 17:16:56 +0000 (19:16 +0200)]
drm: Sync drm_hashtab files with Linux 3.8

Replacing BSD LIST_xxx macros by Linux hlist functions and data types

10 years agodrm: Add hlist RCU macros
François Tigeot [Sun, 13 Oct 2013 16:36:42 +0000 (18:36 +0200)]
drm: Add hlist RCU macros

10 years agodrm: Replace BSD and legacy DRM macros by Linux mechanisms
François Tigeot [Sun, 13 Oct 2013 16:44:20 +0000 (18:44 +0200)]
drm: Replace BSD and legacy DRM macros by Linux mechanisms

Reducing differences with Linux

10 years agodrm: Rename DRM_LIST_HEAD to LINUX_LIST_HEAD
François Tigeot [Sun, 13 Oct 2013 17:35:51 +0000 (19:35 +0200)]
drm: Rename DRM_LIST_HEAD to LINUX_LIST_HEAD

It is supposed to be the well-known Linux LIST_HEAD() macro after all

10 years agokernel - Concurrent fork/exec (2)
Matthew Dillon [Sun, 13 Oct 2013 17:48:57 +0000 (10:48 -0700)]
kernel - Concurrent fork/exec (2)

* Fix bug in vm_fault() path that can cause a token live lock.
  When taking a write fault first_shared must be set to 0
  because the fault might involve calling swap_pager_unswapped(),
  which currently requires an exclusive VM object lock.

10 years agodrm - Fix kernel compile
Matthew Dillon [Sun, 13 Oct 2013 17:08:40 +0000 (10:08 -0700)]
drm - Fix kernel compile

* Linux's LIST_HEAD interferes with ours.  Rename as it was previously
  renamed from LIST_HEAD to DRM_LIST_HEAD.  Also, other source files
  already assumed DRM_LIST_HEAD.

* Fixes kernel compile

10 years agodrm: Add linux/compiler.h from the FreeBSD OFED stack
François Tigeot [Sun, 13 Oct 2013 16:34:29 +0000 (18:34 +0200)]
drm: Add linux/compiler.h from the FreeBSD OFED stack

10 years agodrm: Replace drm_linux_list.h by linux/list.h ...
François Tigeot [Sun, 13 Oct 2013 16:31:44 +0000 (18:31 +0200)]
drm: Replace drm_linux_list.h by linux/list.h ...

... from FreeBSD's OFED stack

* Keep a few missing functions and macros

10 years agodrm: Add a local implementation of linux/export.h
François Tigeot [Sun, 13 Oct 2013 14:59:38 +0000 (16:59 +0200)]
drm: Add a local implementation of linux/export.h

* The Linux drm files often contain EXPORT_SYMBOL() macros

* We don't /need/ them but keeping them unchanged in the drm
  files helps reducing differences with Linux

10 years agodrm: Add a local implementation of linux/hash.h
François Tigeot [Sun, 13 Oct 2013 14:47:04 +0000 (16:47 +0200)]
drm: Add a local implementation of linux/hash.h

* Implement hash_long() as a wrapper on top of the existing
  hash32_buf() function

10 years agodrm: Define BITS_PER_LONG
Jean-Sébastien Pédron [Sat, 7 Sep 2013 09:43:36 +0000 (11:43 +0200)]
drm: Define BITS_PER_LONG

At the same time, rename a macro of the same name in drm_atomic.h. They
both have the same meaning but the one in drm_atomic.h uses sizeof(),
which prevents from using it inside an #if preprocessor condition.

10 years agokernel - Greatly improve concurrent fork's and concurrent exec's
Matthew Dillon [Sat, 12 Oct 2013 23:10:36 +0000 (16:10 -0700)]
kernel - Greatly improve concurrent fork's and concurrent exec's

* Rewrite all the vm_fault*() API functions to use a two-stage methodology
  which keeps track of whether a shared or exclusive lock is being used
  on fs.first_object and fs.object.  For most VM faults a shared lock is
  sufficient, particularly under fork and exec circumstances.

  If the shared lock is not sufficient the functions will back-down to an
  exclusive lock on either or both elements.

* Implement shared chain locks for use by the above.

* kern_exec - exec_map_page() now attempts to access the page with a
  shared lock first, and backs down to an exclusive lock if the page
  is not conveniently available.

* vm_object ref-counting now uses atomic ops across the board.  The
  acquisition call can operate with a shared object lock.  The deallocate
  call will optimize decrementation of ref_count for values above 3 using
  an atomic op without needing any lock at all.

* vm_map_split() and vm_object_collapse() and associated functions are now
  smart about handling terminal (e.g. OBJT_VNODE) VM objects and will use
  a shared lock when possible.

* When creating new shadow chains in front of a OBJT_VNODE object, we no
  longer enter those objects onto the OBJT_VNODE object's shadow_head.
  That is, only DEFAULT and SWAP objects need to track who might be shadowing
  them.  TODO: This code needs to be cleaned up a bit though.

  This removes another exclusive object lock from the critical path.

* vm_page_grab() will use a shared object lock when possible.

10 years agonetinet/in.h: Add missing IPPORT_MAX definition
François Tigeot [Sat, 12 Oct 2013 13:14:49 +0000 (15:14 +0200)]
netinet/in.h: Add missing IPPORT_MAX definition

Obtained-from: FreeBSD

10 years agoFix world build bootstrapping issue
John Marino [Sat, 12 Oct 2013 12:35:31 +0000 (14:35 +0200)]
Fix world build bootstrapping issue

The new version of find(1) uses a new locale function called rpmatch.
The use of this function breaks the world build on systems that don't
have the new locale functionality yet, e.g. Release 3.4.

To fix this, I added a BOOTSTRAPPING macro that will check the
first letter of the response character array rather than use the
locale function.  This modification appears only in the bootstrap tool.

10 years agopwait(1): Import from FreeBSD, built without modification!
John Marino [Fri, 11 Oct 2013 23:51:11 +0000 (01:51 +0200)]
pwait(1): Import from FreeBSD, built without modification!

10 years agopgrep(1), pkill(1): Sync with FreeBSD to get the -F options
John Marino [Fri, 11 Oct 2013 23:04:54 +0000 (01:04 +0200)]
pgrep(1), pkill(1): Sync with FreeBSD to get the -F options

These functions haven't been touched since DragonFly 1.1 (2004), other
than build tweaks.  It was claimed that it would be "trivial" to add
the -F options (pid file) but I wouldn't classify it as such.  There
is a pretty big diff between the FreeBSD and DragonFly 1.1 version.  I
had make some modifications, but the functions appear to work in the
very short tests that I performed.

10 years agofind(1): Sync with FreeBSD
John Marino [Fri, 11 Oct 2013 22:13:17 +0000 (00:13 +0200)]
find(1): Sync with FreeBSD

Originally I did this to gain the -quit feature.  It turns out that we
already had it, but FreeBSD didn't document it until 4 years after they
implemented it, so it wasn't on our man page either.

With this sync, we get time comparisons down to the nanosecond.  We get
the -sparse option.  The behavior of -delete was changed the delete the
files given as arguments.

The only thing that was omitted with all the birthtime options.
The new find was used successfully in locate.update job, something
that failed in the last sync and code in functions.c had to be
partially reverted.

10 years agopwd(1): Sync with FreeBSD (very minor, mainly editorial)
John Marino [Fri, 11 Oct 2013 20:18:38 +0000 (22:18 +0200)]
pwd(1): Sync with FreeBSD (very minor, mainly editorial)

10 years agorealpath(1): Sync with FreeBSD to add -q option
John Marino [Fri, 11 Oct 2013 20:12:25 +0000 (22:12 +0200)]
realpath(1): Sync with FreeBSD to add -q option

If -q is specified, warnings will not be printed out when realpath(3) fails.

10 years agopwd(1), realpath(1): Split shared source file into separate ones
John Marino [Fri, 11 Oct 2013 20:03:46 +0000 (22:03 +0200)]
pwd(1), realpath(1): Split shared source file into separate ones

The realpath(1) and pwd(1) programs share the same source file using the
program name as a condition.  Let's create a dedicated directory for
realpath, duplicate the source file, then tailor both.  Not only is this
more logical, it will make maintenance easier in the (near) future.

10 years agokernel - Fix bug when running swapon a gpt slice
Matthew Dillon [Fri, 11 Oct 2013 19:44:03 +0000 (12:44 -0700)]
kernel - Fix bug when running swapon a gpt slice

* diskpsize() and related API functions to obtain the number of blocks
  in a disk specification was punting if there was no dragonfly disklabel.
  This path was being specifically used by swapon.

* Do not require a dragonfly disklabel when the whole-slice partition is
  specified (i.e. /dev/daXsY with no a...z suffix).

* Swapon now works on gpt swap slices.

Reported-by: julianp
10 years agokernel - Performance optimization pass
Matthew Dillon [Fri, 11 Oct 2013 17:48:43 +0000 (10:48 -0700)]
kernel - Performance optimization pass

* Numerous pid and priority related syscalls, such as getpid(), were
  improperly acquiring proc_token to protect fields that are now protected
  with per-process or per-pgrp tokens.

  Do a pass on kern_prot.c and kern_resource.c fixing these issues.  This
  removes the use of proc_token from several common system call paths but
  it should be noted that none of these system calls are in critical paths.
  The benefit is probably minor but will improve performance in the face
  of allproc-scanning operations (such as when you do a 'ps' or 'top').

* vmntvnodescan() is not in the critical path except for vflush()'s which
  occur on umount.  vflush()'s pass a NULL fast function.  The
  vmntvnodescan() only needs to hold the vmobj_token when the fastfunc is
  non-NULL.  Do not hold the vmobj_token when fastfunc is NULL.

  This primarily improves performance when tmpfs's are being mounted and
  unmounted at a high rate (poudriere bulk builds).

10 years agodrm/radeon: Add missing "return false" after unmapping invalid BIOS
dumbbell [Sun, 15 Sep 2013 07:48:42 +0000 (07:48 +0000)]
drm/radeon: Add missing "return false" after unmapping invalid BIOS

Without that, we would try to copy the unmapped BIOS.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: re (blanket)

10 years agodrm: Rename struct drm_driver_info to struct drm_driver
Jean-Sébastien Pédron [Sat, 7 Sep 2013 09:54:26 +0000 (11:54 +0200)]
drm: Rename struct drm_driver_info to struct drm_driver

This reduces the diff between FreeBSD and Linux 3.8.

10 years agodrm: Rename members of struct drm_agp_head to match Linux
Jean-Sébastien Pédron [Sat, 7 Sep 2013 09:50:46 +0000 (11:50 +0200)]
drm: Rename members of struct drm_agp_head to match Linux

This reduces the diff between FreeBSD and Linux 3.8.

10 years agovga_pci.c: Sync with FreeBSD
François Tigeot [Fri, 11 Oct 2013 13:38:12 +0000 (15:38 +0200)]
vga_pci.c: Sync with FreeBSD

Most important change:

* Use vga_pci_alloc_resource() to map PCI Expansion ROMs

* This is cleaner and fixes Video BIOS mapping when the given device isn't
the boot display.

* Original author: dumbbell@

10 years agokernel: Add a method to get the bus's bus_dma_tag_t
François Tigeot [Fri, 11 Oct 2013 13:30:41 +0000 (15:30 +0200)]
kernel: Add a method to get the bus's bus_dma_tag_t

This is required by some machine architectures where there are separate
IOMMU's for each PCI bus.

Obtained-from: FreeBSD

10 years agostat.1 - Remove unsupported %B
Antonio Huete Jimenez [Fri, 11 Oct 2013 12:34:41 +0000 (05:34 -0700)]
stat.1 - Remove unsupported %B

* Our struct stat does not have st_birthtim so don't mention it.

10 years agokernel - Optimize sync and msync for tmpfs and nfs
Matthew Dillon [Fri, 11 Oct 2013 07:00:39 +0000 (00:00 -0700)]
kernel - Optimize sync and msync for tmpfs and nfs

* Flesh-out the vfs_sync API and implement vhold/vdrop callbacks
  (used by NFS).

* Use MNTK_THR_SYNC in tmpfs and finish implementing it in nfs.  This
  will optimize sync and msync for these filesystems.

* In both cases inode attributes are either synchronous or don't involve
  any VFS work to flush, so we don't have to use VISDIRTY.

10 years agokernel - Optimize vfs_msync() when MNTK_THR_SYNC is used
Matthew Dillon [Fri, 11 Oct 2013 06:13:22 +0000 (23:13 -0700)]
kernel - Optimize vfs_msync() when MNTK_THR_SYNC is used

* vfs_msync() will now use vsyncscan() when MNTK_THR_SYNC is set.
  Lazy synchronization scans will still properly ignore MADV_NOSYNC
  areas, but will not be able to optimize away the scan overhead for
  those vnodes (they remain on the syncer list).

  This change allows both lazy synchronization and explicit 'sync' commands
  to avoid having to scan all cached vnodes on the system, resulting in O(1)
  operation in many cases where it might have taken a few seconds before
  (on large systems with hundreds of thousands to millions of vnodes cached).
  With this change both the vnode sync and the memory sync will be optimal.

  Currently implemented for hammer1 and hammer2.

* Add VOBJDIRTY to the set of flags that will place the vnode on the
  syncer list.  This occurs from the vm_page_dirty() and other bits of
  code only if MNTK_THR_SYNC is set.

  Theoretically it should be safe for us to do this even though neither
  the vm_object or the related vnode are likely locked or guarded, because
  neither can go away while an associated vm_page is busied.  The syncer
  list code itself is protected with a token.

10 years agohammer - Use new vsyncscan() mechanic (3)
Matthew Dillon [Fri, 11 Oct 2013 05:21:49 +0000 (22:21 -0700)]
hammer - Use new vsyncscan() mechanic (3)

* The vsyncscan() feature requires using MNTK_THR_SYNC, otherwise the
  callback has to deal with vnodes unrelated to the mount point.
  Assert this in vsyncscan().

* Enable MNTK_THR_SYNC in hammer

* Cleanup edge cases in the scan2 callback.

10 years agohammer - Use new vsyncscan() mechanic (2)
Matthew Dillon [Fri, 11 Oct 2013 02:33:08 +0000 (19:33 -0700)]
hammer - Use new vsyncscan() mechanic (2)

* Fix crash, VISDIRTY must be cleared in reclaim.

* Implement convenient API functions to set and clear VISDIRTY and
  properly synchronize the syncer list.

10 years agohammer - Use new vsyncscan() mechanic.
Matthew Dillon [Fri, 11 Oct 2013 02:02:24 +0000 (19:02 -0700)]
hammer - Use new vsyncscan() mechanic.

* Use the new vsyncscan() mechanic, greatly reducing the work involved
  in finding dirty vnodes in hammer_vfs_sync() and during unmounting.
  Call vsyncscan() instead of vmntvnodescan().

* We set VISDIRTY in the vnode and call vn_syncer_add() when an inode
  becomes dirty.  This ensures that dirty vnodes are placed in the syncer
  list even if the vnode has no related dirty file data buffers.

  Previously we had to do a full scan of the mount's vnode list to
  find dirty inodes.

10 years agokernel - Add vsyncscan() infrastructure
Matthew Dillon [Fri, 11 Oct 2013 01:56:45 +0000 (18:56 -0700)]
kernel - Add vsyncscan() infrastructure

* For VFS's which support it, allows vnodes with dirty inodes to be placed
  on the syncer list rather than just vnodes with dirty buffers.  The VFS
  can then implement its VFS_SYNC ops by calling vsyncscan() instead of
  vmntvnodescan().

* On large systems with potentially hundreds of thousands to millions of
  cached vnodes, this reduces sync scan overhead by several orders of
  magnitude.

* Add the VISDIRTY flag to vnode->v_flag to indicate a dirty inode, adjust
  syncer add/delete code to use the flag.

* Cleanup vfs_sync.c.  Always initialize mp->mnt_syncer_ctx to something.
  Change the kern.syncdelay sysctl to use SYSCTL_PROC which properly
  range-checks syncdelay.

* Implement vsyncscan() which only scans the syncer lists for a mount point.

10 years agoman: no need for libutil
Franco Fichtner [Thu, 10 Oct 2013 21:08:10 +0000 (23:08 +0200)]
man: no need for libutil

10 years agoman: fix suffix parsing for good
Franco Fichtner [Thu, 10 Oct 2013 19:27:48 +0000 (21:27 +0200)]
man: fix suffix parsing for good

Instead of guessing the suffix in the code, use the suffix list previously
loaded via man.conf(5).  While there, zap unused interation code.

10 years agonetgraph.4: manlint and style nitpicking
Franco Fichtner [Thu, 10 Oct 2013 16:59:21 +0000 (18:59 +0200)]
netgraph.4: manlint and style nitpicking

10 years agoman: mop up a couple of manlint issues
Franco Fichtner [Thu, 10 Oct 2013 16:39:25 +0000 (18:39 +0200)]
man: mop up a couple of manlint issues

10 years agodirfs - Rework how host file permissions are checked.
Antonio Huete Jimenez [Thu, 10 Oct 2013 11:24:31 +0000 (04:24 -0700)]
dirfs - Rework how host file permissions are checked.

* Retrieve uid/gid of the user running the vkernel on mount time
  instead of on every open(2).

10 years agokernel - Attempt to fix tty race
Matthew Dillon [Thu, 10 Oct 2013 06:34:13 +0000 (23:34 -0700)]
kernel - Attempt to fix tty race

* Opening /dev/tty is special cased to open the session ttyvp.  The
  VCTTYISOPEN flag is used on the session ttyvp to indicate this.

* There is a bug where the VCTTYISOPEN flag is set prior to calling
  VOP_OPEN() on ttyvp.  Because devfs's devfs_spec_open() (and
  also devfs_spec_close()) temporarily release the vnode lock
  on the vp (ttyvp in this case), setting the flag prior to
  the VOP_OPEN() can lead to a race where another process opens
  AND closes /dev/tty before our VOP_OPEN() executes.

  The racing open will see that the VCTTYISOPEN flag is already
  set and not issue a VOP_OPEN().  It's close will then VOP_CLOSE()
  ttyvp (which so far has not been opened by either process),
  which can kill the last open on ttyvp and cause the tty to
  disconnect.

  This race is very difficult to reproduce.  We were only able to
  reproduce it on monster (48-core opteron) which happened to
  access "/dev/tty" during a poudriere bulk build in a manner
  that was able to trigger the race.

* Fix this particular bug by not setting the VCTTYISOPEN flag
  until after VOP_OPEN() returns, then re-checking the flag to
  detect the race and clean-up/retry if a race is detected.

* TODO - This is not the only bug.  Unfortunately it is also quite possible
  for multiple threads/processes to open("/dev/tty", ...) simultaniously.
  There is only one VCTTYISOPEN flag so when this occurs and one process
  then close()s its descriptor, the VCTTYISOPEN flag is cleared.

  The other process or processes may then proceed to access ttyvp without
  an opencount guard.  When they close() the count is handled properly
  because the close() code detects that the VCTTYISOPEN flag was cleared.
  The problem is the unguarded read, write, and ioctl calls that might
  occur in the mean time.

10 years agodmesg - Add -f option for continuous monitoring
Matthew Dillon [Wed, 9 Oct 2013 17:15:56 +0000 (10:15 -0700)]
dmesg - Add -f option for continuous monitoring

* Add the -f option to dmesg.  After the initial message buffer dump
  dmesg monitors the kernel for additional data and displays it as it
  arrives.  dmesg will not terminate until killed in this mode.

* The sysctl() is deficient so libkvm is forced when this option is
  specified.

10 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 9 Oct 2013 17:09:00 +0000 (19:09 +0200)]
bsd-family-tree: Sync with FreeBSD.

10 years agokernel: Fix the LINT kernels.
Sascha Wildner [Wed, 9 Oct 2013 17:07:47 +0000 (19:07 +0200)]
kernel: Fix the LINT kernels.

10 years agokernel - Fix pgrp and session ref-count races
Matthew Dillon [Wed, 9 Oct 2013 15:58:35 +0000 (08:58 -0700)]
kernel - Fix pgrp and session ref-count races

* Fix some tight timing windows where the ref count on these structures
  could race.

* Protect the pgrp hash table with a spinlock instead of using proc_token.

* Improve pgfind() performance by using the spinlock in shared mode.

* Do not transition p_pgrp through NULL when changing a process's pgrp.
  Atomically transition the process (protected p->p_token and
  pg->pg_token).

10 years agodrm/radeon: Import firmwares
François Tigeot [Wed, 9 Oct 2013 13:52:53 +0000 (15:52 +0200)]
drm/radeon: Import firmwares

These files come from FreeBSD but were originally obtained from
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/

10 years agodrm/radeon: Remove useless .PATH directive
François Tigeot [Wed, 9 Oct 2013 12:15:04 +0000 (14:15 +0200)]
drm/radeon: Remove useless .PATH directive

10 years agodrm/radeon: Fix locking issues
François Tigeot [Wed, 9 Oct 2013 11:26:57 +0000 (13:26 +0200)]
drm/radeon: Fix locking issues

10 years agodrm: Some drm_addmap() fixes
François Tigeot [Wed, 9 Oct 2013 09:46:16 +0000 (11:46 +0200)]
drm: Some drm_addmap() fixes

* Fix two warnings, moving some of the code to make the function more
  similar to drm_addmap_core() in Linux 3.8

* Remove some weirdly placed locking directives not present in Linux

10 years agoMakefile.usr - Remove pkgsrc targets
Matthew Dillon [Wed, 9 Oct 2013 05:49:46 +0000 (22:49 -0700)]
Makefile.usr - Remove pkgsrc targets

* DragonFly will be pure dports as of the next release so remove the
  pkgsrc helper targets from /usr/Makefile.

10 years agodrm/radeon: Import the Radeon KMS driver from FreeBSD
François Tigeot [Tue, 8 Oct 2013 19:15:54 +0000 (21:15 +0200)]
drm/radeon: Import the Radeon KMS driver from FreeBSD

* Credits for porting an updated version of this driver from Linux
  mainly go to Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>

* Compatibility layer for running 32-bit applications on 64-bit systems
  left out

Additional credits from the FreeBSD import message:

This driver is based on Linux 3.8 and a previous effort by kan@.

More informations about this project can be found on the FreeBSD wiki:
    https://wiki.freebsd.org/AMD_GPU

Help from: kib@, kan@
Tested by: avg@, kwm@, ray@,
Alexander Yerenkow <yerenkow@gmail.com>,
Anders Bolt-Evensen <andersbo87@me.com>,
Denis Djubajlo <stdedjub@googlemail.com>,
J.R. Oldroyd <fbsd@opal.com>,
Mikaël Urankar <mikael.urankar@gmail.com>,
Pierre-Emmanuel Pédron <pepcitron@gmail.com>,
Sam Fourman Jr. <sfourman@gmail.com>,
Wade <wade-is-great@live.com>,
(probably other I forgot...)
HW donations: kyzh, Yakaz

10 years agokernel/drm: Fix the LINT build.
Sascha Wildner [Tue, 8 Oct 2013 20:47:51 +0000 (22:47 +0200)]
kernel/drm: Fix the LINT build.

10 years agoa couple more Mt macros for author emails
Franco Fichtner [Tue, 8 Oct 2013 20:14:58 +0000 (22:14 +0200)]
a couple more Mt macros for author emails

10 years agolibc: proper FreeBSD version and some Mt macros for mails
Franco Fichtner [Tue, 8 Oct 2013 19:30:40 +0000 (21:30 +0200)]
libc: proper FreeBSD version and some Mt macros for mails

10 years agoworld: remove spurious Pp macros
Franco Fichtner [Tue, 8 Oct 2013 19:19:24 +0000 (21:19 +0200)]
world: remove spurious Pp macros

10 years agomdocml: sync std strings with groff
Franco Fichtner [Tue, 8 Oct 2013 19:17:47 +0000 (21:17 +0200)]
mdocml: sync std strings with groff

10 years agogroff: add recent FreeBSD releases
Franco Fichtner [Tue, 8 Oct 2013 19:16:47 +0000 (21:16 +0200)]
groff: add recent FreeBSD releases

(reduces `manlint' noise)

10 years agohammer - Fix exit path for newly added ioctl
Antonio Huete Jimenez [Tue, 8 Oct 2013 09:09:48 +0000 (02:09 -0700)]
hammer - Fix exit path for newly added ioctl

* Release cursor/inode on exit.
* Take in account the case where hammer_get_inode() returns a NULL ip.

10 years agomdocml: sync a few upstream commits
Franco Fichtner [Mon, 7 Oct 2013 21:29:16 +0000 (23:29 +0200)]
mdocml: sync a few upstream commits

Most of our local changes have found its way to upstream.
Let's return the favour and bring in fixes that we have
requested.  Hunk count for mandiff output reduced from
3321 to 3311 (not much, but it's a start).

     # make mandiff | grep "^@@" | wc -l

10 years agobsd.man.mk: add temporary ``mandiff'' target
Franco Fichtner [Mon, 7 Oct 2013 20:16:43 +0000 (22:16 +0200)]
bsd.man.mk: add temporary ``mandiff'' target

Show differences in ASCII output between groff(1) and mandoc(1).  This
will help generate uptream bug reports.  Also useful for spotting local
configuration quirks of both programs.

10 years agoidr: Remove duplicated code
François Tigeot [Mon, 7 Oct 2013 20:04:24 +0000 (22:04 +0200)]
idr: Remove duplicated code

* idr_get_new() and idr_get_new_above() mostly do the same thing

* Have idr_get_new() call idr_get_new_above() and only keep a single
  implementation

10 years agoUpdate pkg bootstraps
John Marino [Mon, 7 Oct 2013 16:40:05 +0000 (18:40 +0200)]
Update pkg bootstraps

The naming scheme for pkg bootstraps is inadequate.  Even if it were to
include the release, library updates could necessitate the generation
of a new bootstrap more than once per release.  Therefore, I've added
a serial in the name.  The name is now:

  bootstrap_pkg_${SERIAL}_x86-${32,64}.tar.xz

Bootstrap 01 has been created and put on mirror master.  The original
bootstraps stopped working after the locales update.

10 years agolibhammer - Make use of the HAMMERIOC_PFS_ITERATE ioctl.
Antonio Huete Jimenez [Sun, 6 Oct 2013 12:09:28 +0000 (05:09 -0700)]
libhammer - Make use of the HAMMERIOC_PFS_ITERATE ioctl.

* With this change 'info' directive no longer issues 65535 ioctl
  calls to retrieve the information of all PFSes.

10 years agohammer - Add HAMMER_PFS_ITERATE ioctl
Antonio Huete Jimenez [Sun, 6 Oct 2013 12:01:41 +0000 (05:01 -0700)]
hammer - Add HAMMER_PFS_ITERATE ioctl

* It allows iterating through all created PFSes and
  retrieving the information from them.

10 years agoFix i386 world build.
Antonio Huete Jimenez [Mon, 7 Oct 2013 13:12:09 +0000 (15:12 +0200)]
Fix i386 world build.

* Patch will be sent upstream to mdocml.

10 years agotools/netperf: Use pipe to pass result back instead of tmp file
Sepherosa Ziehau [Mon, 7 Oct 2013 13:20:37 +0000 (21:20 +0800)]
tools/netperf: Use pipe to pass result back instead of tmp file

10 years agodrm: Remove the drm_gem_names subsystem
François Tigeot [Sat, 5 Oct 2013 19:59:04 +0000 (21:59 +0200)]
drm: Remove the drm_gem_names subsystem

And use the original idr code from Linux 3.8 instead

10 years agoidr: Simplify idr_grow()
François Tigeot [Mon, 7 Oct 2013 05:33:21 +0000 (07:33 +0200)]
idr: Simplify idr_grow()

Make sure to only allocate powers of two descriptor numbers
and not weird values such as 1027

10 years agokernel - Add shared active virtual memory, i386
Matthew Dillon [Mon, 7 Oct 2013 05:06:01 +0000 (22:06 -0700)]
kernel - Add shared active virtual memory, i386

* Add shared active virtual memory.

  Shared active real memory represents the amount of memory shared across
  two or more pmap instances.  The memory is counted just once.

  Shared active virtual memory multiplies that value out by the number
  of pmap instances the memory is being shared across, giving the sysop
  some idea of the amount of ram being saved by e.g. shared libraries or
  shared mmap()s, etc.

* Collect statistics on 32-bit systems too.

10 years agokernel - Allow NULL softc in ulptclose()
Matthew Dillon [Mon, 7 Oct 2013 04:37:25 +0000 (21:37 -0700)]
kernel - Allow NULL softc in ulptclose()

* Try to fix an unplug / null-pointer-indirection

10 years agokernel - Rewrite do_vmtotal and change the way VM statistics are collected
Matthew Dillon [Mon, 7 Oct 2013 01:50:36 +0000 (18:50 -0700)]
kernel - Rewrite do_vmtotal and change the way VM statistics are collected

* The vmtotal sysctl was iterating through all VM objects.  This is a
  problem on machines with huge amounts of memory which might have millions
  of VM objects.

* Collect running VM statistics in the swap pager and vm_page modules,
  on a per-cpu basis.  Add a struct vmtotal structure to globaldata.

  Active real memory use is how many VM pages are mapped to processes.

  Total real memory use is how many VM pages are allocated whether they
  are mapped to processes or not.

  Shared real memory use represents VM pages mapped to more than one process.

  Total virtual memory use uses total real memory plus allocated swap space.

  Remaining fields are left 0 and not currently supported.

* Represents a more realistic view of memmory and VM.  In particular,
  totalling up the file sizes for all mmap()'d files is no longer a
  collected statistic because the system really has no way of knowing
  how little or how much of the file is 'active', or even ever accessed.

* The vmtotal sysctl (e.g. used by systat -vm 1) now just iterates
  cpus to aggregate gd_vmtotal for VM statistics.  This is basically
  O(1) for VM statistics.  It still iterates processes (which we will
  want to fix too, eventually), but the main scaling issue was with VM
  objects and that has been fixed.

10 years agokernel - Report zalloc statistics more accurately
Matthew Dillon [Sun, 6 Oct 2013 23:40:59 +0000 (16:40 -0700)]
kernel - Report zalloc statistics more accurately

* The sysctl proc now subtracts out zalloc objects cached in per-cpu lists.
  A substantial number of objects can be cached on per-cpu lists (up to 1/16
  the zone's maximum in aggregate).

* Thus vmstat -z now reports more accurate numbers.

10 years agokernel - pc64 - Fix pv_free() race and add assertions
Matthew Dillon [Sun, 6 Oct 2013 23:34:53 +0000 (16:34 -0700)]
kernel - pc64 - Fix pv_free() race and add assertions

* Continued work trying to fix the bad *ptep ... panics.  Previous commits
  did not do the job.  It is still unknown whether this one completely fixes
  the panic.

* The pmap pv_entry API was allowing pv_entry's to be retained with 0 refs
  and then doing a separate check for pv_pmap == NULL to determine if the
  pv_entry could be freed or not.  This resulted in a SMP race where multiple
  threads could pv_free() the same pv_entry.

* Change the code to supply an addition ref for pv_pmap != NULL and use the
  1->0 transition to deterministically conditionalize the pv_free().

* Change the shortcuts in pv_hold_try() and pv_drop() to use the new
  assumptions.

* Add some additional assertions and a generation count to try to check bugs.

10 years agokernel - pc64 - Print errata fixup only for cpu 0
Matthew Dillon [Sun, 6 Oct 2013 23:32:22 +0000 (16:32 -0700)]
kernel - pc64 - Print errata fixup only for cpu 0

* Print errata fixup only for cpu 0

10 years agoidr: Fix idr_find
François Tigeot [Sun, 6 Oct 2013 21:27:07 +0000 (23:27 +0200)]
idr: Fix idr_find

* A NULL return value is perfectly valid

10 years agomdocml: sync library definitions
Franco Fichtner [Sun, 6 Oct 2013 21:05:34 +0000 (23:05 +0200)]
mdocml: sync library definitions

10 years agoidr: idr_pre_get() takes two arguments
François Tigeot [Sun, 6 Oct 2013 18:44:47 +0000 (20:44 +0200)]
idr: idr_pre_get() takes two arguments

Don't diverge from the well-known Linux API

10 years agoman: fix literal file suffix parsing regression
Franco Fichtner [Sun, 6 Oct 2013 17:07:27 +0000 (19:07 +0200)]
man: fix literal file suffix parsing regression

Some man pages have dots in their names, apparently.  Fixes
the following invoke:

    # man ./man.conf.5

This, however, doesn't fix parsing of e.g. "./man..conf.4.5".
Instead the suffix list should be searched for a real match
while also preserving their matching order.  In the meantime,
please don't do this (ever).

Noticed-by: Thomas Klausner via NetBSD
10 years agomdocml: teach libmandoc(3) about ``libmandoc''
Franco Fichtner [Sun, 6 Oct 2013 14:31:32 +0000 (16:31 +0200)]
mdocml: teach libmandoc(3) about ``libmandoc''

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.