Sepherosa Ziehau [Mon, 7 May 2018 14:55:46 +0000 (22:55 +0800)]
igb: Dump registers.
This helps debugging.
Obtained-from: dillon
Sascha Wildner [Mon, 7 May 2018 12:43:02 +0000 (14:43 +0200)]
mrsas(4): Remove wrong extra arg from MR_LdBlockSizeGet().
Reported-by: zrj
François Tigeot [Mon, 7 May 2018 07:42:24 +0000 (09:42 +0200)]
drm/i915: Start building i915_gpu_error.c
François Tigeot [Mon, 7 May 2018 07:02:10 +0000 (09:02 +0200)]
drm/linux: Add scnprintf()
Obtained-from: FreeBSD
François Tigeot [Mon, 7 May 2018 05:45:28 +0000 (07:45 +0200)]
drm/linux: Add or improve various *printf functions
François Tigeot [Mon, 7 May 2018 05:28:35 +0000 (07:28 +0200)]
drm/linux: Start using stop_machine.h
Sascha Wildner [Sun, 6 May 2018 20:20:20 +0000 (22:20 +0200)]
Sync zoneinfo database with tzdata2018e from ftp://ftp.iana.org/tz/releases
* North Korea switched back from +0830 to +09 on May, 5.
* Miscellaneous changes, see NEWS.
For a detailed list of changes, see share/zoneinfo/NEWS.
Sascha Wildner [Sun, 6 May 2018 17:05:15 +0000 (19:05 +0200)]
ppp(8): Don't go via <sys/tty.h> for bringing in <termios.h>.
Include it directly.
Sascha Wildner [Sun, 6 May 2018 16:25:14 +0000 (18:25 +0200)]
<unistd.h>: Remove 'restrict' from symlink().
Neither NetBSD, OpenBSD, glibc, nor any standard I checked has them.
Discussed-with: zrj
Sascha Wildner [Sun, 6 May 2018 15:18:12 +0000 (17:18 +0200)]
<libgen.h>: Add comments about POSIX diffs for {base,dir}name().
François Tigeot [Sun, 6 May 2018 14:42:05 +0000 (16:42 +0200)]
drm/linux: Add do_gettimeofday()
François Tigeot [Sun, 6 May 2018 14:33:01 +0000 (16:33 +0200)]
drm: Sync include directives with Linux
* Add a few key include/asm or include/linux headers
* Move some code from .h to .c files in order to avoid clashes
between the DragonFly and Linux variants of kmalloc() and kfree()
Sascha Wildner [Sat, 5 May 2018 21:10:01 +0000 (23:10 +0200)]
Add NetBSD's orders(7) manual page.
Sascha Wildner [Sat, 5 May 2018 20:12:02 +0000 (22:12 +0200)]
libc/termios: Sync a bit with FreeBSD.
Add tcsetsid() to libc.
Taken-from: FreeBSD
Dports-testing: zrj
Sascha Wildner [Sat, 5 May 2018 20:07:33 +0000 (22:07 +0200)]
libc: Add strsuftoll{,x}()
In preparation for makefs(8).
Various dports (such as ftp/tnftpd) will also pick it up.
Taken-from: NetBSD
Dports-testing: zrj
Sascha Wildner [Mon, 30 Apr 2018 11:04:39 +0000 (13:04 +0200)]
libc/{un,}vis: Remove some useless junk. _DIAGASSERT() is defined.
Sascha Wildner [Sat, 5 May 2018 18:39:20 +0000 (20:39 +0200)]
Fix a few typos across the tree.
Sascha Wildner [Sat, 5 May 2018 12:11:45 +0000 (14:11 +0200)]
Makefile_upgrade.inc: Move dot.rhosts to the right place.
zrj [Fri, 4 May 2018 14:10:08 +0000 (17:10 +0300)]
libc/stdtime: Avoid signed overflow in mktime.
Fixes runtime issue with gcc80 -O2 constant folding. We need to use
__generic() macro to properly detect and set LONG_MIN/LONG_MAX here.
zrj [Fri, 4 May 2018 11:29:02 +0000 (14:29 +0300)]
boot/pc32: Avoid issues at -O2.
The 32-bit Legacy boot loader is intended to be compiled at -O1
optimization level. It is easy to forget this when overriding cflags.
For now do not use of frame pointer register as a general register.
zrj [Thu, 26 Apr 2018 09:38:18 +0000 (12:38 +0300)]
libstand/quad.h: Rename __qdivrem() to __udivmoddi4().
The gcc80 at -O2 emits calls to __udivmoddi4() in loader.
Boot-tested.
zrj [Sat, 28 Apr 2018 05:30:03 +0000 (08:30 +0300)]
calloc - Work around gcc-8 bug (2).
GCC-8 at -O2 improperly tries to optimize calloc() replacement even for
malloc+bzero sequence back to calloc from calloc itself. This affects
both main root's shell (tcsh as default) and ld-elf.so dynamic linker.
Explicitly use -fno-builtin-malloc to prevent that at any -Ox level.
zrj [Thu, 26 Apr 2018 07:25:53 +0000 (10:25 +0300)]
watch(8): Add fallthrough.
Mainly to suppress the warning.
zrj [Thu, 26 Apr 2018 07:23:41 +0000 (10:23 +0300)]
rtadvd(8): Suppress implicit-fallthrough.
For now don't change logic and just suppress the warning.
zrj [Thu, 26 Apr 2018 07:16:56 +0000 (10:16 +0300)]
tset(1): Suppress implicit-fallthrough.
It looks like ESC character should be followed by space code.
For now don't change logic and just suppress the warning.
zrj [Thu, 26 Apr 2018 07:10:28 +0000 (10:10 +0300)]
limits(1): Add fallthrough.
In case of end of string fallthrough straight to default.
zrj [Thu, 26 Apr 2018 07:08:02 +0000 (10:08 +0300)]
ident(1): Suppress implicit-fallthrough warnings.
Logic looks to be OK.
zrj [Thu, 26 Apr 2018 07:02:30 +0000 (10:02 +0300)]
ps(1): Add fallthrough.
Fallthrough is intended here, check
4e1c727bebeb810ba7a97614113c24690d2da5e3.
zrj [Thu, 26 Apr 2018 06:53:22 +0000 (09:53 +0300)]
sed(1): Suppress implicit-fallthrough.
The enum in C is really an int in size and space and gcc80 warns on
switch default. Add explict errx() to avoid that. If compiler can prove
that default case would not be reached in linked script->type, then
statement will be optimized out.
zrj [Thu, 26 Apr 2018 06:36:34 +0000 (09:36 +0300)]
dma(8): Use FALLTHROUGH consistently.
Avoids -Wimplicit-fallthrough warnings.
zrj [Thu, 26 Apr 2018 06:29:58 +0000 (09:29 +0300)]
mount_smbfs(8): Mark usage() as dead.
Eitan Adler [Sat, 5 May 2018 07:11:14 +0000 (07:11 +0000)]
[skel] chase previous commit with file removal
Don't forget to remove the file in upgrade case.
Eitan Adler [Sat, 5 May 2018 06:59:11 +0000 (06:59 +0000)]
Remove rhosts from default template
The 'rcmds' were removed in
2458c6f4cb6284cf8c259e0e5bf12ff74ff41952.
Matthew Dillon [Fri, 4 May 2018 18:28:10 +0000 (11:28 -0700)]
kernel - Remove kthread exit debug kprintf()s
* Remove TDF_VERBOSE and debugging kprintf()s on kthread exit.
We don't need this debugging any more.
Reported-by: zrj
Matthew Dillon [Fri, 4 May 2018 17:46:02 +0000 (10:46 -0700)]
kernel - Fix spinlock bug introduced with windowing (2)
* Fix the fix for the spinlock bug to be the actual fix and not
a bad dream.
Reported-by: zrj
Tomohiro Kusumi [Thu, 3 May 2018 06:51:02 +0000 (23:51 -0700)]
sbin/mount_autofs: Use __DECONST() instead of local __UNCONST()
Matthew Dillon [Wed, 2 May 2018 17:19:01 +0000 (10:19 -0700)]
kernel - Fix spinlock bug introduced with windowing
* The exclusive spinlock contention code was improperly assuming that
non-zero EXCLWAIT bits prevented the SHARED bit from being set. This
is no longer true, shared locks can sometimes override EXCLWAIT.
This assumption could result in spin_lock() returning with a shared
lock instead of an exclusive lock.
* Fixed by ensuring that the SHARED bit is cleared when resolving the
contended exclusive lock.
* Should hopefully fix the pmap pv == NULL assertion.
Reported-by: dillon, zrj
Sepherosa Ziehau [Tue, 1 May 2018 12:11:33 +0000 (20:11 +0800)]
igb: Bring in WOL configuration from FreeBSD.
This does _not_ fix rebooting issue on certain LOM.
Tested-by: dillon
Obtained-from: FreeBSD
Sepherosa Ziehau [Tue, 1 May 2018 11:49:59 +0000 (19:49 +0800)]
netgraph7: Protect so_rcv properly
Reported-by: Markus Pfeiffer <markus.pfeiffer@morphism.de>
Tested-by: Markus Pfeiffer <markus.pfeiffer@morphism.de>
Matthew Dillon [Sun, 29 Apr 2018 01:06:19 +0000 (18:06 -0700)]
kernel - Refactor machdep.cpu_idle_hlt
* Refactor machdep.cpu_idle_hlt. Operation works essentially the
same way as before but the code is a lot easier to read.
* Refactor mode 3 to have ACPI call back into machdep when entering
a C1 halt. Continue using HLT for this situation as we aren't
really sure what ACPI may or may not have done. MONITOR/MWAIT
might not be appropriate.
* Fix bug in cpu_smp_stopped(). Just because cpu_mwait_hints is
non-zero does not mean that there is an index entry for CPU_MWAIT_C1.
Use the last entry based on cpu_mwait_hints instead.
* Note that machdep.cpu_idle_hlt mode 2 still doesn't work as intended.
Matthew Dillon [Sat, 28 Apr 2018 18:10:38 +0000 (11:10 -0700)]
systat - Enhance -pv display
* Enhance systat -pv. Add a delimeter between the totals rows and
the cpu rows, add average user, sys, intr, and idle% over all cpus,
add total collisions, and include a percentage of total system eaten
up by collisions.
Sascha Wildner [Sat, 28 Apr 2018 16:13:16 +0000 (18:13 +0200)]
Avoid absolute SYMLINKS in cpio(1), tar(1) and mailwrapper(8).
Matthew Dillon [Sat, 28 Apr 2018 03:55:34 +0000 (20:55 -0700)]
hammer - Add missing lock
* Add missing lock around hammer_redo_fifo_end_flush(). The missing
lock could result in an assertion under heavy loads.
Matthew Dillon [Sat, 28 Apr 2018 03:21:46 +0000 (20:21 -0700)]
kernel - Adjust the scheduler to fix nice +N glitches
* Swap the DIDYIELD and steal code. The steal code needs to
go first, allowing a more desirable thread to steal the uschedcp
designation from a less desirable thread.
* The DIDYIELD code also needs a need_user_resched() to interrupt the
currently running less desirable thread.
* Set a half-queue default for usched_dfly_fast_resched instead of 0.
This should reduce unnecessary ping-ponging of user threads that
belong to the same queue.
* Increase the dynamic priority range from 12 to 20 queues.
This ensures that a cpu-bound nice -20 process cannot completely
override a nice +0 process, and ensures that a nice +20 process
does not complete stall against a nice +0 cpu-bound process.
That would be '16'. We set it to 20 to give ourselves some headroom.
* Remove some dead code.
* These changes fix relative priority glitches. More desirable
threads no longer glitch waiting for a significantly less desirable
thread to switch away on the current cpu, reducing the switch
latency from 1+ scheduler ticks to a few microseconds.
This allows nice +N processes and dynamic priority adjustments
to run in the background fully cpu-bound.
Matthew Dillon [Fri, 27 Apr 2018 18:41:12 +0000 (11:41 -0700)]
kernel - Improve indefinite macros a bit
* Delay saving SMP collision info and label string for a few loops
so we don't lose performance by doing it after the contested lock has
been resolved.
Sascha Wildner [Fri, 27 Apr 2018 15:05:14 +0000 (17:05 +0200)]
termios.4: Improve markup.
Matthew Dillon [Fri, 27 Apr 2018 06:43:15 +0000 (23:43 -0700)]
kernel - Add two debug variables to struct globaldata
* Add two debug variables to struct globaldata. These variables
can be used in assembly to debug difficult issues and accessed
in kgdb or by IPI failure alerts.
Matthew Dillon [Fri, 27 Apr 2018 06:11:07 +0000 (23:11 -0700)]
kernel - Fix several usched nits
* Fix an issue where a usched-restricted process is pulled onto a
cpu that is outside of its mask. The process will immediately
push itself back onto a cpu in its mask, but this bug leads to
unwanted cpu ping ponging.
* Fix an issue where cpu-bound usched-restricted processes can
cause other processes to be misscheduled at a lower priority
than their actual priority, resulting in unexpected stuttering.
* With these changes, nice +/- priorities should work considerably
better. In the normal case, alotted cpu time will be as shown
below. This is intended to be non-linear:
1 RQ0N 1:42.11 forever
2 R0N 1:22.55 forever
3 R0N 0:51.46 forever
4 RQ0N 0:24.23 forever
5 R0N 0:23.12 forever
6 RQ0N 0:19.91 forever
7 RQ0N 0:09.08 forever
8 RQ0N 0:08.38 forever
9 RQ0N 0:06.46 forever
10 RQ0N 0:06.72 forever
11 RQ0N 0:04.65 forever
12 RQ0N 0:04.60 forever
13 RQ0N 0:03.04 forever
14 RQ0N 0:02.53 forever
15 RQ0N 0:02.16 forever
16 RQ0N 0:01.55 forever
17 RQ0N 0:01.25 forever
18 RQ0N 0:00.81 forever
19 RQ0N 0:00.76 forever
20 RQ0N 0:00.32 forever
* In addition, dynamic priority operation should also work better with
these changes.
* WARNING! With this change, nice values actually work as intended. A
nice +20 process will get very little cpu in the face of a cpu-bound
nice +0 process on a cpu. Similarly, a cpu-bound nice -20 process will
allow nice +0 processes to barely function on a cpu.
And if you use an even larger spread, a cpu-bound nice -20 process
will not allow a nice +1 or higher process any cpu time at all.
Having multiple cores mitigations this somewhat, but users must be
careful especially when specifying negative nice values for processes.
* If you run X and have jerkiness issues due to process load, you may want
to give the X server itself around a nice -5. You can fiddle, but in
basic testing with everything running at nice 0, the scheduler appears
to do a pretty good just generally. For example, if your browser is
so overloaded that it has essentially become cpu bound, it will get cpu
on an equal basis with batch jobs like bulk builds.
zrj [Thu, 26 Apr 2018 11:49:16 +0000 (14:49 +0300)]
lib/i18n_module: Fix out of bounds bug.
Taken-from: NetBSD
zrj [Thu, 26 Apr 2018 10:55:13 +0000 (13:55 +0300)]
gcore(1): Mark as breaking strict aliasing.
IS_ELF(*(Elf_Ehdr *)&exec).
zrj [Thu, 26 Apr 2018 10:49:33 +0000 (13:49 +0300)]
tip(1): Mark as breaking strict aliasing.
The boolean(v) macro uses type-punned pointers.
zrj [Thu, 26 Apr 2018 10:38:01 +0000 (13:38 +0300)]
gcc50: Fix false positive for -Walloc-size-large-than.
Backport fix for PR 79132, prevent using alloca(-1).
zrj [Thu, 26 Apr 2018 10:35:33 +0000 (13:35 +0300)]
gcc47: Fix false positive for -Walloc-size-large-than.
Backport fix for PR 79132, prevent using alloca(-1).
Sascha Wildner [Thu, 26 Apr 2018 16:17:33 +0000 (18:17 +0200)]
mpsutil(8): Add missing braces.
Reported-by: zrj
zrj [Wed, 25 Apr 2018 16:22:13 +0000 (19:22 +0300)]
bsd.sys.mk: Implement WARNS framework for HOST_CCVER.
Previously we were handling just a CCVER only.
zrj [Wed, 25 Apr 2018 16:21:40 +0000 (19:21 +0300)]
world: Mark all build-tools.
zrj [Wed, 25 Apr 2018 16:20:33 +0000 (19:20 +0300)]
csh(1): Separate hostprog.
zrj [Wed, 25 Apr 2018 16:20:06 +0000 (19:20 +0300)]
awk(1): Separate hostprog.
zrj [Wed, 25 Apr 2018 16:19:40 +0000 (19:19 +0300)]
libmagic(3): Separate hostprog.
Set WARNS=1 for mkmagic.nx so as not to use -w.
zrj [Wed, 25 Apr 2018 16:19:07 +0000 (19:19 +0300)]
phantasia(6): Separate hostprog.
Make substantial effort to reduce dependencies for setup.nx.
While there install monsters file as 640.
zrj [Wed, 25 Apr 2018 16:18:29 +0000 (19:18 +0300)]
hack(6): Separate hostprog.
zrj [Wed, 25 Apr 2018 16:18:06 +0000 (19:18 +0300)]
adventure(6): Separate hostprog.
François Tigeot [Wed, 25 Apr 2018 09:52:23 +0000 (11:52 +0200)]
drm: Implement parts of the Linux irq subsystem
* Allowing to reuse more drm drivers code as-is from Linux
* Also allowing Linux irq functions to return expected status
codes, increasing general driver robustness
Tested-with: many i915 devices, Radeon HD6450
Sascha Wildner [Tue, 24 Apr 2018 20:03:51 +0000 (22:03 +0200)]
kernel/mpr: Remove unused malloc type.
Sascha Wildner [Tue, 24 Apr 2018 20:03:51 +0000 (22:03 +0200)]
Remove <sys/ioctl_compat.h>.
Now that tkusumi's fix for benchmarks/fio for the name and location
change of the IOCTLTRIM ioctl is in DeltaPorts, remove the header
entirely.
Fixes for stty(1) and pstat(8) are from FreeBSD.
Dports-checking: zrj
Sascha Wildner [Tue, 24 Apr 2018 18:45:47 +0000 (20:45 +0200)]
Add FreeBSD's mpr(4) driver for LSI Fusion-MPT 3/3.5 SAS controllers.
This commit also includes a userland utility for mps(4) and mpr(4)
(mprutil(8) aka mpsutil(8)).
After porting bug fixing, testing shows that it seems to be stable,
therefore I have added it to our X64_64_GENERIC as well.
Thanks to zrj for testing and to sephe for some porting clues.
Taken-from: FreeBSD
Sascha Wildner [Tue, 24 Apr 2018 12:49:10 +0000 (14:49 +0200)]
<sys/proc.h>: Fix unused macro name (number == bit number) and comment.
Sascha Wildner [Tue, 24 Apr 2018 07:14:57 +0000 (09:14 +0200)]
evtranalyze.1: Fix typo.
Sepherosa Ziehau [Mon, 23 Apr 2018 14:15:44 +0000 (22:15 +0800)]
x86_64/ioapic: Make sure that legacy IRQ only appears on one CPU.
The legacy IRQ lookup assumes only one CPU has a given legacy IRQ.
On system w/ large number of IOAPIC, GSI96 could be mapped to IRQ17
on CPU0 (since IRQ96 is used by SYSCALL), while GSI17 is mapped to
IRQ17 on another CPU. This breaks later IRQ lookup.
Reported-by: Imre Vadasz
Tested-by: Imre Vadasz
Matthew Dillon [Mon, 23 Apr 2018 07:27:21 +0000 (00:27 -0700)]
kernel - Remove cache ping-pong on common scheduler operations
* Reflect dfly_curprocmask and dfly_rdyprocmask bits in the
scheduler's pcpu structures. This allows us to reduce global
atomic ops that are virtually guaranteed to cause cache ping
ponging.
* sched_yield and token-based yield operations no longer clear
the bit in the curprocmask, since they are just yielding
(XXX needs work, a later blocking op then might not pull a
new process from another cpu).
Matthew Dillon [Mon, 23 Apr 2018 07:23:15 +0000 (00:23 -0700)]
kernel - More deterministic systat -pv lock name output
* Update the lock name in the globaldata structure for any
contended lock that bumps the SMP collision count (basically,
any lock which contends for more than 1uS).
* Improved systat -pv accuracy at very little cost.
Matthew Dillon [Mon, 23 Apr 2018 07:19:46 +0000 (00:19 -0700)]
kernel - Improve lockf performance
* Improve fcntl lockf performance with two small optimizations.
Together these add a little over 10% in non-contended
performance.
* Add a 2-entry-per-cpu range lock allocation cache. This
covers the most typical lock/unlock situations.
* Conditionalize the setting of VMAYHAVELOCKS to avoid unnecessary
atomic ops.
* Remove the clearing of VMAYHAVELOCKS. The cost in close() is
basically nothing while the cost in the lockf critical path
is several branches and an atomic op.
Matthew Dillon [Mon, 23 Apr 2018 02:29:58 +0000 (19:29 -0700)]
libthread_xu - Improve contended mutex code
* Retry a few times in a loop before using the umtx*() system
calls to sleep.
This significantly reduces IPI traffic and improves performance
when a mutex is heavily contended.
Matthew Dillon [Mon, 23 Apr 2018 02:26:58 +0000 (19:26 -0700)]
kernel - Improve namecache performance
* Improve performance for the edge case where a process is
deleting a large number of files. In this situation,
NCF_DESTROYED ncp entries can build up in the hash table
and slow things down until the system quiets down, then
the tables get cleaned up.
Improve by recycling such entries into new entries when
possible.
* Refactor the hash calculation again. The big-prime idea
actually has some trivially obvious problems, scrap it
for the moment.
Matthew Dillon [Mon, 23 Apr 2018 02:25:23 +0000 (19:25 -0700)]
kernel - Improve kern_dup() performance
* Run the operation with a single exclusive spinlock instead of
acquiring and releasing it twice. Improves thread-concurent
dup() performance.
Matthew Dillon [Mon, 23 Apr 2018 02:24:07 +0000 (19:24 -0700)]
kernel - Carefully refactor contended tokens and spinlocks (2)
* After testing, increasing the exponential cap from 1024 to
4096 appears to produce better results, so the previous comment
is wrong. Adjust the default and the comment.
* Forgot to commit the changes to spinlock.h, fixed.
Matthew Dillon [Mon, 23 Apr 2018 02:16:24 +0000 (19:16 -0700)]
kernel - Fix statistics accounting bug in kfree()
* kfree() was bumping the statistics counters for the wrong cpu.
This could lead to kmalloc statistics slowly becoming inaccurate.
* This also fixes some significant cache line bouncing under
heavy threaded loaded.
Matthew Dillon [Mon, 23 Apr 2018 01:56:14 +0000 (18:56 -0700)]
kernel - Carefully refactor contended tokens and spinlocks
* Carefully put the exponential backoff back in for spinlocks, and
implement for tokens. Only applicable to exclusive locks, capped
via sysctl (mjg). Tested on dual-socket xeon.
* Exclusive priority for shared locks reduces the shared/exclusive
starvation that can occur when exclusive locks use exponential
backoff.
* Exponential backoff significantly improves performance for
heavily contended exclusive locks by allowing some degree of burst
operation.
* Implement TSC windowing for shared locks (and a little for
exclusive locks too). This prevents heavily contended exclusive
locks from completely starving shared locks by using windowing
to disable the exclusive-priority mechanic for shared locks.
This allows a few contending shared locks to compete on equal
ground with exclusive locks.
Suggested-by: mjg
Matthew Dillon [Mon, 23 Apr 2018 01:55:03 +0000 (18:55 -0700)]
kernel - Remove performance pessimization with INVARIANTS
* Remove lf_global_counter under INVARIANTS, fixes cache pessimization.
We want performance scaling to continue to work with INVARIANTS since
that is how we ship the kernel by default.
Matthew Dillon [Sun, 22 Apr 2018 19:29:55 +0000 (12:29 -0700)]
kernel - cleanup kern_descrip.c
* Cleanup long lines, syntax
* fsetfd_locked() does not have to call fclearcache().
Matthew Dillon [Sun, 22 Apr 2018 19:12:33 +0000 (12:12 -0700)]
kernel - Localize [in]activevnodes globals, improve allocvnode
* Move to globaldata, keep globals as rollup statistics.
* We already solved normal active->inactive->active issues
in prior work, this change primarily effects vnode termination,
such as for unlink operations.
* Enhance allocvnode to reuse a convenient reclaimed vnode
if we can find one on the pcpu's inactive list and lock it
non-blocking. This reduces unnecessary vnode count bloating.
Matthew Dillon [Sun, 22 Apr 2018 18:57:07 +0000 (11:57 -0700)]
tmpfs - Move dnode lock to improve unlink performance
* Unlock the directory node a little earlier in tmpfs_vop_nremove().
Matthew Dillon [Sun, 22 Apr 2018 17:41:52 +0000 (10:41 -0700)]
kernel - Minor rollup cleanup
* Collect count and apply once at the end of the loop.
Sascha Wildner [Sun, 22 Apr 2018 20:17:21 +0000 (22:17 +0200)]
LINT64: Fix typo.
Matthew Dillon [Sun, 22 Apr 2018 17:34:22 +0000 (10:34 -0700)]
kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf (2)
* Fix lost fp bug, a file pointer would sometimes not get dropped,
leading to disconnection problems (e.g. sftp).
zrj [Tue, 30 Jan 2018 11:38:27 +0000 (13:38 +0200)]
rpc: Add support for NO_WCAST_FUNCTION_TYPE make variables.
It is unfortunate that <rpc/xdr.h> has the "bool_t xdr_void(void);"
without the XDR* parameter even if it is unused. Since we do not want to
change public symbol interface, suppressing the warning is a better way.
While there, add suppression to acpiexec/inetd for function cast too.
zrj [Wed, 24 Jan 2018 17:29:16 +0000 (19:29 +0200)]
world: Mark utilities that use out of bounds copies.
zrj [Mon, 22 Jan 2018 13:24:11 +0000 (15:24 +0200)]
bsd.kern.mk: Handle gcc80 better in buildkernel.
Matthew Dillon [Sun, 22 Apr 2018 00:48:43 +0000 (17:48 -0700)]
libc - Remove incorrect sched_yield() stub
* sched_yield() is a system call, and libthread_xu does not
override it. Remove the empty stub so the system call is
properly called.
* Now sched_yield() is no longer a NOP.
Matthew Dillon [Sun, 22 Apr 2018 00:30:42 +0000 (17:30 -0700)]
kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf
* Use an eventcounter and the per-thread fd cache to fix
bottlenecks in checkfdclosed(). This will work well for
the vast majority of applications and test benches.
* Batch holdfp*() operations on kqueue collections when implementing
poll() and select(). This significant improves performance.
Full scaling not yet achieved, however.
* Increase copyin item batching from 8 to 32 for select() and poll().
* Give the uidinfo structure a pcpu array to hold the posixlocks
and openfiles count fields, with a rollup contained in the uidinfo
structure itself.
This removes numerous global bottlenecks related to open(),
close(), dup*(), and lockf operations (posixlocks count).
ui_openfiles will force a rollup on limit reached to be sure
that the limit was actually reached. ui_posixlocks stays fairly
loose. Each cpu rolls up generally only when the pcpu count exceeds
+32 or goes below -32.
* Give the proc structure a pcpu array for the same counts, in order
to properly support seteuid() and such.
* Replace P_ADVLOCK with a char field proc->p_advlock_flag, and
remove token operations around the field.
Matthew Dillon [Sun, 22 Apr 2018 00:23:23 +0000 (17:23 -0700)]
kernel - Refactor lwkt_token pool hash
* Refactor the lwkt_token pool hash to a better hash algorithm
using large primes.
Matthew Dillon [Fri, 20 Apr 2018 15:44:32 +0000 (08:44 -0700)]
kernel - per-thread fd cache, p_fd lock bypass
* Implement a per-thread (fd,fp) cache. Cache hits can keep fp's
in a held state (avoiding the need to fhold()/fdrop() the ref count),
and bypasses the p_fd spinlock. This allows the file pointer structure
to generally be shared across cpu caches.
* Can cache up to four descriptors in each thread, LRU. This is the common
case. Highly threaded programs tend to focus work on a distinct
file descriptors in each thread.
* One file descriptor can be cached in up to four threads. This is
a significant limitation, though relatively uncommon. On a cache miss
the code drops into the normal shared p_fd spinlock lookup.
Tomohiro Kusumi [Sat, 21 Apr 2018 21:58:36 +0000 (14:58 -0700)]
sbin/hammer: Drop _X macro for hammer show
Also reduce supported indent levels from 17 to 10.
17 levels with 62 fanouts for internal nodes seems way more than
needed even considering max capacity of HAMMER1.
Sascha Wildner [Sat, 21 Apr 2018 21:39:24 +0000 (23:39 +0200)]
Fix up UPGRADING.
Sascha Wildner [Sat, 21 Apr 2018 21:26:37 +0000 (23:26 +0200)]
Remove IPsec and related code from the system.
It was unmaintained ever since we inherited it from FreeBSD 4.8.
In fact, we had two implementations from that time: IPSEC and FAST_IPSEC.
FAST_IPSEC is the implementation to which FreeBSD has moved since, but
it didn't even build in DragonFly.
Fixes for dports have been committed to DeltaPorts.
Requested-by: dillon
Dports-testing-and-fixing: zrj
Sascha Wildner [Tue, 17 Apr 2018 17:10:55 +0000 (19:10 +0200)]
kernel: Disable TCP_SIGNATURE in preparation for removing IPSEC.
Keep the code around until it gets fixed at a later date.
Requested-by: sephe
Sascha Wildner [Sat, 21 Apr 2018 18:56:40 +0000 (20:56 +0200)]
<sys/mbuf.h>: Fix packet tag comments.
Matthew Dillon [Sat, 21 Apr 2018 01:18:52 +0000 (18:18 -0700)]
kernel - Fix duplicate da0 or da* and locked up boot
* Fix duplicate da* reporting at boot which usually results in
the boot locking up.
* The diskinfo was being installed while before CAM's softc->state
normalized, potentially allowing I/O to occur during the probe
sequence and causing the probe state to be repeated.
Delay calling disk_setdiskinfo() until after softc->state is
normalized.
Tomohiro Kusumi [Fri, 20 Apr 2018 15:01:30 +0000 (08:01 -0700)]
sys/vfs/autofs: Use ksnprintf() (sync with NetBSD)
FreeBSD and DragonFly had strcpy()+strcat().
NetBSD changed it to snprintf().
Tomohiro Kusumi [Fri, 20 Apr 2018 15:00:57 +0000 (08:00 -0700)]
sys/vfs/autofs: Fix a comment
This isn't really a FALLTHROUGH. Not sure why I even originally
added this since this had never existed in FreeBSD too.