Tomohiro Kusumi [Thu, 11 Aug 2016 07:37:46 +0000 (16:37 +0900)]
sbin/hammer: Move score_printf()/hammer_check_restrict() to cmd_mirror.c
Make sbin/hammer/misc.c independent of /sbin/hammer's global variables
(used by two functions score_printf()/hammer_check_restrict()) that
aren't accessible from other programs such as /sbin/newfs_hammer
which already links to some of sbin/hammer/*.o's.
/sbin/newfs_hammer could make use of misc.o, but globals have been
preventing from linking against sbin/hammer/misc.o. If these are
to be used by other hammer commands, they need to be reimplemented
without dependencies.
Tomohiro Kusumi [Thu, 11 Aug 2016 05:53:37 +0000 (14:53 +0900)]
sbin/hammer: Increment recovery scan offset regardless of get_buffer() result
otherwise the loop may become an infinite loop though that's not
likely to actually happen in this case.
Tomohiro Kusumi [Tue, 9 Aug 2016 17:21:11 +0000 (02:21 +0900)]
sbin/hammer: Add debug prints while scanning node during recovery
Prints "zone2offset nodetype elmnum elmtypes" with -d.
Prints "zone2offset -" for invalid offsets in addition to above with -dd.
-- example
...
20000000207fd000 -
20000000207fe000 -
20000000207ff000 -
2000000020800000 L 2 RR
mkinode (dir) /tmp/xxxxx/PFS00000
2000000020801000 I 52 LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
2000000020802000 L 32 RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
mkdir /tmp/xxxxx/PFS00000/obj_0x0000000100010590
...
Tomohiro Kusumi [Tue, 9 Aug 2016 17:24:32 +0000 (02:24 +0900)]
sbin/hammer: Use HAMMER_BTREE_TYPE_RECORD
Sascha Wildner [Wed, 10 Aug 2016 17:43:52 +0000 (19:43 +0200)]
ppp(8): Remove useless _POSIX_SOURCE checks (no functional change).
Sascha Wildner [Wed, 10 Aug 2016 16:51:28 +0000 (18:51 +0200)]
tcsetattr.3: Adjust for recent termios.h changes.
Matthew Dillon [Mon, 8 Aug 2016 17:46:35 +0000 (10:46 -0700)]
kernel - Add workaround for improper yield in ACPI path
* For now add a workaround for an improper yield that can occur indirectly
via the ACPI path. The problem is that the ACPI contrib code can hold
a spinlock across a kmalloc() call.
* The ACPI code, in particular AcpiOsAcquireLock(), uses a spin lock. At
the same time it MUST use a spinlock because it might be called from
the idle thread. But it also appears that the code might call kmalloc()
while holding a spinlock.
The kmalloc path ACPI calls is with M_INTWAIT, which reduces the chance
that kmalloc might try to block. However, kmalloc is used to execute
staged kfrees which can create a sequence:
kmalloc -> kmem_slab_free -> (vm system) ->
vm_object_page_remove_callback -> lwkt_user_yield().
Sascha Wildner [Mon, 8 Aug 2016 17:35:33 +0000 (19:35 +0200)]
<sys/termios.h>: Clean up the namespace.
Sascha Wildner [Mon, 8 Aug 2016 17:35:01 +0000 (19:35 +0200)]
<sys/termios.h>: Adjust whitespace (no functional change).
Sascha Wildner [Mon, 8 Aug 2016 06:15:59 +0000 (08:15 +0200)]
make upgrade: Remove one more file I forgot in
859c2e538.
zrj [Mon, 8 Aug 2016 04:40:29 +0000 (07:40 +0300)]
gold: Fix CFLAGS override.
This was not intended.
In-discussion-with: marino
Matthew Dillon [Mon, 8 Aug 2016 02:44:33 +0000 (19:44 -0700)]
kernel - Remove some debug output
* Remove "Warning: cache_resolve: ncp '%s' was unlinked" debug output.
This was originally added to validate a particular code path and is
no longer needed.
Sascha Wildner [Sun, 7 Aug 2016 17:49:40 +0000 (19:49 +0200)]
i386 removal, part 57/x: Remove two i386 leftovers.
Sascha Wildner [Sun, 7 Aug 2016 16:31:12 +0000 (18:31 +0200)]
kernel: Remove useless I586_PMC_GUPROF option.
Sascha Wildner [Sun, 7 Aug 2016 16:21:00 +0000 (18:21 +0200)]
i386 removal, part 56/x: Remove old i386 specific manual pages.
Shuffle a number of them to share/man/man4 because they didn't seem to
be i386 specific for one reason or another.
Sascha Wildner [Sun, 7 Aug 2016 16:17:51 +0000 (18:17 +0200)]
kernel: Remove the old vx(4) network driver.
Aside from being quite obsolete, its documentation always was in the
i386 so i have my doubts that it still works.
If anyone needs it back for some reason I can't imagine currently,
we can take another look then.
Sascha Wildner [Sun, 7 Aug 2016 15:37:56 +0000 (17:37 +0200)]
i386 removal, part 55/x: Remove if_sbni(4) remains.
Sascha Wildner [Sun, 7 Aug 2016 15:26:26 +0000 (17:26 +0200)]
i386 removal, part 54/x: Remove perfmon(4) remains.
It only ever was compilable into i386 kernels. I forgot to remove it
too in
f4c88b0b86f1810db0482795bc097597d1197c54.
Sascha Wildner [Sun, 7 Aug 2016 14:22:04 +0000 (16:22 +0200)]
i386 removal, part 53/x: Remove the code of the fe(4) driver too.
It only ever was compilable into i386 kernels. I forgot to remove it
too in
f4c88b0b86f1810db0482795bc097597d1197c54.
Sascha Wildner [Sun, 7 Aug 2016 14:08:27 +0000 (16:08 +0200)]
kernel: Remove the old ep(4) and ex(4) network drivers.
Aside from being quite obsolete, their documentation always was in the
i386 so i have my doubts that they still work.
If anyone needs them back for some reason I can't imagine currently,
we can take another look then.
Sascha Wildner [Sun, 7 Aug 2016 13:09:47 +0000 (15:09 +0200)]
i386 removal, part 52/x: Remove the old cs(4) network driver.
Looks like it was i386 specific and ended up in our x86_64 configs by
mistake. At least its manpage was in the i386 section and FreeBSD does
not have it in amd64's NOTES either.
Sascha Wildner [Sun, 7 Aug 2016 12:49:22 +0000 (14:49 +0200)]
Clean up some more after the sys/emulation/linux removal.
Tomohiro Kusumi [Sun, 7 Aug 2016 11:28:44 +0000 (20:28 +0900)]
sbin/hammer: Abort if failed to creat recover target dir
Tomohiro Kusumi [Sun, 7 Aug 2016 08:59:07 +0000 (17:59 +0900)]
sbin/hammer: Add verbose volume message while recovering
sizetostr() is brought from newfs_hammer code.
newfs_hammer should use sizetostr() by linking sbin/hammer/misc.o,
as it already has dependencies on other sbin/hammer/*.o.
(Also note that hammer2 also has sizetostr() in both directories)
Sascha Wildner [Sun, 7 Aug 2016 09:29:13 +0000 (11:29 +0200)]
<time.h>: Adjust the visibility of CLOCK_REALTIME and TIMER_ABSTIME.
Looks like they came in with IEEE Std 1003.1b-1993.
Helps building math/clblas with GCC.
Reported-by: zrj
Matthew Dillon [Sun, 7 Aug 2016 08:34:54 +0000 (01:34 -0700)]
boot - Force -O
* Always force -O for the boot code. -O2 will implode it. This is a bit
weird but -O will override any prior -O2. We still want other CFLAGS
that mk scripts supply so we can't just set CFLAGS=
Matthew Dillon [Sun, 7 Aug 2016 08:04:48 +0000 (01:04 -0700)]
tcsh - Work around gcc-5 bug
* GCC-5 improperly tries to optimize tcsh's calloc() replacement into a
tail-jmp to tcsh's calloc. It tries to optimize the malloc+memset
sequence into calloc, inside calloc itself.
This is really a bug in GCC-5 but work around it for now by hacking
tcsh's calloc().
Matthew Dillon [Sun, 7 Aug 2016 07:21:55 +0000 (00:21 -0700)]
build - prepare for higher optimization levels (2)
* A couple more programs need Makefile mods.
Matthew Dillon [Sun, 7 Aug 2016 07:07:29 +0000 (00:07 -0700)]
build - Add support for new NO_* make variables
* Add support for NO_STRICT_ALIASING, NO_STRICT_OVERFLOW,
and NO_WARRAY_BOUNDS.
Matthew Dillon [Sun, 7 Aug 2016 07:04:51 +0000 (00:04 -0700)]
build - prepare for higher optimization levels
* Add NO_STRICT_ALIASING, NO_STRICT_OVERFLOW, and NO_WARRAY_BOUNDS
make variables as-needed.
Matthew Dillon [Sun, 7 Aug 2016 07:00:30 +0000 (00:00 -0700)]
kernel - Fix minor bug in powermng
* Fix a minor array overflow (incorrect index used) bug in powermng.
Matthew Dillon [Sun, 7 Aug 2016 04:02:46 +0000 (21:02 -0700)]
kernel - Cleanup gcc warnings
* Cleanup gcc warnings at higher optimization levels. This will allow
us to build kernels -O2 or -O3.
zrj [Wed, 27 Jul 2016 16:17:54 +0000 (19:17 +0300)]
libc/strptime: Handle ISO 8601 time zone formats in %z.
Formats of +hh:mm +hh Z are now also accepted to previous +hhmm.
zrj [Tue, 26 Jul 2016 12:29:59 +0000 (15:29 +0300)]
libc/strptime: Fix "%Y %W %w %H:%M:%S".
Also throw in the fix for "12:34:56 2016 30 0", "%H:%M:%S %Y %W %w".
Correct partial format reads are still not supported.
zrj [Tue, 26 Jul 2016 13:48:35 +0000 (16:48 +0300)]
strptime.3: Sync with FreeBSD.
zrj [Tue, 26 Jul 2016 12:14:49 +0000 (15:14 +0300)]
libc/strptime: Attempt to fix up %U and %W.
Thera are still few issues left.
Taken-from: FreeBSD
zrj [Tue, 26 Jul 2016 10:05:36 +0000 (13:05 +0300)]
libc/strptime: Add support for %t and %n per POSIX.
Only skip space for %e and fail on unknown specifiers.
Also remove magic year 1900 constants.
Taken-from: FreeBSD
zrj [Tue, 26 Jul 2016 06:59:42 +0000 (09:59 +0300)]
libc/strptime: Check for NULL, not 0.
Also add check for gmtime_r() result.
While there, perform license change as per FreeBSD r267544
Matthew Dillon [Sun, 7 Aug 2016 04:25:26 +0000 (21:25 -0700)]
kernel - Fix memcpy assembly ABI
* memcpy must return the original (dst) argument, and wasn't for the kernel.
Nothing used it explicitly, but gcc sometimes decides to call memcpy and
assumes the correct return value. It was just luck that it hasn't up until
now.
Matthew Dillon [Sat, 6 Aug 2016 18:05:10 +0000 (11:05 -0700)]
libc - Include information on the 'e' flag in the popen() manual page.
* Include information on the 'e' flag in the popen() manual page.
Matthew Dillon [Sat, 6 Aug 2016 17:53:59 +0000 (10:53 -0700)]
kernel, world - Remove the remaining vestiges of linux emul
* Remove the remaining bits of the 32-bit linux emulation code. This
code hasn't been used in ages and we have no plans to implement a
64-bit linux emulation.
Tomohiro Kusumi [Sat, 6 Aug 2016 12:08:15 +0000 (21:08 +0900)]
sbin/hammer: Directly access volume in volume list
This is what ondisk code does.
No reference/etc to acquire via get_volume().
Tomohiro Kusumi [Sat, 6 Aug 2016 09:58:58 +0000 (18:58 +0900)]
sys/vfs/hammer: Add HAMMER_VOL_BUF_SIZE()
Tomohiro Kusumi [Sat, 6 Aug 2016 08:54:29 +0000 (17:54 +0900)]
sbin/hammer: Remove rel_volume()
It does nothing after
da519351 which got rid of unnecessary
volume-modified flag.
volume_info list never gets cleaned up once it's added, so
release isn't necessary, unlike buffers (incl volume buffer)
that need to be managed.
Matthew Dillon [Fri, 5 Aug 2016 20:12:08 +0000 (13:12 -0700)]
kernel - Fix kern.proc.pathname sysctl
* kern.proc.pathname is a sysctl used by programs to find the path
of the running program. This sysctl was created before we stored
sufficient information in the proc structure to construct the
correct path when multiple aliases are present (due to e.g. null-mounts)
to the same file.
* We do have this information, in p->p_textnch, so change the sysctl to
use it. The sysctl will now return the actual full path in the context
of whomever ran the program, so it should properly take into account
chroots and such.
Sascha Wildner [Fri, 5 Aug 2016 08:33:54 +0000 (10:33 +0200)]
Use ; instead of , where appropriate.
Also add the coccinelle patch which found this to test/cocci (taken from
https://github.com/coccinelle/coccinellery/blob/master/comma/comma.cocci).
Matthew Dillon [Fri, 5 Aug 2016 07:18:07 +0000 (00:18 -0700)]
dma - Fix security hole
* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.
* Add O_NOFOLLOW to disallow symlinks.
Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.
Sascha Wildner [Fri, 5 Aug 2016 07:07:57 +0000 (09:07 +0200)]
bsd-family-tree: Sync with FreeBSD (DragonFly 4.6.0).
Peter Avalos [Thu, 4 Aug 2016 10:29:55 +0000 (03:29 -0700)]
Merge branch 'vendor/OPENSSH'
Peter Avalos [Thu, 4 Aug 2016 10:28:43 +0000 (03:28 -0700)]
Add a openbsd-compat file for latest import.
Peter Avalos [Thu, 4 Aug 2016 10:27:08 +0000 (03:27 -0700)]
Update files for OpenSSH-7.3p1 import.
Peter Avalos [Thu, 4 Aug 2016 08:15:20 +0000 (01:15 -0700)]
Merge branch 'vendor/OPENSSH'
Peter Avalos [Thu, 4 Aug 2016 06:09:16 +0000 (23:09 -0700)]
Import OpenSSH-7.3p1.
Peter Avalos [Thu, 4 Aug 2016 01:25:04 +0000 (18:25 -0700)]
Remove most local modifications from OpenSSH.
This primarily removes the HPN patches. It's become too cumbersome to
maintain these patches as demonstrated by the fact that we haven't
updated OpenSSH in quite some time. If people want additional
functionality in their OpenSSH, it's available in dports
(security/openssh).
Instead of just silently ignoring removed options in people's
configurations, I decided to treat these as errors so that the admin
will need to decide to remove it from their configuration or install the
dport to get the functionality back.
Sascha Wildner [Thu, 4 Aug 2016 06:53:34 +0000 (08:53 +0200)]
make upgrade: Remove no longer existing manpages after the OpenSSL upgrade.
Sascha Wildner [Thu, 4 Aug 2016 06:53:21 +0000 (08:53 +0200)]
strftime.3: Remove extra whitespace.
Matthew Dillon [Thu, 4 Aug 2016 02:38:11 +0000 (19:38 -0700)]
kernel - Fix lwp_fork/exit race (2) (vkernel)
* Fix same race as before, in vkernel also.
Peter Avalos [Wed, 3 Aug 2016 20:22:16 +0000 (13:22 -0700)]
libcrypto(3): Set CC variable for Perl scripts.
This detects assembler/compiler capabilities.
Obtained-from: FreeBSD
François Tigeot [Wed, 3 Aug 2016 19:35:34 +0000 (21:35 +0200)]
drm/linux: kernel_ulong_t is defined in linux/mod_devicetable.h
Peter Avalos [Wed, 3 Aug 2016 19:16:05 +0000 (12:16 -0700)]
Fix typo.
Peter Avalos [Wed, 3 Aug 2016 19:11:29 +0000 (12:11 -0700)]
libcrypto(3): Remove some cruft from when we supported 32-bit.
Peter Avalos [Wed, 3 Aug 2016 19:05:00 +0000 (12:05 -0700)]
Add IDEA support for libcrypto(3).
The patent expired years ago.
Sascha Wildner [Wed, 3 Aug 2016 18:09:42 +0000 (20:09 +0200)]
vkernel: Add a simple pagezero() macro (unbreaks build).
Peter Avalos [Wed, 3 Aug 2016 09:52:16 +0000 (02:52 -0700)]
Update files for OpenSSL-1.0.2h import.
Make the jump to 1.0.2, because support for 1.0.1 ends at the end of
this year.
Peter Avalos [Wed, 3 Aug 2016 08:18:34 +0000 (01:18 -0700)]
Merge branch 'vendor/OPENSSL'
Peter Avalos [Wed, 3 Aug 2016 08:02:32 +0000 (01:02 -0700)]
Import OpenSSL-1.0.2h.
Matthew Dillon [Wed, 3 Aug 2016 05:28:54 +0000 (22:28 -0700)]
kernel - Fix lwp_fork/exit race
* In a multi-threaded program it is possible for the exit sequence to
deadlock if one thread is trying to exit (exit the entire process)
while another thread is simultaniously creating a new thread.
* Fix the issue by having the new thread checking for the exit condition and
sending a SIGKILL to itself. And kprintf() a message when it happens.
Sascha Wildner [Wed, 3 Aug 2016 03:39:50 +0000 (05:39 +0200)]
librt/aio: #ifndef notyet -> #if 0 /* not yet */
Sascha Wildner [Wed, 3 Aug 2016 02:59:16 +0000 (04:59 +0200)]
Adjust a couple of manual pages to the recent header changes.
Sascha Wildner [Wed, 3 Aug 2016 02:48:08 +0000 (04:48 +0200)]
<sys/types.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.
Sascha Wildner [Wed, 3 Aug 2016 02:47:13 +0000 (04:47 +0200)]
<sys/stat.h>: Clean up the POSIX namespace.
* Use __BSD_VISIBLE instead of !_POSIX_SOURCE.
* Reduce visibility of some BSD specific stuff.
* Expand visibility of fchmod() and lstat().
Sascha Wildner [Wed, 3 Aug 2016 02:46:23 +0000 (04:46 +0200)]
<sys/aio.h>: Remove unneeded includes (cleans up namespace).
Sascha Wildner [Wed, 3 Aug 2016 02:45:14 +0000 (04:45 +0200)]
<sys/ipc.h>: Some POSIX adjustments.
* Use standard types.
* Reduce visibility of some BSD specific stuff.
* While here, add missing parentheses around a macro argument.
Sascha Wildner [Wed, 3 Aug 2016 02:43:40 +0000 (04:43 +0200)]
<sys/shm.h>: Some POSIX adjustments.
* Define pid_t, size_t and time_t as required.
* Put BSD specific stuff under __BSD_VISIBLE.
Sascha Wildner [Wed, 3 Aug 2016 02:42:14 +0000 (04:42 +0200)]
<sys/sem.h>: Some POSIX adjustments.
* Define pid_t, size_t and time_t as required.
* Put BSD specific stuff under __BSD_VISIBLE.
* Use standard types.
Sascha Wildner [Wed, 3 Aug 2016 02:41:14 +0000 (04:41 +0200)]
<sys/msg.h>: Some POSIX adjustments.
* Define msglen_t and msgqnum_t and use them (no size change).
* Define pid_t, size_t, ssize_t and time_t as required.
* Put BSD specific stuff under __BSD_VISIBLE.
Sascha Wildner [Wed, 3 Aug 2016 02:39:47 +0000 (04:39 +0200)]
<netinet/tcp.h>: Clean up the POSIX namespace a bit.
Sascha Wildner [Wed, 3 Aug 2016 02:36:12 +0000 (04:36 +0200)]
Clean up whitespace in a few headers (no functional change).
<netinet/tcp.h>
<sys/aio.h>
<sys/ipc.h>
<sys/msg.h>
<sys/sem.h>
<sys/shm.h>
<sys/stat.h>
<sys/types.h>
In preparation for namespace cleanup.
Matthew Dillon [Wed, 3 Aug 2016 00:41:08 +0000 (17:41 -0700)]
kernel - Remove PG_ZERO and zeroidle (page-zeroing) entirely
* Remove the PG_ZERO flag and remove all page-zeroing optimizations,
entirely. Aftering doing a substantial amount of testing, these
optimizations, which existed all the way back to CSRG BSD, no longer
provide any benefit on a modern system.
- Pre-zeroing a page only takes 80ns on a modern cpu. vm_fault overhead
in general is ~at least 1 microscond.
- Pre-zeroing a page leads to a cold-cache case on-use, forcing the fault
source (e.g. a userland program) to actually get the data from main
memory in its likely immediate use of the faulted page, reducing
performance.
- Zeroing the page at fault-time is actually more optimal because it does
not require any reading of dynamic ram and leaves the cache hot.
- Multiple synth and build tests show that active idle-time zeroing of
pages actually reduces performance somewhat and incidental allocations
of already-zerod pages (from page-table tear-downs) do not affect
performance in any meaningful way.
* Remove bcopyi() and obbcopy() -> collapse into bcopy(). These other
versions existed because bcopy() used to be specially-optimized and
could not be used in all situations. That is no longer true.
* Remove bcopy function pointer argument to m_devget(). It is no longer
used. This function existed to help support ancient drivers which might
have needed a special memory copy to read and write mapped data. It has
long been supplanted by BUSDMA.
Matthew Dillon [Mon, 1 Aug 2016 20:03:52 +0000 (13:03 -0700)]
kernel - Cleanup vm_page_pcpu_cache()
* Remove the empty vm_page_pcpu_cache() function and related call. Page
affinity is handled by the vm_page_queues[] array now.
François Tigeot [Sun, 31 Jul 2016 15:45:29 +0000 (17:45 +0200)]
drm/linux: Add linux/kobject.h
Matthew Dillon [Sun, 31 Jul 2016 03:40:06 +0000 (20:40 -0700)]
kernel - Refactor cpu localization for VM page allocations (3)
* Instead of iterating the cpus in the mask starting at cpu #0, iterate
starting at mycpu to the end, then from 0 to mycpu - 1.
This fixes random masked wakeups from favoring lower-numbered cpus.
* The user process scheduler (usched_dfly) was favoring lower-numbered
cpus due to a bug in the simple selection algorithm, causing forked
processes to initially weight improperly. A high fork or fork/exec
rate skewed the way the cpus were loaded.
Fix this by correctly scanning cpus from the (scancpu) rover.
* For now, use a random 'previous' affinity for initially scheduling a
fork.
François Tigeot [Sun, 31 Jul 2016 06:06:36 +0000 (08:06 +0200)]
drm/linux: Add vmap()
Sascha Wildner [Sat, 30 Jul 2016 20:19:24 +0000 (22:19 +0200)]
Sync ACPICA with Intel's version
20160729.
* Restructured and standardized the C library configuration for
ACPICA.
* AML interpreter: Allows for execution of so-called "executable"
AML code outside of control methods, not just at the module level
(top level) but also within any scope declared outside of a
control method - Scope{}, Device{}, Processor{}, PowerResource{},
and ThermalZone{}. Lv Zheng.
* iASL: Add full support for the RASF ACPI table (RAS Features Table).
* iASL: Allows for compilation/disassembly of so-called "executable"
AML code (see above).
For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.
Matthew Dillon [Sat, 30 Jul 2016 19:30:24 +0000 (12:30 -0700)]
kernel - Refactor cpu localization for VM page allocations (2)
* Finish up the refactoring. Localize backoffs for search failures
by doing a masked domain search. This avoids bleeding into non-local
page queues until we've completely exhausted our local queues,
regardess of the starting pg_color index.
* We try to maintain 16-way set associativity for VM page allocations
even if the topology does not allow us to do it perfect. So, for
example, a 4-socket x 12-core (48-core) opteron can break the 256
queues into 4 x 64 queues, then split the 12-cores per socket into
sets of 3 giving 16 queues (the minimum) to each set of 3 cores.
* Refactor the page-zeroing code to only check the localized area.
This fixes a number of issues related to the zerod pages in the
queues winding up severely unbalanced. Other cpus in the local
group can help replentish a particular cpu's pre-zerod pages but
we intentionally allow a heavy user to exhaust the pages.
* Adjust the cpu topology code to normalize the physical package id.
Some machines start at 1, some machines start at 0. Normalize
everything to start at 0.
Matthew Dillon [Sat, 30 Jul 2016 19:27:09 +0000 (12:27 -0700)]
kernel - cleanup vfs_cache debugging
* Remove the deep namecache recursion warning, we've taken care of it
properly for a while now so we don't need to know when it happens any
more.
* Augment the cache_inval_internal warnings with more information.
Imre Vadász [Sat, 30 Jul 2016 10:32:26 +0000 (12:32 +0200)]
if_iwm - Fix iwm_poll_bit() usage in iwm_stop_device().
* The iwm(4) iwm_poll_bit() returns 1 on success and 0 on failure,
whereas iwl_poll_bit() in Linux iwlwifi returns >= 0 on success and
< 0 on failure.
Matthew Dillon [Sat, 30 Jul 2016 00:03:22 +0000 (17:03 -0700)]
kernel - Refactor cpu localization for VM page allocations
* Change how cpu localization works. The old scheme was extremely unbalanced
in terms of vm_page_queue[] load.
The new scheme uses cpu topology information to break the vm_page_queue[]
down into major blocks based on the physical package id, minor blocks
based on the core id in each physical package, and then by 1's based on
(pindex + object->pg_color).
If PQ_L2_SIZE is not big enough such that 16-way operation is attainable
by physical and core id, we break the queue down only by physical id.
Note that the core id is a real core count, not a cpu thread count, so
an 8-core/16-thread x 2 socket xeon system will just fit in the 16-way
requirement (there are 256 PQ_FREE queues).
* When a particular queue does not have a free page, iterate nearby queues
start at +/- 1 (before we started at +/- PQ_L2_SIZE/2), in an attempt to
retain as much locality as possible. This won't be perfect but it should
be good enough.
* Also fix an issue with the idlezero counters.
Matthew Dillon [Fri, 29 Jul 2016 21:59:15 +0000 (14:59 -0700)]
systat - Adjust extended vmstats display
* When the number of devices are few enough (or you explicitly specify
just a few disk devices, or one), there is enough room for the
extended vmstats display. Make some adjustments to this display.
* Display values in bytes (K, M, G, etc) instead of pages like the other
fields.
* Rename zfod to nzfod and subtract-away ozfod when displaying nzfod
(only in the extended display), so the viewer doesn't have to do the
subtraction in his head.
Matthew Dillon [Fri, 29 Jul 2016 20:29:03 +0000 (13:29 -0700)]
kernel - Reduce memory testing and early-boot zeroing.
* Reduce the amount of memory testing and early-boot zeroing that
we do, improving boot times on systems with large amounts of memory.
* Fix race in the page zeroing count.
* Refactor the VM zeroidle code. Instead of having just one kernel thread,
have one on each cpu.
This significantly increases the rate at which the machine can eat up
idle cycles to pre-zero pages in the cold path, improving performance
in the hot-path (normal) page allocations which request zerod pages.
* On systems with a lot of cpus there is usually a little idle time (e.g.
0.1%) on a few of the cpus, even under extreme loads. At the same time,
such loads might also imply a lot of zfod faults requiring zero'd pages.
On our 48-core opteron we see a zfod rate of 1.0 to 1.5 GBytes/sec and
a page-freeing rate of 1.3 - 2.5 GBytes/sec. Distributing the page
zeroing code and eating up these miniscule bits of idle improves the
kernel's ability to provide a pre-zerod page (vs having to zero-it in
the hot path) significantly.
Under the synth test load the kernel was still able to provide 400-700
MBytes/sec worth of pre-zerod pages whereas before this change the kernel
was only able to provide 20 MBytes/sec worth of pre-zerod pages.
Matthew Dillon [Fri, 29 Jul 2016 17:22:53 +0000 (10:22 -0700)]
kernel - Cleanup namecache stall messages on console
* Report the proper elapsed time and also include td->td_comm
in the printed output on the console.
Matthew Dillon [Fri, 29 Jul 2016 17:02:50 +0000 (10:02 -0700)]
kernel - Fix rare tsleep/callout race
* Fix a rare tsleep/callout race. The callout timer can trigger before
the tsleep() releases its lwp_token (or if someone else holds the
calling thread's lwp_token).
This case is detected, but failed to adjust lwp_stat before
descheduling and switching away. This resulted in an endless sleep.
zrj [Fri, 29 Jul 2016 07:12:39 +0000 (10:12 +0300)]
mktemp.3: Improve the manpage, add mklinks.
Fix SYNOPSIS, remove outdated information and clarify availability.
Taken-from: FreeBSD
zrj [Fri, 29 Jul 2016 07:27:22 +0000 (10:27 +0300)]
mdoc.local: Add DragonFly 4.6 for future reference.
Sepherosa Ziehau [Fri, 29 Jul 2016 08:56:10 +0000 (16:56 +0800)]
hyperv/vmbus: Passthrough interrupt resource allocation to nexus
This greatly simplies interrupt allocation. And reenable the interrupt
resource not found warning in acpi.
Matthew Dillon [Fri, 29 Jul 2016 01:05:42 +0000 (18:05 -0700)]
libthread_xu - Don't override vfork()
* Allow vfork() to operate normally in a threaded environment. The kernel
can handle multiple concurrent vfork()s by different threads (only the
calling thread blocks, same as how Linux deals with it).
Sascha Wildner [Thu, 28 Jul 2016 20:16:33 +0000 (22:16 +0200)]
mktemp.3: Fix a typo and bump .Dd
Matthew Dillon [Thu, 28 Jul 2016 17:12:39 +0000 (10:12 -0700)]
kernel - Be nicer to pthreads in vfork()
* When vfork()ing, give the new sub-process's lwp the same TID as the one
that called vfork(). Even though user processes are not supposed to do
anything sophisticated inside a vfork() prior to exec()ing, some things
such as fileno() having to lock in a threaded environment might not be
apparent to the programmer.
* By giving the sub-process the same TID, operations done inside the
vfork() prior to exec that interact with pthreads will not confuse
pthreads and cause corruption due to e.g. TID 0 clashing with TID 0
running in the parent that is running concurrently.
Sascha Wildner [Thu, 28 Jul 2016 17:10:40 +0000 (19:10 +0200)]
ed(1): Sync with FreeBSD.
Sascha Wildner [Thu, 28 Jul 2016 17:18:46 +0000 (19:18 +0200)]
ed(1): Remove handling of non-POSIX environment.