dragonfly.git
8 years agoRemove ext2mount.h via 'make upgrade'.
Sascha Wildner [Tue, 9 Jun 2015 04:17:24 +0000 (06:17 +0200)]
Remove ext2mount.h via 'make upgrade'.

8 years agobuild - Parallelize kernel module build
Matthew Dillon [Tue, 9 Jun 2015 00:19:18 +0000 (17:19 -0700)]
build - Parallelize kernel module build

* Parallelize the module build portion of a full buildkernel.

* Decreases full kernel build times significantly.  The build
  is up to 3 times faster now.

* On monster full kernel build time goes from 10:48 to 3:04.

8 years agoetc/remote: add ucom1 to ucom4
Markus Pfeiffer [Mon, 8 Jun 2015 19:42:51 +0000 (19:42 +0000)]
etc/remote: add ucom1 to ucom4

8 years agousb4bsd: Make the serial driver create all devices
Markus Pfeiffer [Mon, 8 Jun 2015 19:22:32 +0000 (19:22 +0000)]
usb4bsd: Make the serial driver create all devices

* This patch adds creation of ttyUx, ttyiUx, ttylUx, cuaUx, cuaiUx,
  and cualUx, where x is the unit number for usb serial devices.
* The actual functionality for .init and .lock is not completelyl
  implemented yet

8 years agokernel/radeon: Regen register check tables (only removes FreeBSD SVN ID).
Sascha Wildner [Mon, 8 Jun 2015 17:13:37 +0000 (19:13 +0200)]
kernel/radeon: Regen register check tables (only removes FreeBSD SVN ID).

8 years agoAdd some tools to update various DRM related files, firmwares, etc.
Sascha Wildner [Mon, 8 Jun 2015 17:10:39 +0000 (19:10 +0200)]
Add some tools to update various DRM related files, firmwares, etc.

Taken-from: FreeBSD

8 years agokernel/drm: Sync radeonkms' PCI ID list with Linux 3.11's.
Sascha Wildner [Mon, 8 Jun 2015 16:42:23 +0000 (18:42 +0200)]
kernel/drm: Sync radeonkms' PCI ID list with Linux 3.11's.

8 years agokernel/radeonfw: Update two firmwares.
Sascha Wildner [Mon, 8 Jun 2015 15:35:24 +0000 (17:35 +0200)]
kernel/radeonfw: Update two firmwares.

8 years agotail - Add -q option
Matthew Dillon [Sun, 7 Jun 2015 18:41:51 +0000 (11:41 -0700)]
tail - Add -q option

* Bring in the -q option from FreeBSD.  This option masks the printing
  of filename headers when tailing multiple files.

Taken-from: FreeBSD

8 years agosys/gnu/vfs/ext2fs: Fix indentation
Tomohiro Kusumi [Sun, 7 Jun 2015 14:21:11 +0000 (23:21 +0900)]
sys/gnu/vfs/ext2fs: Fix indentation

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

8 years agosys/gnu/vfs/ext2fs: Fix comments
Tomohiro Kusumi [Sun, 7 Jun 2015 13:23:56 +0000 (22:23 +0900)]
sys/gnu/vfs/ext2fs: Fix comments

- Have a full Linux kernel path.

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

8 years agosys/gnu/vfs/ext2fs: Rename struct ext2mount -> struct ext2_mount
Tomohiro Kusumi [Sun, 7 Jun 2015 12:30:48 +0000 (21:30 +0900)]
sys/gnu/vfs/ext2fs: Rename struct ext2mount -> struct ext2_mount

- Not sure why but this is the only struct without _ after ext2.

- This struct is _KERNEL struct.

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

8 years agosys/gnu/vfs/ext2fs: Rename ext2mount.h -> ext2_mount.h
Tomohiro Kusumi [Sun, 7 Jun 2015 12:22:27 +0000 (21:22 +0900)]
sys/gnu/vfs/ext2fs: Rename ext2mount.h -> ext2_mount.h

- Not sure why but this is the only file without _ after ext2.

- Renaming should not affect external userspace programs since
  userspace should never need this header (only kernel stuff).

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

8 years agolibc - Attribute setcontext() and getcontext()
Matthew Dillon [Sun, 7 Jun 2015 04:06:55 +0000 (21:06 -0700)]
libc - Attribute setcontext() and getcontext()

* Give getcontext() the __returns_twice attribute and
  give setcontext() the __dead2 attribute.

Suggested-by: swildner
8 years agocolldef/mklocale: Remove some workarounds from "locale megapatch" times.
Sascha Wildner [Sun, 7 Jun 2015 03:26:54 +0000 (05:26 +0200)]
colldef/mklocale: Remove some workarounds from "locale megapatch" times.

This basically made it impossible to extend <sys/cdefs.h> without having
to add more gunk to the Makefiles.

8 years agostdc - add __returns_twice
Matthew Dillon [Sun, 7 Jun 2015 02:54:42 +0000 (19:54 -0700)]
stdc - add __returns_twice

* Add __returns_twice attribute support.

* Use for longjmp() and vfork() plus any variants.

Taken-From: FreeBSD

8 years agosh - Sync to FreeBSD d038ee76 part 2/2 (f)
Matthew Dillon [Sun, 7 Jun 2015 02:53:48 +0000 (19:53 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (f)

* Fix bin/kill (shares code with /bin/sh).  Procedure renamed.

8 years agosh - Sync to FreeBSD d038ee76 part 2/2 (e)
Matthew Dillon [Sun, 7 Jun 2015 02:47:35 +0000 (19:47 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (e)

* Reapply d9b533666 - mdoc nits.

* Makefile adjustments for clean stderr

* Fix minor coding error in recent commit..

8 years agosh - Sync to FreeBSD d038ee76 part 2/2 (d)
Matthew Dillon [Sun, 7 Jun 2015 02:44:29 +0000 (19:44 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (d)

Reapply 330497ceac - 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 agosh - Sync to FreeBSD d038ee76 part 2/2 (c)
Matthew Dillon [Sun, 7 Jun 2015 02:25:53 +0000 (19:25 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (c)

* Renumber copyright lines after the advertising clause was taken out.

8 years agosh - Sync to FreeBSD d038ee76 part 2/2 (b)
Matthew Dillon [Sun, 7 Jun 2015 02:22:15 +0000 (19:22 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (b)

* Undo a portion of the error.h move to reduce edits to bin/kill/halt.c etc.

8 years agosh - Sync to FreeBSD d038ee76 part 2/2 (a)
Matthew Dillon [Sun, 7 Jun 2015 01:44:14 +0000 (18:44 -0700)]
sh - Sync to FreeBSD d038ee76 part 2/2 (a)

* Undo el_fn_sh_complete rename.

8 years agosh - Sync to FreeBSD d038ee76 part 1/2
Matthew Dillon [Sun, 7 Jun 2015 01:41:36 +0000 (18:41 -0700)]
sh - Sync to FreeBSD d038ee76 part 1/2

* Sync to FreeBSD d038ee76 25 Apr 2015.

8 years ago<sys/sysctl.h>: Include <sys/lock.h> only for the kernel (unbreaks world).
Sascha Wildner [Sun, 7 Jun 2015 02:16:12 +0000 (04:16 +0200)]
<sys/sysctl.h>: Include <sys/lock.h> only for the kernel (unbreaks world).

The problem was that when userland included <sys/sysctl.h> without
_KERNEL_STRUCTURES defined, it could later on no longer include
<sys/lock.h> _with_ _KERNEL_STRUCTURES defined (via <sys/kinfo.h>,
for example).

8 years agokernel/hpt27xx: Stop using __DATE__ and __TIME__.
Sascha Wildner [Sun, 7 Jun 2015 00:30:22 +0000 (02:30 +0200)]
kernel/hpt27xx: Stop using __DATE__ and __TIME__.

Better for binary diffs.

Taken-from: FreeBSD

8 years agosysctl - SMP performance work
Matthew Dillon [Sat, 6 Jun 2015 23:17:41 +0000 (16:17 -0700)]
sysctl - SMP performance work

Performance work on the sysctl API.  Most accesses (including nearly all
accesses made by libc) now use a shared lock, increasing concurrency in the
exec path.

* Acquire the sysctl global lock shared instead of exclusive for all normal
  accesses.  Use an exclusive lock for node and leaf creation or deletion.
  Ultimately we will move to a fine-grained model and remove the global lock.

* Give each oid its own lockmgr lock.  Automatically acquire this lock
  shared for read access and exclusive for write access.  This retains
  just enough serialization of modifying (individual) sysctls to make
  sense to programmers.

* Supply flag overrides to force shared or exclusive use.  Force a shared
  oid lock for name2oid(), allowing the sysctlbyname() path to nominally
  use a shared lock.

8 years agolibarchive - Ensure futimens() operation is consistent with utimes()
Matthew Dillon [Sat, 6 Jun 2015 18:20:21 +0000 (11:20 -0700)]
libarchive - Ensure futimens() operation is consistent with utimes()

* utimes() allows tv_sec to be -1 to indicate that the element should
  not be updated.

* Handle this case for when futimens() is used by setting tv_nsec to
  UTIME_OMIT.

* This way operation is consistent whether we use futimens() or use
  utimes().

8 years agosys/gnu/vfs/ext2fs: Remove|fix duplicated macro definitions
Tomohiro Kusumi [Sat, 6 Jun 2015 10:09:44 +0000 (19:09 +0900)]
sys/gnu/vfs/ext2fs: Remove|fix duplicated macro definitions

- Define MAXNAMLEN using EXT2_NAME_LEN since EXT2_NAME_LEN
  is the original ondisk definition.

- Bring back MAXSYMLINKLEN that was removed in a0403c0
  using EXT2_MAXSYMLINKLEN. It's probably better to keep both
  EXT2_MAXSYMLINKLEN and MAXSYMLINKLEN just like above MAXNAMLEN
  does considering it's been exposed to userspace and removing
  may break them (although there are probably none or very few).

- Remove duplicated MAXMNTLEN definition.

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

8 years agosys/gnu/vfs/ext2fs: Add missing ifndef/define/endif
Tomohiro Kusumi [Sat, 6 Jun 2015 12:46:25 +0000 (21:46 +0900)]
sys/gnu/vfs/ext2fs: Add missing ifndef/define/endif

- ext2fs/fs.h needs ifndef/define/endif.

- The next commit ("Remove|fix duplicated macro definitions")
  results compile error without this.

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

8 years agosys/gnu/vfs/ext2fs: Fix terminology of "cylinder group"
Tomohiro Kusumi [Sat, 6 Jun 2015 08:36:50 +0000 (17:36 +0900)]
sys/gnu/vfs/ext2fs: Fix terminology of "cylinder group"

- Change "cylinder group" to "block group".

- Both "block group" and "cylinder group" are used in dfly ext2.
  These refer to the same(similar) idea and ext2 uses "block group".
  Not having two expressions is grep-friendly.

- No binary difference as it only changes some comments.

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

8 years agodrm/radeon: Sync gpu driver code with Linux 3.11
zrj [Wed, 3 Jun 2015 12:01:30 +0000 (15:01 +0300)]
drm/radeon: Sync gpu driver code with Linux 3.11

Little to none functional change.

Use kzalloc()/kfree()/kcalloc() wrappers.
Also use mb() and rmb().

Use linux compat macros:
  udelay, mdelay
  wake_up
  printk
  ARRAY_SIZE
  ALIGN, round_up
  BUG, BUG_ON, BUILD_BUG_ON, WARN

While there, reduce whitespace diffs with Linux 3.11

8 years agodrm/radeon: Move some prototype declarations
zrj [Wed, 3 Jun 2015 11:48:49 +0000 (14:48 +0300)]
drm/radeon: Move some prototype declarations

While there fix a typo in r600_cp.c

8 years agodrm/radeon: Use release_firmware()/request_firmware()
zrj [Wed, 3 Jun 2015 11:45:46 +0000 (14:45 +0300)]
drm/radeon: Use release_firmware()/request_firmware()

8 years agosys/gnu/vfs/ext2fs: Remove|avoid duplicated macro definitions
Tomohiro Kusumi [Sat, 6 Jun 2015 02:33:17 +0000 (11:33 +0900)]
sys/gnu/vfs/ext2fs: Remove|avoid duplicated macro definitions

- There are EXT2_ROOTINO and EXT2_ROOT_INO, but using EXT2_ROOTINO
  is probably appropriate on dfly (and it does use EXT2_ROOTINO)
  considering it's been used by userspace, and other fs have it in
  NAME_ROOTINO format.

- WINO is from UFS, but ext2 has it for bad inode for ondisk inode.

- NDADDR and NIADDR (# of slots for direct/indirect block) should be
  defined using existing ext2 ondisk definitions.
  (or maybe don't even use NDADDR and NIADDR, but these two should be
  kept as dfly ext2 code is UFS based and UFS heavily uses these two)

- Remove MAXSYMLINKLEN since there is EXT2_MAXSYMLINKLEN and only
  EXT2_MAXSYMLINKLEN is being used. It also conflicts with UFS version
  of MAXSYMLINKLEN in vfs/ufs/dinode.h.

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

8 years agomake.conf: Remove a no longer used variable.
Sascha Wildner [Fri, 5 Jun 2015 22:49:48 +0000 (00:49 +0200)]
make.conf: Remove a no longer used variable.

8 years agokernel/syscons: Hack around some issues between console cut/paste and Xorg.
Sascha Wildner [Fri, 5 Jun 2015 21:25:51 +0000 (23:25 +0200)]
kernel/syscons: Hack around some issues between console cut/paste and Xorg.

It led to repeating characters (as if typed) when cutting/pasting
in Xorg.

Reported-by: profmakx, jh32, ryuo, and others
Submitted-by: dillon
8 years agodrm: hack together an implementation of fb_get_options
Imre Vadász [Tue, 2 Jun 2015 21:14:52 +0000 (23:14 +0200)]
drm: hack together an implementation of fb_get_options

This can be used to set the video mode used for the syscons fb console,
a la "video=..." in linux.

8 years agokernel/syscons: First hacky steps to make syscons work with {i915,radeon}kms.
Sascha Wildner [Wed, 3 Jun 2015 18:01:46 +0000 (20:01 +0200)]
kernel/syscons: First hacky steps to make syscons work with {i915,radeon}kms.

This is a joint effort of Imre Vadasz (all the drm/i915/radeon related
bits) and me (syscons rendering related bits, mainly).

To enable the support, the "kern.kms_console" tunable needs to be set
via loader.conf.

In-collaboration-with: ivadasz

8 years agoFix kernel options in files for i915/radeon (kmsdrm -> kms).
Sascha Wildner [Tue, 2 Jun 2015 17:09:15 +0000 (19:09 +0200)]
Fix kernel options in files for i915/radeon (kmsdrm -> kms).

8 years agoUpdate files for recent drm/i915/radeon changes.
Sascha Wildner [Tue, 2 Jun 2015 16:59:17 +0000 (18:59 +0200)]
Update files for recent drm/i915/radeon changes.

8 years agosensors: By default, stick sensor tasks to the first cpu package
Sepherosa Ziehau [Fri, 5 Jun 2015 13:04:54 +0000 (21:04 +0800)]
sensors: By default, stick sensor tasks to the first cpu package

8 years agoecc/e5: Register sensor tasks to the proper cpu package
Sepherosa Ziehau [Fri, 5 Jun 2015 13:04:01 +0000 (21:04 +0800)]
ecc/e5: Register sensor tasks to the proper cpu package

8 years agomemtemp/e5: Register sensor tasks to the proper cpu package
Sepherosa Ziehau [Fri, 5 Jun 2015 13:03:24 +0000 (21:03 +0800)]
memtemp/e5: Register sensor tasks to the proper cpu package

8 years agocpu_topo: Add get_cpu_node_by_chipid()
Sepherosa Ziehau [Fri, 5 Jun 2015 13:02:20 +0000 (21:02 +0800)]
cpu_topo: Add get_cpu_node_by_chipid()

This function retrieve cpu_node according to the chip ID passed.

8 years agosys/gnu/vfs/ext2fs: Cleanup __KERNEL__ related macros
Tomohiro Kusumi [Sat, 30 May 2015 10:19:35 +0000 (19:19 +0900)]
sys/gnu/vfs/ext2fs: Cleanup __KERNEL__ related macros

- Add comments on EXT2_XXX(s) macros. These macros on dfly ext2 happen
  to be tricky and confusing as their arg types are not consistent.
  These macros are taken from e2fsprogs header (rather than macros of
  the same name in Linux kernel header) and made to work as a part of
  kernel filesystem code.

- Remove unused __KERNEL__ version of EXT2_XXX(s) macros. These are not
  compiled on dfly (and most of them result compile error if enabled on
  dfly ext2) since __KERNEL__ is designed to be Linux kernel specific
  code while dfly ext2 is made to work with userspace version of macros
  taken from e2fsprogs as mentioned above. Moreover, some of these
  __KERNEL__ version of macros are already deprecated on Linux kernel
  and have been removed from the e2fsprogs header accordingly, so there
  is no reason to keep it here as well.

- Compiling e2fsprogs does not require ext2_fs.h installed under
  /usr/include/... as it has its own copy of the ext2_fs.h in its source
  code that the dfly ext2 originally referred to.

- This commit makes no binary difference. Also this commit does not
  affect external userspace programs.

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

8 years agosys/gnu/vfs/ext2fs: Cleanups
Tomohiro Kusumi [Sat, 30 May 2015 08:18:16 +0000 (17:18 +0900)]
sys/gnu/vfs/ext2fs: Cleanups

- Align with other #define by removing a space between # and define.

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

8 years agosys/gnu/vfs/ext2fs: Sync with Linux kernel's ext2 definitions
Tomohiro Kusumi [Sat, 30 May 2015 02:39:14 +0000 (11:39 +0900)]
sys/gnu/vfs/ext2fs: Sync with Linux kernel's ext2 definitions

- Some of these macros could be used in the existing dfly ext2 code.

- This commit makes no binary difference.

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

8 years agokernel - Fix altq fairq panic
Matthew Dillon [Thu, 4 Jun 2015 18:04:37 +0000 (11:04 -0700)]
kernel - Fix altq fairq panic

* Fix an altq fairq panic when RED and/or RIO is enabled.  A packet drop
  can cause a sequence of events which leads to a NULL pointer dereference
  in the fairq round robin code.

Reported-by: Joris Giovannangeli
8 years agosensors: Accept -1 as sensor thread cpuid
Sepherosa Ziehau [Thu, 4 Jun 2015 12:31:02 +0000 (20:31 +0800)]
sensors: Accept -1 as sensor thread cpuid

The task will be register to the default sensor thread.

8 years agocoretemp: Utilize per-cpu sensor threads
Sepherosa Ziehau [Thu, 4 Jun 2015 11:00:53 +0000 (19:00 +0800)]
coretemp: Utilize per-cpu sensor threads

This greatly simplifies the code.

8 years agosensors: Create per-cpu sensor task threads
Sepherosa Ziehau [Thu, 4 Jun 2015 11:00:08 +0000 (19:00 +0800)]
sensors: Create per-cpu sensor task threads

So that accessing to sensor device could be properly cpu localized,
e.g. accessing coretemp(4) could be localized to a proper cpu core,
and accessing ecc(4) could be localized to a proper cpu package.

8 years agocputimer/tsc: Prevent rdtsc reordering
Sepherosa Ziehau [Mon, 1 Jun 2015 14:19:07 +0000 (22:19 +0800)]
cputimer/tsc: Prevent rdtsc reordering

Use lfence on Intel and mfence on AMD to make sure that all instructions
before rdtsc are completed.  This should prevent time warps, if TSC is
selected as cputimer.

8 years agotsc: Factor out rdtsc_ordered()
Sepherosa Ziehau [Mon, 1 Jun 2015 13:41:44 +0000 (21:41 +0800)]
tsc: Factor out rdtsc_ordered()

Use lfence on Intel and mfence on AMD to make sure that all instructions
before rdtsc are completed.

While I'm here
- Remove redundant functions declaration in lwkt_thread.c to unbreak
  compile.
- Add cpu_vendor_id for vkernel64; extra work is needed to set it to a
  proper value.

8 years agorc.conf.5: Fix description of sysvipcd_enable.
Sascha Wildner [Wed, 3 Jun 2015 07:24:48 +0000 (09:24 +0200)]
rc.conf.5: Fix description of sysvipcd_enable.

Reported-by: James Buren <ryu0@ymail.com>
8 years agodrm - Fix deadlock
Matthew Dillon [Tue, 2 Jun 2015 06:37:04 +0000 (23:37 -0700)]
drm - Fix deadlock

* mutex_trylock()'s return value was inverted, resulting in a hanging
  lock.  Adjust the macro.

* This should fix multiple reports of deadlocks in i915 (intel).

Reported-by: ftigeot
8 years agokernel - Fix VM deadlock in optimized file read path
Charlie Root [Tue, 2 Jun 2015 01:17:30 +0000 (18:17 -0700)]
kernel - Fix VM deadlock in optimized file read path

* The optimized file read path can deadlock if the uiocopy or copyout
  operation requires a non-trivial VM fault.  Most cases were handled,
  but a MAP_ENTRY_NEEDS_COPY->vm_map_entry_shadow() path was not being
  handled.

* Disallow the optimized path for the COW case.

Reported-by: Sevan Janiyan
8 years agodrm: Partially sync drm_ioctl() with Linux 3.14
François Tigeot [Sun, 31 May 2015 17:02:10 +0000 (19:02 +0200)]
drm: Partially sync drm_ioctl() with Linux 3.14

It now uses the drm_global_mutex lockmgr lock

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().