dragonfly.git
5 years agokernel - Refactor copyinstr and copystr
Matthew Dillon [Sun, 23 Sep 2018 18:35:21 +0000 (11:35 -0700)]
kernel - Refactor copyinstr and copystr

* Replace lodsb/stosb sequence with discrete mov's.  Remove related
  xchgq and cld.

Suggested-by: mjg
5 years agokernel/pfsync: Use the correct macros when checking for bpf or CARP.
Sascha Wildner [Tue, 25 Sep 2018 12:45:59 +0000 (14:45 +0200)]
kernel/pfsync: Use the correct macros when checking for bpf or CARP.

Similar to 5b7f73c4a34bc9105fb3f29fce8161e3b8dce5ea.

Note that pfsync is currently lacking userland support (in ifconfig
at least) so this commit won't affect anyone.

5 years agorc.d/pflog - Be quiet when check if modules are loaded
Aaron LI [Tue, 25 Sep 2018 12:30:58 +0000 (20:30 +0800)]
rc.d/pflog - Be quiet when check if modules are loaded

This rc script was missed from tuxillo's commit (0dfdc028b39).

5 years agokernel/pflog: Fix a recently introduced regression.
Sascha Wildner [Tue, 25 Sep 2018 12:40:43 +0000 (14:40 +0200)]
kernel/pflog: Fix a recently introduced regression.

The recently added #ifdef (in a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48)
used the wrong name (NBPFILTER) and thereby effectively disabled the
bpfattach.

Fix it to the right name (NBPF), include the necessary use_bpf.h and
while here, also fix another such case for detaching.

Reported-by: Peeter Must
5 years agokernel/acpi: Some improvements in acpi_eval_osc().
Sascha Wildner [Tue, 25 Sep 2018 07:28:15 +0000 (09:28 +0200)]
kernel/acpi: Some improvements in acpi_eval_osc().

* If ACPI_OSC_QUERY_SUPPORT is set, return the results in the buffer
  that was passed for further processing.

* Rename related flags/masks to better names and update comments in the
  header file.

5 years agokernel/assym: Remove V_FORWARDED_{HITS,INTS,MISSES}.
Sascha Wildner [Mon, 24 Sep 2018 08:03:15 +0000 (10:03 +0200)]
kernel/assym: Remove V_FORWARDED_{HITS,INTS,MISSES}.

All usage was removed in our tree in 2003 and 2005:

V_FORWARDED_{HITS,MISSES} in cb973d1510c62c9b0a2e26530585a2c50672efa3
V_FORWARDED_INTS          in 477d3c1cb94fc723c033f6ad0897a6a3d65046b6

5 years agodrm/ttm: convert to the reservation api
François Tigeot [Sun, 23 Sep 2018 13:41:47 +0000 (15:41 +0200)]
drm/ttm: convert to the reservation api

5 years agodrm/linux: Implement more reservation objects code
François Tigeot [Sun, 23 Sep 2018 13:30:35 +0000 (15:30 +0200)]
drm/linux: Implement more reservation objects code

5 years agodumpon(8): Make error messages clearer
Aaron LI [Sun, 23 Sep 2018 04:26:33 +0000 (12:26 +0800)]
dumpon(8): Make error messages clearer

Before this patch, when a dump device is already configured, dumpon(8)
only complains with 'Device busy', which isn't helpful.  Now, dumpon(8)
will tell whether the dump device is already configured or whether need
to run 'dumpoff' first.

Always show verbose information.  The utility still accepts the '-v'
option for backward compatibility, but don't mention the option in the
man page anymore.

Bugs: https://bugs.dragonflybsd.org/issues/3092

5 years agodumpon(8): Add "dumpoff" variant to be "dumpon off"
Aaron LI [Sat, 22 Sep 2018 12:57:52 +0000 (20:57 +0800)]
dumpon(8): Add "dumpoff" variant to be "dumpon off"

"dumpon off" doesn't seem to be a good command, so let's add the "dumpoff"
variant that just acts as "dumpon off", similar to "swapoff".

Thanks to swildner for the initial patch.

See also: https://bugs.dragonflybsd.org/issues/3092#note-2

5 years agolibc/stdtime: Remove some #ifdef checks for TM_{GMTOFF,ZONE}.
Sascha Wildner [Sat, 22 Sep 2018 18:54:40 +0000 (20:54 +0200)]
libc/stdtime: Remove some #ifdef checks for TM_{GMTOFF,ZONE}.

We don't override those and use the defaults from private.h.

While here, clean up the CFLAGS of zdump(8) and zic(8). Most of this
isn't needed.

5 years agokernel: Remove orphaned externs.
Sascha Wildner [Sat, 22 Sep 2018 10:55:13 +0000 (12:55 +0200)]
kernel: Remove orphaned externs.

5 years agoiwm - Remove unused TX_CMD_NEXT_FRAME_*
Imre Vadász [Fri, 21 Sep 2018 14:00:35 +0000 (16:00 +0200)]
iwm - Remove unused TX_CMD_NEXT_FRAME_*

Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa

5 years agoiwm - Remove unused REPLY_MAX
Imre Vadász [Fri, 21 Sep 2018 13:58:54 +0000 (15:58 +0200)]
iwm - Remove unused REPLY_MAX

Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada

5 years agoiwm - Update alive response handling, add v4 and remove old versions.
Imre Vadász [Fri, 21 Sep 2018 11:43:11 +0000 (13:43 +0200)]
iwm - Update alive response handling, add v4 and remove old versions.

5 years agodrm/ttm: Rename ttm_mem_global.spin to ttm_mem_global.lock
François Tigeot [Sat, 22 Sep 2018 08:28:23 +0000 (10:28 +0200)]
drm/ttm: Rename ttm_mem_global.spin to ttm_mem_global.lock

It was named so in Linux in the first place.

5 years agodrm/ttm: Use mutex_lock/mutex_unlock
François Tigeot [Sat, 22 Sep 2018 08:07:31 +0000 (10:07 +0200)]
drm/ttm: Use mutex_lock/mutex_unlock

5 years agokernel/drm: Actually enable -Werror.
Sascha Wildner [Fri, 21 Sep 2018 21:23:18 +0000 (23:23 +0200)]
kernel/drm: Actually enable -Werror.

When using compile-with, we have to specify this manually using the
${WERROR} variable which reacts to the NO_WERROR option.

5 years agokernel: Remove some obsolete commented out code.
Sascha Wildner [Fri, 21 Sep 2018 19:34:01 +0000 (21:34 +0200)]
kernel: Remove some obsolete commented out code.

5 years agokernel - Temporarily change WORLD_ALTCOMPILER default in master
Matthew Dillon [Fri, 21 Sep 2018 17:26:42 +0000 (10:26 -0700)]
kernel - Temporarily change WORLD_ALTCOMPILER default in master

* Temporarily change to 'all' to ensure that gcc50 gets built.
  Some ports appear to need libraries in /usr/lib/gcc50.

* Will be changed back to 'gcc47' once the ports issue is resolved.

5 years agoIn several standard headers, harmonize checks for legacy defines etc.
Sascha Wildner [Thu, 20 Sep 2018 17:36:47 +0000 (19:36 +0200)]
In several standard headers, harmonize checks for legacy defines etc.

When something goes away in a certain issue of the standard, always
check with < $standard, not <= $previous_standard. Also, uniformly
check for __XSI_VISIBLE or __POSIX_VISIBLE being > 0 in these cases.

While here, fix a small nit in <sys/wait.h>: wait3() was removed
from Issue 6, but the requirement to define the rusage structure was
removed from Issue 7.

5 years ago<glob.h>: GLOB_NOSYS was removed from Issue 7 of the standard.
Sascha Wildner [Thu, 20 Sep 2018 17:28:34 +0000 (19:28 +0200)]
<glob.h>: GLOB_NOSYS was removed from Issue 7 of the standard.

5 years agoiwm - Fix race during detach, where a callout is left after driver is gone.
Imre Vadász [Wed, 6 Jun 2018 21:32:36 +0000 (23:32 +0200)]
iwm - Fix race during detach, where a callout is left after driver is gone.

5 years agoif_iwm - Stop iwm_watchdog callout when idle.
Imre Vadász [Thu, 24 May 2018 21:05:10 +0000 (23:05 +0200)]
if_iwm - Stop iwm_watchdog callout when idle.

5 years agoMakefile_upgrade.inc: Handle some recently added files better.
Sascha Wildner [Thu, 20 Sep 2018 09:01:10 +0000 (11:01 +0200)]
Makefile_upgrade.inc: Handle some recently added files better.

<bus/pccard/cardinfo.h> is one of 4 headers that were removed in
3aef805084f3d031ffbf02b8a00333a755c4677c so add them all.

<linux/linux_input.h> was never in our tree, so it is outside of
Makefile_upgrade.inc's scope.

5 years ago<sys/endian.h>: Use basic integer types.
Sascha Wildner [Thu, 20 Sep 2018 08:22:23 +0000 (10:22 +0200)]
<sys/endian.h>: Use basic integer types.

We might at some point stop including <sys/types.h> too, in favor of
<machine/stdint.h>, but I first need to test which ports assume that
<sys/types.h> comes in with <sys/endian.h>.

5 years ago<fnmatch.h>: FNM_NOSYS was removed from Issue 7 of the standard.
Sascha Wildner [Thu, 20 Sep 2018 08:15:02 +0000 (10:15 +0200)]
<fnmatch.h>: FNM_NOSYS was removed from Issue 7 of the standard.

5 years agonfs - Avoid memory leakage when unloading the nfs module.
Imre Vadász [Wed, 5 Sep 2018 19:59:55 +0000 (21:59 +0200)]
nfs - Avoid memory leakage when unloading the nfs module.

* This adds some missing objcache_destroy and hashdestroy calls in the nfs
  module unload codepath.

5 years agokernel - Fix early boot interrupt race
Matthew Dillon [Wed, 19 Sep 2018 23:51:50 +0000 (16:51 -0700)]
kernel - Fix early boot interrupt race

* Fix a null pointer dereference panic due to an interrupt
  race during early boot.  Interrupts are enabled before
  intr_block is allocated, so intr_block can be NULL.

* Refactor the kmalloc() for intr_block to only allocate the
  space needed for ncpus.

5 years agodrm/ttm: Use Linux kobjects
François Tigeot [Wed, 19 Sep 2018 18:07:35 +0000 (20:07 +0200)]
drm/ttm: Use Linux kobjects

* Reducing differences with Linux

* Changes based on Linux commit ecff665f5e3f1c6909353e00b9420e45ae23d995
  "drm/ttm: make ttm reservation calls behave like reservation calls"

5 years agodrm/linux: Implement more kobject parts
François Tigeot [Wed, 19 Sep 2018 17:52:15 +0000 (19:52 +0200)]
drm/linux: Implement more kobject parts

5 years agokernel - Bump sysctl default limits for unix domain sockets
Matthew Dillon [Wed, 19 Sep 2018 07:05:28 +0000 (00:05 -0700)]
kernel - Bump sysctl default limits for unix domain sockets

* Bump all default limits for unix domain sockets to 65536.
  In particular, this increases limits for datagrams from absurdly
  small values (2048 byte packet size limit).

* Fixes wpa_supplicant (reported by ivadasz).

* Requires further testing.

5 years agokernel - Introduce separate sysctls for seqpacket limits
Matthew Dillon [Wed, 19 Sep 2018 06:53:36 +0000 (23:53 -0700)]
kernel - Introduce separate sysctls for seqpacket limits

* Add net.local.seqpacket.maxseqpacket, previously used the same
  default as net.local.stream.sendspace.

* Add net.local.seqpacket.recvspace, previously used the same
  default as net.local.stream.recvspace.

* Default is 57344 bytes (unchanged from before)

Taken-from: FreeBSD

5 years agokernel - Fix sio lockup
Matthew Dillon [Tue, 18 Sep 2018 20:03:38 +0000 (13:03 -0700)]
kernel - Fix sio lockup

* Fix crit-v-com_lock order.  Critical sections must be entered before
  com_lock, and exited after com_unlock.  This fixes an issue where
  crit_exit() was executing complex code with com_lock still held,
  potentially deadlocking against sio when processing pending interrupts.

5 years agodrm/ttm: Use Linux memory management functions
François Tigeot [Tue, 18 Sep 2018 19:24:09 +0000 (21:24 +0200)]
drm/ttm: Use Linux memory management functions

Reducing differences with the Linux code base.

5 years ago<sys/semaphore.h>: Move the include guard check below the copyright.
Sascha Wildner [Mon, 17 Sep 2018 20:09:52 +0000 (22:09 +0200)]
<sys/semaphore.h>: Move the include guard check below the copyright.

5 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 16 Sep 2018 15:16:57 +0000 (17:16 +0200)]
Update the pciconf(8) database.

September 12, 2018 snapshot from https://pci-ids.ucw.cz

5 years agodrm/linux: Increase coverage of the page protection APIs
François Tigeot [Sun, 16 Sep 2018 07:28:44 +0000 (09:28 +0200)]
drm/linux: Increase coverage of the page protection APIs

5 years agodrm/linux: use pgprot_t
François Tigeot [Sun, 16 Sep 2018 07:20:37 +0000 (09:20 +0200)]
drm/linux: use pgprot_t

5 years agobuild - Remove cvs tags from COPYRIGHT
Matthew Dillon [Sat, 15 Sep 2018 04:45:20 +0000 (21:45 -0700)]
build - Remove cvs tags from COPYRIGHT

* Remove cvs tags from COPYRIGHT.  An manual install will print the
  content of the COPYRIGHT file during boot, there's no need to display
  an old $FreeBSD tag.

5 years agonewsyslog.conf: Fix an age old typo that caused weekly.log to rotate wrongly.
Sascha Wildner [Fri, 14 Sep 2018 07:27:29 +0000 (09:27 +0200)]
newsyslog.conf: Fix an age old typo that caused weekly.log to rotate wrongly.

weekly.log's rotation isn't triggered by size.

5 years agokernel: Add some missing __printflike()s.
Sascha Wildner [Sun, 9 Sep 2018 20:57:48 +0000 (22:57 +0200)]
kernel: Add some missing __printflike()s.

5 years agokernel: More adjustments to fix -Wint-in-bool-context warnings.
Sascha Wildner [Sun, 9 Sep 2018 19:09:10 +0000 (21:09 +0200)]
kernel: More adjustments to fix -Wint-in-bool-context warnings.

5 years agodrm: Sync drm/drmP.h with Linux 4.7.10
François Tigeot [Sat, 8 Sep 2018 12:26:15 +0000 (14:26 +0200)]
drm: Sync drm/drmP.h with Linux 4.7.10

Remove most generic kernel includes, in order to avoid Linux/DragonFly
keyword clashes as much as possible in the future.

5 years agodrm: Add more Linux include files
François Tigeot [Sat, 8 Sep 2018 05:19:30 +0000 (07:19 +0200)]
drm: Add more Linux include files

5 years agodrm: Use a dedicated .h file for configuration options
François Tigeot [Fri, 7 Sep 2018 05:59:43 +0000 (07:59 +0200)]
drm: Use a dedicated .h file for configuration options

With-advice-from: swildner

5 years agobsd-family-tree: add NetBSD 7.2
Eitan Adler [Thu, 6 Sep 2018 01:44:21 +0000 (01:44 +0000)]
bsd-family-tree: add NetBSD 7.2

Also correct the origin of NetBSD 8.0, which was not derived from 7.x.

Obtained from: NetBSD

5 years agokernel: Fix some -Wint-in-bool-context warnings.
Sascha Wildner [Thu, 6 Sep 2018 00:57:10 +0000 (02:57 +0200)]
kernel: Fix some -Wint-in-bool-context warnings.

I.e., stop treating integers like booleans. In ix(4) I commented out
a problematic function that returns bool but tries to return -1 if
there was an error.

5 years agokernel - Avoid a race between dfly_schedulerclock and usched_dfly_cpu_init.
Imre Vadász [Tue, 4 Sep 2018 20:47:17 +0000 (22:47 +0200)]
kernel - Avoid a race between dfly_schedulerclock and usched_dfly_cpu_init.

* This race was repeatedly occuring during startup, running with multiple
  virtual cpu cores in qemu (using TCG emulation on a DragonFly host).

5 years agokernel/gcc80: Add -Werror to the kernel and module builds.
Sascha Wildner [Tue, 4 Sep 2018 22:00:00 +0000 (00:00 +0200)]
kernel/gcc80: Add -Werror to the kernel and module builds.

5 years agonrelease/Makefile: Use net/isc-dhcp44-server
Antonio Huete Jimenez [Tue, 4 Sep 2018 14:23:52 +0000 (07:23 -0700)]
nrelease/Makefile: Use net/isc-dhcp44-server

5 years agogcc80: Fix manual page links for the primary compiler.
Sascha Wildner [Tue, 4 Sep 2018 07:59:53 +0000 (09:59 +0200)]
gcc80: Fix manual page links for the primary compiler.

Taken-from: zrj

5 years agogcc80: Clean up two Makefiles a bit (no functional change).
Sascha Wildner [Tue, 4 Sep 2018 07:38:01 +0000 (09:38 +0200)]
gcc80: Clean up two Makefiles a bit (no functional change).

Based-on: zrj's work

5 years agoMore gcc80 adjustments.
Sascha Wildner [Tue, 4 Sep 2018 06:38:59 +0000 (08:38 +0200)]
More gcc80 adjustments.

Nothing spectacular.

Taken-from: zrj

5 years agokernel: unbreak buildkernel
Markus Pfeiffer [Mon, 3 Sep 2018 23:29:36 +0000 (23:29 +0000)]
kernel: unbreak buildkernel

5 years agogcc80: Enable -Werror for gcc80. Temporarily lower libpam's WARNS to 2.
Sascha Wildner [Mon, 3 Sep 2018 20:15:57 +0000 (22:15 +0200)]
gcc80: Enable -Werror for gcc80. Temporarily lower libpam's WARNS to 2.

The Resedacea upgrade introduced a warning which I'll fix later.

5 years agokernel - Fix missing brelse() in error path
Matthew Dillon [Mon, 3 Sep 2018 20:14:54 +0000 (13:14 -0700)]
kernel - Fix missing brelse() in error path

* Fix missing brelse() in nvtruncbuf() in error path

Reported-by: myu
5 years agoWorld - Change default compiler from gcc-5 to gcc-8
Matthew Dillon [Mon, 3 Sep 2018 17:25:35 +0000 (10:25 -0700)]
World - Change default compiler from gcc-5 to gcc-8

* Change the default compiler from gcc-5 to gcc-8.
  gcc-5 will no longer be built by default.  Setting
  WORLD_ALTCOMPILER=all will build all three as before.

* Create CC hardlink for gcc80 so dports picks it up.
  gcc80 is now the default for dports instead of 50.

* Adjust the Makefile's to make things easier the next time,
  though they could still use more work.

5 years agodfregress(8): Use mkostemp() instead of mktemp() to fix some warnings.
Sascha Wildner [Sun, 2 Sep 2018 10:13:13 +0000 (12:13 +0200)]
dfregress(8): Use mkostemp() instead of mktemp() to fix some warnings.

5 years agodrm/linux: Rewrite READ_ONCE() and WRITE_ONCE()
François Tigeot [Sat, 1 Sep 2018 06:34:40 +0000 (08:34 +0200)]
drm/linux: Rewrite READ_ONCE() and WRITE_ONCE()

These macros were broken when used with some complex types like
pointers to pointers.

5 years agokernel - Fix a third missing wakeup() in kern_lock.c
Matthew Dillon [Thu, 30 Aug 2018 05:10:49 +0000 (22:10 -0700)]
kernel - Fix a third missing wakeup() in kern_lock.c

* Fix a case where an lockmgr LK_EXCLUSIVE call with a
  timeout blocks due to existing shared locks.  If the
  timeout occurs, the exclusive lock request is backed out.

  However, if any new shared locks are attempted while
  the EXREQ was pending (due to the exclusive priority
  mechanism), those threads will block.  The backout code
  was not waking the blocked threads up for this situation.

* Fixed by issuing the wakeup() unconditionally for this
  case.  This is not a heavily traveled code path as locks
  with timeouts rarely reach the actual timeout.

5 years agoif_tun: Disallow to destroy an opened device
Aaron LI [Thu, 30 Aug 2018 13:36:07 +0000 (21:36 +0800)]
if_tun: Disallow to destroy an opened device

When a tun device (created via 'ifconfig') is opened, disallow to destroy
it (e.g., ifconfig destroy).  Otherwise, a panic occurs when the caller
closes the device, since it has been already destroyed.

Following the previous fix to if_tap.

5 years agoif_tap: Disallow to destroy an opened device
Aaron LI [Thu, 30 Aug 2018 13:13:27 +0000 (21:13 +0800)]
if_tap: Disallow to destroy an opened device

When a tap device (created via 'ifconfig') is opened, disallow to destroy
it (e.g., ifconfig destroy).  Otherwise, a panic occurs when the caller
closes the device, since it has been already destroyed.

Test case:
[A]% ifconfig tap0 create
[B]% # run a program that opens '/dev/tap0' and keep it running
[A]% ifconfig tap0 destroy
[B]% # exit the program which will then close '/dev/tap0'
=> panic!

In addition:
* Add an assertion to tapclose() to assert the device must exist.
* Return EINVAL instead of ENOIX when try to destroy an manually created
  tap device.
* Improve the function description a bit.

5 years agovkernel64 - Fix build
Matthew Dillon [Wed, 29 Aug 2018 17:11:34 +0000 (10:11 -0700)]
vkernel64 - Fix build

* Add missing CPUID_TO_APICID() macro which vm_page.c now needs.

Reminded-by: swildner
5 years agokernel - Fix startup race in usched_dfly
Matthew Dillon [Sun, 26 Aug 2018 18:52:59 +0000 (11:52 -0700)]
kernel - Fix startup race in usched_dfly

* Use a master configuration lock for usched_dfly's thread
  creation, ensuring that no thread tries to check dfly_pcpu[]
  until the whole thing has been initialized.

* Fixes occassional panic in usched_dfly on boot on many-cores
  systems due to a lower-numbered usched thread triggering before
  dfly_pcpu is completely initialized.

5 years agotmpfs - Fix rare deadlock
Matthew Dillon [Sat, 25 Aug 2018 17:10:08 +0000 (10:10 -0700)]
tmpfs - Fix rare deadlock

* Fix a deadlock which can occur between umount and tmpfs, and
  possibly in other very rare situations.

* tmpfs holds the directory node locked when resolving a directory
  entry.  This results in a lock order reversal between the
  directory's tmpfs_node lock and the vnode being locked.

  Fixed by using a NOWAIT/UNLOCK/SLEEPFAIL/RETRY sequence.

5 years agokernel/apple_gmux: Unbreak loading i915.
Peeter Must [Tue, 28 Aug 2018 13:26:05 +0000 (16:26 +0300)]
kernel/apple_gmux: Unbreak loading i915.

* Commit 183e2373896e4ea605435a6bd8f943e8273bf8cd broke loading i915
  on Apple MacBookPro laptops with dual GPUs and the gmux chip. The
  reason is that whereas formely drm_init_pdev() and drm_fill_pdev()
  where mere bookkeeping routines, the above commit relocates
  assignment of irq from drm_drv.c:drm_attach() to drm_fill_pdev().
  Since apple_gmux is loaded before i915, and apple_gmux initializes
  a pdev structure including an irq for the graphics pci device, the
  i915 which is loaded afterwards will get zero for an irq and hence
  fails to attach.

* The temporary fix is to disable apple_gmux initializing a pci_dev
  structure for bookkeeping purposes. This is not needed at the
  moment since the primary purpose of apple_gmux is to switch to iGPU
  so the user is not left with a frozen screen after loading i915. We
  do not support switching between GPUs yet.

* When and if the initialization of graphics pci devices becomes
  independent from the drm subsystem, we can make apple_gmux aware of
  the various GPUs in the system.

5 years agodocs - Update tuning.7
Matthew Dillon [Fri, 24 Aug 2018 18:29:22 +0000 (11:29 -0700)]
docs - Update tuning.7

* Minor update to tuning.7.

5 years agokernel - Fix two missing wakeup()s in kern_lock.c
Matthew Dillon [Fri, 24 Aug 2018 07:19:18 +0000 (00:19 -0700)]
kernel - Fix two missing wakeup()s in kern_lock.c

* Fix two cases where a shared lock request could block forever due
  to missing wakeups for certain specific combinations of request flags.

5 years agoSet autorehash in root's .cshrc.
Sascha Wildner [Thu, 23 Aug 2018 20:06:46 +0000 (22:06 +0200)]
Set autorehash in root's .cshrc.

5 years agokernel - Update AMD topology detection, scheduler NUMA work (TR2) (2)
Matthew Dillon [Thu, 23 Aug 2018 18:43:16 +0000 (11:43 -0700)]
kernel - Update AMD topology detection, scheduler NUMA work (TR2) (2)

* Pass un-mod'd physid to vm_numa_add_topology_mem().  This fixes the
  match logic inside vm_numa_add_topology_mem().

5 years agokernel - Update AMD topology detection, scheduler NUMA work (TR2)
Matthew Dillon [Thu, 23 Aug 2018 01:34:32 +0000 (18:34 -0700)]
kernel - Update AMD topology detection, scheduler NUMA work (TR2)

* Update AMD topology detection to use the correct cpuid.  It
  now properly detects the Threadripper 2990WX as having four nodes
  with 8 cores and 2 threads per core, per node.  It previously detected
  the chip as one node with 32 cores and 2 threads per core.

* Report the basic detected topology without requiring bootverbose.

* Record information about how much memory is attached to each node.
  We previously just assumed that it was symmetric.  This will be
  used by the scheduler.

* Fix instability in the scheduler when running on a large number
  of cores.  Flag 0x08 (on by default) is needed to actively
  schedule overloaded threads onto other cores, but this operation
  was being executed on all cores simultaneously which throws the
  uload/ucount metrics into an unstable state, causing threads to
  bounce around longer the necessary.

  Fix by round-robining the operation based on something similar to
  sched_ticks % cpuid.

  This significantly improves heavy multi-tasking performance on systems
  with many cores.

* Add memory-on-node weighting to the scheduler.  This detects asymetric
  NUMA configurations for situations where not all DIMM slots have been
  populated, and for CPUs which are naturally assymetric such as the
  2990WX which only has memory directly connected to two of its four
  nodes.

  This change will preferentially schedule threads onto nodes with
  greater amounts of attached memory under light loads, and dig into
  the less desirable cpu nodes as the load increases.

5 years agoig4 - Stop I2C controller after checking that it's kind of functional.
Imre Vadász [Sat, 18 Aug 2018 16:42:55 +0000 (18:42 +0200)]
ig4 - Stop I2C controller after checking that it's kind of functional.

5 years agoig4 - We actually need to set the Rx threshold register one smaller.
Imre Vadász [Sat, 18 Aug 2018 16:41:47 +0000 (18:41 +0200)]
ig4 - We actually need to set the Rx threshold register one smaller.

* Setting the IG4_REG_RX_TL register to 1 was actually generating an
  interrupt after 2 bytes were available in the Rx fifo. We need to set the
  register to 0 to get an interrupt for 1 byte already.

5 years agoig4 - Only enable interrupts when we want them. Otherwise keep mask at 0.
Imre Vadász [Sat, 18 Aug 2018 10:58:40 +0000 (12:58 +0200)]
ig4 - Only enable interrupts when we want them. Otherwise keep mask at 0.

* This avoids possible interrupt storms, depending on the state of the I2C
  controller before the driver attached.

* During attaching this clears the interrupt mask.

5 years agoig4 - Use serializer instead of lockmgr lock.
Imre Vadász [Sat, 18 Aug 2018 10:49:40 +0000 (12:49 +0200)]
ig4 - Use serializer instead of lockmgr lock.

* This allows us to use lwkt_serialize_handler_disable when stopping the
  interrupt, which should be safer in case of detaching during an interrupt
  storm.

5 years agohammer2 - Add the vfs.hammer2.cluster_write sysctl back in
Matthew Dillon [Sat, 18 Aug 2018 02:59:06 +0000 (19:59 -0700)]
hammer2 - Add the vfs.hammer2.cluster_write sysctl back in

* Value may be 0 or 1, defaults to 0 (disabled).  Was previously
  enabled.

* By default H2 no longer sets B_CLUSTEROK on dirty buffers being
  written.  Theoretically this shouldn't be a problem because H2
  already uses a large 64KB buffer size.

* Should improve I/O throughput on high-performance SSDs by removing
  kernel overhead and should also work better with vfsync's dirty
  buffer scan which is already sorted.

5 years agokernel - remove BUF_TIMELOCK use in fast flush pass
Matthew Dillon [Sat, 18 Aug 2018 02:57:28 +0000 (19:57 -0700)]
kernel - remove BUF_TIMELOCK use in fast flush pass

* Remove the BUF_TIMELOCK call in the fast flush pass.  This call can
  cause unnecessary flush stalls due to clustered writes getting ahead
  of the vfsync scan.

* Significantly improves filesystem flush performance to SSDs.

5 years agokernel - Refactor the TSC MP synchronization test
Matthew Dillon [Fri, 17 Aug 2018 23:52:45 +0000 (16:52 -0700)]
kernel - Refactor the TSC MP synchronization test

* Refactor the TSC MP synchronization test.  Do not use cpusync.
  Using cpusync results in O(N x N) worth of overhead instead of
  O(N) worth of overhead.

  Instead, have the per-cpu threads run the test simultaneously using
  each other's data.

* We synchronize to the last TSC element that was saved on each cpu.
  This probably needs a bit of work to ensure determinism, but at
  the moment its good in that it synchronizes all cores off of a
  single cache mastership change, instead of having them all compete
  for cache mastership.

* Probably needs some fine tuning, at the moment I allow a slop of
  10uS which is almost certainly too much.  Note, however, that
  SMP interactions can create ~1uS latencies on particular memory
  accesses.

* Solves serious issues with the old test on 64 cpu threads.
  These issues may also have been related to the ipiq fifo size
  being too small.

5 years agokernel - Increase MAXCPUFIFO from 32 to 256
Matthew Dillon [Fri, 17 Aug 2018 23:51:56 +0000 (16:51 -0700)]
kernel - Increase MAXCPUFIFO from 32 to 256

* Increase to 256, ensures that no deadlocks can occur on systems
  with more than 32 cpu threads.

5 years agoRevert "[zoneinfo] Add some missing zoneinfo files"
Sascha Wildner [Fri, 17 Aug 2018 15:51:38 +0000 (17:51 +0200)]
Revert "[zoneinfo] Add some missing zoneinfo files"

This reverts commit e6c3cf619df176c8ebd2391f8f731dfefbc48fcd.

We do not need those files and they were left out intentionally.

Also, adding them broke installworld because we would have needed
new directories in /usr/share/zoneinfo via mtree.

5 years ago[zoneinfo] Add some missing zoneinfo files
Eitan Adler [Thu, 16 Aug 2018 15:13:16 +0000 (15:13 +0000)]
[zoneinfo] Add some missing zoneinfo files

5 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 15 Aug 2018 07:56:46 +0000 (09:56 +0200)]
Update the pciconf(8) database.

August 12, 2018 snapshot from https://pci-ids.ucw.cz

5 years agobsd-family-tree: Small sync with FreeBSD.
Sascha Wildner [Mon, 13 Aug 2018 19:01:18 +0000 (21:01 +0200)]
bsd-family-tree: Small sync with FreeBSD.

5 years agoBuild - for /rescue transition must make upgrade
Matthew Dillon [Mon, 13 Aug 2018 04:03:28 +0000 (21:03 -0700)]
Build - for /rescue transition must make upgrade

* Must make upgrade before make rescue when transitioning to the new
  /rescue topology.

* Must ensure certain header files are not present.  make rescue
  currently improperly uses /usr/include which can have all sorts of
  cruft in it.

* This is a quick hack, will be fixed by a later cleanup of the
  make rescue target to properly split it into buildworld (to build)
  and installworld (to install).

5 years agohammer2 - Shift inode xop functions into hammer2_xop.c
Matthew Dillon [Mon, 30 Jul 2018 00:21:01 +0000 (17:21 -0700)]
hammer2 - Shift inode xop functions into hammer2_xop.c

* Move the inode related xop functions from hammer2_inode.c
  to hammer2_xop.c.  Leave the xop functions in strategy
  and flush where they are.

* Fix desc macro.

5 years agohammer2 - Remote xop implementation part 1
Matthew Dillon [Sun, 29 Jul 2018 02:03:29 +0000 (19:03 -0700)]
hammer2 - Remote xop implementation part 1

* Normalize naming conventions for XOP functions.

* Change the XOP callback API to remove the hammer2_thread argument.
  Pass the clindex and scratch buffer in directly.

* Change the XOP API to pass in a function descriptor instead of a
  function pointer, create prototypes for DMSG send/receive XOPs which
  will be used for XOP components which are DMSG based and not
  local-storage based.

* Adjust comments.

5 years agokernel - Clear bp->b_error prior to initiating write I/O
Matthew Dillon [Sun, 29 Jul 2018 02:01:39 +0000 (19:01 -0700)]
kernel - Clear bp->b_error prior to initiating write I/O

* Clear bp->b_error prior to initiating write I/O so a lingering
  b_error code from a retry that later succeeds is not retained.

5 years agosys/vfs/autofs: Change u_xxx -> unsigned xxx
Tomohiro Kusumi [Sun, 12 Aug 2018 11:26:59 +0000 (04:26 -0700)]
sys/vfs/autofs: Change u_xxx -> unsigned xxx

(ap->a_cmd and refcount apis are of u_xxx)

5 years agokernel/drm: Remove CONFIG_PCI as a kernel option.
Sascha Wildner [Sat, 11 Aug 2018 20:39:07 +0000 (22:39 +0200)]
kernel/drm: Remove CONFIG_PCI as a kernel option.

The code does not link in the absence of it and neither do we expect
systems without PCI support configured, nor does it make sense for
DRM specific stuff in particular, so just set it unconditionally.

If anything, it could be tied to NPCI being >0 (to check if
"device pci" is in the kernel), but for that it would have to
actually build/link without CONFIG_PCI in the first place.

5 years agoSync ACPICA with Intel's version 20180810:
Sascha Wildner [Fri, 10 Aug 2018 20:30:26 +0000 (22:30 +0200)]
Sync ACPICA with Intel's version 20180810:

* Attempt to continue initially loading ACPI tables regardless of
  malformed AML.

* Enhance acpiexec(8)'s -fi option and plug a memory leak in it.

For detailed list, please see sys/contrib/dev/acpica/changes.txt.

5 years agodrm: Sync drm_pci.c with Linux 4.7.10
François Tigeot [Fri, 10 Aug 2018 19:11:19 +0000 (21:11 +0200)]
drm: Sync drm_pci.c with Linux 4.7.10

5 years agodrm: Add CONFIG_PCI
François Tigeot [Fri, 10 Aug 2018 19:07:16 +0000 (21:07 +0200)]
drm: Add CONFIG_PCI

5 years agodrm/linux: Add field devfn to struct pci_dev
François Tigeot [Thu, 9 Aug 2018 21:01:42 +0000 (23:01 +0200)]
drm/linux: Add field devfn to struct pci_dev

5 years agoMove fpclassify.3 from libc to libm where it belongs.
Sascha Wildner [Thu, 9 Aug 2018 12:32:06 +0000 (14:32 +0200)]
Move fpclassify.3 from libc to libm where it belongs.

5 years agoAdd back a signbit.3 manpage that was killed w/o providing a substitute.
Sascha Wildner [Thu, 9 Aug 2018 12:31:25 +0000 (14:31 +0200)]
Add back a signbit.3 manpage that was killed w/o providing a substitute.

5 years agofpgetround.3: Replace references to the former fenv.3 manual page.
Sascha Wildner [Thu, 9 Aug 2018 12:27:02 +0000 (14:27 +0200)]
fpgetround.3: Replace references to the former fenv.3 manual page.

OpenBSD's libm has 4 separate manual pages for these.

5 years agoRemove two references (one commented) to a non-existant manpage.
Sascha Wildner [Thu, 9 Aug 2018 11:41:47 +0000 (13:41 +0200)]
Remove two references (one commented) to a non-existant manpage.

5 years agoRemove some documentation of the i386 specific fpresetsticky().
Sascha Wildner [Thu, 9 Aug 2018 07:26:03 +0000 (09:26 +0200)]
Remove some documentation of the i386 specific fpresetsticky().

5 years agoRevert "pf: Allow disappearing or not yet existing interfaces for ALTQ"
Aaron LI [Thu, 9 Aug 2018 02:40:36 +0000 (10:40 +0800)]
Revert "pf: Allow disappearing or not yet existing interfaces for ALTQ"

This reverts commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6.

1. It's incorrect to change the ifnet_unlock().  The original protection
   range is used to make sure that the ifp does not get ripped out behind
   our back.

2. We don't suffer from the issue that that commit was intended to fix.

Thanks-to: sephe