dragonfly.git
8 years agodrm: Synchronize ioctl definitions with Linux 3.14
François Tigeot [Sun, 31 May 2015 16:28:29 +0000 (18:28 +0200)]
drm: Synchronize ioctl definitions with Linux 3.14

Many IOCTLs don't require the acquisition of a lock anymore.

8 years agoclock/tsc: Run TSC MP synchronization test on APs too.
Sepherosa Ziehau [Sat, 30 May 2015 08:47:56 +0000 (16:47 +0800)]
clock/tsc: Run TSC MP synchronization test on APs too.

TSC MP synchronization needs BIOS and hardware coordination.  It is
known that buggy BIOS could make TSC not MP synchronized if the system
has multiple CPU packages.  Testing TSC MP synchronization only on BSP
is not enough to discover certain types of TSC MP unsynchronization,
e.g. APs TSC is ahead of BSP's TSC by great amount.  Thus APs also need
to run TSC MP synchronization test to make sure that TSC is really MP
synchronized.  And we are now running at least 50000 TSC MP
synchronization tests on each CPU.

And use lfence to prevent rdtsc from reordering during TSC MP
synchronization test, since we only test TSC MP synchronization on
Intel CPUs currently (mfence will be needed for AMD CPUs).

8 years agolwkt: Initialize LWKT objcache initialization to earlier place
Sepherosa Ziehau [Sat, 30 May 2015 13:15:04 +0000 (21:15 +0800)]
lwkt: Initialize LWKT objcache initialization to earlier place

So that calling lwkt_create w/o thread template could work during
early boot.

LWKT is now initialized before SOFTCLOCK, since SOFTCLOCK creates
per-cpu callout threads, though the creation uses thread template.

8 years agodrm: Sync drm_gem_close_ioctl() with Linux 3.14
François Tigeot [Sun, 31 May 2015 16:06:33 +0000 (18:06 +0200)]
drm: Sync drm_gem_close_ioctl() with Linux 3.14

8 years agonet80211 - Fix mis-merge
Matthew Dillon [Sun, 31 May 2015 02:05:11 +0000 (19:05 -0700)]
net80211 - Fix mis-merge

* Fix a mismerge that messes up broadcast packets.

Reported-by: Romick
Verified-by: Adrian Chadd
8 years agodrm/radeon: Add temperature sensor support
Imre Vadász [Sat, 30 May 2015 20:30:07 +0000 (22:30 +0200)]
drm/radeon: Add temperature sensor support

* Implement support for reporting radeon temperature sensors via the
  sensor framework, by replacing the original sysfs glue code from Linux.

8 years agosys/gnu/vfs/ext2fs: Fix coding style
Tomohiro Kusumi [Fri, 29 May 2015 11:17:39 +0000 (20:17 +0900)]
sys/gnu/vfs/ext2fs: Fix coding style

- Fix coding style that we rarely see in dfly kernel as well as
  ansi c code in general.

- It's visually confusing as it resembles multiplication of variables.

- (Note that dfly's ext2 seems to be broken currently)

8 years agosys/gnu/vfs/ext2fs: Remove FS/I_FS macros
Tomohiro Kusumi [Fri, 29 May 2015 10:55:39 +0000 (19:55 +0900)]
sys/gnu/vfs/ext2fs: Remove FS/I_FS macros

- These file-local macros are from UFS, but not necessary.
  Directly refering to the superblock like the original ext2
  code should be clearer.

- (Note that dfly's ext2 seems to be broken currently)

8 years agosys/gnu/vfs/ext2fs: Remove unused typedef
Tomohiro Kusumi [Fri, 29 May 2015 10:31:42 +0000 (19:31 +0900)]
sys/gnu/vfs/ext2fs: Remove unused typedef

- (Note that dfly's ext2 seems to be broken currently)

8 years agosys/gnu/vfs/ext2fs: Remove bsd_malloc/free macros
Tomohiro Kusumi [Fri, 29 May 2015 10:26:01 +0000 (19:26 +0900)]
sys/gnu/vfs/ext2fs: Remove bsd_malloc/free macros

- These file-local macros are not necessary.
  These are neither from the original ext2 nor UFS code.

- (Note that dfly's ext2 seems to be broken currently)

8 years agodrm/radeon: Expose radeon driver knobs to /boot/loader.conf
zrj [Fri, 29 May 2015 06:27:29 +0000 (09:27 +0300)]
drm/radeon: Expose radeon driver knobs to /boot/loader.conf

8 years agokernel - Fix SMP race against fp seek position lock
Matthew Dillon [Fri, 29 May 2015 21:09:37 +0000 (14:09 -0700)]
kernel - Fix SMP race against fp seek position lock

* Fix a SMP race against write-appends.  Atomic ops are used on the
  struct file->f_flag field to interlock write-append operations.
  However, the fcntl() and flock() code was also modifying file->f_flag
  using non-atomic ops.

* Fix fcntl() and flock() to use atomic ops.

* Problem could lead to processes stuck forever in "fpoff".

Reported-by: Sevan Janiyan
8 years agoSync drm_context.c with Linux 3.14
François Tigeot [Fri, 29 May 2015 19:02:19 +0000 (21:02 +0200)]
Sync drm_context.c with Linux 3.14

8 years agovmpageinfo - Add PG_NEED_COMMIT flag
Matthew Dillon [Fri, 29 May 2015 16:43:03 +0000 (09:43 -0700)]
vmpageinfo - Add PG_NEED_COMMIT flag

* Add display of the PG_NEED_COMMIT flag.

8 years agokernel - Fix improper OOM process kill when no swap configured
Matthew Dillon [Fri, 29 May 2015 16:38:13 +0000 (09:38 -0700)]
kernel - Fix improper OOM process kill when no swap configured

* The avail_shortage calculation used by the pageout demon to track
  whether enough pages could be retired had a degenerate case which
  caused the demon to improperly believe that the machine was out of
  memory when it wasn't.

* Generally would only happen if no swap was configured.

Reported-by: joris
8 years agodrm: Sync vblank handling code with Linux 3.14
François Tigeot [Thu, 28 May 2015 20:38:06 +0000 (22:38 +0200)]
drm: Sync vblank handling code with Linux 3.14

8 years agodrm/radeon: Sync to Linux 3.11
Michael Neumann [Wed, 27 May 2015 07:35:36 +0000 (10:35 +0300)]
drm/radeon: Sync to Linux 3.11

8 years agosystat.1: Improve a bit.
Sascha Wildner [Thu, 28 May 2015 16:48:32 +0000 (18:48 +0200)]
systat.1: Improve a bit.

8 years agohammer - Fix build for crc changes
Matthew Dillon [Thu, 28 May 2015 16:41:28 +0000 (09:41 -0700)]
hammer - Fix build for crc changes

* hammer uses the old crc code but needs the crc_tab from the new code.

8 years agoboot - Fix build
Matthew Dillon [Thu, 28 May 2015 16:38:45 +0000 (09:38 -0700)]
boot - Fix build

* icrc32.c from libkern is too big for the boot code, bring in the old
  icrc32.c (slow but compact) directly into the boot subtree.

8 years agohammer2 - Set default compression for PFS
Matthew Dillon [Thu, 28 May 2015 15:54:09 +0000 (08:54 -0700)]
hammer2 - Set default compression for PFS

* When creating a new PFS, set the default compression to lz4 (instead of
  autozero which is no compression at all).

8 years agohammer2 - Use faster iscsi crc algorithm
Matthew Dillon [Thu, 28 May 2015 15:50:22 +0000 (08:50 -0700)]
hammer2 - Use faster iscsi crc algorithm

* libdmsg and hammer2 now use the faster iscsi crc algorithm.  Improvements
  are as follows:

    PATH             ncp  data-use inode-use comp kaddr
    /mnt/src01         0    1.15GB     41845 comp=autozero:default check=crc32
    /mnt/src00         0    0.86GB     41845 comp=lz4:default check=crc32
    /mnt/src02         0    0.76GB     41845 comp=zlib:9 check=crc32
    /mnt/src03         0    1.15GB     41845 comp=autozero:default check=none
    /mnt/src04         0    0.86GB     41845 comp=lz4:default check=none

  With no CRC at all (autozero and lz4 decompression):

    /mnt/src03 0.484u  2.967s 0:37.46 9.1%     25+65k 134868+0io 16pf+0w
    /mnt/src04 0.468u  3.280s 0:28.99 12.9%    25+65k 125494+0io 0pf+0w

  OLD CRC (autozero, lz4, zlib decopmression)

    /mnt/src01 0.538u 11.114s 0:47.80 24.3%    26+69k 134886+0io 0pf+0w
    /mnt/src00 0.538u 11.153s 0:34.57 33.7%    25+67k 126146+0io 0pf+0w
    /mnt/src02 0.538u 12.785s 0:32.78 40.6%    26+69k 121814+0io 0pf+0w

  NEW CRC (autozero, lz4, zlib decompression)

    /mnt/src01  0.398u 4.670s 0:42.52 11.9%     25+66k 135020+0io 30pf+0w
    /mnt/src00  0.531u 5.225s 0:29.43 19.5%     26+69k 126122+0io 0pf+0w
    /mnt/src02  0.499u 6.520s 0:27.44 25.5%     27+71k 121326+0io 0pf+0w

8 years agokernel - Replace iscsi CRC algo with a better one
Matthew Dillon [Thu, 28 May 2015 15:48:22 +0000 (08:48 -0700)]
kernel - Replace iscsi CRC algo with a better one

* Bring in Gary S. Brown's fast iscsi crc code.

* Greatly improves iscsi CRC performance.

* HAMMER2 uses the icrc CRC so it also improves HAMMER2's CRC performance
  (see followup commit).

Taken-from: FreeBSD

8 years agosys/gnu/vfs/ext2fs: Don't define buffer_head
Tomohiro Kusumi [Thu, 28 May 2015 14:16:25 +0000 (23:16 +0900)]
sys/gnu/vfs/ext2fs: Don't define buffer_head

- Remove '#define buffer_head buf'.

- BSD's ext2 implementation is based on UFS (i.e. copy + rename) rather
  than the original ext2, so there isn't really any reason to make the
  code and data structures look like Linux kernel. FreeBSD doesn't have
  this rename (anymore) either.

- (Note that dfly's ext2 seems to be broken currently)

8 years agosys/gnu/vfs/ext2fs: Remove unused typedef
Tomohiro Kusumi [Thu, 28 May 2015 13:55:28 +0000 (22:55 +0900)]
sys/gnu/vfs/ext2fs: Remove unused typedef

- ino_t is being used by dfly ext2.

- (Note that dfly's ext2 seems to be broken currently)

8 years agosys/gnu/vfs/ext2fs: Rename ROOTINO to EXT2_ROOTINO
Tomohiro Kusumi [Thu, 28 May 2015 13:37:33 +0000 (22:37 +0900)]
sys/gnu/vfs/ext2fs: Rename ROOTINO to EXT2_ROOTINO

- Add "EXT2_" so utility programs can distinguish it from UFS's
  ROOTINO when they need to include filesystem headers possibly
  in the future.

- Also see 5b09d16c.

- (Note that dfly's ext2 seems to be broken currently)

8 years agohammer2 - Stabilization
Matthew Dillon [Thu, 28 May 2015 05:47:30 +0000 (22:47 -0700)]
hammer2 - Stabilization

* Fix a division that was not adjusted for the new blockref size.
  The freemap now has one additional level in the worst case.

8 years agohammer2 - Stabilization pass
Matthew Dillon [Thu, 28 May 2015 05:26:42 +0000 (22:26 -0700)]
hammer2 - Stabilization pass

* Fix numerous deadlocks in syncthr.

* Fix startup issue in syncthr, elements in the initial iroot cluster
  were being marked INVALID for the syncthr.  This is what we want for
  front-end operations, but not for the syncthr.  The flag was preventing
  syncthr from properly synchronizing sub-trees.

* Fix a chain leak in syncthr which was leaving referenced chains sitting
  around on unmount.

* Do not repoint iroot elements in syncthr.  The iroot elements already
  exist and will not be created or destroyed, so no repointing should be
  necessary.

* Fix improper freemap indirect block size in hammer2_chain_create_indirect().

* Fix pmp->inode_tid assignment.  Inode number assignments are now handled
  on a per-PFS basis.

* Use the data_count and inode_count statistics to fill out statfs and
  statvfs.

* Use the data_count statistics to fill out vap->va_bytes for normal stat().

* Cleanups

8 years agohammer2 - hook up aggregate stats
Matthew Dillon [Wed, 27 May 2015 23:04:24 +0000 (16:04 -0700)]
hammer2 - hook up aggregate stats

* Keep track of data and inode use for the entire sub-tree in the
  blockref.  Since H2 is a copy-on-write filesystem, this winds up
  being trivial now that we have room in the blockref to store the
  info.

  Tracking is synchronized by the filesystem flush and requires no
  additonal I/O.  If you've just written something and want to check
  use, you do have to 'sync' first (or wait for the normal filesystem
  flush).

* Gives hammer2 the ability to report inode and data use for a
  sub-tree without having to traverse it.

* Actual data storage use is reported, not cumulative logical file
  size, so the user can immediately see the effects of e.g. compression
  and data block size selection by the filesystem.

* hammer2 stat <file_or_dir> will report use as of the most recent
  filesystem sync.

  PATH                            ncp  data-use inode-use comp kaddr
  /mnt/src00               0    0.86GB     41818 comp=lz4:default check=crc32
  /mnt/src00/Makefile_upg* 0   24.00KB         0 comp=lz4:default check=crc32
  /mnt/src00/bin           0    2.63MB       476 comp=lz4:default check=crc32
  /mnt/src00/contrib       0  169.98MB     15198 comp=lz4:default check=crc32
  /mnt/src00/lib           0   29.82MB      3617 comp=lz4:default check=crc32
  ...

  ls -la /mnt/src00/Makefile_upgrade.inc
  ... 1 dillon  wheel  90795 Apr 29 21:23 /mnt/src00/Makefile_upgrade.inc

  In the media dump we find that H2 was able to compress the 90KB
  Makefile_upgrade.inc file into a 16KB block and an 8KB block (the low byte
  of the data offset is the storage radix), for 24KB total.  And indeed, the
  stats from the hammer2 stat command above indicate 24KB of storage used
  for that file.

      data.0   0000000043d8800e 0000000000000000/16 mir=0000000000000025
mod=000000000000001b (meth 22)
      data.1   0000000043d84c0d 0000000000010000/16 mir=0000000000000025
mod=000000000000001b (meth 22)

8 years agohammer2 - Increase size of blockref, refactor freemap.
Matthew Dillon [Wed, 27 May 2015 21:41:36 +0000 (14:41 -0700)]
hammer2 - Increase size of blockref, refactor freemap.

I finally buckled under and increase the size of the blockref from 64 bytes
to 128 bytes.  The negative consequences are relatively minor, and the
positives are many.

Negative consequences

    * 512 blocks per 64KB indirect block instead of 1024.
    * Inode has only 4 built-in blockrefs instead of 8.
    * Indirect block overhead is doubled.
    * Freemap overhead is doubled due to SEGSIZE being 1GB instead of 2GB.
    * Small files will have to push an indirect block sooner (at 256KB).

Positive consequences

    * Freemap overhead is still only 0.40% of the storage.
    * Freemap now uses a 32KB indirect block instead of a 64KB indirect block.

    * Data and inode statistics can be tracked in the blockref.
    * Check code goes from max-192-bits to max-512-bits.
    * Additional fields now available for future filesystem features.

8 years agoradeon: sync to radeon 3.10
Michael Neumann [Mon, 25 May 2015 14:45:04 +0000 (17:45 +0300)]
radeon: sync to radeon 3.10

8 years agodrm/ttm: revert again to use tree(3)
zrj [Mon, 25 May 2015 16:34:57 +0000 (19:34 +0300)]
drm/ttm: revert again to use tree(3)

 This reverts 06cbdcf32488e8ce7bf9c345068a9f8d72cf48e2.
 Also add RB_ROOT redefine in ttm_bo_driver.h for ttm.

8 years agosys/gnu/vfs/ext2fs: Sync with Linux kernel's ext2 definitions
Tomohiro Kusumi [Wed, 27 May 2015 18:33:07 +0000 (03:33 +0900)]
sys/gnu/vfs/ext2fs: Sync with Linux kernel's ext2 definitions

- Note that ext2 on DragonFly seems to be broken currently.

8 years agoUpdate libarchive's and liblzma's configuration for recently added stuff.
Sascha Wildner [Wed, 27 May 2015 18:36:30 +0000 (20:36 +0200)]
Update libarchive's and liblzma's configuration for recently added stuff.

Make both use futimens() and utimensat(). xz's configure won't check for
futimes() if futimens() is available (hence HAVE_FUTIMES goes back to
undefined).

While here, define HAVE_DIRFD for libarchive too since we have it as a
public function since de45303d1431339260c3a353a1e18d034c807c4a.

Note that diff and grep also have HAVE_... macros for futimens() and
utimesat() in their config.h's but they are unused in the code, probably
stray configure checks.

8 years ago<sys/param.h>: Bump __DragonFly_version for futimens() and utimensat().
Sascha Wildner [Wed, 27 May 2015 16:40:59 +0000 (18:40 +0200)]
<sys/param.h>: Bump __DragonFly_version for futimens() and utimensat().

8 years agoAdd missing prototype for futimens(2) in <sys/stat.h>
Dimitris Papastamos [Wed, 27 May 2015 16:28:27 +0000 (17:28 +0100)]
Add missing prototype for futimens(2) in <sys/stat.h>

Fix spacing for utimensat() as well.

8 years ago<sys/stat.h>: Whitespace cleanup.
Sascha Wildner [Wed, 27 May 2015 16:38:12 +0000 (18:38 +0200)]
<sys/stat.h>: Whitespace cleanup.

8 years agokernel - Fix issue w/recent utimes commit
Matthew Dillon [Wed, 27 May 2015 16:19:25 +0000 (09:19 -0700)]
kernel - Fix issue w/recent utimes commit

* The repurposed itimerfix() and itimespecfix() functions needed to have
  a conditional removed which was putting an arbitrary limit on the tv_sec
  field.

* Fixes an issue that caused utimes*() to fail and return EINVAL.

8 years agohammer2 - cleanup
Matthew Dillon [Wed, 27 May 2015 03:00:18 +0000 (20:00 -0700)]
hammer2 - cleanup

* Cleanup a lock/unlock sequence used to force-load chain->data by
  replacing it with the appropriate load call.

8 years agottys - Add 'ifconsole' option to ttys entries
Matthew Dillon [Tue, 26 May 2015 20:01:25 +0000 (13:01 -0700)]
ttys - Add 'ifconsole' option to ttys entries

* Add the 'ifconsole' option.  This allows you to construct a line as shown
  below to enable a getty (e.g. on a serial port) only if the tty is the
  system console.

    ttyd0   "/usr/libexec/getty std.9600"   dialup  on secure ifconsole

  The ifconsole option also silently disables any devices which do not
  exist, removing unnecessary console spam.

* Modify libc and init to handle the new flag.

* Modify the nrelease build and ttys defaults to use this option for
  ttyd0, ttyd1, ttyd2, and ttyd3.

* Avoids previously reported issues with system crashes on certain machines
  whos serial ports are not implemented properly without having to fully
  disable the default ttyd* getty feature.  If the serial port isn't the
  console, it won't be enabled.

* Add a sysctl to the kernel which init needs to test whether a tty is the
  console or not.

Suggested-by: swildner
8 years agokernel - Return EINVAL on negative timeout to poll()
Matthew Dillon [Tue, 26 May 2015 18:03:32 +0000 (11:03 -0700)]
kernel - Return EINVAL on negative timeout to poll()

* Return EINVAL if poll() is called with a negative
  timeout, as per manual page.

Submitted-by: stateless
8 years agokernel - Sanity-check getutimes().
Matthew Dillon [Tue, 26 May 2015 18:00:45 +0000 (11:00 -0700)]
kernel - Sanity-check getutimes().

* Sanity check getutimes() and getutimens()

* Also note futimes commit just before this one was also
Submitted-by: stateless.
Submitted-by: stateless
8 years agokernel - Add futimens()
Matthew Dillon [Tue, 26 May 2015 17:56:19 +0000 (10:56 -0700)]
kernel - Add futimens()

* Add futimens()

* Consolidate the support function to kern_futimens().

8 years agokernel - Consolidate kern_utimes() into kern_utimensat()
Matthew Dillon [Tue, 26 May 2015 17:49:56 +0000 (10:49 -0700)]
kernel - Consolidate kern_utimes() into kern_utimensat()

* Consolidate kern_utimes() into kern_utimensat()

Submitted-by: stateless
8 years agobuildworld: Specify cpp for rpcgen to use rather than fallback
John Marino [Tue, 26 May 2015 07:56:49 +0000 (09:56 +0200)]
buildworld: Specify cpp for rpcgen to use rather than fallback

Without the -Y switch, rpcgen will fall back to "cpp" which is guided
by OBJFORMAT environment settings to point at the host cpp from gcc50.
In the later stages of buildworld, we want to use the cpp we just built,
not the host cpp which could have issues.  By stage 4, no native host
tools should be in use.

8 years agohammer2 - cleanup data load, unlink optimization
Matthew Dillon [Tue, 26 May 2015 04:42:00 +0000 (21:42 -0700)]
hammer2 - cleanup data load, unlink optimization

* Clean up data loading on chain lock.  Use chain flags to interlock data
  loading with either a shared or exclusive lock.

* We no longer upgrade a shared lock to exclusive in order to load data,
  preventing a potentially unexpected deadlock from occuring.

* Clean up the chain_core (chain->core) structure.  Remove flags and
  move the main lock from the core to the main chain structure proper.

* Attempt to avoid I/O when unlinking files by not updating the inode
  on the final 1->0 transition of nlinks.  This greatly reduces the amount
  of write I/O occuring during a rm -rf and improves performance by a
  factor of 3x.

8 years agokernel - Change bundirty() location in I/O sequence (2)
Matthew Dillon [Mon, 25 May 2015 19:28:09 +0000 (12:28 -0700)]
kernel - Change bundirty() location in I/O sequence (2)

* The bundirty() move interfered with softupdates because
  the buf_complete() callback can re-dirty the buffer.

* Fixed by moving the bundirty() prior to the buf_complete()
  call.

Reported-by: marino
8 years agonet80211 - Add dofbsddiff script
Matthew Dillon [Mon, 25 May 2015 19:00:29 +0000 (12:00 -0700)]
net80211 - Add dofbsddiff script

* Add helper script to the repo so it isn't lost.

* Helps diff DFly and FBsd 80211 code for work.

8 years agohammer2 - stabilization
Matthew Dillon [Mon, 25 May 2015 16:22:13 +0000 (09:22 -0700)]
hammer2 - stabilization

* Fix more deadlocks.  The solution here is not ideal, I'm doing too much
  unlocking and relocking of clusters and probably breaking certain atomicy
  requirements.

* Implement a delayed flush mechanism when making permanent chain deletions
  instead of calling hammer2_flush().  This should allow the flush code to
  better optimize-out unnecessary write I/Os.

* Add a spinlock for the ip->cluster (not completed yet).

* I had broken system-initated filesystem syncing by calling vclrisdirty()
  on the syncer vnode.  Fix it.

8 years agogcc50: bump version date to 25 May 2015
John Marino [Mon, 25 May 2015 08:08:41 +0000 (10:08 +0200)]
gcc50: bump version date to 25 May 2015

The base compiler gains all the fixes over the last 5 weeks since
GCC 5.1 was released.  This could fix a couple of issues in dports.

8 years agoMerge branch 'vendor/GCC50'
John Marino [Mon, 25 May 2015 08:52:09 +0000 (10:52 +0200)]
Merge branch 'vendor/GCC50'

8 years agoUpdate gcc-50 to SVN version 223641 (gcc-5-branch)
John Marino [Mon, 25 May 2015 08:05:27 +0000 (10:05 +0200)]
Update gcc-50 to SVN version 223641 (gcc-5-branch)

Last Changed Date: 2015-05-25 02:16:10 +0200 (Mon, 25 May 2015)

8 years agosystat.1: Update sensors display specific commands
Sepherosa Ziehau [Sun, 24 May 2015 12:46:53 +0000 (20:46 +0800)]
systat.1: Update sensors display specific commands

8 years agoecc.4: Update for the recent ecc(4) changes
Sepherosa Ziehau [Sun, 24 May 2015 12:06:39 +0000 (20:06 +0800)]
ecc.4: Update for the recent ecc(4) changes

8 years agomemtemp.4: Update for the recent sensor description change
Sepherosa Ziehau [Sun, 24 May 2015 11:54:10 +0000 (19:54 +0800)]
memtemp.4: Update for the recent sensor description change

8 years agocoretemp.4: Update for the recent sensor description change
Sepherosa Ziehau [Sun, 24 May 2015 11:51:34 +0000 (19:51 +0800)]
coretemp.4: Update for the recent sensor description change

8 years agodirfs - only expose inlines to the kernel
Matthew Dillon [Mon, 25 May 2015 04:04:25 +0000 (21:04 -0700)]
dirfs - only expose inlines to the kernel

* Only expose inlines to kernel code, user code can get tripped up on
  things like KKASSERT().

8 years agohammer2 - Refactor cluster locks, syncthr fixes, cleanups
Matthew Dillon [Mon, 25 May 2015 03:20:39 +0000 (20:20 -0700)]
hammer2 - Refactor cluster locks, syncthr fixes, cleanups

* Do not resolve the cluster when locking and unlocking.  This led to
  problems when cparents used in iterations were being temporarily unlocked,
  because their nodes represent the iteration in the physical topology
  so the resolve might fail when relocked.

  Instead, resolution occurs with all cluster creation mechanics.  So, e.g.
  hammer2_cluster_lookup() and hammer2_cluster_next() will resolve the
  cluster being returned.

* Change hammer2_cluster_copy() semantics to inherit focus state and not
  call hammer2_cluster_resolve(), for the same reason as above.

* A cluster iteration usually returns NULL when the focus is lost, e.g.
  when only unsynchronized slaves remain.  Add a flag so the sync thread
  can iterate the cluster until all nodes are exhausted.

* Cleanup focus handling for the cluster iterator.  Move the bref compare
  to the resolver and get rid of the manual compare code in the iterator.

* Fix a locking flags bug in the cluster iterator.

* Fix numerous deadlocks.  Mostly requires unlocking the whole cluster before
  looping the iterator for new elements, so later indexes are not held locked
  while working on earlier indexes.

* Fix numerous issues in syncthr, in particular only repoint the index
  of the cluster the syncthr is managing when updating the inode to avoid
  clashes with inode updates from other syncthrs.

* Change the way HAMMER2_CITEM_INVALID works in syncthr so we can be
  more hard-nosed about it in the cluster iterator.  Generally speaking
  we clear the INVALID bit when synchronizing a new element, even if it is
  a recursion and modify_tid cannot be immediately set.

8 years agoRemove unused bsd.cpu.gcc44.mk file.
Sascha Wildner [Sun, 24 May 2015 17:34:35 +0000 (19:34 +0200)]
Remove unused bsd.cpu.gcc44.mk file.

8 years agokernel/acpi_wmi: Move wmi_info_list into sc.
Sascha Wildner [Sat, 23 May 2015 07:49:36 +0000 (09:49 +0200)]
kernel/acpi_wmi: Move wmi_info_list into sc.

Taken-from: FreeBSD

8 years agovi(1): Remove a no longer used file.
Sascha Wildner [Sat, 23 May 2015 07:42:25 +0000 (09:42 +0200)]
vi(1): Remove a no longer used file.

8 years agodrm: Add linux/ktime.h
François Tigeot [Sun, 24 May 2015 09:04:12 +0000 (11:04 +0200)]
drm: Add linux/ktime.h

8 years agokernel - Add utimensat() support
Matthew Dillon [Sun, 24 May 2015 04:19:04 +0000 (21:19 -0700)]
kernel - Add utimensat() support

* Brings in utimensat() from FreeBSD, adjusted for DragonFly system
  call mechanics.

Submitted-by: stateless #2818
8 years agodrm/i915: Fix a __raw_i915_read32() definition
François Tigeot [Sat, 23 May 2015 17:08:11 +0000 (19:08 +0200)]
drm/i915: Fix a __raw_i915_read32() definition

We don't have pci_iomap() yet so registers can't be properly mapped
in the Linux way.

8 years agodrm: Put abs64 definition in the right place
François Tigeot [Sat, 23 May 2015 06:24:11 +0000 (08:24 +0200)]
drm: Put abs64 definition in the right place

8 years agodrm/linux: Add a few smp_mb_xxx_atomic_inc() functions
François Tigeot [Sat, 23 May 2015 06:15:04 +0000 (08:15 +0200)]
drm/linux: Add a few smp_mb_xxx_atomic_inc() functions

8 years agolinux/i2c.h: Properly define struct device
François Tigeot [Sat, 23 May 2015 06:11:42 +0000 (08:11 +0200)]
linux/i2c.h: Properly define struct device

8 years agodrm/linux: Add TASK_COMM_LEN
François Tigeot [Sat, 23 May 2015 06:06:03 +0000 (08:06 +0200)]
drm/linux: Add TASK_COMM_LEN

8 years agodrm/linux: Add mod_timer_pinned()
François Tigeot [Sat, 23 May 2015 06:00:42 +0000 (08:00 +0200)]
drm/linux: Add mod_timer_pinned()

8 years agodrm/linux: define destroy_timer_on_stack()
François Tigeot [Sat, 23 May 2015 05:58:41 +0000 (07:58 +0200)]
drm/linux: define destroy_timer_on_stack()

8 years agodrm/linux: define ETIME
François Tigeot [Sat, 23 May 2015 05:51:07 +0000 (07:51 +0200)]
drm/linux: define ETIME

8 years agodrm/linux: Implement DEFINE_MUTEX()
François Tigeot [Fri, 22 May 2015 20:23:13 +0000 (22:23 +0200)]
drm/linux: Implement DEFINE_MUTEX()

8 years agodrm/linux: Add set_pages_uc()
François Tigeot [Fri, 22 May 2015 18:38:34 +0000 (20:38 +0200)]
drm/linux: Add set_pages_uc()

8 years agoWORLD_CCVER: Fix buildworld with clangXX
John Marino [Fri, 22 May 2015 16:40:24 +0000 (09:40 -0700)]
WORLD_CCVER: Fix buildworld with clangXX

The backtrace library requires unwind.h to build.  This file was never
created, so the base GCC's would fall back to the version in /usr/libdata.
Clang compilers from ports don't have unwind.h so they were failing on the
world build (building gcc50).  This modification makes unwind.h available
for backtrace.c and allows the build to complete with WORLD_CCVER=clang36

8 years agokernel - Change cpu_idle_hlt default
Matthew Dillon [Fri, 22 May 2015 17:03:48 +0000 (10:03 -0700)]
kernel - Change cpu_idle_hlt default

* Set cpu_idle_hlt default to 1 for Intel Haswell or later cpus.  These
  cpus do major power management in the HLT instruction.

  Leave cpu_idle_hlt default at 2 for AMD cpus or older Intel cpus.
  These cpus do not do major management in the HLT instruction and ACPI
  entry is required to reduce idle power consumption.

8 years agohammer2 - Fix hammer2_cluster_load_async() issue
Matthew Dillon [Fri, 22 May 2015 01:48:06 +0000 (18:48 -0700)]
hammer2 - Fix hammer2_cluster_load_async() issue

* Fix a hammer2_cluster_load_async() issue. Old code hardwired the cluster
  index to 0, but this might not be a validated chain.  Use cluster->focus
  instead.

8 years agodrm: Improve mutex_lock_interruptible() again
François Tigeot [Thu, 21 May 2015 20:44:00 +0000 (22:44 +0200)]
drm: Improve mutex_lock_interruptible() again

It should really be interruptible by signals

Spotted-by: dillon
8 years agodrm/linux: Improve the implementation of mutex_lock_interruptible()
François Tigeot [Thu, 21 May 2015 18:47:46 +0000 (20:47 +0200)]
drm/linux: Improve the implementation of mutex_lock_interruptible()

8 years agodrm/linux: Add get_page()
François Tigeot [Thu, 21 May 2015 18:17:59 +0000 (20:17 +0200)]
drm/linux: Add get_page()

8 years agoipfw3.8: Some cleanup.
Sascha Wildner [Thu, 21 May 2015 16:35:04 +0000 (18:35 +0200)]
ipfw3.8: Some cleanup.

8 years agokernel - Change bundirty() location in I/O sequence
Matthew Dillon [Thu, 21 May 2015 05:18:41 +0000 (22:18 -0700)]
kernel - Change bundirty() location in I/O sequence

* When doing a write BIO, do not bundirty() the buffer prior to issuing
  the vn_strategy().  Instead, bundirty() the buffer when the I/O
  is complete, primarily in bpdone().

  The I/O's data buffer is protected during the operation by vfs_busy_pages(),
  so related VM pages cannot be modified while the write is running.  And,
  of course, the buffer itself is locked exclusively for the duration of the
  opeartion.  Thus this change should NOT introduce any redirtying races.

* This change ensures that vp->v_rbdirty_tree remains non-empty until all
  related write I/Os have completed, removing a race condition for code
  which checks vp->v_rbdirty_tree to determine e.g. if a file requires
  synchronization or not.

  This race could cause problems because the system buffer flusher might
  be in the midst of flushing a buffer just as a filesystem decides to
  sync and starts checking vp->v_rbdirty_tree.

* This should theoretically fix a long-standing but difficult-to-reproduce
  bug in HAMMER1 where a backend flush occurs at an inopportune time.

8 years agohammer2 - Per-PFS transaction management
Matthew Dillon [Thu, 21 May 2015 05:10:45 +0000 (22:10 -0700)]
hammer2 - Per-PFS transaction management

* Replace the global transaction manager with a per-mount transaction
  manager.

* Each media volume's spmp (super-root pfs) also gets its own transaction
  manager.

* The Filesystem sync now flushes each PFS associated with the mount,
  and then flushes the super-root for the related physical volumes.

  When flushing the super-root, the flush stops at the PFS transition.

* Interactions on one mount point no longer stall other mount points on
  the same media.  This also means that freemap updates related to
  other mount points may occur while a flush is occuring on one of them.
  (might have broken recovery here, will fix in another pass).

* For now keep the syncer interlock vs new modifying operations to ensure
  a stable snapshot.

8 years agohammer2 - per-node sync threads
Matthew Dillon [Thu, 21 May 2015 01:04:49 +0000 (18:04 -0700)]
hammer2 - per-node sync threads

* Change the per-pfs sync threads into per-node sync threads.  Each sync
  thread is responsible for synchronizing its particular node to the
  pfs-based cluster when its particular node is out-of-sync.

* Significant work to the cluster iteration code to fix numerous deadlocks.

* Call vclrisdirty() conditionally at end of flush.

* Do not call vclrisdirty() unconditionally in hammer2_vop_fsync().

* Misc cleanups.

8 years agodrm/linux: Add seq_puts()
François Tigeot [Wed, 20 May 2015 20:00:08 +0000 (22:00 +0200)]
drm/linux: Add seq_puts()

8 years agohammer - limit certain diagnostics to 1/sec.
Matthew Dillon [Wed, 20 May 2015 16:35:02 +0000 (09:35 -0700)]
hammer - limit certain diagnostics to 1/sec.

* Limit certain diagnostics that can degenerately print in huge volumes
  to the console to one per second.

8 years agoecc/e3: Hook up error correction counting into sensors framework.
Sepherosa Ziehau [Thu, 14 May 2015 15:48:43 +0000 (23:48 +0800)]
ecc/e3: Hook up error correction counting into sensors framework.

8 years agoHAMMER: Add "hammer abort-cleanup" command
John Marino [Sun, 5 Apr 2015 11:06:49 +0000 (13:06 +0200)]
HAMMER: Add "hammer abort-cleanup" command

A new command has been added to HAMMER: abort-cleanup.  As could be
deduced from its name, this command will terminate all active cleanup
operations.  It takes no arguments.

It works by searching the /var/run directory for pidfiles starting with
"hammer.cleanup.".  It gets the pid from the filename rather than by
reading the contents of the pidfile.  Once the pid is obtained, the
SIGTERM signal is set to it.  Any successfully terminated process will
be announced on stdout.

The SIGINT signal could also be used, but this one does not print
"Terminated" on the process's terminal, which I find useful.

Currently if the cleanup is interrupted another way, the pidfile will
not be removed.  These hammer.cleanup pidfiles will accumulate until
the next "hammer abort-cleanup" command is executed.  Stale pidfiles
will be removed if encountered by abort-cleanup command.

8 years agopipe2 - Adjust manual page
Matthew Dillon [Tue, 19 May 2015 18:49:43 +0000 (11:49 -0700)]
pipe2 - Adjust manual page

* Add a description of pipe2 to the pipe manual page.

Taken-from: FreeBSD

8 years agokernel - fix O_CLOEXEC race in open() and fhopen()
Matthew Dillon [Tue, 19 May 2015 18:46:07 +0000 (11:46 -0700)]
kernel - fix O_CLOEXEC race in open() and fhopen()

* Fix an O_CLOEXEC race where a fork/exec can race an
  open(...O_CLOEXEC) and improperly inherit the descriptor.

8 years agokernel, libc - add pipe2()
Matthew Dillon [Tue, 19 May 2015 18:45:09 +0000 (11:45 -0700)]
kernel, libc - add pipe2()

* Add the pipe2() system call.

8 years agosbin/usched: Fix man usched(8)
Tomohiro Kusumi [Tue, 19 May 2015 11:25:30 +0000 (20:25 +0900)]
sbin/usched: Fix man usched(8)

- Add description on when cpumask has multiple bits set.

- e.g. When cpumask is 15 (0xF) then usched(8) first does
  usched_set(getpid(), USCHED_SET_CPU, 1, ...) for cpu#0 and then
  usched_set(getpid(), USCHED_ADD_CPU, x, ...) for cpu#1,2,3.

  # usched -d dfly:15 true
  DEBUG: USCHED_SET_SCHEDULER: scheduler: dfly
  DEBUG: USCHED_SET_CPU: cpuid: 0
  DEBUG: USCHED_ADD_CPU: cpuid: 1
  DEBUG: USCHED_ADD_CPU: cpuid: 2
  DEBUG: USCHED_ADD_CPU: cpuid: 3

8 years agosbin/usched: Make perror show pid/cpu#/scheduler
Tomohiro Kusumi [Sun, 17 May 2015 14:53:32 +0000 (23:53 +0900)]
sbin/usched: Make perror show pid/cpu#/scheduler

- Note that the caller's pid (or 0) is the only choice for pid currently.

8 years agosbin/usched: Use uint64_t for cpu#
Tomohiro Kusumi [Sun, 17 May 2015 14:25:07 +0000 (23:25 +0900)]
sbin/usched: Use uint64_t for cpu#

- Use uint64_t for 64 cpus(mask) instead of unsigned long.

8 years agoecc/e5: Log error for critical ECC errors
Sepherosa Ziehau [Mon, 18 May 2015 12:26:33 +0000 (20:26 +0800)]
ecc/e5: Log error for critical ECC errors

8 years agoecc/e5: Remove unused fields
Sepherosa Ziehau [Mon, 18 May 2015 12:21:42 +0000 (20:21 +0800)]
ecc/e5: Remove unused fields

8 years agoUpdate the pciconf(8) database.
Sascha Wildner [Mon, 18 May 2015 19:20:41 +0000 (21:20 +0200)]
Update the pciconf(8) database.

May 13, 2015 snapshot from http://pciids.sourceforge.net/

8 years agodrm/linux: Add uapi/linux/fb.h
François Tigeot [Mon, 18 May 2015 15:24:16 +0000 (17:24 +0200)]
drm/linux: Add uapi/linux/fb.h

8 years agokernel - Fix cpu lockup on resume after entering the debugger
Matthew Dillon [Mon, 18 May 2015 05:52:05 +0000 (22:52 -0700)]
kernel - Fix cpu lockup on resume after entering the debugger

* Xcpustop was not testing ipending on resume.  Since Xcpustop STIs
  it is possible for it to receive further interrupts while stopped
  which can cause ipending to be set.

* Use doreti instead of doreti_iret.   doreti will test ipending,
  fpending, the per-cpu flags.

* Change the semantics to work more similarly to normal interrupt vectors.

* Note that dumping is still problematic.

8 years agohammer2 - slave sync work
Matthew Dillon [Mon, 18 May 2015 00:23:50 +0000 (17:23 -0700)]
hammer2 - slave sync work

* Break hammer2_cluster_resolve() into three passes, do a better job
  validating the elements of a cluster.

* Fix miscellaneous focus issues in the hammer2_cluster_*() API.

* Acquire required spinlock when doing certain base block array updates.

* Fix miscellaneous recursion bugs in the slave sync thread.

* Fix a panic case when writing embedded data in an inode.

8 years agodrm - Add chip=161E8086
Matthew Dillon [Sun, 17 May 2015 20:24:33 +0000 (13:24 -0700)]
drm - Add chip=161E8086

* Add chip for broadwell  m-5y70