pfg [Mon, 20 Jan 2014 19:38:16 +0000 (19:38 +0000)]
MFC r260014, r260099:
gcc: Add support for label attributes and "unavailable" attribute.
Apple GCC has extensions to support for both label attributes and
an "unavailable" attribute. These are critical for objc but are
also useful in regular C/C++.
Improve error message shown to the user when trying to load a module that is
already loaded or compiled withing the kernel
Point the user to dmesg(1) to get informations about why loading a module did fail
instead of printing the cryptic "Exec format error"
Update the BUGS section of kld(4) according the recent changes in kldload(8)
gjb [Sun, 19 Jan 2014 19:49:24 +0000 (19:49 +0000)]
MFC r259729:
Bootstrap etcupdate(8) as part of the release build, similar
to what is done for mergemaster(8). This allows etcupdate(8)
to work out-of-box after the first upgrade of a system.
mav [Sat, 18 Jan 2014 22:52:43 +0000 (22:52 +0000)]
MFC r245848 (by jhb):
Always update the hw.uart.console hint anytime a change is made to the
comconsole setup. Previously the hint would be set when if you set a
custom port, but it would not be updated if you later set a custom speed.
Also, leave the hw.uart.console hint mutable so it can be overridden or
unset by the user if needed.
jhb [Tue, 14 Jan 2014 21:20:51 +0000 (21:20 +0000)]
MFC 238423,238426,238428,258063,258063,258066,258097,258185,259134:
The etcupdate utility is a tool for managing updates to files that are
not updated as part of `make installworld' such as files in /etc. It
manages updates by doing a three-way merge of changes made to these files
against the local versions. It is also designed to minimize the amount
of user intervention with the goal of simplifying upgrades for clusters
of machines.
delphij [Tue, 14 Jan 2014 19:27:42 +0000 (19:27 +0000)]
On stable/8 and stable/9, disable hardware random number generators
by default. This is a direct commit to stable/ branches because
HEAD and stable/10 have superior implementation of random device.
pfg [Tue, 14 Jan 2014 15:21:19 +0000 (15:21 +0000)]
MFC r260545:
ext2fs: fix inode flag conversion.
After r252890 we are naively attempting to pass through the
inode flags. This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.
Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.
Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.
pfg [Sat, 11 Jan 2014 01:45:20 +0000 (01:45 +0000)]
MFC r260361:
gcc: Fix optimization bug.
GCC-PR rtl-optimization/34628
* combine.c (try_combine): Stop and undo after the first combination
if an autoincrement side-effect on the first insn has effectively
been lost.
asomers [Fri, 10 Jan 2014 18:14:15 +0000 (18:14 +0000)]
MFC 259339
sbin/devd/devd.cc
Increase the size of devd's client socket's send buffer from the
default (8k) to 128k. This prevents clients from getting
POLLHUPped during event storms. For example, during zpool creation,
the kernel emits a resource.fs.zfs.statechange event for every vdev
in the pool. A 128k buffer is large enough to hold the statechange
events for a pool with nearly 800 drives.
asomers [Fri, 10 Jan 2014 17:40:29 +0000 (17:40 +0000)]
MFC 259240
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
When a da or ada device dissappears, outstanding IOs fail with
ENXIO, not EIO. The check for EIO was probably copied from Illumos,
where that is indeed the correct errno.
Without this change, pulling a busy drive from a zpool would usually
turn it into UNAVAIL, even though pulling an idle drive would turn
it into REMOVED. With this change, it is REMOVED every time.
Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that
results in devd getting two resource.fs.zfs.removed events. The
comment said that the event had to be sent directly instead of
through the async removal thread because "the DE engine is using
this information to discard prevoius I/O errors". However, the fact
that vdev_geom_io_intr was never actually sending the events until
now, and that vdev_geom_orphan never sent them at all, and that
vdev_geom_orphan usually gets called about 2 seconds after the
actual removal, means that FreeBSD's userland can cope with a late
event just fine.
ae [Fri, 10 Jan 2014 12:22:49 +0000 (12:22 +0000)]
MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
to lla_lookup().
This drastically reduces the very high lock contention when doing parallel
TCP throughput tests (> 1024 sockets) with IPv6.
MFC r260187:
lla_lookup() does modification only when LLE_CREATE is specified.
Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
lla_lookup() without LLE_CREATE flag.
MFC r260217:
Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
LLE_CREATE flag.
ae [Fri, 10 Jan 2014 12:09:38 +0000 (12:09 +0000)]
MFC r259634:
Prevent users from deactivating the last component of a mirror.
MFC r259929:
Add an ability to stop gmirror and clear its metadata in one command.
This fixes the problem, when gmirror starts again just after stop.
The problem occurs when gmirror's component has geom label with equal size.
E.g. gpt and gptid have the same size as partition, diskid has the same
size as entire disk. When gmirror's geom has been destroyed, glabel
creates its providers and this initiate retaste.
Now "gmirror destroy" command is available. It destroys geom and also
erases gmirror's metadata.
dim [Thu, 9 Jan 2014 23:08:56 +0000 (23:08 +0000)]
MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.
MFC r260369:
Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios. Sorry about the breakage.
dim [Thu, 9 Jan 2014 22:40:51 +0000 (22:40 +0000)]
MFC r260102:
Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile. Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.
MFC r260322:
In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk,
since kernel module builds do not use kern.pre.mk.
mav [Thu, 9 Jan 2014 10:45:37 +0000 (10:45 +0000)]
MFC r259197:
Do not DELAY() for P-state transition unless we want to see the result.
Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point." So seems it should be fine to just
trigger wanted transition and go. Linux does the same.
kib [Thu, 9 Jan 2014 03:33:12 +0000 (03:33 +0000)]
MFC r260205:
Update the description for pmap_remove_pages() to match the modern
times. Assert that the pmap passed to pmap_remove_pages() is only
active on current CPU.
cperciva [Wed, 8 Jan 2014 02:31:35 +0000 (02:31 +0000)]
MFC r258893, r258956:
Add a new sysctl / loader tunable kern.panic_reboot_wait_time which
defaults to PANIC_REBOOT_WAIT_TIME (a long-existing kernel config
setting). Use this now-variable value in place of the defined constant
to control how long the system waits after a panic before rebooting.
cperciva [Wed, 8 Jan 2014 02:30:24 +0000 (02:30 +0000)]
MFC r258894: Make rc(8) re-source rc.conf upon receipt of SIGALRM.
The rc system aggressively caches the contents of /etc/rc.conf in order to
improve boot performance; this produces arguably astonishing (non-)results
if /etc/rc.conf is modified during the boot process. This commit provides
a mechanism for explicitly requesting that rc.conf be reloaded.
dim [Sun, 5 Jan 2014 15:39:37 +0000 (15:39 +0000)]
Revert MFC of r260102 for now, until I can merge the required fix from
head. This should fix building modules which require -fms-extensions to
compile them with gcc.
luigi [Sun, 5 Jan 2014 11:58:07 +0000 (11:58 +0000)]
MFC revision 259907
use the correct netmap <-> nic slot mapping on the transmit ring for 'lem'.
This bug would manifest only in netmap mode and on packets transmitted after
a NIC reset while netmap mode is active.
dim [Sat, 4 Jan 2014 22:00:07 +0000 (22:00 +0000)]
MFC r260095:
For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
directly to the linker (LD_FLAGS) from flags passed indirectly, via the
compiler driver (LDFLAGS).
This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
use ${LD} directly to link, and the normal LDFLAGS value should not be
used in these cases.
dim [Sat, 4 Jan 2014 18:53:31 +0000 (18:53 +0000)]
MFC r260040:
In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.
dim [Sat, 4 Jan 2014 17:56:19 +0000 (17:56 +0000)]
MFC r260102:
Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile. Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.
dim [Sat, 4 Jan 2014 17:22:53 +0000 (17:22 +0000)]
MFC r260015:
In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by
adding a __libcpp prefix to the applicable identifiers.
Upstream is still debating about this, but we need it now, to be able to
import clang 3.4.
jilles [Fri, 3 Jan 2014 14:30:24 +0000 (14:30 +0000)]
MFC r258281: Fix siginfo_t.si_status for wait6/waitid/SIGCHLD.
Per POSIX, si_status should contain the value passed to exit() for
si_code==CLD_EXITED and the signal number for other si_code. This was
incorrect for CLD_EXITED and CLD_DUMPED.
This is still not fully POSIX-compliant (Austin group issue #594 says that
the full value passed to exit() shall be returned via si_status, not just
the low 8 bits) but is sufficient for a si_status-related test in libnih
(upstart, Debian/kFreeBSD).
jhb [Thu, 2 Jan 2014 21:57:03 +0000 (21:57 +0000)]
MFC 255708,255711,255731:
Extend the support for exempting processes from being killed when swap is
exhausted.
- Add a new protect(1) command that can be used to set or revoke protection
from arbitrary processes. Similar to ktrace it can apply a change to all
existing descendants of a process as well as future descendants.
- Add a new procctl(2) system call that provides a generic interface for
control operations on processes (as opposed to the debugger-specific
operations provided by ptrace(2)). procctl(2) uses a combination of
idtype_t and an id to identify the set of processes on which to operate
similar to wait6().
- Add a PROC_SPROTECT control operation to manage the protection status
of a set of processes. MADV_PROTECT still works for backwards
compatability.
- Add a p_flag2 to struct proc (and a corresponding ki_flag2 to kinfo_proc)
the first bit of which is used to track if P_PROTECT should be inherited
by new child processes.