]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoEnable superpages on arm64 by default. These seem to be stable, having
Andrew Turner [Sun, 4 Sep 2016 17:50:23 +0000 (17:50 +0000)]
Enable superpages on arm64 by default. These seem to be stable, having
survived multiple world and kernel builds, and of poudriere building full
package sets.

I have observed a 3% reduction in buildworld times with superpages enabled,
however further testing is needed to see if this is observed in other
workloads.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoWith clang 3.9.0, compiling sys/netinet/igmp.c results in the following
Dimitry Andric [Sun, 4 Sep 2016 17:23:10 +0000 (17:23 +0000)]
With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7777

8 years agoWith clang 3.9.0, compiling uplcom results in the following warnings:
Dimitry Andric [Sun, 4 Sep 2016 16:59:35 +0000 (16:59 +0000)]
With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by: imp, hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7776

8 years agocache: defer freeing entries until after the global lock is dropped
Mateusz Guzik [Sun, 4 Sep 2016 16:52:14 +0000 (16:52 +0000)]
cache: defer freeing entries until after the global lock is dropped

This also defers vdrop for held vnodes.

Glanced at by: kib

8 years agoOops, the previous i386 version of e_fmodf.S and e_fmodl.S was
Bruce Evans [Sun, 4 Sep 2016 15:08:14 +0000 (15:08 +0000)]
Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was
actually the amd64 version.

8 years agoDisconnect the "optimized" asm variants of cos(), sin() and tan() from
Bruce Evans [Sun, 4 Sep 2016 14:12:19 +0000 (14:12 +0000)]
Disconnect the "optimized" asm variants of cos(), sin() and tan() from
the build on i386.  Leave them in the source tree for regression tests.

The asm functions were always much less accurate (by a factor of more
than 10**18 in the worst case).  They were faster on old CPUs.  But
with each new generation of CPUs they get relatively slower.  The
double precision C version's average advantage is about a factor of 2
on Haswell.

The asm functions were already intentionally avoided in float and long
double precision on i386 and in all precisions on amd64.  Float
precision and amd64 give larger advantages to the C version.  The long
double precision C code and compilers' understanding of long double
precision are not so good, so the i387 is still slightly faster for
long double precision, except for the unimportant subcase of huge args
where the sub-optimal C code now somehow beats the i387 by about a
factor of 2.

8 years agofd: fix up fdeget_file
Mateusz Guzik [Sun, 4 Sep 2016 13:31:57 +0000 (13:31 +0000)]
fd: fix up fdeget_file

It was supposed to return NULL if a fp is not installed.

Facepalm-by: mjg
8 years agoAdd asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm
Bruce Evans [Sun, 4 Sep 2016 12:22:14 +0000 (12:22 +0000)]
Add asm versions of fmod(), fmodf() and fmodl() on amd64.  Add asm
versions of fmodf() amd fmodl() on i387.

fmod is similar to remainder, and the C versions are 3 to 9 times
slower than the asm versions on x86 for both, but we had the strange
mixture of all 6 variants of remainder in asm and only 1 of 6
variants of fmod in asm.

8 years agoUpgrade to Unbound 1.5.9.
Dag-Erling Smørgrav [Sun, 4 Sep 2016 12:17:57 +0000 (12:17 +0000)]
Upgrade to Unbound 1.5.9.

8 years agoFix missing fmodl() on arches with 53-bit long doubles.
Bruce Evans [Sun, 4 Sep 2016 12:01:32 +0000 (12:01 +0000)]
Fix missing fmodl() on arches with 53-bit long doubles.

PR: 199422, 211965
MFC after: 1 week

8 years agocache: manage negative entry list with a dedicated lock
Mateusz Guzik [Sun, 4 Sep 2016 08:58:35 +0000 (08:58 +0000)]
cache: manage negative entry list with a dedicated lock

Since negative entries are managed with a LRU list, a hit requires a
modificaton.

Currently the code tries to upgrade the global lock if needed and is
forced to retry the lookup if it fails.

Provide a dedicated lock for use when the cache is only shared-locked.

Reviewed by: kib
MFC after: 1 week

8 years agocache: put all negative entry management code into dedicated functions
Mateusz Guzik [Sun, 4 Sep 2016 08:55:15 +0000 (08:55 +0000)]
cache: put all negative entry management code into dedicated functions

Reviewed by: kib
MFC after: 1 week

8 years agobhndb(4): Fix probing of bhndb-attached bhnd_nvram devices.
Landon J. Fuller [Sun, 4 Sep 2016 01:47:21 +0000 (01:47 +0000)]
bhndb(4): Fix probing of bhndb-attached bhnd_nvram devices.

This fixes bhnd(4) nvram handling on devices that map SPROM CSRs via PCI
configuration space.

The probe method previously required that a bhnd(4) device be attached to the
parent bridge; now that the bhnd_nvram device is always attached first, this
unnecessary sanity check always failed.

Approved by: adrian (mentor, implicit)

8 years agobhndb(4): Skip disabled cores when performing bridge configuration probing.
Landon J. Fuller [Sun, 4 Sep 2016 01:43:54 +0000 (01:43 +0000)]
bhndb(4): Skip disabled cores when performing bridge configuration probing.

On BCM4321 chipsets, both PCI and PCIe cores are included, with one of
the cores potentially left floating.

Since the PCI core appears first in the device table, and the PCI
profiles appear first in the resource configuration tables, this resulted in
incorrectly matching and using the PCI/v1 resource configuration on PCIe
devices, rather than the correct PCIe/v1 profile.

Approved by: adrian (mentor, implicit)

8 years agosiba(4): Add missing bhnd_device/bhnd_device_quirk table terminator entries.
Landon J. Fuller [Sun, 4 Sep 2016 01:25:46 +0000 (01:25 +0000)]
siba(4): Add missing bhnd_device/bhnd_device_quirk table terminator entries.

This resulted in an over-read on siba chipsets that failed to match the
existing entries.

Approved by: adrian (mentor, implicit)

8 years agoRemove empty directories left by r299241, r302190, r304870, and r301410
Landon J. Fuller [Sun, 4 Sep 2016 01:17:16 +0000 (01:17 +0000)]
Remove empty directories left by r299241, r302190, r304870, and r301410

Approved by: adrian (mentor, implicit)

8 years agoMigrate bhndb(4) to the new bhnd_erom API.
Landon J. Fuller [Sun, 4 Sep 2016 00:58:19 +0000 (00:58 +0000)]
Migrate bhndb(4) to the new bhnd_erom API.

Adds support for probing and initializing bhndb(4) bridge state using
the bhnd_erom API, ensuring that full bridge configuration is available
*prior* to actually attaching and enumerating the bhnd(4) child device,
allowing us to safely allocate bus-level agent/device resources during
bhnd(4) bus enumeration.

- Add a bhnd_erom_probe() method usable by bhndb(4). This is an analogue
  to the existing bhnd_erom_probe_static() method, and allows the bhndb
  bridge to discover the best available erom parser class prior to newbus
  probing of its children.
- Add support for supplying identification hints when probing erom
  devices. This is required on early EXTIF-only chipsets, where chip
  identification registers are not available.
- Migrate bhndb over to the new bhnd_erom API, using bhnd_core_info
  records rather than bridged bhnd(4) device_t references to determine
  the bridged chipsets' capability/bridge configuration.
- The bhndb parent (e.g. if_bwn) is now required to supply a hardware
  priority table to the bridge. The default table is currently sufficient
  for our supported devices.
- Drop the two-pass attach approach we used for compatibility with bhndb(4) in
  the bhnd(4) bus drivers, and instead perform bus enumeration immediately,
  and allocate bridged per-child bus-level resources during that enumeration.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7768

8 years agoMicro-optimize sleepq_signal().
Mark Johnston [Sun, 4 Sep 2016 00:29:48 +0000 (00:29 +0000)]
Micro-optimize sleepq_signal().

Lift a comparison out of the loop that finds the highest-priority thread
on the queue.

MFC after: 1 week

8 years agoRespect the caller's hints when performing swap readahead.
Mark Johnston [Sun, 4 Sep 2016 00:25:49 +0000 (00:25 +0000)]
Respect the caller's hints when performing swap readahead.

The pager getpages interface allows the caller to bound the number of
readahead and readbehind pages, and vm_fault_hold() makes use of this
feature. These bounds were ignored after r305056, causing the swap pager
to potentially page in more than the specified number of pages.

Reported and reviewed by: alc
X-MFC with: r305056

8 years agoImplement a generic bhnd(4) device enumeration table API.
Landon J. Fuller [Sat, 3 Sep 2016 23:57:17 +0000 (23:57 +0000)]
Implement a generic bhnd(4) device enumeration table API.

This defines a new bhnd_erom_if API, providing a common interface to device
enumeration on siba(4) and bcma(4) devices, for use both in the bhndb bridge
and SoC early boot contexts, and migrates mips/broadcom over to the new API.

This also replaces the previous adhoc device enumeration support implemented
for mips/broadcom.

Migration of bhndb to the new API will be implemented in a follow-up commit.

- Defined new bhnd_erom_if interface for bhnd(4) device enumeration, along
  with bcma(4) and siba(4)-specific implementations.
- Fixed a minor bug in bhndb that logged an error when we attempted to map the
  full siba(4) bus space (18000000-17FFFFFF) in the siba EROM parser.
- Reverted use of the resource's start address as the ChipCommon enum_addr in
  bhnd_read_chipid(). When called from bhndb, this address is found within the
  host address space, resulting in an invalid bridged enum_addr.
- Added support for falling back on standard bus_activate_resource() in
  bhnd_bus_generic_activate_resource(), enabling allocation of the bhnd_erom's
  bhnd_resource directly from a nexus-attached bhnd(4) device.
- Removed BHND_BUS_GET_CORE_TABLE(); it has been replaced by the erom API.
- Added support for statically initializing bhnd_erom instances, for use prior
  to malloc availability. The statically allocated buffer size is verified both
  at runtime, and via a compile-time assertion (see BHND_EROM_STATIC_BYTES).
- bhnd_erom classes are registered within a module via a linker set, allowing
  mips/broadcom to probe available EROM parser instances without creating a
  strong reference to bcma/siba-specific symbols.
- Migrated mips/broadcom to bhnd_erom_if, replacing the previous MIPS-specific
  device enumeration implementation.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7748

8 years agoThe bug:
Andrey A. Chernov [Sat, 3 Sep 2016 23:04:56 +0000 (23:04 +0000)]
The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)
MFC after:      3 days

8 years agoRemove redefinitions of some kernel types from mbuf.d.
Mark Johnston [Sat, 3 Sep 2016 20:43:59 +0000 (20:43 +0000)]
Remove redefinitions of some kernel types from mbuf.d.

These override the kernel's definitions and do not match in some cases,
which can break scripts that use these types. With r305055, dtrace is able
to trace fields of struct mbuf's anonymous structs and unions, so there is
no need to redefine types already defined in CTF.

MFC after: 3 days

8 years agoRemove support for idle page zeroing.
Mark Johnston [Sat, 3 Sep 2016 20:38:13 +0000 (20:38 +0000)]
Remove support for idle page zeroing.

Idle page zeroing has been disabled by default on all architectures since
r170816 and has some bugs that make it seemingly unusable. Specifically,
the idle-priority pagezero thread exacerbates contention for the free page
lock, and yields the CPU without releasing it in non-preemptive kernels. The
pagezero thread also does not behave correctly when superpage reservations
are enabled: its target is a function of v_free_count, which includes
reserved-but-free pages, but it is only able to zero pages belonging to the
physical memory allocator.

Reviewed by: alc, imp, kib
Differential Revision: https://reviews.freebsd.org/D7714

8 years agoWith clang 3.9.0, compiling cxgb results in the following warning:
Dimitry Andric [Sat, 3 Sep 2016 19:01:11 +0000 (19:01 +0000)]
With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by: np
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7772

8 years agoUse correct CTR<n> variant.
Navdeep Parhar [Sat, 3 Sep 2016 18:54:26 +0000 (18:54 +0000)]
Use correct CTR<n> variant.

8 years agoUpdate contrib/netbsd-tests with new content from NetBSD
Enji Cooper [Sat, 3 Sep 2016 18:11:48 +0000 (18:11 +0000)]
Update contrib/netbsd-tests with new content from NetBSD

This updates the snapshot from 09/30/2014 to 08/11/2016

This brings in a number of new testcases from upstream, most
notably:

- bin/cat
- lib/libc
- lib/msun
- lib/libthr
- usr.bin/sort

lib/libc/tests/stdio/open_memstream_test.c was moved to
lib/libc/tests/stdio/open_memstream2_test.c to accomodate
the new open_memstream test from NetBSD.

MFC after: 2 months
Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
Sponsored by: EMC / Isilon Storage Division

8 years agoSkip testcases 9/10 if jail(8) isn't installed
Enji Cooper [Sat, 3 Sep 2016 17:59:46 +0000 (17:59 +0000)]
Skip testcases 9/10 if jail(8) isn't installed

These testcases require jail support

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd a missing "Bail out!" if zpool create fails
Enji Cooper [Sat, 3 Sep 2016 17:31:13 +0000 (17:31 +0000)]
Add a missing "Bail out!" if zpool create fails

This will make the exit info more meaningful if/when zpool create fails,
and establishes parity with the other 2 zfs acl testcases (01, 03).

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agoExplicitly include all .rodata.* sections in the kernel .rodata. This
Andrew Turner [Sat, 3 Sep 2016 17:23:24 +0000 (17:23 +0000)]
Explicitly include all .rodata.* sections in the kernel .rodata. This
helps link the kernel with lld as it will then put all these into a single
.rodata section.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

8 years agoUse the root key in the Security ID EFUSE (when valid) to generate a
Jared McNeill [Sat, 3 Sep 2016 15:28:09 +0000 (15:28 +0000)]
Use the root key in the Security ID EFUSE (when valid) to generate a
MAC address instead of creating a random one each boot.

8 years agoDon't use -N to set the OMAGIC with data and text writeable and data
Warner Losh [Sat, 3 Sep 2016 15:26:28 +0000 (15:26 +0000)]
Don't use -N to set the OMAGIC with data and text writeable and data
not page aligned. To do this, use the ld script gnu ld installs on my
system.

This is imperfect: LDFLAGS_BIN and LD_FLAGS_BIN describe different
things. The loader script could be better named and take into account
other architectures. And having two different mechanisms to do
basically the same thing needs study. However, it's blocking forward
progress on lld, so I'll work in parallel to sort these out.

Differential Revision: https://reviews.freebsd.org/D7409
Reviewed by: emaste

8 years agoAdd support for Allwinner A64 thermal sensors.
Jared McNeill [Sat, 3 Sep 2016 15:26:00 +0000 (15:26 +0000)]
Add support for Allwinner A64 thermal sensors.

8 years agoAdd cpu-supply xref to cpu@0
Jared McNeill [Sat, 3 Sep 2016 15:24:30 +0000 (15:24 +0000)]
Add cpu-supply xref to cpu@0

8 years agoAdd SID, THS, and CPU operating points.
Jared McNeill [Sat, 3 Sep 2016 15:23:59 +0000 (15:23 +0000)]
Add SID, THS, and CPU operating points.

8 years agoAdd support for reading root key on A83T/A64.
Jared McNeill [Sat, 3 Sep 2016 15:22:50 +0000 (15:22 +0000)]
Add support for reading root key on A83T/A64.

8 years agoimport unbound 1.5.9
Dag-Erling Smørgrav [Sat, 3 Sep 2016 15:08:13 +0000 (15:08 +0000)]
import unbound 1.5.9

8 years agoWith clang 3.9.0, compiling ppbus(4) results in the following warnings:
Dimitry Andric [Sat, 3 Sep 2016 13:48:44 +0000 (13:48 +0000)]
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
        if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
                     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
                if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
                    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
                                        nACK | SELECT | PERROR | nBUSY)) {
                                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7771

8 years agoDefine drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
Dimitry Andric [Sat, 3 Sep 2016 13:33:28 +0000 (13:33 +0000)]
Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by: dumbbell
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7770

8 years agoremove CONSTRUCTORS from MIPS uboot linker script
Ed Maste [Sat, 3 Sep 2016 13:01:37 +0000 (13:01 +0000)]
remove CONSTRUCTORS from MIPS uboot linker script

The linker script CONSTRUCTORS keyword is only meaningful "when linking
object file formats which do not support arbitrary sections, such as
ECOFF and XCOFF"[1] and is ignored for other object file formats.

LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove
CONSTRUCTORS from the linker script as it has no effect.

[1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html

8 years agoMissed FreeBSD-specific piece of r305338.
Alexander Motin [Sat, 3 Sep 2016 11:17:33 +0000 (11:17 +0000)]
Missed FreeBSD-specific piece of r305338.

8 years agoMFC r305337: 7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object
Alexander Motin [Sat, 3 Sep 2016 11:00:29 +0000 (11:00 +0000)]
MFC r305337: 7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object

Using a benchmark which has 32 threads creating 2 million files in the
same directory, on a machine with 16 CPU cores, I observed poor
performance. I noticed that dmu_tx_hold_zap() was using about 30% of
all CPU, and doing dnode_hold() 7 times on the same object (the ZAP
object that is being held).

dmu_tx_hold_zap() keeps a hold on the dnode_t the entire time it is
running, in dmu_tx_hold_t:txh_dnode, so it would be nice to use the
dnode_t that we already have in hand, rather than repeatedly calling
dnode_hold(). To do this, we need to pass the dnode_t down through
all the intermediate calls that dmu_tx_hold_zap() makes, making these
routines take the dnode_t* rather than an objset_t* and a uint64_t
object number. In particular, the following routines will need to have
analogous *_by_dnode() variants created:

dmu_buf_hold_noread()
dmu_buf_hold()
zap_lookup()
zap_lookup_norm()
zap_count_write()
zap_lockdir()
zap_count_write()

This can improve performance on the benchmark described above by 100%,
from 30,000 file creations per second to 60,000. (This improvement is on
top of that provided by working around the object allocation issue. Peak
performance of ~90,000 creations per second was observed with 8 CPUs;
adding CPUs past that decreased performance due to lock contention.) The
CPU used by dmu_tx_hold_zap() was reduced by 88%, from 340 CPU-seconds
to 40 CPU-seconds.

Sponsored by: Intel Corp.

Closes #109

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@d3e523d489a169ab36f9ec1b2a111a60a5563a9f

8 years agoMFV r305336: 7247 zfs receive of deduplicated stream fails
Alexander Motin [Sat, 3 Sep 2016 10:59:05 +0000 (10:59 +0000)]
MFV r305336: 7247 zfs receive of deduplicated stream fails

This resolves two 'zfs recv' issues. First, when receiving into an
existing filesystem, a snapshot created during the receive process is
not added to the guid->dataset map for the stream, resulting in failed
lookups for deduped streams when a WRITE_BYREF record refers to a
snapshot received earlier in the stream. Second, the newly created
snapshot was also not set properly, referencing the snapshot before the
new receiving dataset rather than the existing filesystem.

Closes #159

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Author: Chris Williamson <chris.williamson@delphix.com>

openzfs/openzfs@b09697c8c18be68abfe538de9809938239402ae8

8 years agoMFV r305335: 7003 zap_lockdir() should tag hold
Alexander Motin [Sat, 3 Sep 2016 10:58:14 +0000 (10:58 +0000)]
MFV r305335: 7003 zap_lockdir() should tag hold

zap_lockdir() / zap_unlockdir() should take a "void *tag" argument which
tags the hold on the zap. This will help diagnose programming errors
which misuse the hold on the ZAP.

Sponsored by: Intel Corp.

Closes #108

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@0780b3eab5a2c13e04328b39ecd2a6d0d3c4f7cb

8 years ago7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object
Alexander Motin [Sat, 3 Sep 2016 10:54:56 +0000 (10:54 +0000)]
7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object

Using a benchmark which has 32 threads creating 2 million files in the
same directory, on a machine with 16 CPU cores, I observed poor
performance. I noticed that dmu_tx_hold_zap() was using about 30% of
all CPU, and doing dnode_hold() 7 times on the same object (the ZAP
object that is being held).

dmu_tx_hold_zap() keeps a hold on the dnode_t the entire time it is
running, in dmu_tx_hold_t:txh_dnode, so it would be nice to use the
dnode_t that we already have in hand, rather than repeatedly calling
dnode_hold(). To do this, we need to pass the dnode_t down through
all the intermediate calls that dmu_tx_hold_zap() makes, making these
routines take the dnode_t* rather than an objset_t* and a uint64_t
object number. In particular, the following routines will need to have
analogous *_by_dnode() variants created:

dmu_buf_hold_noread()
dmu_buf_hold()
zap_lookup()
zap_lookup_norm()
zap_count_write()
zap_lockdir()
zap_count_write()

This can improve performance on the benchmark described above by 100%,
from 30,000 file creations per second to 60,000. (This improvement is on
top of that provided by working around the object allocation issue. Peak
performance of ~90,000 creations per second was observed with 8 CPUs;
adding CPUs past that decreased performance due to lock contention.) The
CPU used by dmu_tx_hold_zap() was reduced by 88%, from 340 CPU-seconds
to 40 CPU-seconds.

Sponsored by: Intel Corp.

Closes #109

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@d3e523d489a169ab36f9ec1b2a111a60a5563a9f

8 years ago7247 zfs receive of deduplicated stream fails
Alexander Motin [Sat, 3 Sep 2016 10:50:43 +0000 (10:50 +0000)]
7247 zfs receive of deduplicated stream fails

This resolves two 'zfs recv' issues. First, when receiving into an
existing filesystem, a snapshot created during the receive process is
not added to the guid->dataset map for the stream, resulting in failed
lookups for deduped streams when a WRITE_BYREF record refers to a
snapshot received earlier in the stream. Second, the newly created
snapshot was also not set properly, referencing the snapshot before the
new receiving dataset rather than the existing filesystem.

Closes #159

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Author: Chris Williamson <chris.williamson@delphix.com>

openzfs/openzfs@b09697c8c18be68abfe538de9809938239402ae8

8 years ago7003 zap_lockdir() should tag hold
Alexander Motin [Sat, 3 Sep 2016 10:48:48 +0000 (10:48 +0000)]
7003 zap_lockdir() should tag hold

zap_lockdir() / zap_unlockdir() should take a "void *tag" argument which
tags the hold on the zap. This will help diagnose programming errors
which misuse the hold on the ZAP.

Sponsored by: Intel Corp.

Closes #108

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@0780b3eab5a2c13e04328b39ecd2a6d0d3c4f7cb

8 years agoMFV r304157:
Alexander Motin [Sat, 3 Sep 2016 10:10:58 +0000 (10:10 +0000)]
MFV r304157:
7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and END records

illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa
https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5f
e1d9cfa

https://www.illumos.org/issues/7230
  A test failure occurred where a send stream had only a BEGIN record. This
  should not be possible if the send returns without error. Prevented this from
  happening in the future by adding an assertion to dmu_send_impl() to verify
  that if the function returns 0 (success) both a BEGIN and END record are
  present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN o
r
  END records sent), having dump_record() set flags appropriately, adding VERIFY
  statement to dmu_send_impl().

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matt Krantz <matt.krantz@delphix.com>

8 years agoMFV r304156: 7235 remove unused func dsl_dataset_set_blkptr
Alexander Motin [Sat, 3 Sep 2016 10:09:23 +0000 (10:09 +0000)]
MFV r304156: 7235 remove unused func dsl_dataset_set_blkptr

illumos/illumos-gate@bd56f80007857b960e0981ed0797ad8ec844a96b
https://github.com/illumos/illumos-gate/commit/bd56f80007857b960e0981ed0797ad8ec
844a96b

https://www.illumos.org/issues/7235
  The function dsl_dataset_set_blkptr() is unused. We should remove it.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r304159: 7277 zdb should be able to print zfs_dbgmsg's
Alexander Motin [Sat, 3 Sep 2016 10:07:46 +0000 (10:07 +0000)]
MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's

illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b
https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f
57a223b

https://www.illumos.org/issues/7277
  ztest always prints the debug messages (zfs_dbgmsg()) by calling
  zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well
  before exiting.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

8 years agoMFV r304155: 7090 zfs should improve allocation order and throttle allocations
Alexander Motin [Sat, 3 Sep 2016 10:04:37 +0000 (10:04 +0000)]
MFV r304155: 7090 zfs should improve allocation order and throttle allocations

illumos/illumos-gate@0f7643c7376dd69a08acbfc9d1d7d548b10c846a
https://github.com/illumos/illumos-gate/commit/0f7643c7376dd69a08acbfc9d1d7d548b
10c846a

https://www.illumos.org/issues/7090
  When write I/Os are issued, they are issued in block order but the ZIO pipelin
e
  will drive them asynchronously through the allocation stage which can result i
n
  blocks being allocated out-of-order. It would be nice to preserve as much of
  the logical order as possible.
  In addition, the allocations are equally scattered across all top-level VDEVs
  but not all top-level VDEVs are created equally. The pipeline should be able t
o
  detect devices that are more capable of handling allocations and should
  allocate more blocks to those devices. This allows for dynamic allocation
  distribution when devices are imbalanced as fuller devices will tend to be
  slower than empty devices.
  The change includes a new pool-wide allocation queue which would throttle and
  order allocations in the ZIO pipeline. The queue would be ordered by issued
  time and offset and would provide an initial amount of allocation of work to
  each top-level vdev. The allocation logic utilizes a reservation system to
  reserve allocations that will be performed by the allocator. Once an allocatio
n
  is successfully completed it's scheduled on a given top-level vdev. Each top-
  level vdev maintains a maximum number of allocations that it can handle
  (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels *
  mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab
  groups and round robin across all eligible metaslab groups to distribute the
  work. As top-levels complete their work, they receive additional work from the
  pool-wide allocation queue until the allocation queue is emptied.

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

8 years agoMFV r303081: 7163 ztest failures due to excess error injection
Alexander Motin [Sat, 3 Sep 2016 08:48:51 +0000 (08:48 +0000)]
MFV r303081: 7163 ztest failures due to excess error injection

illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c
3101155

https://www.illumos.org/issues/7163
  Running zloop from zfs-precommit hit this assertion:
       *panicstr/s
  0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240,
  thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
  1827
       $c
  libc.so.1`_lwp_kill+0xa()
  libc.so.1`_assfail+0x182(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libc.so.1`assfail+0x19(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libzpool.so.1`dbuf_dirty+0xc69(10e3bc103601700)
  libzpool.so.1`dbuf_dirty+0x61e(10c736403601700)
  libzpool.so.1`dbuf_dirty+0x61e(10e282803601700)
  libzpool.so.1`dmu_buf_will_fill+0x64(10e282803601700)
  libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40,
  3601700)
  ztest_replay_write+0x568(4950d0, 3717a80, 0)
  ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000)
  ztest_io+0x1bb(4950d0, d, 400000002e000000)
  ztest_dmu_write_parallel+0xaa(4950d0, 6)
  ztest_execute+0x83(1, 420c98, 6)
  ztest_thread+0xf4(6)
  libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240)
  libc.so.1`_lwp_start()
  This is another manifestation of ECKSUM in ztest:
  The lowest level ancestor that’s in memory is the L8 (topmost). The L7
  ancestor is blkid 0x10:
       ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
  addr object lvl blkid holds os
  600be50 d 7 4 1 ztest/ds_6
  719d880 d 7 0 4 ztest/ds_6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r303080: 6451 ztest fails due to checksum errors
Alexander Motin [Sat, 3 Sep 2016 08:47:46 +0000 (08:47 +0000)]
MFV r303080: 6451 ztest fails due to checksum errors

illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d
a3cb7e7

https://www.illumos.org/issues/6451
  Sometimes ztest fails because zdb detects checksum errors. e.g.:
  Traversing all blocks to verify checksums and verify nothing leaked ...
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000:
  180000> [L0 other uint64[]] sha256 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=271L/271P fill=1
  cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf --
  skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800:
  180000> [L0 other uint64[]] sha256 uncompressed LE contigu
  ous unique single size=100000L/100000P birth=840L/840P fill=1
  cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75
  -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400:
  180000> [L0 other uint64[]] sha256 uncompressed LE conti
  guous unique single size=100000L/100000P birth=904L/904P fill=1
  cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d
  ba -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400:
  180000> [L0 other uint64[]] sha256 uncompressed LE cont
  iguous dedup single size=100000L/100000P birth=549L/549P fill=1
  cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb
  58 -- skipping
  zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000>
  [L0 other uint64[]] fletcher4 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50:
  29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin
  g
  The problem is that ztest_fault_inject() can inject multiple faults into the
  same block. It is designed such that it can inject errors on all leafs of a
  RAID-Z or mirror, but for a given range of offsets, it will only inject errors

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r303079:
Alexander Motin [Sat, 3 Sep 2016 08:46:53 +0000 (08:46 +0000)]
MFV r303079:
7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion

illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3
https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d
73a51e3

https://www.illumos.org/issues/7147
  Here's the dbuf we're currently reading:
       966f200::dbuf
  addr object lvl blkid holds os
  966f200 4 0 0 1 ztest/ds_3
       966f200::print dmu_buf_t db_data
  db_data = 0x9ae0400
       0x9ae0400/10J
  0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d
  The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to
  read the block on disk we find that it has matches what ztest_ddt_repair()
  would have written:
       ~c1c7ced932020d=J
  ff3e383126cdfdf2
       966f200::print dmu_buf_impl_t db_blkptr | ::blkptr
  DVA0=<0:71d3c00:800>
  [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single
  size=400L/400P birth=55L/55P fill=1
  cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0
     1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head
        Found vdev type: mirror
  0:71d3c00:800
  0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
  000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

8 years agoMFV r303078:
Alexander Motin [Sat, 3 Sep 2016 08:43:43 +0000 (08:43 +0000)]
MFV r303078:
7086 ztest attempts dva_get_dsize_sync on an embedded blockpointer

illumos/illumos-gate@926549256b71acd595f69b236779ff6b78fa08ef
https://github.com/illumos/illumos-gate/commit/926549256b71acd595f69b236779ff6b7
8fa08ef

https://www.illumos.org/issues/7086
  In dbuf_dirty(), we need to grab the dn_struct_rwlock before looking at the
  db_blkptr, to prevent it from being changed by syncing context.
  Otherwise we may see that ztest got a segfault from this stack:
  libzpool.so.1`dva_get_dsize_sync+0x98(872f000b32b240fed7811b, 0, b4cda20,
0)
  libzpool.so.1`bp_get_dsize+0x60(872f000b32b240, 0, 97cb7809d4c1a8, 0)
  libzpool.so.1`dbuf_dirty+0x9b3(ce0a10097cb780, 9, fecd2530)
  libzpool.so.1`dmu_buf_will_dirty+0xc3(ce0a10097cb780ea293d6c, 1)
  libzpool.so.1`zap_lockdir+0x1a0(8aaa3c0, 1, 0, 97cb780, 1, 1)
  libzpool.so.1`zap_remove_norm+0x30(8aaa3c0, 1, 0, 8728b10, 0, 97cb780)
  libzpool.so.1`zap_remove+0x29(8aaa3c0, 1, 0, 8728b1097cb780, a)
  ztest_replay_remove+0x225(ea2945888728ae8, 0, 38010000, 0, 0)
  ztest_remove+0x9f(ea294588ea293f50, 4, 3)
  ztest_object_init+0x78(ea294588ea293f50, 4e0, 1)
  ztest_dmu_object_alloc_free+0x71(ea294588, 13)
  ztest_dmu_objset_create_destroy+0x224(80cef08, 13, 0, 805d36c9017ad44, 0)
  ztest_execute+0x89(a, 807c720, 13, 0)
  ztest_thread+0xea(13, 0, 0, 0)
  libc.so.1`_thrp_setup+0x88(f0983240)
  libc.so.1`_lwp_start(f0983240, 0, 0, 0, 0, 0)
  Looking into it a bit, we see that this is an embedded blockpointer, so
  BP_GET_NDVAS should have returned 0:
       b32b240::blkptr
  EMBEDDED [L0 ZAP_OTHER] et=0 LZ4 size=200L/4aP birth=80L
  Instead, it looks like another thread is modifying this blockpointer:
       b32b240::ugrep | ::whatis
  f47a0e0c is in [ stack tid=0x19f ]
  ebd6ec40 is in [ stack tid=0x226 ]
  ea293bd0 is in [ stack tid=0x244 ]
  ea293be4 is in [ stack tid=0x244 ]

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r303077:
Alexander Motin [Sat, 3 Sep 2016 08:42:12 +0000 (08:42 +0000)]
MFV r303077:
7072 zfs fails to expand if lun added when os is in shutdown state

illumos/illumos-gate@c39a2aae1e2c439d156021edfc20910dad7f9891
https://github.com/illumos/illumos-gate/commit/c39a2aae1e2c439d156021edfc20910dad7f9891

https://www.illumos.org/issues/7072
  upstream:
  38733 zfs fails to expand if lun added when os is in shutdown state
  DLPX-36910 spares and caches should not display expandable space
  DLPX-39262 vdev_disk_open spam zfs_dbgmsg buffer

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>

8 years agoMFV r302991: 6950 ARC should cache compressed data
Alexander Motin [Sat, 3 Sep 2016 08:30:51 +0000 (08:30 +0000)]
MFV r302991: 6950 ARC should cache compressed data

illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2

https://www.illumos.org/issues/6950
  When reading compressed data from disk, the ARC should keep the compressed
  block cached and only decompress it when consumers access the block. The
  uncompressed data should be short-lived allowing the ARC to cache a much larger
  amount of data. The DMU would also maintain a smaller cache of uncompressed
  blocks to minimize the impact of decompressing frequently accessed blocks.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>

8 years agoReturn a NULL pointer (0 vm_offset) on error in map_dcsr().
Justin Hibbits [Sat, 3 Sep 2016 04:21:40 +0000 (04:21 +0000)]
Return a NULL pointer (0 vm_offset) on error in map_dcsr().

mpc85xx_map_dcsr() returns a vm_offset_t, not an error code.  Follow-up to
r304069.

8 years agoUse the right ifdef macro.
Justin Hibbits [Sat, 3 Sep 2016 04:09:03 +0000 (04:09 +0000)]
Use the right ifdef macro.

"E500" is not defined, but "BOOKE_E500" is.  Without this the idle hook cannot
be called.

MFC after: 1 week

8 years agoAs an optimization to the machine-independent layer, change the machine-
Alan Cox [Sat, 3 Sep 2016 03:14:24 +0000 (03:14 +0000)]
As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.

MFC after: 3 weeks

8 years agoHandle missed mergeinfo by merging r305031 (the missing revision
Enji Cooper [Sat, 3 Sep 2016 02:51:46 +0000 (02:51 +0000)]
Handle missed mergeinfo by merging r305031 (the missing revision
according to svn merge)

8 years agoMFhead @ r305314
Enji Cooper [Sat, 3 Sep 2016 00:50:18 +0000 (00:50 +0000)]
MFhead @ r305314

8 years agoDon't dedupe signals less than SIGRTMIN
Enji Cooper [Sat, 3 Sep 2016 00:47:54 +0000 (00:47 +0000)]
Don't dedupe signals less than SIGRTMIN

FreeBSD always delivers all signals sent with sigqueue, except when
dealing with low memory conditions according to kib (see
bug # 212173 comment # 5).

In collaboration with: kib
PR: 212173
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd cpuset support to separate forked processes.
George V. Neville-Neil [Sat, 3 Sep 2016 00:22:42 +0000 (00:22 +0000)]
Add cpuset support to separate forked processes.

Reviewed by: cem
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7766

8 years agoAdd a runner script for cryptotest.
George V. Neville-Neil [Fri, 2 Sep 2016 21:35:32 +0000 (21:35 +0000)]
Add a runner script for cryptotest.

Althought cryptotest itself has a -z mode to test all algorithms at a variety
of sizes, this script allows us to be more selective.  Threads and buffer sizes
move in powers of two from 1, for threads, and 256 for buffer sizes.

e.g.  cryptorun.sh aes 4 512

Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes.

Sponsored by: Rubicon Communications, LLC (Netgate)

8 years agodhclient: add support for interface-mtu (26)
Conrad Meyer [Fri, 2 Sep 2016 21:14:29 +0000 (21:14 +0000)]
dhclient: add support for interface-mtu (26)

Make dhclient set interface MTU if it was provided.

This version implements MTU setting in dhclient itself before it runs
dhclient-script.

PR: 206721
Submitted by: novel@
Reported by: Jarrod Petz <jlpetz at gmail.com>
Reviewed by: cem, allanjude
Differential Revision: https://reviews.freebsd.org/D5675

8 years agosh: Add some tests for non-standard features of the echo builtin.
Jilles Tjoelker [Fri, 2 Sep 2016 21:13:46 +0000 (21:13 +0000)]
sh: Add some tests for non-standard features of the echo builtin.

MFC after: 1 week

8 years agoClean up the usage message and remove dead code.
George V. Neville-Neil [Fri, 2 Sep 2016 21:11:37 +0000 (21:11 +0000)]
Clean up the usage message and remove dead code.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7765

8 years agoDIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.
Bryan Drewery [Fri, 2 Sep 2016 20:41:43 +0000 (20:41 +0000)]
DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoRenaming libifc to libifconfig in response to feedback on initial commit of
Kristof Provost [Fri, 2 Sep 2016 18:33:08 +0000 (18:33 +0000)]
Renaming libifc to libifconfig in response to feedback on initial commit of
this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix)
should reduce chances of namespace collisions, make it more clear what the
library does, and be more in line with existing libraries.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D7742
Reviewed by: cem, kp

8 years agoWhen -n is specified, don't make bogus DNS queries. Instead,
Hajimu UMEMOTO [Fri, 2 Sep 2016 18:28:14 +0000 (18:28 +0000)]
When -n is specified, don't make bogus DNS queries.  Instead,
when -n is specified more than once, hostnames stored in utmp
are attempted to resolve to display them as network addresses.

PR: 212272

8 years agoMerge from CheriBSD:
Brooks Davis [Fri, 2 Sep 2016 18:22:56 +0000 (18:22 +0000)]
Merge from CheriBSD:

Rename sigprop-table constants to SIGPROP_ from SA_ to reduce the
impression of a namespace collision.

Submitted by: rwatson
Reviewed by: jhb, kib (slightly different versions)
Obtained from: CheriBSD (814ec5771cb1cb53deba317c561de62a91ae7684)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7616

8 years agoAdd a pc_clock pcpu field and use it to implement cpu_est_clockrate. This
Andrew Turner [Fri, 2 Sep 2016 10:13:51 +0000 (10:13 +0000)]
Add a pc_clock pcpu field and use it to implement cpu_est_clockrate. This
will allow drivers that manage the clock frequency to communicate this with
the reset of the kernel.

Reported by: jmcneill
MFC after: 1 week
Sponsored by: ABT Systems Ltd

8 years agoFix array size issue when using the pre-scaling feature for
Hans Petter Selasky [Fri, 2 Sep 2016 08:44:14 +0000 (08:44 +0000)]
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

MFC after: 1 week

8 years agoSkip :test_large on i386
Enji Cooper [Fri, 2 Sep 2016 08:17:43 +0000 (08:17 +0000)]
Skip :test_large on i386

More assertions are failing on ^/head now.

PR: 205446
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't expect :fmod to fail on FreeBSD
Enji Cooper [Fri, 2 Sep 2016 06:55:32 +0000 (06:55 +0000)]
Don't expect :fmod to fail on FreeBSD

Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/ic: Cleanup timesync channel callback.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:23:28 +0000 (06:23 +0000)]
hyperv/ic: Cleanup timesync channel callback.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7745

8 years agohyperv/ic: Cleanup shutdown channel callback.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:15:30 +0000 (06:15 +0000)]
hyperv/ic: Cleanup shutdown channel callback.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7744

8 years agohyperv/ic: Minor style fix.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:08:08 +0000 (06:08 +0000)]
hyperv/ic: Minor style fix.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7743

8 years agonet/rndis: Define common message header for RNDIS messages.
Sepherosa Ziehau [Fri, 2 Sep 2016 05:57:13 +0000 (05:57 +0000)]
net/rndis: Define common message header for RNDIS messages.

And avoid RNDIS_HEADER_OFFSET hardcoding.

Reviewed by: hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7739

8 years agonet/rndis: Add comment for rndis_comp_hdr
Sepherosa Ziehau [Fri, 2 Sep 2016 05:49:38 +0000 (05:49 +0000)]
net/rndis: Add comment for rndis_comp_hdr

Reviewed by: hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7738

8 years agohyperv/hn: Use the per-packet-info types defined by net/rndis.h
Sepherosa Ziehau [Fri, 2 Sep 2016 05:30:38 +0000 (05:30 +0000)]
hyperv/hn: Use the per-packet-info types defined by net/rndis.h

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7737

8 years agohyperv/hn: Simplify RX hash related bits.
Sepherosa Ziehau [Fri, 2 Sep 2016 03:19:55 +0000 (03:19 +0000)]
hyperv/hn: Simplify RX hash related bits.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7736

8 years agocron: use existing maximum username constant MAXLOGNAME
Ed Maste [Fri, 2 Sep 2016 03:15:54 +0000 (03:15 +0000)]
cron: use existing maximum username constant MAXLOGNAME

Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR: 212305
Reported by: Andrii Kuzik
Reviewed by: allanjude, jilles
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7747

8 years agohyperv/hn: Rework RXCSUM related bits
Sepherosa Ziehau [Fri, 2 Sep 2016 03:10:30 +0000 (03:10 +0000)]
hyperv/hn: Rework RXCSUM related bits

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7735

8 years agoRevert r304192 to fix short month names and replace %b with %_m in date_fmt
Kevin Lo [Fri, 2 Sep 2016 00:43:03 +0000 (00:43 +0000)]
Revert r304192 to fix short month names and replace %b with %_m in date_fmt
for Chinese locales.

As mentioned in the commit message of r289041, nl_langinfo(ABMON_*) only
returned numbers when using a Chinese locale, this causes problems in
applications that put the short month name and the day of the month together.

Spotted by: Ting-Wei Lan <lantw44 gmail com>

8 years agoReplace %m with %_m in date_fmt for Chinese locales.
Kevin Lo [Fri, 2 Sep 2016 00:27:27 +0000 (00:27 +0000)]
Replace %m with %_m in date_fmt for Chinese locales.
This is a fix for the problem mentioned in the PR.

PR: 199441

8 years agocxgbe/cxgbei: Provide a knob to set the DDP threshold for iSCSI
Navdeep Parhar [Fri, 2 Sep 2016 00:21:24 +0000 (00:21 +0000)]
cxgbe/cxgbei: Provide a knob to set the DDP threshold for iSCSI
transfers.

The Initiator and Target both perform zero copy receive for transfers
greater than or equal to this threshold.

Sponsored by: Chelsio Communications

8 years agoInitialize lists of signals using C99 designators
Brooks Davis [Fri, 2 Sep 2016 00:16:19 +0000 (00:16 +0000)]
Initialize lists of signals using C99 designators

Reviewed by: jilles
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7601

8 years agocxgbe/cxgbei: Count various events related to iSCSI operation and make
Navdeep Parhar [Thu, 1 Sep 2016 23:58:36 +0000 (23:58 +0000)]
cxgbe/cxgbei: Count various events related to iSCSI operation and make
these counters available in the sysctl MIB.

Sponsored by: Chelsio Communications

8 years agoioat(4): Despam relatively common hardware reset messages
Conrad Meyer [Thu, 1 Sep 2016 23:56:02 +0000 (23:56 +0000)]
ioat(4): Despam relatively common hardware reset messages

Reported by: ngie@

8 years agoDIRDEPS_BUILD: Build crunchide for the host.
Bryan Drewery [Thu, 1 Sep 2016 23:52:25 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Build crunchide for the host.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Include crunched object meta files for gendirdeps.
Bryan Drewery [Thu, 1 Sep 2016 23:52:20 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Include crunched object meta files for gendirdeps.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoBump __FreeBSD_version for crunchgen META_MODE fix in r305254.
Bryan Drewery [Thu, 1 Sep 2016 23:22:31 +0000 (23:22 +0000)]
Bump __FreeBSD_version for crunchgen META_MODE fix in r305254.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen binaries.
Bryan Drewery [Thu, 1 Sep 2016 23:21:12 +0000 (23:21 +0000)]
DIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen binaries.

This was an incomplete item from r291561.  The host {clang,llvm}-tblgen
binaries were used, rather than the ones built into the host stagedir by
normal Makefile.depend dependencies on tblgen.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.
Bryan Drewery [Thu, 1 Sep 2016 23:21:08 +0000 (23:21 +0000)]
META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.

- DIRDEPS_BUILD: Fix crunchgen builds losing their library dependencies
  on a nop-rebuild.
- META_MODE: Fix not rebuilding various crunch.mk targets if their .meta
  files warrant a rebuild.  They were lacking .meta files previously.
  This adds .NOMETA to the crunch objects being used since they are
  already built.  Bmake was forcing a rebuild on them since their
  .meta files were not in the expected place; there is no reason to
  rebuild them.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Don't expect .meta files for side-effect generated files.
Bryan Drewery [Thu, 1 Sep 2016 23:20:54 +0000 (23:20 +0000)]
META_MODE: Don't expect .meta files for side-effect generated files.

This is similar to r301285.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agocxgbe/cxgbei: Minor changes in the iSCSI CPL handlers.
Navdeep Parhar [Thu, 1 Sep 2016 22:40:55 +0000 (22:40 +0000)]
cxgbe/cxgbei: Minor changes in the iSCSI CPL handlers.

- Use m_copydata instead of bcopy.
- Add new assertions.
- Log some more information.

Sponsored by: Chelsio Communications

8 years agoRemove warning about pci_addr_t being different sizes.
John Baldwin [Thu, 1 Sep 2016 21:30:12 +0000 (21:30 +0000)]
Remove warning about pci_addr_t being different sizes.

pci_addr_t has always been 64-bits since r163805.

MFC after: 1 week

8 years agoAdd support for changing A23 PLL1 frequency.
Jared McNeill [Thu, 1 Sep 2016 21:20:07 +0000 (21:20 +0000)]
Add support for changing A23 PLL1 frequency.

8 years agoAdd support for setting DCDC2 voltage.
Jared McNeill [Thu, 1 Sep 2016 21:19:11 +0000 (21:19 +0000)]
Add support for setting DCDC2 voltage.