Commit Graph

222426 Commits

Author SHA1 Message Date
Simon J. Gerraty
e1cee40d8b Merge bmake-20170420 2017-04-21 00:45:44 +00:00
Josh Paetzel
36064ac2d5 MFV 316871
7490 real checksum errors are silenced when zinject is on

illumos/illumos-gate@6cedfc397d
6cedfc397d

https://www.illumos.org/issues/7490
  When zinject is on, error codes from zfs_checksum_error() can be overwritten
  due to an incorrect and overly-complex if condition.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
2017-04-21 00:24:59 +00:00
Josh Paetzel
9a625bd31c MFV 316870
7448 ZFS doesn't notice when disk vdevs have no write cache

illumos/illumos-gate@295438ba32
295438ba32

https://www.illumos.org/issues/7448
       I built a SmartOS image with all the NVMe commits including 7372
       (support NVMe volatile write cache) and repeated my dd testing:
       > #!/bin/bash
       > for i in `seq 1 1000`; do
       > dd if=/dev/zero of=file00 bs=1M count=102400 oflag=sync &
       > dd if=/dev/zero of=file01 bs=1M count=102400 oflag=sync &
       > wait
       > rm file00 file01
       > done
       >
       Previously each dd command took ~145 seconds to finish, now it takes
       ~400 seconds.
       Eventually I figured out it is 7372 that causes unnecessary
       nvme_bd_sync() executions which wasted CPU cycles.
  If a NVMe device doesn't support a write cache, the nvme_bd_sync function will
  return ENOTSUP to indicate this to upper layers.
  It seems this returned value is ignored by ZFS, and as such this bug is not
  really specific to NVMe. In vdev_disk_io_start() ZFS sends the flush to the
  disk driver (blkdev) with a callback to vdev_disk_ioctl_done(). As nvme filled
  in the bd_sync_cache function pointer, blkdev will not return ENOTSUP, as the
  nvme driver in general does support cache flush. Instead it will issue an
  asynchronous flush to nvme and immediately return 0, and hence ZFS will not set
  vdev_nowritecache here. The nvme driver will at some point process the cache
  flush command, and if there is no write cache on the device it will return
  ENOTSUP, which will be delivered to the vdev_disk_ioctl_done() callback. This
  function will not check the error code and not set nowritecache.
  The right place to check the error code from the cache flush is in
  zio_vdev_io_assess(). This would catch both cases, synchronous and asynchronous
  cache flushes. This would also be independent of the implementation detail that
  some drivers can return ENOTSUP immediately.

Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Obtained from:	Illumos
2017-04-21 00:17:54 +00:00
Rick Macklem
dedec68c32 Fix the setting of atime for Linux client NFSv4 mounts.
The FreeBSD NFSv4 server did not set the attribute bit for TimeAccess in
the reply to an Open with exclusive_create, as required by the RFCs.
(This is required since the FreeBSD NFS server stores the create_verifier
 in the va_atime attribute.)
As such, the Linux NFSv4 client did not set the TimeAccess (atime) in
the Setattr done in an RPC after the one with the Open/exclusive_create.
This patch fixes the server to set the TimeAccess bit in the reply.

I believe that storing the create_verifier in an extended attribute for
file systems that support extended attributes might be a good idea,
but I will wait for a discussion of this on the freebsd-fs@ email list
before considering committing a patch to do this.

Reported by:	jim@ks.uiuc.edu
Suggested by:	dfr
MFC after:	2 weeks
2017-04-21 00:17:47 +00:00
Josh Paetzel
47e222432b MFV 316868
7430 Backfill metadnode more intelligently

illumos/illumos-gate@af346df588
af346df588

https://www.illumos.org/issues/7430
  Description and patch from brought over from the following ZoL commit: https://
  github.com/zfsonlinux/zfs/commit/68cbd56e182ab949f58d004778d463aeb3f595c6
  Only attempt to backfill lower metadnode object numbers if at least
  4096 objects have been freed since the last rescan, and at most once
  per transaction group. This avoids a pathology in dmu_object_alloc()
  that caused O(N^2) behavior for create-heavy workloads and
  substantially improves object creation rates. As summarized by
  @mahrens in #4636:
  "Normally, the object allocator simply checks to see if the next
  object is available. The slow calls happened when dmu_object_alloc()
  checks to see if it can backfill lower object numbers. This happens
  every time we move on to a new L1 indirect block (i.e. every 32 *
  128 = 4096 objects). When re-checking lower object numbers, we use
  the on-disk fill count (blkptr_t:blk_fill) to quickly skip over
  indirect blocks that don?t have enough free dnodes (defined as an L2
  with at least 393,216 of 524,288 dnodes free). Therefore, we may
  find that a block of dnodes has a low (or zero) fill count, and yet
  we can?t allocate any of its dnodes, because they've been allocated
  in memory but not yet written to disk. In this case we have to hold
  each of the dnodes and then notice that it has been allocated in
  memory.
  The end result is that allocating N objects in the same TXG can
  require CPU usage proportional to N^2."
  Add a tunable dmu_rescan_dnode_threshold to define the number of
  objects that must be freed before a rescan is performed. Don't bother
  to export this as a module option because testing doesn't show a
  compelling reason to change it. The vast majority of the performance
  gain comes from limit the rescan to at most once per TXG.

Reviewed by: Alek Pinchuk <alek@nexenta.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Ned Bass <bass6@llnl.gov>

Obtained from:	Illumos
2017-04-21 00:12:47 +00:00
Gleb Smirnoff
89aa578fde - When reading VM stats, provide proper size argument to sysctl.
- While here, remove unused arguments from mysysctl().
2017-04-21 00:00:23 +00:00
Simon J. Gerraty
f62a02334b Import bmake-20170420
Only use -C arg "as is" if it contains no relative component.
Fix Main_SetObjdir() for relative paths (eg obj).
Fix a number of coverity complaints.
2017-04-20 23:12:37 +00:00
Jung-uk Kim
795cd431cb Fix systat(1) regression. It was broken by r317061. 2017-04-20 22:30:39 +00:00
Pedro F. Giffuni
8413ef5798 libthread_db: unbreak build due to sign/unsigned comparison.
Reported by:	lwshu
2017-04-20 21:01:59 +00:00
Dimitry Andric
bcfe4c376c Add function and data sections when building llvm, clang, lld and lldb,
and allow the linker to garbage collect them.  This shaves off up to a
few MB from the final executables.

MFC after:	3 days
2017-04-20 21:00:09 +00:00
Dimitry Andric
c83fca58fa Turn off llvm/clang's ENABLE_BACKTRACES setting, since it never worked
properly anyway.  (Upstream has reorganized this somewhat in the mean
time, but for proper backtraces we would need llvm-symbolizer in base.)

MFC after:	3 days
2017-04-20 21:00:04 +00:00
Scott Long
fb2cec6f53 Reorder the minimum_cmd_size code to make it a little smaller and
easier to read.
2017-04-20 20:46:34 +00:00
Edward Tomasz Napierala
28ffa76673 Mention GEOM_MOUNTVER.
MFC after:	2 weeks
2017-04-20 20:06:51 +00:00
Baptiste Daroussin
af8612c17a GNU diff is done and GNU diff3 is not using libgnuregex, so no need to
condition the build of libgnuregex anymore on WITHOUT_GNU_DIFF
2017-04-20 19:33:00 +00:00
Baptiste Daroussin
fd1444e4c9 Only build libreadline for gdb, binutils actually does not need it 2017-04-20 19:29:35 +00:00
Baptiste Daroussin
a17665bcef Replace again GNU diff with BSD diff
After a firts failed attempt, BSD diff is now good enough to replace
GNU diff.

Relnotes:	yes
2017-04-20 19:24:51 +00:00
Michael Tuexen
190d9abce7 Syncoockies can be used in combination with the syncache. If the cache
overflows, syncookies are used.
This patch restricts the usage of syncookies in this case: accept
syncookies only if there was an overflow of the syncache recently.
This mitigates a problem reported in PR217637, where is syncookie was
accepted without any recent drops.
Thanks to glebius@ for suggesting an improvement.

PR:			217637
Reviewed by:		gnn, glebius
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D10272
2017-04-20 19:19:33 +00:00
Baptiste Daroussin
933870f0d1 Cross reference pr(1) which diff might call with -l option 2017-04-20 19:14:52 +00:00
Baptiste Daroussin
fa0a8c0192 Update the TODO list to reflect what has been changed 2017-04-20 19:07:52 +00:00
Baptiste Daroussin
bcf91ad6d3 Document all long options 2017-04-20 19:05:43 +00:00
Baptiste Daroussin
50502545ce Readd Big5: some large databases setup are still requiring it.
Reported by:	"張君天(Chun-Tien Chang)" <tcs@kitty.2y.idv.tw>
2017-04-20 18:21:50 +00:00
Pedro F. Giffuni
3876a56282 libpthread_db: undo the memset size change.
I inadvertedly soubled the size of the memset without noticing the
start address had changed. The size for the memset in pt_map_thread()
shouldn't actually match the reallocarray() so undo that part of r317200.

This is a re-commit of r317201 to clarify the log.

X-MFC with:	r317200
2017-04-20 17:58:27 +00:00
Pedro F. Giffuni
171fcb3069 Revert r317201 to fix the log. 2017-04-20 17:54:59 +00:00
Pedro F. Giffuni
febd54ebb7 libpthread_db: leave the memset size from unchanged.
The size for the memset in pt_map_thread() shouldn't actually match the
reallocarray() so undo that part of r317200.

X-MFC with:	r317200
2017-04-20 17:49:37 +00:00
Pedro F. Giffuni
1f2b051d84 libthread_db: unsign map_len and use reallocarray(3).
Lengths are not negative, so map_len should be unsigned. Unsign the
corresponding indexes too and bring a small use of reallocarray(3).

Reorder the memset to be consistent with the realloc: it appears we
were only clearing half the memory in pt_map_thread().

MFC after:	2 weeks
2017-04-20 17:43:25 +00:00
Bruce Evans
2d445fb18c Eliminate the ega renderer switch. It did nothing useful except hold
a pointer to the main ega drawing method which is misoptimized be in
a different function than the main vga planar mode drawing method.
Vga initialization handles everything with no extra code except for
selecting the different function.
2017-04-20 17:22:03 +00:00
Bruce Evans
55d26fc07c When the character width is 9, remove vertical lines in the mouse cursor
corresponding to the gaps between characters.  This fixes distortion
of the cursor due to expanding it across the gaps.

Again for character width 9, when the cursor characters are not in the
graphics range (0xb0-0xdf), the gaps were always there (filled in the
background color for the previous char).  They still look strange, but
don't cause distortion.  When the cursor characters are in the graphics
range, the gaps are filled by repeating the previous line.  This gives
distortion with cilia.  Removing vertical lines reduces the distortion
to vertical cilia.

Move the default for the cursor characters out of the graphics range.
With character width 9, this gives gaps instead of distortion and
other problems.  With character width 8, it just fixes a smaller set
of other problems.  Some distortion and other problems can be recovered
using vidcontrol -M.  Presumably the default was to fill the gaps
intentionally, but it is much better to leave gaps.  The gaps can even
be considered as a feature for text processing -- they give sub-pointers
to character boundaries.  The other problems are: (1) with character
width 9, characters near the cursor are moved into the graphics range
and thus distorted if any of their 8th bits is set; (2) conflicts with
national characters in the graphics range.

The default range for the graphics cursor characters is now 8-11.  This
doesn't conflict with anything, since the glyphs for the characters in
this range are unreachable.

Use the 10x16 mouse cursor in text mode too (if the font size is >= 14).

When the character width is 9, removal of 1 or 2 vertical lines makes
10x16 cursor no wider than the 9x13 one usually was.  We could even
handle cursors 1 pixel wider in 2 character cells and gaps without
more clipping than given by the gaps (the worst case is 1 pixel in the
left cell, 1 removed in the middle gap, 8 in the right cell and 1
removed in the right gap.  The pixel in the right gap is removed so
it doesn't matter if it is in the font).

When the character width is 8, we now clip the 10-wide cursor by 1
pixel in the worst case.  This clipping is usually invisible since it
is of the border and and the border usually merges with the background
so is invisible.  There should be an option to use reverse video to
highlight the border and its tip instead of the interior (graphics
mode can do better using separate colors).  This needs the 9x13 cursor
again.

Ideas from: ache (especially about the bad default character range)
2017-04-20 16:34:09 +00:00
Andrew Turner
52a680fb22 Restrict the arm64 supervisor all instructions to only allow a zero
immediate value for system calls. We may wish to use other values in the
future for other purposes.

MFC after:	1 week
Sponsored by:	DARPA, AFRL
2017-04-20 15:53:20 +00:00
Konstantin Belousov
be4bf62684 Write-combine framebuffer writes through user-space mappings, if possible.
Note that KVA mapping of the framebuffer already uses write-combining
mode, so the change, besides improving speed of user mode writes, also
satisfies requirement of the IA32 architecture of using consistent
caching modes for multiple mappings of the same page.

Reported and tested by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	 1 week
2017-04-20 15:18:15 +00:00
Olivier Houchard
5d840968f8 Update comment ot reflect realilty, we know also take care of CPUs that
provide a enable-method.

Suggested by:	jhibbits
2017-04-20 15:06:16 +00:00
Baptiste Daroussin
fddcb7b82f Implement a basic --changed-group-format
etcupdate(8) requires that option, while GNU diff supports many more variation
of that options, their behaviour beside the simple verion implemented here are
quite inconsistent as such I do not plan to implement those.

The only special keyword supported by this implementation are: %< and %>
%= is not implemented as the documentation of GNU diff says: common lines, but
it actually when tested print the changes from the first file
2017-04-20 14:22:33 +00:00
Ed Maste
431bcfcdbd elfcopy: document --strip-symbols=filename in the man page
Reported by:	bz
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-04-20 13:57:53 +00:00
Andrew Turner
d7635c7a49 Push loading curthread into assembly in the synchronous exception handlers.
This will help investigating the performance impact of moving parts of the
switch statement in do_el0_sync into assembly.

Sponsored by:	DARPA, AFRL
2017-04-20 13:56:30 +00:00
Olivier Houchard
21ce594e7a ePAPR states that any non-boot CPU will come in "disabled" state. So we should
not consider a "disabled" cpu as a CPU we have to ignore, and we should use
them if they provide a "enable-method".
While I'm there, support "ok" as well as "okay", while ePAPR only accepts
"okay", linux accepts "ok" too so we can expect it to be used.

Reviewed by:	andrew (partially)
2017-04-20 13:56:06 +00:00
Bruce Evans
ecb56aaf60 Attempt to determine the modes in which 8-bit wide characters are actually
9 wide.

I only need this to improve the mouse cursor, but it has always been
needed to select and/or adjust fonts.

This is complicated because there are no standard parameter tables
giving this bit of information directly, and the device register bit
giving the information can't be trusted even if it is read from the
hardware.  Use a heuristic to guess if the device register can be
trusted.  (The device register is normally read from the BIOS mode
table, but on my system where the device register is wrong, the mode
table doesn't match the hardware and is not used; the device registers
are used in this case.)
2017-04-20 13:46:55 +00:00
Baptiste Daroussin
05d06ecac3 Add a regression test for diff -D 2017-04-20 11:32:18 +00:00
Kristof Provost
00eab743ab pf: Fix possible incorrect IPv6 fragmentation
When forwarding pf tracks the size of the largest fragment in a fragmented
packet, and refragments based on this size.
It failed to ensure that this size was a multiple of 8 (as is required for all
but the last fragment), so it could end up generating incorrect fragments.

For example, if we received an 8 byte and 12 byte fragment pf would emit a first
fragment with 12 bytes of payload and the final fragment would claim to be at
offset 8 (not 12).

We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so
other users won't make the same mistake.

Reported by:	Antonios Atlasis <aatlasis at secfu net>
MFC after:	3 days
2017-04-20 09:05:53 +00:00
Alexander Motin
d1025db49e Some cosmetic polishing for pre-timeouts.
MFC after:	1 week
2017-04-20 09:01:31 +00:00
Enji Cooper
4c033a734e Regenerate src.conf(5) after recent additions/clarifications
Sponsored by:	Dell EMC Isilon
2017-04-20 03:43:37 +00:00
David C Somayajulu
9a5f785486 Cleanup QLA_LOCK/QLA_UNLOCK macros
remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros
format qla_error_recovery()

MFC after:3 days
2017-04-20 03:41:42 +00:00
Enji Cooper
863d0264b1 Clean up WITH*_PROFILE
- Clarify that profiled libraries are usable with gprof(8).
- Add WITH_PROFILE to complement WITHOUT_PROFILE and placate makeman.

MFC after:	7 weeks
Sponsored by:	Dell EMC Isilon
2017-04-20 03:36:09 +00:00
Enji Cooper
bcdf1a2d4e Add WITH_GROFF to complement WITHOUT_GROFF and placate complaints from makeman
MFC after:	7 weeks
Sponsored by:	Dell EMC Isilon
2017-04-20 03:32:30 +00:00
Navdeep Parhar
b0ca71f0a0 Free lro_hash unconditionally, just like lro_mbuf_data a few lines
later.  Fix whitespace nit while here.
2017-04-19 23:06:07 +00:00
Gleb Smirnoff
8152071324 Bump __FreeBSD_version due to r317061, struct vmmeter changes. 2017-04-19 22:50:19 +00:00
Gleb Smirnoff
69db34c309 Fix build without SC_PIXEL_MODE defined. 2017-04-19 22:48:27 +00:00
Jung-uk Kim
2696ce471c Revert r316796. It is not necessary since r317173. 2017-04-19 22:43:11 +00:00
Jung-uk Kim
b249b33322 Always clear borders when the terminal is flushed.
PR:		202288
2017-04-19 22:41:24 +00:00
Navdeep Parhar
a3927369fa Do not leak lro_hash on failure to allocate lro_mbuf_data.
MFC after:	1 week
2017-04-19 22:27:26 +00:00
Jung-uk Kim
5971d9cf1c Micro-optimize vt_set_border(). 2017-04-19 22:21:15 +00:00
Navdeep Parhar
3d24e03800 Remove redundant assignment. 2017-04-19 22:20:41 +00:00