avg [Sat, 10 Nov 2012 12:22:26 +0000 (12:22 +0000)]
zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots
... before trying to destroy the zvol snapshots themselves.
PR: kern/173442
Reported by: Petri Helenius <petri@helenius.fi>,
mm
Obtained from: Brian Behlendorf <behlendorf1@llnl.gov>,
Illumos Bug #3170
Tested by: Petri Helenius <petri@helenius.fi>
MFC after: 10 days
mav [Sat, 10 Nov 2012 07:02:57 +0000 (07:02 +0000)]
Several optimizations to sched_idletd():
- Do not try to steal load from other CPUs if there was no contest switches
on this CPU (i.e. it was idle all the time and woke up just for bus mastering
or TLB shutdown). If current CPU was idle, then it is quite unlikely that some
other CPU has load to steal. Under high I/O rate, when TLB shutdowns cause
numerous CPU wakeups, on 24-CPU system load stealing code may consume up to
25% of all CPU time without giving any benefits.
- Change code that implements spinning for load to restart spin in case of
context switch. Previous code periodically called cpu_idle() even under
high interrupt/context switch rate.
- Rise spinning threshold to 10KHz, where it gives at least some effect
that may worth consumed power.
alfred [Sat, 10 Nov 2012 02:08:40 +0000 (02:08 +0000)]
Allow maxusers to scale on machines with large address space.
Some hooks are added to clamp down maxusers and nmbclusters for
small address space systems.
VM_MAX_AUTOTUNE_MAXUSERS - the max maxusers that will be autotuned based on
physical memory.
VM_MAX_AUTOTUNE_NMBCLUSTERS - max nmbclusters based on physical memory.
These are set to the old values on i386 to preserve the clamping that was
being done to all arches.
Another macro VM_AUTOTUNE_NMBCLUSTERS is provided to allow an override
for the calculation on a MD basis. Currently no arch defines this.
dim [Fri, 9 Nov 2012 18:56:27 +0000 (18:56 +0000)]
Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as
the FreeBSD ABI requires. This is essentially a revert of upstream llvm
commit r126226, and it will be reverted by upstream too.
attilio [Fri, 9 Nov 2012 18:02:25 +0000 (18:02 +0000)]
Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag.
Porters should refer to __FreeBSD_version 1000021 for this change as
it may have happened at the same timeframe.
hselasky [Fri, 9 Nov 2012 16:28:58 +0000 (16:28 +0000)]
Fix LOW and FULL speed USB INTERRUPT endpoint support for the
DWC OTG driver. Fix a hang issue when using LOW and FULL speed
BULK traffic. Make sure we don't ask for data in the last
microframe. This allows using devices like USB mice and USB
keyboards connected to the RPI-B.
kib [Fri, 9 Nov 2012 16:00:30 +0000 (16:00 +0000)]
Do not try to enable new features in the %cr4 if running under
hypervisor. Apparently, hypervisors failed to filter out 'Standard
Extended Features' report from CPUID, but deliver #gp when
corresponding bit in %cr4 is toggled.
This shall be reconsidered later, after hypervisors correct the bug.
Reported and tested by: joel
Reviewed by: avg
MFC after: 2 weeks
dim [Thu, 8 Nov 2012 23:21:02 +0000 (23:21 +0000)]
Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in
sio.S. This is not particularly needed for head right now, but it is
intended to merge to stable/9, to fix boot2 build with clang there.
adrian [Thu, 8 Nov 2012 18:11:31 +0000 (18:11 +0000)]
Add some hooks into the driver to attach, detach and record EDMA descriptor
events.
This is primarily for the TX EDMA and TX EDMA completion. I haven't yet
tied it into the EDMA RX path or the legacy TX/RX path.
Things that I don't quite like:
* Make the pointer type 'void' in ath_softc and have if_ath_alq*()
return a malloc'ed buffer. That would remove the need to include
if_ath_alq.h in if_athvar.h.
* The sysctl setup needs to be cleaned up.
kib [Thu, 8 Nov 2012 03:17:41 +0000 (03:17 +0000)]
Zero the newly allocated md(4) swap-backed page to prevent random
kernel memory leakage to userspace. For the typical use, when a
filesystem put on the md disk, the change only results in CPU and
memory bandwidth spent to zero the page, since filsystems make sure
that user never see unwritten content. But if md disk is used as raw
device by userspace, the garbage is exposed.
Reported by: Paul Schenkeveld <freebsd@psconsult.nl>
MFC after: 2 weeks
jeff [Thu, 8 Nov 2012 01:46:47 +0000 (01:46 +0000)]
- Change ULE to use dynamic slice sizes for the timeshare queue in order
to further reduce latency for threads in this queue. This should help
as threads transition from realtime to timeshare. The latency is
bound to a max of sched_slice until we have more than sched_slice / 6
threads runnable. Then the min slice is allotted to all threads and
latency becomes (nthreads - 1) * min_slice.
jeff [Thu, 8 Nov 2012 01:41:04 +0000 (01:41 +0000)]
- Implement BIO_FLUSH support around journal entries. This will not 100%
solve power loss problems with dishonest write caches. However, it
should improve the situation and force a full fsck when it is unable
to resolve with the journal.
- Resolve a case where the journal could wrap in an unsafe way causing
us to prematurely lose journal entries in very specific scenarios.
attilio [Thu, 8 Nov 2012 00:32:49 +0000 (00:32 +0000)]
- Current caching mode is completely broken because it simply relies
on timing of the operations and not real lookup, bringing too many
false positives. Remove the whole mechanism. If it needs to be
implemented, next time it should really be done in the proper way.
- Fix VOP_GETATTR() in order to cope with userland bugs that would
change the type of file and not panic. Instead it gets the entry as
if it is not existing.
grog [Thu, 8 Nov 2012 00:24:26 +0000 (00:24 +0000)]
Add y flag and environment variable LS_SAMESORT to specify the same
sorting order for time and name with the -t option. IEEE Std 1003.2
(POSIX.2) mandates that the -t option sort in descending order, and
that if two files have the same timestamp, they should be sorted in
ascending order of their names. The -r flag reverses both of these
sort orders, so they're never the same. This creates significant
problems for sequentially named files stored on FAT file systems,
where it can be impossible to list them in the order in which they
were created.
Add , (comma) option to print file sizes grouped and separated by
thousands using the non-monetary separator returned by localeconv(3),
typically a comma or period.
jhibbits [Wed, 7 Nov 2012 23:45:09 +0000 (23:45 +0000)]
Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.
There is one known issue: Some probes will display an error message along the
lines of: "Invalid address (0)"
I tested this with both a simple dtrace probe and dtruss on a few different
binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect
problems without the modules loaded. Volunteers are welcome.
mav [Wed, 7 Nov 2012 23:12:53 +0000 (23:12 +0000)]
Use information about suported diagnostic pages to avoid reading optional
Element Descriptor page if it is not supported. This removes one error
message from verbose logs during boot on systems with some enclosures.
dim [Wed, 7 Nov 2012 22:45:34 +0000 (22:45 +0000)]
For kernel builds with PROFLEVEL >= 2, such as LINT, don't attempt to
use the -mprofiler-epilogue option if the compiler is clang, as the flag
is not supported. While here, fix up the value indentations.
ray [Wed, 7 Nov 2012 22:43:09 +0000 (22:43 +0000)]
Disable automatic attachment of arswitch. It can't be auto-detected (like PHYs
do) and cause a problems trying to attach another instance to child mdio.
Submitted by: Luiz Otavio O Souza
Approved by: adrian (menthor)
dim [Wed, 7 Nov 2012 22:15:28 +0000 (22:15 +0000)]
For kernel builds with PROFLEVEL >= 1, such as LINT, don't attempt to
use the -falign-functions option if the compiler is clang, as the flag
is not supported.
tuexen [Wed, 7 Nov 2012 22:11:38 +0000 (22:11 +0000)]
Add per outgoing stream accounting for chunks in the send
and sent queue. This provides no functional change, but is
a preparation for an upcoming stream reset improvement.
Done with rrs@.
dim [Wed, 7 Nov 2012 19:51:53 +0000 (19:51 +0000)]
Put in a band-aid to get the pc98 bootstraps building, now clang is the
default compiler. This has two parts:
- Make sys/boot/pc98/boot2 always build with gcc for now, until we can
figure out a way to shrink it enough when building with clang.
- Since sys/boot/p98/cdboot uses .code16 directives, which are not yet
supported by clang's integrated assembler, use -no-integrated-as,
similar to sys/boot/i386/cdboot.
wblock [Wed, 7 Nov 2012 19:26:32 +0000 (19:26 +0000)]
Remove fifteen-year-old notes on media selection (suggested by simon@).
Add commas after "e.g." and "i.e.". Change "silent" to "silence" in
wireless create section (reviewed by adri@).
wblock [Wed, 7 Nov 2012 15:59:24 +0000 (15:59 +0000)]
Add devd.conf(5) and devd(8) to SEE ALSO xrefs. Give users a pointer to
seemingly mysterious actions that are not done by ifconfig itself, but
by devd triggering on events caused by ifconfig.
glebius [Wed, 7 Nov 2012 07:35:05 +0000 (07:35 +0000)]
Merge rev. 1.125 from OpenBSD:
date: 2009/06/12 02:03:51; author: dlg; state: Exp; lines: +59 -69
rewrite the way states from pfsync are merged into the local state tree
and the conditions on which pfsync will notify its peers on a stale update.
each side (ie, the sending and receiving side) of the state update is
compared separately. any side that is further along than the local state
tree is merged. if any side is further along in the local state table, an
update is sent out telling the peers about it.
glebius [Wed, 7 Nov 2012 07:30:40 +0000 (07:30 +0000)]
It may happen that pfsync holds the last reference on a state. In this
case keys had already been freed. If encountering such state, then
just release last reference.
Not sure this can happen as a runtime race, but can be reproduced by
the following scenario:
- enable pfsync
- disable pfsync
- wait some time
- enable pfsync
ambrisko [Tue, 6 Nov 2012 23:25:06 +0000 (23:25 +0000)]
- Extend the prior commit to use the generic SCSI command building
function use that for JBOD and Thunderbolt disk write command. Now
we only have one implementation in mfi.
- Fix dumping on Thunderbolt cards. Polled IO commands do not seem to
be normally acknowledged by changing cmd_status to MFI_STAT_OK.
In order to get acknowledgement of the IO is complete, the Thunderbolt
command queue needs to be run through. I added a flag MFI_CMD_SCSI
to indicate this command is being polled and to complete the
Thunderbolt wrapper and indicate the result. This flag needs to be
set in the JBOD case in case if that us using Thunderbolt card.
When in the polling loop check for completed commands.
- Remove mfi_tbolt_is_ldio and just do the check when needed.
- Fix an issue when attaching of disk device happens when a device is
already scheduled to be attached but hasn't attached.
- add a tunable to allow raw disk attachment to CAM via:
hw.mfi.allow_cam_disk_passthrough=1
- fixup aborting of commands (AEN and LD state change). Use a generic
abort function and only wait the command being aborted not both.
Thunderbolt cards don't seem to abort commands so the abort times
out.
ghelmer [Tue, 6 Nov 2012 21:07:04 +0000 (21:07 +0000)]
Work around a race in bpfread() by validating the hold buffer pointer
before freeing it. Otherwise, we can lose a buffer and cause a panic
in catchpacket().