dragonfly.git
10 years agokernel/nataraid: Fix a panic upon booting with a degraded Intel RAID. v3.6.1
Sascha Wildner [Thu, 20 Feb 2014 20:44:03 +0000 (21:44 +0100)]
kernel/nataraid: Fix a panic upon booting with a degraded Intel RAID.

disk_idx has upper bits set in this case which we need to mask.

Taken-from:             FreeBSD's r205074
Reported-and-tested-by: Aaron Bieber <deftly@gmail.com>
10 years agohammer - Really fix VFS_STATFS() when operating volumes.
Antonio Huete Jimenez [Mon, 17 Feb 2014 15:47:49 +0000 (07:47 -0800)]
hammer - Really fix VFS_STATFS() when operating volumes.

- Correct a mistake in the previous "fix". Compute the
  total number of blocks based on the bigblock count which
  was already updated.
- Take care of stats also on volume deletion.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2497>

10 years agokernel/nataraid: Fix a bug for array sizes >2TB.
Sascha Wildner [Sun, 16 Feb 2014 22:51:16 +0000 (23:51 +0100)]
kernel/nataraid: Fix a bug for array sizes >2TB.

The overall array size (total_sectors) in the softc was already 64 bit
wide but due to a missing cast when multiplying the 32 bit disk size
by the number of disks, it never became larger than 32 bits.

Also, the disk size was signed when it should have been unsigned.

Note that these fixes apply to RAIDs created using natacontrol(8), but
not necessarily to those created with BIOS utilities.

Reported-by: Aaron Bieber <deftly@gmail.com>
10 years agokernel/nataraid: Fix nVidia MediaShield metadata kprintfs for unsigned.
Sascha Wildner [Sun, 16 Feb 2014 19:50:35 +0000 (20:50 +0100)]
kernel/nataraid: Fix nVidia MediaShield metadata kprintfs for unsigned.

10 years agorcrun(8): Properly handle scripts that provide more than one keyword.
Sascha Wildner [Fri, 14 Feb 2014 21:15:14 +0000 (22:15 +0100)]
rcrun(8): Properly handle scripts that provide more than one keyword.

The loop that checks if all dependencies of the target are running
didn't take into account that there could be more than one PROVIDE
keyword in one script. It treated all PROVIDEs which were not named
like the target as not yet running dependencies and failed.

To fix, loop through the PROVIDEs twice, the first time to skip all
the PROVIDEs of the script if the target is one of them.

All this is due to the output of "rcorder -o ..." having the script
that provides the target which we want to run as its last element,
so document that with a comment.

Reported-by: joris
10 years agorcrun(8): Rename $i, $j and $k to (more) meaningful names.
Sascha Wildner [Sat, 1 Feb 2014 07:13:58 +0000 (08:13 +0100)]
rcrun(8): Rename $i, $j and $k to (more) meaningful names.

10 years agorcrun(8): Read /etc/rc.conf too for overrides of $local_startup.
Sascha Wildner [Sat, 1 Feb 2014 07:02:23 +0000 (08:02 +0100)]
rcrun(8): Read /etc/rc.conf too for overrides of $local_startup.

10 years agoaltq: Byte counter is not compat w/ RED or RIO AQM
Sepherosa Ziehau [Thu, 6 Feb 2014 13:21:58 +0000 (21:21 +0800)]
altq: Byte counter is not compat w/ RED or RIO AQM

For altq packet schedulers, use packet counter should be enough.

Reported-by: Pierre Abbat
10 years agoswapcache - Fix token leak
Matthew Dillon [Tue, 11 Feb 2014 02:20:30 +0000 (18:20 -0800)]
swapcache - Fix token leak

* vmobjlst tokens can build up in the swapcache thread due to a label
  in the wrong place.  This eventually panics the box.

Reported-by: ftigeot
10 years agoinstall(1): Fix 2.5 y/o verbose bug, use static functions
John Marino [Thu, 6 Feb 2014 13:33:01 +0000 (14:33 +0100)]
install(1): Fix 2.5 y/o verbose bug, use static functions

A bug was introduced by this commit to add the -D option:

a2bc4e56d4ab068fea12d65d13740b7a600769a8 (7 SEP 11)

It changed the -v verbose option from standalone to expecting input and
as a result, any use of -v caused the usage screen to come up.  Fixed.
Additionally, the pathnames.h header is unused, removed now.
Finally, several functions were turned into static functions and explicit
void casts were used when functions normally return integers.  The last
two change sets converge with FreeBSD.

xinstall has not been seriously updated in a long time and has fallen
behind BSD counterparts.  Syncing with FreeBSD may take several steps as
there is significant divergence and options (e.g. -l) do different things
on FreeBSD

10 years agojails/netinet6: unbreak source selection after cfd7912 crater/DragonFly_RELEASE_3_6
Markus Pfeiffer [Wed, 29 Jan 2014 21:37:00 +0000 (21:37 +0000)]
jails/netinet6: unbreak source selection after cfd7912

Commit cfd7912 broke source address selection for the host. It
selected link-local addresses for local global routeable addresses.

Reported-By: ftigeot
10 years agosys: platform: pc64: vmm: vmx.c: bug-fix in PROCBASED2 detection
Mihai Carabas [Sat, 25 Jan 2014 23:42:38 +0000 (01:42 +0200)]
sys: platform: pc64: vmm: vmx.c: bug-fix in PROCBASED2 detection

Bug-fix in accessing PROCBASED2 MSR:
 * First check PROCBASED MSR to see if it is available

Reported-by: Johannes Hofmann
10 years agojails/netinet6: Only select jailed ips for outgoing
Markus Pfeiffer [Sat, 25 Jan 2014 19:01:11 +0000 (19:01 +0000)]
jails/netinet6: Only select jailed ips for outgoing

Outgoing IP address selection for jailed processes using ipv6
was broken and selected the first ip6 address available.
Now the code checks whether an ip6 is available to the jail
in in6_ifawithascope.

10 years agokernel/ppc: Fix a tsleep with NULL ident.
Sascha Wildner [Sat, 18 Jan 2014 06:48:06 +0000 (07:48 +0100)]
kernel/ppc: Fix a tsleep with NULL ident.

10 years agokernel/dm_target_striped: Plug a memory leak.
Sascha Wildner [Fri, 17 Jan 2014 07:19:07 +0000 (08:19 +0100)]
kernel/dm_target_striped: Plug a memory leak.

10 years agohammer2(8): Fix wrong sizeof.
Sascha Wildner [Thu, 16 Jan 2014 06:11:11 +0000 (07:11 +0100)]
hammer2(8): Fix wrong sizeof.

10 years agoacpi_sony(4): Free the sysctl_ctx upon detaching.
Sascha Wildner [Tue, 31 Dec 2013 23:41:17 +0000 (00:41 +0100)]
acpi_sony(4): Free the sysctl_ctx upon detaching.

Fixes crashes when unloading the module.

10 years agoSync zoneinfo database with tzdata2013i from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Sun, 22 Dec 2013 10:47:01 +0000 (11:47 +0100)]
Sync zoneinfo database with tzdata2013i from ftp://ftp.iana.org/tz/releases

See https://github.com/eggert/tz/blob/master/NEWS for a list of
what changed. We were previously in sync with tzdata2013d.

10 years agosed(1): Implement the 'i' flag.
Eitan Adler [Mon, 9 Dec 2013 19:19:39 +0000 (14:19 -0500)]
sed(1): Implement the 'i' flag.

Per the resolution of POSIX bug 0000779 (note 0002050) add
support for using 'i' as a case insensitive flag.

Obtained-from:   FreeBSD r259132

10 years agocallout: Fix callout_terminate() if the callout_reset() is never called
Sepherosa Ziehau [Tue, 10 Dec 2013 15:38:36 +0000 (23:38 +0800)]
callout: Fix callout_terminate() if the callout_reset() is never called

If callout_reset() is never called, then c_gd will be NULL

10 years agoacpi utilities: Raise WARNS to 2, bump CSTD to gnu99, fix warnings.
Sascha Wildner [Sat, 7 Dec 2013 11:32:42 +0000 (12:32 +0100)]
acpi utilities: Raise WARNS to 2, bump CSTD to gnu99, fix warnings.

MFC'd to 3.6 because it actually makes acpidb(8) work at all (before,
it segfaulted).

10 years agodrm: Convert idr spinlocks to lockmgr locks
François Tigeot [Thu, 5 Dec 2013 12:39:36 +0000 (13:39 +0100)]
drm: Convert idr spinlocks to lockmgr locks

* Since the idr code uses blocking calls in some code paths we can't
  hold spin locks accross idr calls

* This commit and the idr infinite loop one fix system freeze issues
  with some Xorg operations involving a huge number of pixmaps

10 years agoidr: Fix an infinite loop issue
Matthew Dillon [Thu, 5 Dec 2013 09:25:23 +0000 (10:25 +0100)]
idr: Fix an infinite loop issue

* idr routines were doing an infinite loop when the array was full but element
  #0 was still free

* Because allocations start at 1, the low bound was not being taken account of
  in idr_find_free(), causing an infinite loop

* idr_get_new_above() couldn't allocate an id >= 1 and idr_pre_get() thought it
  didn't have to expand because id #0 was available

10 years agoidr: fix bounds checks
Johannes Hofmann [Wed, 4 Dec 2013 20:55:50 +0000 (21:55 +0100)]
idr: fix bounds checks

10 years agoidr: access nodes array with token held
Johannes Hofmann [Tue, 3 Dec 2013 21:36:31 +0000 (22:36 +0100)]
idr: access nodes array with token held

10 years agoidr: fix sizeof in kmalloc calls
Johannes Hofmann [Tue, 3 Dec 2013 07:02:19 +0000 (08:02 +0100)]
idr: fix sizeof in kmalloc calls

10 years agoidr : Fix logic error in binary tree allocation
Joris Giovannangeli [Tue, 3 Dec 2013 00:55:27 +0000 (01:55 +0100)]
idr : Fix logic error in binary tree allocation

 * A complete binary tree has 2^n - 1 nodes, not 2^n. Changes default size
   to be 2^n - 1.

 * While here, also add proper locking directives to idr_grow and idr_remove_all

10 years agomail(1): Fix an over 9 years old typo/bug.
Sascha Wildner [Wed, 4 Dec 2013 17:19:57 +0000 (18:19 +0100)]
mail(1): Fix an over 9 years old typo/bug.

10 years agoFix indentation from the previous commit.
Antonio Huete Jimenez [Thu, 21 Nov 2013 18:50:04 +0000 (10:50 -0800)]
Fix indentation from the previous commit.

10 years agohammer - Ignore privilege check for HAMMERIOC_PFS_ITERATE.
Antonio Huete Jimenez [Thu, 21 Nov 2013 18:33:09 +0000 (10:33 -0800)]
hammer - Ignore privilege check for HAMMERIOC_PFS_ITERATE.

* This caused 'hammer info' to display an empty list of PFSes
  when run by non-root.

Pointed-out-by: dillon
10 years agokernel: Fix two typos, _KERNRL -> _KERNEL and ALTQ_unLOCK -> ALTQ_UNLOCK.
Sascha Wildner [Thu, 21 Nov 2013 00:45:27 +0000 (01:45 +0100)]
kernel: Fix two typos, _KERNRL -> _KERNEL and ALTQ_unLOCK -> ALTQ_UNLOCK.

10 years agobnx: Only 5718 chip family use PCI_BAR4 as MSI-X table; rest use PCI_BAR2
Sepherosa Ziehau [Thu, 21 Nov 2013 00:43:57 +0000 (08:43 +0800)]
bnx: Only 5718 chip family use PCI_BAR4 as MSI-X table; rest use PCI_BAR2

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

10 years ago<time.h>: #if 0 some prototypes of syscalls which we don't (yet) have.
Sascha Wildner [Tue, 12 Nov 2013 21:14:24 +0000 (22:14 +0100)]
<time.h>: #if 0 some prototypes of syscalls which we don't (yet) have.

Came in with the "locale megapatch". Useless without implementation, but
leave them in #if 0 since (being standard) we want them.

10 years agoNote on ABI change requiring rebuild of third-party software. v3.6.0
Justin C. Sherrill [Wed, 20 Nov 2013 05:03:41 +0000 (00:03 -0500)]
Note on ABI change requiring rebuild of third-party software.

10 years agoAdd note about reboot before 'make upgrade' step.
Justin C. Sherrill [Wed, 20 Nov 2013 05:01:21 +0000 (00:01 -0500)]
Add note about reboot before 'make upgrade' step.

Based on:

http://lists.dragonflybsd.org/pipermail/users/2013-September/090163.html

10 years agocpdup - Add another way to prevent host:path misintepretation
Matthew Dillon [Thu, 14 Nov 2013 20:23:15 +0000 (12:23 -0800)]
cpdup - Add another way to prevent host:path misintepretation

* Allow a local file or directory name to be prefixed with localhost:
  to prevent colons in the filename from being misinterpreted as a
  remote-host specification.

  This is in addition to the nominal absolute-path method to prevent
  misinterpretation (a '/' occuring before any ':' prevents
  misinterpretation of the ':' as a remote-host specification)

10 years agofix the INT64_C and INTMAX_C family macro for x86_64.
Alexandre Perrin [Mon, 18 Nov 2013 22:16:22 +0000 (23:16 +0100)]
fix the INT64_C and INTMAX_C family macro for x86_64.

  This patch fix the expanding type of both the INT64_C and the INTMAX_C
  family macros to match their corresponding type:
  - INT64_C(value) to `int_least64_t`
  - UINT64_C(value) to `uint_least64_t`
  - INTMAX_C(value) to `intmax_t`
  - UINTMAX_C(value) to `uintmax_t`

10 years agomdocml: bump DragonFly version for release
Franco Fichtner [Sun, 17 Nov 2013 14:09:41 +0000 (15:09 +0100)]
mdocml: bump DragonFly version for release

10 years agogroff: properly display $Mdocdate magic
Franco Fichtner [Sun, 17 Nov 2013 13:39:56 +0000 (13:39 +0000)]
groff: properly display $Mdocdate magic

OpenSSH and mdocml pages require this.  Reduces the groff/mandoc
output diff.  I heard this was suggested upstream a while ago, but
never made it into the code base.

Taken-from: OpenBSD

10 years agoiwn: fix compilation without INVARIANTS
Johannes Hofmann [Sat, 9 Nov 2013 20:13:49 +0000 (21:13 +0100)]
iwn: fix compilation without INVARIANTS

wlan_serializer is now held consistently, so we can get rid
of the conditional locking which breaks building without
INVARIANTS.

noticed-by: Andrey Oktyabrskiy

10 years agoed(1): Plug some memory leaks in error paths (taken from FreeBSD).
Sascha Wildner [Thu, 14 Nov 2013 12:08:06 +0000 (13:08 +0100)]
ed(1): Plug some memory leaks in error paths (taken from FreeBSD).

10 years agokernel - Fix lock/delete race in the namecache
Matthew Dillon [Mon, 11 Nov 2013 17:12:58 +0000 (09:12 -0800)]
kernel - Fix lock/delete race in the namecache

* Re-check ncp connectivity and the NCF_DESTROYED flag after
  successfully locking the ncp.

10 years agohammer - Remove cache_inval_vp() call
Matthew Dillon [Mon, 11 Nov 2013 17:14:15 +0000 (09:14 -0800)]
hammer - Remove cache_inval_vp() call

* Remova a call to cache_inval_vp() that no other VFSs use which was
  causing deadlocks against concurrent rm's of hardlinks to the same
  file.

Reported-by: ftigeot
10 years agokernel: Mark two variables as being used by KKASSERT() only.
Sascha Wildner [Sat, 9 Nov 2013 00:19:45 +0000 (01:19 +0100)]
kernel: Mark two variables as being used by KKASSERT() only.

Reported-by: Andrey Oktyabrskiy <ano@bestmx.net>
10 years agopkill - Optimize pgrep -F
Matthew Dillon [Sat, 9 Nov 2013 17:08:47 +0000 (09:08 -0800)]
pkill - Optimize pgrep -F

* Ask for a specific process instead of pulling down all processes when
  -F <pidfile> is specified.  This is much much faster.

10 years agokernel - Fix lockmgr LK_UPGRADE bug
Matthew Dillon [Sat, 9 Nov 2013 04:46:43 +0000 (20:46 -0800)]
kernel - Fix lockmgr LK_UPGRADE bug

* Fix a bug in the LK_UPGRADE sequencing.  If an LKC_UPREQ owner is present
  and releasing the shared lock would release the lock, the UPREQ owner must
  be granted the exclusive lock right then and there.

10 years agops - Remove display of the 'M'P state
Matthew Dillon [Fri, 8 Nov 2013 18:20:02 +0000 (10:20 -0800)]
ps - Remove display of the 'M'P state

* Remove display of the 'M' flag, which used to mean that the process was
  running MPSAFE w/regards to the kernel's mp_lock.  Well, pretty much
  all processes are MPSAFE now, so the flag just clutters the output.

10 years agosystat - Sync with kernel changes for SMP collision statistics
Matthew Dillon [Fri, 8 Nov 2013 07:23:59 +0000 (23:23 -0800)]
systat - Sync with kernel changes for SMP collision statistics

* Rename the tokcol fields to smpcol/label.  Remove the nice% field
  (combine it with user%) and expand the collision label space to
  18 characters.

* Now able to display token, lockmgr, mtx, and spinlock contention.

10 years agokernel - Improve SMP collision statistics
Matthew Dillon [Fri, 8 Nov 2013 07:22:20 +0000 (23:22 -0800)]
kernel - Improve SMP collision statistics

* Populate the per-cpu collision counter and label from the spinlock,
  lockmgr lock, and mutex code.  The token code already used it.

* Pass __func__ to the spinlock routines so it can be copied into
  the per-cpu collision label.

10 years agokernel - slotimer is MPSAFE, fix degenerate mplock case in callout threads
Matthew Dillon [Fri, 8 Nov 2013 18:29:49 +0000 (10:29 -0800)]
kernel - slotimer is MPSAFE, fix degenerate mplock case in callout threads

* The slotimer (runs once every 10 seconds) is MPSAFE.  This runs on all cpus
  all at once so it kinda created a little hicup before due to being defined
  wrong.

* When a callout thread sleeps, make sure any left-over mplock is not
  being held.

10 years agoopenssh - Fix an openssh issue.
Matthew Dillon [Fri, 8 Nov 2013 18:52:20 +0000 (10:52 -0800)]
openssh - Fix an openssh issue.

* Properly zero the newkey structure as per OpenBSD announcement.  Our older
  openssh does not implement the AES-GCM cipher that creates the vulnerability
  but fix the bug anyway.

10 years agokernel - Fix memory leak, clean up kernel slab fragmentation
Matthew Dillon [Thu, 7 Nov 2013 19:21:12 +0000 (11:21 -0800)]
kernel - Fix memory leak, clean up kernel slab fragmentation

* The kernel slab allocator collects off-cpu kfree()s in z_RChunks.  This
  linked list is freed up by the owning cpu.  However, zones which are not
  at the head of the list can wind up with non-NULL z_RChunks which never
  get freed.

* Add a 10-second callout on every cpu to clean-up these stale zones, giving
  the kernel a chance to free the related zones.

* This was probably the cause for other kernel memory leaks reported in the
  past.

Found-by: sephe
10 years agokernel - Fix vn_syncer_add panic with UFS
Matthew Dillon [Tue, 5 Nov 2013 22:46:00 +0000 (14:46 -0800)]
kernel - Fix vn_syncer_add panic with UFS

* The new VONWORKLST requirements were expanded to include VOBJDIRTY
  for both the standard syncer and the new syncer.  There was a path
  in the VM system which could clear VOBJDIRTY but failed to resynchronize
  VONWORKLST which could cause UFS to accidently leave a vnode on the
  syncer list after reclamation, causing a crash.

* Fix the VM path.

Reported-by: David Shao
10 years ago3.6 branching and setup. v3.6.0rc
Justin C. Sherrill [Tue, 5 Nov 2013 03:30:53 +0000 (22:30 -0500)]
3.6 branching and setup.

10 years agohammer2 - Stabilization
Matthew Dillon [Mon, 4 Nov 2013 19:41:09 +0000 (11:41 -0800)]
hammer2 - Stabilization

* Do not scrap deleted + modified chains unconditionally, this will mess
  up operations on unlinked-but-open files.  Also fixes an assertion which
  was getting hit and fixes poudriere test run stdout EBADF errors on
  unlinked fifos.

* Optimize handling of the DESTROYED flag to restore the feature where a
  rm -rf can get away with doing almost no write I/O.

* Remove a bunch of debug stuff

10 years agomdoc_local: Add two more FreeBSD versions which are used in manual pages.
Sascha Wildner [Mon, 4 Nov 2013 19:33:43 +0000 (20:33 +0100)]
mdoc_local: Add two more FreeBSD versions which are used in manual pages.

10 years agostrlcpy.3: Use OpenBSD's revamped description of strlcpy and strlcat.
Sascha Wildner [Mon, 4 Nov 2013 19:21:30 +0000 (20:21 +0100)]
strlcpy.3: Use OpenBSD's revamped description of strlcpy and strlcat.

This is FreeBSD's r257646.

Submitted-by: Eitan Adler <eadler@freebsd.org>
From their commit msg:

This explanation is supposed to be simpler and better.  In particular
"comparing it to the snprintf API provides lots of value, since it raises the
bar on understanding, so that programmers/auditors will a better job calling
all 3 of these functions."

10 years agopthread/sem_timedwait: sem_timedwait()'s timespec argument is const.
Sascha Wildner [Sun, 3 Nov 2013 22:00:28 +0000 (23:00 +0100)]
pthread/sem_timedwait: sem_timedwait()'s timespec argument is const.

10 years agoFix some more prototypes in manual pages.
Sascha Wildner [Sun, 3 Nov 2013 21:36:35 +0000 (22:36 +0100)]
Fix some more prototypes in manual pages.

10 years agobsd-family-tree: Sync with FreeBSD (for OpenBSD 5.4).
Sascha Wildner [Sun, 3 Nov 2013 20:51:34 +0000 (21:51 +0100)]
bsd-family-tree: Sync with FreeBSD (for OpenBSD 5.4).

10 years agoFix two prototypes in stringlist.3 and rpc_svc_reg.3.
Sascha Wildner [Sun, 3 Nov 2013 20:50:39 +0000 (21:50 +0100)]
Fix two prototypes in stringlist.3 and rpc_svc_reg.3.

10 years agokernel/x86_64: Do not print a message upon every segmentation fault.
Sascha Wildner [Sun, 3 Nov 2013 08:21:33 +0000 (09:21 +0100)]
kernel/x86_64: Do not print a message upon every segmentation fault.

It was printed even when the SIGSEGV was caught, such as by configure
tests, causing a rather noisy console when packages were built. After
this commit we're back to the traditional behavior (no message if the
signal is caught, and the usual message if not):

pid <pid> (<user>), uid <uid>: exited on signal 11 (core dumped)

While here, adjust some comments.

10 years agokernel/i386: Implement atomic_swap_long()
François Tigeot [Sun, 3 Nov 2013 07:13:18 +0000 (08:13 +0100)]
kernel/i386: Implement atomic_swap_long()

10 years agodrm: Use Linux atomic types and functions
François Tigeot [Sat, 2 Nov 2013 14:47:01 +0000 (15:47 +0100)]
drm: Use Linux atomic types and functions

Opportunistically sync to Linux 3.8 when possible

10 years agokref.h: Adapt to Linux 3.8's drm
François Tigeot [Sat, 2 Nov 2013 14:36:46 +0000 (15:36 +0100)]
kref.h: Adapt to Linux 3.8's drm

* Implement kref_sub()

* The internal counter is used by the drm code, rename it to refcount

* The internal counter must be of type atomic_t

10 years agodrm: Import linux/kernel.h from FreeBSD's OFED stack
François Tigeot [Sat, 2 Nov 2013 14:02:53 +0000 (15:02 +0100)]
drm: Import linux/kernel.h from FreeBSD's OFED stack

10 years agodrm: fix test_and_set_bit() prototype
François Tigeot [Sat, 2 Nov 2013 17:58:22 +0000 (18:58 +0100)]
drm: fix test_and_set_bit() prototype

10 years agodrm: Import linux/bitops.h from the FreeBSD OFED stack
François Tigeot [Sat, 2 Nov 2013 15:36:15 +0000 (16:36 +0100)]
drm: Import linux/bitops.h from the FreeBSD OFED stack

10 years agodrm: Improve linux/atomic.h
François Tigeot [Sat, 2 Nov 2013 12:41:31 +0000 (13:41 +0100)]
drm: Improve linux/atomic.h

* Add an atomic64_t definition

* Add back atomic_xchg()

* Add atomic64_read() atomic64_xchg() and atomic64_set()

10 years agodrm: Replace drm_atomic.h by linux/atomic.h from FreeBSD's OFED stack
François Tigeot [Sat, 2 Nov 2013 12:07:24 +0000 (13:07 +0100)]
drm: Replace drm_atomic.h by linux/atomic.h from FreeBSD's OFED stack

10 years agodirfs - Call VOP_INACTIVE() on last VOP_CLOSE()
Antonio Huete Jimenez [Sat, 2 Nov 2013 21:06:52 +0000 (22:06 +0100)]
dirfs - Call VOP_INACTIVE() on last VOP_CLOSE()

10 years agodirfs - Add VFS_STATFS() function
Antonio Huete Jimenez [Sat, 2 Nov 2013 21:02:41 +0000 (22:02 +0100)]
dirfs - Add VFS_STATFS() function

10 years agodirfs - Add KTR_LOG for VFS_MOUNT / VFS_UNMOUNT
Antonio Huete Jimenez [Sat, 2 Nov 2013 20:49:25 +0000 (21:49 +0100)]
dirfs - Add KTR_LOG for VFS_MOUNT / VFS_UNMOUNT

10 years agodirfs - Improve a couple KTR messages
Antonio Huete Jimenez [Sat, 2 Nov 2013 20:16:54 +0000 (21:16 +0100)]
dirfs - Improve a couple KTR messages

10 years agohammer2 - Stabilization
Matthew Dillon [Sat, 2 Nov 2013 07:06:57 +0000 (00:06 -0700)]
hammer2 - Stabilization

* Fix heavy cpu use in flush due to a blown recursion which can run down
  the same chain many times due to the aliasing of hammer2_chain_core
  structures.

  The basic problem is that there can be H2 operations running concurrently
  with a flush that are not part of the flush.  These operations have a
  higher transaction id.  When situated deep in the tree, they can cause
  the flush to repeatedly traverse large portions of the tree that it had
  already checked because the recording of the lower flush TID is lower
  than the update_tid from the concurrent operations.

* Fix a multitude of flush / concurrent-operations races.  The worst of the
  lot is related to the situation where a concurrent operation does a
  delete-duplicate on a chain containing a block table (which can include
  an inode chain) which the flush needs to update.  This results in TWO
  block tables needing updating relative to different synchronization
  points.  Essentially, one of the chains is strictly temporary for flush
  purposes while the other is the 'real' chain.

  For example, if the concurrent operation is adding or deleting elements
  from a block table the flush may have to add/delete DIFFERENT elements
  for its own view.  This requires two different versions of the block table
  (one being strictly temporary).

  Improper updates of the chain->bref.mirror_tid caused the flush to get
  confused and assert on the blocktable not containing the expected dat.

* More concurrent-operations during a flush issues fixed.  If a concurrent
  operation deletes a chain and the flush needs to fork a 'live' version
  of the chain, the flush's version will have a lower transaction id and
  must be properly ordered in hammer2_chain_core->ownerq.  It was not
  being ordered properly.

* Flushes are recursive and to improve concurrency the flush temporarily
  unlocks the old parent when diving under a child.  This can result in a
  race where, due to hammer2_chain_core aliasing the recursion can wrap
  around back to the parent.

  Detect the case after re-locking the parent on the way back up the tree
  and do the right thing.

* Fix handling of the flush block table rollup.  Consolidate the call to
  modify the parent (so we can adjust the blockrefs after flushing the
  children) to a single point.

* Improve flush performance.  If a parent is deferred at a higher level
  and then encountered again via a shallower path, we now leave it deferred
  and do not try to execute it in the shallower path even though the stack
  depth is ok, as it will likely become deferred at a lower level anyway.

  Check a deleted-chain case early before we recurse.  A deleted chain
  which is flagged DUPLICATED does not have to recurse as the sub-path
  is reachable via some other parent.  This significantly improves
  performance because there are often a ton of chains in-memory marked
  DELETED.

  This results in more efficient deferrals.

* Fix adjustments of modify_tid and delete_tid in delete-duplicate
  operations, clean up handling of CHAIN_INITIAL, properly transfer
  flags in delete-duplicate.

* Fix some gratuitous wakeups in the transaction API.

10 years agohammer2 - stabilization
Matthew Dillon [Fri, 1 Nov 2013 16:48:10 +0000 (09:48 -0700)]
hammer2 - stabilization

* Reduce HAMMER2_FLUSH_DEPTH_LIMIT from 40 to 10 to avoid blowing out
  the kernel stack.

* Retool hammer2_chain_drop() and hammer2_chain_lastdrop() to remove all
  possible recursion.  The in-memory topology can get very deep and very
  wide.  This fixes another kernel stack blowout.

* Fix a bug in hammer2_chain_flush()'s deferred flush.  Now that
  hammer2_chain_flush() can replace the passed-in chain, we have to drop
  the extra ref before calling it instead of after.

10 years agohammer2 - stabilization
Matthew Dillon [Fri, 1 Nov 2013 07:51:00 +0000 (00:51 -0700)]
hammer2 - stabilization

* Code generally assumes that a deleted-flagged chain can still be
  duplicated.  Remove bogus call to hammer2_freemap_free() and
  remove bogus masking of chain->bref.data_off in hammer2_chain_delete().

10 years agohammer1 - cleanup, minor bug fixes
Matthew Dillon [Fri, 1 Nov 2013 06:09:31 +0000 (23:09 -0700)]
hammer1 - cleanup, minor bug fixes

* Cleanup pass, remove some dead code

* Minor bug fixes, add tokens around some paths that need them.

* Remove use of the master token in several paths that don't need it,
  improving concurrency.

10 years agokernel - Improve panic handling
Matthew Dillon [Fri, 1 Nov 2013 06:07:03 +0000 (23:07 -0700)]
kernel - Improve panic handling

* Clear the gd_spinlocks counter when handling a panic.  This improves
  our chances of being able to obtain a crash dump

10 years agohammer2 - Stabilization pass, more flush refactoring
Matthew Dillon [Fri, 1 Nov 2013 05:57:55 +0000 (22:57 -0700)]
hammer2 - Stabilization pass, more flush refactoring

* Add voldata.inode_tid, separate inode TID allocations from
  transaction TID allocations in voldata.

* Rewrite the transaction management functions.

* Rewrite hammer2's filesystem sync code to reduce stalls.

* Keep track of a generation number on the hammer2_chain_core structure
  so the flush code can re-scan when it modifies elements within the
  flush transaction.

* Cleanup the duplication and delete-duplication code and hardlink handling.
  The delete-duplication code now properly tags delete_tid when a flush is
  delete-duplicating a chain which is deleted in the live view but is still
  valid in the flush view.

* Correct numerous bugs in tracking the modified/deleted state of
  a chain.

* Correct numerous flush bugs.

* Separate the mirror TID for the freemap chain from the volume chain.
  This will allow freemap updates to be delayed.

* Implement a more stringent algorithm to determine when CHAIN_MOVED
  can be cleared in chain->flags.

* Do a better job limiting the flush scan when concurrent modifying
  operations are occuring in large volumes.

10 years agotest - Adjust vnodeinfo for system changes
Matthew Dillon [Fri, 1 Nov 2013 05:55:45 +0000 (22:55 -0700)]
test - Adjust vnodeinfo for system changes

* Make vnodeinfo in test/debug compile again.

10 years agohammer2 - Refactor flush
Matthew Dillon [Wed, 30 Oct 2013 07:13:34 +0000 (00:13 -0700)]
hammer2 - Refactor flush

* Replace HAMMER2_CHAIN_SUBMODIFIED with core->update_tid.  SUBMODIFIED
  applies to chain->core, not to chain. Use a TID to track updates to
  make it easier for a flush to update records without messing up flush
  sequencing of chains being concurrently modified outside the flush's
  TID (that will be handled in the next flush).

* Make sure the DUPLICATED flag is set when duplicating a chain which
  has already been duplicated to another target.  This case is only during
  flushes and can occur when the flush races against concurrent updates
  which are not part of the flush.

* Refactor bioq flushing during a flush.  hammer2_vfs_sync now gives the
  bioq a window to operate using the flush's TID before the flush actually
  starts to flush.

* hammer2_chain_modify() retains the current allocation block if the TID
  does not cross a flush boundary.

* chain->bref.mirror_tid is now used to track flush progress and is compared
  against core->update_tid to determine when a flush is needed.

* Code cleanups.

10 years agoshutdown.8: Actually, start a new paragraph for poweroff's description.
Sascha Wildner [Thu, 31 Oct 2013 18:21:09 +0000 (19:21 +0100)]
shutdown.8: Actually, start a new paragraph for poweroff's description.

10 years agoshutdown.8: Remove an empty line.
Sascha Wildner [Thu, 31 Oct 2013 17:38:01 +0000 (18:38 +0100)]
shutdown.8: Remove an empty line.

10 years agoMention KTR_IF_POLL in LINT and the ktr(4) manual page.
Sascha Wildner [Thu, 31 Oct 2013 14:04:38 +0000 (15:04 +0100)]
Mention KTR_IF_POLL in LINT and the ktr(4) manual page.

10 years ago<sys/msgport.h>: Extend the #ifdef _KERNEL to cover the lwkt_* protos too.
Sascha Wildner [Wed, 30 Oct 2013 20:46:08 +0000 (21:46 +0100)]
<sys/msgport.h>: Extend the #ifdef _KERNEL to cover the lwkt_* protos too.

This unbreaks buildworld after the previous commit to <sys/msgport.h>.

Reported-by: Ed Berger <edwberger@gmail.com>
10 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 30 Oct 2013 17:57:15 +0000 (18:57 +0100)]
bsd-family-tree: Sync with FreeBSD.

10 years agomsgport: Add putport_oncpu; helps scheduling netisr locally for spin port
Sepherosa Ziehau [Wed, 30 Oct 2013 13:50:55 +0000 (21:50 +0800)]
msgport: Add putport_oncpu; helps scheduling netisr locally for spin port

Background:
High rate (actually same rate as polling(4)) IPIs on random CPUs are
observed when polling(4) is enabled and there is virtually no network
activity.

After polling(4) activities are traced using ktr(9), it turns out that the
high rate IPIs are actually from the wakeup() on netisr's msgport.  Since
the sleep queue cpumask is indexed by the hash of ident, there are chances
that the netisr's msgport ident has the same hash value as other idents
that certain threads on other CPUs are waiting on.  If this ever happens
(well, it does happen), the netisr's msgport wakeup will trigger "wakeup"
IPIs to other CPUs.  However, these "wakeup" IPIs are actually useless,
since only netisr will wait on its msgport.

putport_oncpu() msgport method is added to call wakeup_mycpu() for spin
msgport, if we know that this port is only accessed by one thread on the
current CPU, e.g. polling(4).  This is also the case for other network
code, e.g.  syncache timeout, TCP timeout, fastforward flow cache timeout
etc.  However, these network code's running rate is too low to unveil the
extra "wakeup" IPIs problem.  lwkt_sendmsg_oncpu() is added as wrapper to
putport_oncpu() msgport method.

Currently, only polling(4) is using lwkt_sendmsg_oncpu().  Others will
be converted soon.

10 years agomsgport: Merge several sendmsg functions
Sepherosa Ziehau [Tue, 29 Oct 2013 14:10:14 +0000 (22:10 +0800)]
msgport: Merge several sendmsg functions

sendmsg_stage1 and sendmsg_stage2 are actually copy and paste of part of
sendmsg.  Make the functionality inline and let sendmsg call them
sequentially.

While I am here, rename "stage1" to "prepare" and "stage2" to "start"

10 years agopolling: Add preliminary KTR support
Sepherosa Ziehau [Tue, 29 Oct 2013 13:58:14 +0000 (21:58 +0800)]
polling: Add preliminary KTR support

10 years agoipsec_strerror.3: Ansify prototype.
Sascha Wildner [Tue, 29 Oct 2013 20:16:52 +0000 (21:16 +0100)]
ipsec_strerror.3: Ansify prototype.

10 years agoFix three typos I made in the locale manpages.
Sascha Wildner [Tue, 29 Oct 2013 17:51:23 +0000 (18:51 +0100)]
Fix three typos I made in the locale manpages.

10 years agomdocml: tweak mandocdb(8) database creation
Franco Fichtner [Mon, 28 Oct 2013 21:04:43 +0000 (22:04 +0100)]
mdocml: tweak mandocdb(8) database creation

Since the current apropos(1) has a few issues, it's desirable to
switch to mdocml's version.  In order to do this, tweak the handling
of MLINKS.  While there, be a bit nostalgic about apropos(1) output.

10 years agoman.conf: correctly point to database file
Franco Fichtner [Mon, 28 Oct 2013 18:24:28 +0000 (19:24 +0100)]
man.conf: correctly point to database file

10 years agodrm: Fix warnings introduced by recent commits
François Tigeot [Mon, 28 Oct 2013 15:16:08 +0000 (16:16 +0100)]
drm: Fix warnings introduced by recent commits

10 years agodrm: Import linux/types.h from the FreeBSD OFED stack
François Tigeot [Sun, 27 Oct 2013 14:52:48 +0000 (15:52 +0100)]
drm: Import linux/types.h from the FreeBSD OFED stack

10 years agodrm: Import asm/types.h from the FreeBSD OFED stack
François Tigeot [Sun, 27 Oct 2013 14:53:30 +0000 (15:53 +0100)]
drm: Import asm/types.h from the FreeBSD OFED stack

10 years agodrm/i915: Put i915_drm.h into include/
François Tigeot [Sun, 27 Oct 2013 09:02:44 +0000 (10:02 +0100)]
drm/i915: Put i915_drm.h into include/

Split the header in two separate files, like it is done in Linux 3.8.

10 years agohammer2 - Fix misc bugs
Matthew Dillon [Sun, 27 Oct 2013 05:09:28 +0000 (22:09 -0700)]
hammer2 - Fix misc bugs

* Move the live_zero optimization from hammer2_chain to
  hammer2_chain_core.  It is only applicable to the core
  and delete-duplicate operations can mess up the cache.

* Move the HAMMER2_CHAIN_COUNTEDBREFS flag to HAMMER2_CORE_COUNTEDBREFS.
  It is only applicable to the core and delete-duplication operations
  can really mess up calculations of live_count otherwise.

* Don't bump live_count if inserting a deleted chain.

* The vp in the hammer2_sync_scan2() is not locked on purpose.  Use the
  synclist token interlock to safely ref the hammer2_inode before
  potentially blocking, otherwise it can get ripped out from under us.

10 years agotmpfs - Fix SMP race
Matthew Dillon [Sun, 27 Oct 2013 05:06:17 +0000 (22:06 -0700)]
tmpfs - Fix SMP race

* Hold the node lock in order to safely indirect through
  node->tn_dir.tn_parent.