Commit Graph

203981 Commits

Author SHA1 Message Date
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Bryan Drewery
170caa9d93 Add missing SVN keywords.
Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:25:19 +00:00
Alexander Motin
5d4dfee032 Constify ctl_serialize_table. 2015-09-25 18:49:25 +00:00
Conrad Meyer
2f1c4e0ebf sbuf: Process more than one char at a time
Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and
fixup callers.

Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly
changes to some callers.

Reviewed by:	jhb, markj
Obtained from:	Dan Sledz
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3717
2015-09-25 18:37:14 +00:00
Alexander Motin
c30a4c1871 Remove some dead code found by Clang analyzer. 2015-09-25 18:15:34 +00:00
Alexander Motin
67cc546dfc Remove stale comments and some excessive empty lines. 2015-09-25 16:34:59 +00:00
Bryan Drewery
14bb2c3003 The bsd.progs.mk -> bsd.prog.mk rework did not pan out yet.
It may still in the future but for now unmark this deprecated.  bsd.progs.mk
is less bad after r288158.
2015-09-25 16:27:11 +00:00
Bryan Drewery
66788feea0 PROGS: Let the parent run the children in parallel.
This seems to work fine.

MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-25 15:57:00 +00:00
Michael Gmelin
034fb271ae Fix non-POSIX-compliant use of getaddrinfo in libfetch
Submitted by:	Boris Kolpackov <boris@codesynthesis.com>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3724
2015-09-25 14:24:23 +00:00
Konstantin Belousov
b2557db607 Use per-cpu values for base and last in tc_cpu_ticks(). The values
are updated lockess, different CPUs write its own view of timecounter
state.  The critical section is done for safety, callers of
tc_cpu_ticks() are supposed to already enter critical section, or to
own a spinlock.

The change fixes sporadical reports of too high values reported for
the (W)CPU on platforms that do not provide cpu ticker and use
tc_cpu_ticks(), in particular, arm*.

Diagnosed and reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-25 13:03:57 +00:00
Alexander Motin
e675024a02 Switch I/O time accounting from system time to uptime.
While there, make num_dmas accounted independently of CTL_TIME_IO.
2015-09-25 10:14:39 +00:00
Alexander Motin
6c068d4bf3 Collect DMA statistics on secondary HA node. 2015-09-25 09:55:51 +00:00
Alexander Motin
116c5818ec Make HA handle datamove and done in a universal way, using port methods.
Now from primary node point of view requests transferred from secondary
node should look almost normal and always have valid port.
2015-09-25 09:14:29 +00:00
Poul-Henning Kamp
ef02f85c38 Fix two cases where "const" were washed off pointers with strchr(3) 2015-09-25 07:37:00 +00:00
Alexander Motin
21d963e528 Remove some control_softc references. 2015-09-25 07:27:23 +00:00
Bryan Drewery
509301d918 META_MODE: Fix staging not respecting _DIR overrides.
This fixes atf-c.h not properly being installed to /usr/include/ (in
the stagedir) via its override of 'INCSDIR_atf-c.h= ${INCLUDEDIR}'.

This fixes building things that depend on atf.

Staging seems to ignore OWN/GRP/MODE settings and needs further exploration.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 05:15:27 +00:00
Josh Paetzel
d7b87b89b7 Fix typo.
Sponsored by:	iXsystems
2015-09-25 03:46:06 +00:00
Ed Maste
0e28ca2eff Add double size 16x32 VGA ROM font
This was created from vgarom-8x16.hex, and should be useful for higher
resolution displays.

Sponsored by:	The FreeBSD Foundation
2015-09-25 02:52:54 +00:00
Xin LI
8012d6910c MFV r288063: make dataset property de-registration operation O(1)
A change to a property on a dataset must be propagated to its descendants
in case that property is inherited. For datasets whose information is
not currently loaded into memory (e.g. a snapshot that isn't currently
mounted), there is nothing to do; the property change will take effect
the next time that dataset is loaded. To handle updates to datasets that
are in-core, ZFS registers a callback entry for each property of each
loaded dataset with the dsl directory that holds that dataset. There
is a dsl directory associated with each live dataset that references
both the live dataset and any snapshots of the live dataset. A property
change is effected by doing a traversal of the tree of dsl directories
for a pool, starting at the directory sourcing the change, and invoking
these callbacks.

The current implementation both registers and de-registers properties
individually for each loaded dataset. While registration for a property is
O(1) (insert into a list), de-registration is O(n) (search list and then
remove). The 'n' for de-registration, however, is not limited to the size
(number of snapshots + 1) of the dsl directory. The eviction portion
of the life cycle for the in core state of datasets is asynchronous,
which allows multiple copies of the dataset information to be in-core
at once. Only one of these copies is active at any time with the rest
going through tear down processing, but all copies contribute to the
cost of performing a dsl_prop_unregister().

One way to create multiple, in-flight copies of dataset information
is by performing "zfs list" operations from multiple threads
concurrently. In-core dataset information is loaded on demand and then
evicted when reference counts drops to zero. For datasets that are not
mounted, there is no persistent reference count to keep them resident.
So, a list operation will load them, compute the information required to
do the list operation, and then evict them. When performing this operation
from multiple threads it is possible that some of the in-core dataset
information will be reused, but also possible to lose the race and load
the dataset again, even while the same information is being torn down.

Compounding the performance issue further is a change made for illumos
issue 5056 which made dataset eviction single threaded. In environments
using automation to manage ZFS datasets, it is now possible to create
enough of a backlog of dataset evictions to consume excessive amounts
of kernel memory and to bog down the system.

The fix employed here is to make property de-registration O(1). With this
change in place, it is hoped that a single thread is more than sufficient
to handle eviction processing. If it isn't, the problem can be solved
by increasing the number of threads devoted to the eviction taskq.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h:
    Associate dsl property callback records with both the
    dsl directory and the dsl dataset that is registering the
    callback. Both connections are protected by the dsl directory's
    "dd_lock".

    When linking callbacks into a dsl directory, group them by
    the property type. This helps reduce the space penalty for the
    double association (the property name pointer is stored once
    per dsl_dir instead of in each record) and reduces the number of
    strcmp() calls required to do callback processing when updating
    a single property. Property types are stored in a linked list
    since currently ZFS registers a maximum of 10 property types
    for each dataset.

    Note that the property buckets/records associated with a dsl
    directory are created on demand, but only freed when the dsl
    directory is freed. Given the static nature of property types
    and their small number, there is no benefit to freeing the few
    bytes of memory used to represent the property record earlier.
    When a property record becomes empty, the dsl directory is either
    going to become unreferenced a little later in this thread of
    execution, or there is a high chance that another dataset is
    going to be loaded that would recreate the bucket anyway.

    Replace dsl_prop_unregister() with dsl_prop_unregister_all().
    All callers of dsl_prop_unregister() are trying to remove
    all property registrations for a given dsl dataset anyway. By
    changing the API, we can avoid doing any lookups of callbacks
    by property type and just traverse the list of all callbacks
    for the dataset and free each one.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c:
    Replace use of dsl_prop_unregister() with the new
    dsl_prop_unregister_all() API.

illumos/illumos-gate@03bad06fbb
    Author: Justin Gibbs <gibbs@scsiguy.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Prakash Surya <prakash.surya@delphix.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Illumos issue:
    6171 dsl_prop_unregister() slows down dataset eviction
    https://www.illumos.org/issues/6171

MFC after:	2 weeks
2015-09-25 01:05:44 +00:00
Ed Maste
2518edf632 Remove EOL whitespace from Makefile.inc1 2015-09-25 00:30:53 +00:00
Bryan Drewery
e05c9e31e9 Don't recurse with cleanobj.
bsd.obj.mk handles the needs fine.  When an objdir exists it will
just rm -Rf the objdir.  When it does not exist though it will
call 'clean' and 'cleandepend', which properly recurse in bsd.progs.mk.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-25 00:07:31 +00:00
Bryan Drewery
8727aeb472 Remove unneeded dependency of '.o: .h' that bsd.prog.mk already handles.
MFC after:	2 weeks
X-MFC-With:	r288198
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:23:58 +00:00
Bryan Drewery
660d1f65bb Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
Bryan Drewery
8ddbefd8a2 Remove unneeded dependency line.
bsd.prog.mk adds 'ktutil-commands.o: ktutil-commands.h' already.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:08:33 +00:00
Ed Maste
453b09caf5 Rename ELFOSABI_SYSV to ELFOSABI_NONE to match current spec
Source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3731
2015-09-24 21:04:48 +00:00
Ed Maste
473c31f158 readelf: Correct typo HPUS -> HPUX
Submitted by:	kib
2015-09-24 18:53:20 +00:00
Hans Petter Selasky
a130076f26 Implement support for reading USB quirks from the kernel environment.
Refer to the usb_quirk(4) manual page for more details on how to use
this new feature.

Submitted by:	Maxime Soule <btik-fbsd@scoubidou.com>
PR:		203249
MFC after:	2 weeks
2015-09-24 17:37:30 +00:00
Bryan Drewery
a00dbfa82b Fix running make in src directories without a Makefile giving confusing errors.
This fixes the following errors:
  make: don't know how to make bsd.README. Stop
  make: don't know how to make auto.obj.mk. Stop

This is easily seen in sys/dev/*.

The new behavior is now the expected output:
  make: no target to make.

This would happen as MAKESYSPATH (.../share/mk) is auto added to the -I list.
Any directory where make is ran in the src tree that has no local Makefile
would then try executing the target in share/mk/Makefile, which by default
was to build the first entry in FILES.  Of course, because bsd.README and
auto.obj.mk are not in the current directory the error is shown.

This check only works for bmake, but I will still MFC it with an extra
'!defined(.PARSEDIR) ||' guard for stable/10.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 17:36:18 +00:00
Adrian Chadd
1ff8129a59 Fix up error path handling after the recent churn.
* Don't free the mbuf in the tx path - it uses the transmit path now,
  so the caller frees the mbuf.
* Don't decrement the node ref upon error - that's up to the caller to
  do as well.

Tested:

* Intel 5300 3x3 wifi, station mode

Noticed by: <s3erios@gmail.com>
2015-09-24 17:23:41 +00:00
Ed Maste
5882166b78 Correct UPDATING entry date 2015-09-24 16:56:44 +00:00
Ed Maste
05117b57a5 Install kernel debug data under /usr/lib/debug
This avoids needing a large boot partition / file system in order to
accommodate multiple kernels, and provides consistency with userland
debug. This also simplifies the process of moving kernel debug files
to a separate package and installing them on demand.

In addition, change kernel debug file extension to .debug, to match
userland debug files.

When using the supported kernel installation method the
/usr/lib/debug/boot/kernel directory will be renamed (to kernel.old)
as is done with /boot/kernel.

Developers wishing to maintain the historical behavior of installing
debug files in /boot/kernel/ can set KERN_DEBUGDIR="" in src.conf(5).

Reviewed by:	bdrewery, brooks, imp, markj
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1006
2015-09-24 16:55:22 +00:00
Alexander Motin
6c2acea564 Allow WRITE SAME with NDOB bit set but without UNMAP.
This combination was originally forbidden, but allowed at spc4r3.
2015-09-24 15:59:08 +00:00
Alexander Motin
4ef0129a46 Add new report types to REPORT LUNS command.
This is only for completeness, since we have nothing new to report there.
2015-09-24 12:22:47 +00:00
Alexander Motin
a6daea64fd Update WRITE ATOMIC(16) support to sbc4r8 draft.
This is only a cosmetic change.  We still don't support atomic boundary
field in the CDB, but at least now we do it formally.
2015-09-24 08:04:47 +00:00
Alexander Motin
de988746be Add support for READ BUFFER(16) command. 2015-09-24 07:16:34 +00:00
Bryan Drewery
64d6acd5e7 Note that LIBADD is only valid in /usr/src.
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 00:22:48 +00:00
Bryan Drewery
fa3423b9a7 Add very basic LIBADD documentation.
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 00:20:34 +00:00
Bryan Drewery
538c8eea82 Document bsd.progs.mk and add more variables overrides.
BINGRP BINMODE BINOWN LINKS MLINKS PROGNAME.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 00:17:00 +00:00
Bryan Drewery
ba7a7c1b82 RELDIR is useful without META_MODE. Always define it.
It is the CURDIR without the SRC base location in it.

Sponsored by:	EMC / Isilon Storage Division
2015-09-23 23:30:57 +00:00
Bryan Drewery
abb02fa2f9 Fix most cases of bsd.progs.mk running duplicate or missing commands.
This mostly fixes an interaction with bsd.test.mk with PROGS and SCRIPTS.
This was most notable with 'make clean' and 'make install', which r281055
and r272055 attempted to address but were inadequate.

It also addresses similar issues in bsd.progs.mk when not using bsd.test.mk.

This also fixes cases of NOT running commands in the parent when using
bsd.progs.mk:
  - 'make clean' was not run for the main process for Makefiles which had both
    FILES and SUBDIR but no PROGS or SCRIPTS.  This usually was just a
    leftover Kyuafile.auto.  One such example is usr.bin/bmake/tests/sysmk/t1/2.
  - 'make obj' was not running in the current directory with bsd.test.mk due
    to early inclusion of bsd.subdir.mk.  This was not really a problem due to
    the SUBDIRS using 'mkdir -p' for their objdirs.

There were subtle bugs causing this wrong behavior:
  1. bsd.progs.mk needs to set SCRIPTS to empty when recursing to avoid
     the sub-makes from installing, cleaning or building the SCRIPTS;
     only the parent make should be doing this.  r281055 effectively did
     the same but wasn't enough.
  2. CLEANFILES may contain (especially from *.test.mk) files which only
     the parent should clean, such as from FILES and SCRIPTS.  To resolve
     sub-makes also cleaning these, reset CLEANFILES and CLEANDIRS in the
     children before including bsd.prog.mk.  A tempting alternative would be
     to only handle CLEANFILES in the parent but then the child bsd.prog.mk
     CLEANFILES of per-PROGS wouldn't be setup.
  3. bsd.subdir.mk was included too soon in bsd.test.mk.  It needs to be
     included after bsd.prog.mk as the SCRIPTS logic is short-circuitted if
     'install:' is already defined (which bsd.subdir.mk does).  There is
     actually no need to include bsd.subdir.mk from bsd.test.mk as bsd.prog.mk
     and bsd.obj.mk will do so in the proper order.  The description in r257095
     covers this for FILES and was fixed differently, though changing the
     handling of target(install) in bsd.prog.mk may make sense after more
     research.
  4. bsd.progs.mk had extra logic to handle recursing SCRIPTS if PROGS was
     empty, which isn't its business to be doing.  SCRIPTS is handled fine
     by bsd.prog.mk.  This mostly reverts and reworks the fix in r259209 and
     partially reverts r272055.
  5. bsd.progs.mk has no need to depend 'all:' on SCRIPTS and FILES.  These
     are handled by bsd.prog.mk/bsd.files.mk fine.  This also partially reverts
     r272055.
  6. bsd.progs.mk was not drop-in safe for bsd.prog.mk.  Move the PROGS
     check from r273186 to allow it to be used safely.

Specific tested cases:
  SCRIPTS:no PROGS:no FILES:yes SUBDIR:yes
    usr.bin/bmake/tests/sysmk/t1/2

  SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
    usr.bin/bmake/tests/sysmk/t1/2/1

  SCRIPTS:yes PROGS:yes FILES:yes SUBDIR:yes
    lib/libthr/tests

  SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
    usr.bin/yacc/tests
    libexec/atf/atf-sh/tests

A full buildworld/installworld/clean comparison with mtree was also done.
The only relevant difference was the new fixed behavior of removing
Kyuafile.auto from the objdir in 'clean'.

Converting SCRIPTS to be a special case FILES group will make this less
fragile and is being explored.

One known remaining issue is 'cleandepend' removing the tags files for
every recursive call.

Note that the 'make clean' command runs for the CURDIR last, which can make
it appear to run multiple times when cleaning in tests/, but each command is
for a SUBDIR returning up the chain.  This is purely bsd.subdir.mk behavior.

PR:		191055
PR:		191955
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-23 23:20:49 +00:00
Bryan Drewery
b8aba4fc19 META_MODE: Fix 2nd build causing everything to rebuild due to changed CC.
In the first build the TOOLSDIR does not exit yet which causes CC to default
to the sys.mk version.  Once a TOOLSDIR is created during the build though,
this logic was changing CC to ${TOOLSDIR}/usr/bin/cc even though that file
did not exist.  Thus CC went from 'cc' to '/usr/bin/cc' which forced a
rebuild of everything while using the same compiler.  Check that TOOLSDIR is
not empty to avoid this.  If there is actually a TOOLSDIR cc then it will be
used and properly rebuild.

Sponsored by:	EMC / Isilon Storage Division
2015-09-23 22:36:01 +00:00
Bryan Drewery
4b23c482f4 META_MODE: Avoid // in meta log for tracked --sysroot files.
Sponsored by:	EMC / Isilon Storage Division
2015-09-23 22:23:59 +00:00
Bryan Drewery
075b136250 META_MODE: Follow-up r287865 and define CCACHE_DIR as realpath'd.
Filemon(4) will record paths as they are seen, not as fully resolved.  make(1)
will take the .MAKE.META.IGNORE_PATHS values and resolve them.  This creates
a discrepancy if CCACHE_DIR is a symlink.  Fix this by ensuring it is
resolved for its actual usage.

Submitted by:	sjg
2015-09-23 21:46:58 +00:00
Bryan Drewery
2254894222 Similar to r266147, don't define PROG in the test subdirs.
Magic things happen when including bsd.prog.mk in them.

Sponsored by:	EMC / Isilon Storage Division
2015-09-23 21:35:58 +00:00
Conrad Meyer
b4d7290796 geom_dev: Use kenv 'dumpdev' in the same way as rc/etc.d/dumpon
Skip a /dev/ prefix, if one is present, when checking for matching
device names for dump.

Suggested by:	avg
Reviewed by:	markj
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3725
2015-09-23 21:08:52 +00:00
Bryan Drewery
533fbec505 META_MODE: Follow-up r287879 and have 'make -V .OBJDIR' still invoke auto.obj.mk.
When inspecting this value it is more expected to have it show the
automatically-created directory value rather than CURDIR.

Sponsored by:	EMC / Isilon Storage Division
2015-09-23 20:46:23 +00:00
Ed Maste
8c034f6af7 Bring LLVM libunwind snapshot into contrib/llvm/projects 2015-09-23 19:30:46 +00:00
Ed Maste
dc24fbd60e Import LLVM libunwind snapshot revision 246528
From https://llvm.org/svn/llvm-project/libunwind/trunk/
2015-09-23 19:02:06 +00:00
Alexander Motin
ca85b7c4e9 Synchronize mode pages between HA peers.
We allow to modify only few fields in mode pages now, but still it is
not good if they unexpectedly change during failover.  Also this fixes
reporting of "Mode parameters changed" UAs on secondary node.
2015-09-23 18:33:00 +00:00
Craig Rodrigues
f1e1637581 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
Submitted by:   Sascha Wildner <swildner@dragonflybsd.org>
Obtained from:  DragonFlyBSD (commit 5d7d35b17f98588c39b30036f1a3fe8802935c2c)
2015-09-23 16:16:16 +00:00