gibbs [Wed, 29 Feb 2012 18:41:59 +0000 (18:41 +0000)]
MFC r231883
===========
Fix regression in the handling of blkback close events for
devices that are unplugged via QEMU.
sys/dev/xen/blkback/blkback.c:
Toolstack initiated closures change the frontend's state
to Closing. The backend must change to Closing as well,
even if we can't actually close yet, in order for the
frontend to notice and start the closing process.
davidxu [Wed, 29 Feb 2012 06:19:00 +0000 (06:19 +0000)]
MFC 230857:
If multiple threads call kevent() to get AIO events on same kqueue fd,
it is possible that a single AIO event will be reported to multiple
threads, it is not threading friendly, and the existing API can not
control this behavior.
Allocate a kevent flags field sigev_notify_kevent_flags for AIO event
notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH
or EV_ONESHOT to AIO kernel code, user can control whether the event
should be cleared once it is retrieved by a thread. This change should
be comptaible with existing application, because the field should have
already been zero-filled, and no additional action will be taken by
kernel.
PR: kern/156567
MFC 231006:
Add 32-bit compat code for AIO kevent flags introduced in revision 230857.
MFC 231724:
Add notes about sigev_notify_kevent_flags introduced in revision 230857
which enables thread-friendly polling on same fd for AIO events.
thompsa [Wed, 29 Feb 2012 00:52:56 +0000 (00:52 +0000)]
MFC r232008,232010,232080,232089
Using the flowid in the mbuf assumes the network card is giving a good hash for
the traffic flow, this may not be the case giving poor traffic distribution.
Add a sysctl which allows us to fall back to our own flow hash code.
delphij [Tue, 28 Feb 2012 23:30:19 +0000 (23:30 +0000)]
MFC r228924:
In POSIX.1-2008:
P_tmpdir [OB XSI] Default directory prefix for tempnam().
This macro is used in a lot of places in legacy applications,
and is why we see a lot of programs written for e.g. Linux
store volatile temporary files in /var/tmp and not /tmp.
rmacklem [Tue, 28 Feb 2012 15:52:01 +0000 (15:52 +0000)]
MFC: r232050
hrs@ reported a panic to freebsd-stable@ under the subject line
"panic in 8.3-PRERELEASE" on Feb. 22, 2012. This panic was caused
by use of a mix of tsleep() and msleep() calls on the same event
in the new NFS server DRC code. It did "mtx_unlock(); tsleep();"
in two places, which kib@ noted introduced a slight risk that the
wakeup() would occur before the tsleep(), resulting in a 10sec
delay before waking up. This patch fixes the problem by replacing
"mtx_unlock(); tsleep();" with mtx_sleep(..PDROP..). It also
changes a nfsmsleep() call to mtx_sleep() so that the code uses
mtx_sleep() consistently within the file.
jkim [Mon, 27 Feb 2012 18:28:18 +0000 (18:28 +0000)]
MFC: r231843, r232061, r232063, r232065, r232069
- Set the initial mode for the adapter after executing VESA BIOS POST.
- Probe supported states for save/restore function.
- Defer to VGA methods if no state is supported.
sbruno [Mon, 27 Feb 2012 17:29:42 +0000 (17:29 +0000)]
MFC r231860
During work to port isci(4) to stable/7 I noted that the maxio portion of
struct ccb_pathinq from sys/cam/cam_ccb.h wasn't added to stable/7 at all
and didn't appear in stable/8 until svn R195534. Since __FreeBSD_version
did not get bumped until svn R195634, assume that maxio is valid at 800102
or higher.
brueffer [Sat, 25 Feb 2012 10:10:43 +0000 (10:10 +0000)]
MFC: r231871
Switch the license boilerplates to our standard one.
Advantages:
- Reduces the number of different license versions in the tree
- Eliminates a typo
- Removes some incorrect author attributions due to c/p
- Removes c/p error potential for future pmc manpages
marius [Sat, 25 Feb 2012 00:35:19 +0000 (00:35 +0000)]
MFC: r231913
- Probe BCM57780.
- In case the parent is bge(4), don't set the Jumbo frame settings unless
the MAC actually is Jumbo capable as otherwise the PHY might not have the
corresponding registers implemented. This is also in line with what the
Linux tg3 driver does.
PR: 165032
Submitted by: Alexander Milanov
Obtained from: OpenBSD
marius [Fri, 24 Feb 2012 00:47:14 +0000 (00:47 +0000)]
MFC: r231621
- As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
Note that besides currently there not being a quirk type that disables
MSI-X only and there's no evidence that MSI doesn't work with the VMware
pass-through, it's really questionable whether MSI generally works in
that setup as VMware only mention three know working devices [1, p. 4].
Also not that this quirk entry currently doesn't affect the devices
emulated by VMware in any way as these don't claim support MSI/MSI-X to
begin with. [2]
While at it, make the PCI quirk table const and static.
- Remove some duplicated empty lines.
- Use DEVMETHOD_END.
jkim [Thu, 23 Feb 2012 22:34:44 +0000 (22:34 +0000)]
MFC: r231781
Some BIOSes are known for corrupting low 64KB between suspend and resume.
Mask off the first 16 pages unless we appear to be running in a VM. This
address may be overridden by 'hw.physmem.start' tunable from loader.
jkim [Thu, 23 Feb 2012 22:26:14 +0000 (22:26 +0000)]
MFC: r231161
- Give all clocks and timers on acpi0 the equal probing order.
- Increase probing order for ECDT table to match HID-based probing.
- Decrease probing order for HPET table to match HID-based probing.
- Decrease probing order for CPUs and system resources.
- Fix ACPI_DEV_BASE_ORDER to reflect the reality.
jkim [Thu, 23 Feb 2012 22:20:52 +0000 (22:20 +0000)]
MFC: r231797
Clean up RFLAG and CR3 register handling and nearby comments. For BSP, use
spinlock_enter()/spinlock_exit() to save/restore RFLAGS. We know interrupt
is disabled when returning from S3. For AP, we do not have to save/restore
it because IRET will do it for us any way. Do not save CR3 locally because
savectx() does it and BSP does not have to switch to kernel map for amd64.
Change contigmalloc(9) flag while I am in the neighborhood.
jkim [Thu, 23 Feb 2012 22:03:20 +0000 (22:03 +0000)]
MFC: r231791, r231840
Set up an event handler to turn off speaker if user requested it. Speaker
will stop beeping after all device drivers are resumed. Use proper API to
"acquire" and "release" PIC timer2 for consistency and correctness.
kmacy [Thu, 23 Feb 2012 19:20:36 +0000 (19:20 +0000)]
MFC r230623
exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64
excluding other allocations including UMA now entails the addition of
a single flag to kmem_alloc or uma zone create
kmacy [Thu, 23 Feb 2012 18:50:19 +0000 (18:50 +0000)]
MFC r230598
A flowtable entry can continue referencing an llentry indefinitely if the entry is repeatedly
referenced within its timeout window. This change clears the LLE_VALID flag when an llentry
is removed from an interface's hash table and adds an extra check to the flowtable code
for the LLE_VALID flag in llentry to avoid retaining and using a stale reference.
kib [Tue, 21 Feb 2012 21:21:31 +0000 (21:21 +0000)]
MFC r230430:
Use getcontextx(3) internal API instead of getcontext(2) to provide
the signal handlers with the context information in the deferrred
case.
kib [Tue, 21 Feb 2012 21:18:59 +0000 (21:18 +0000)]
MFC r230429:
Add API for obtaining extended machine context states that cannot be
fit into existing mcontext_t.
On i386 and amd64 do return the extended FPU states using
getcontextx(3). For other architectures, getcontextx(3) returns the
same information as getcontext(2).
MFC r230864:
Make the sys/ucontext.h self-contained by changing the return type
of __getcontextx_size(3) from size_t to int.
kib [Tue, 21 Feb 2012 01:43:31 +0000 (01:43 +0000)]
MFC r231313 (by mckusick):
First attempt the uiomove() to the newly allocated (and dirty) buffer
and only zeros it if the uiomove() fails. The effect is to eliminate the
gratuitous zeroing of the buffer in the usual case where the uiomove()
successfully fills it.
kib [Tue, 21 Feb 2012 01:37:27 +0000 (01:37 +0000)]
MFC r231160 (by mckusick):
Do not fsync all resident UFS vnodes from the syncer vnode call
to ffs_sync(). Since all inode metadata updates are translated to
inodeblock updates, the vnodes syncing is handled by syncer dirty buffer
wheel. The only things that shall be synced by ffs_sync() from the
syncer calls are the filesystem metadata proper.
kib [Tue, 21 Feb 2012 01:27:23 +0000 (01:27 +0000)]
MFC r231122:
Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to
guarantee that all UFS inode metadata changes results in the dirtiness
of the inodeblock.
mm [Mon, 20 Feb 2012 21:10:14 +0000 (21:10 +0000)]
MFC r230397, r230438:
MFC r230397 (pjd):
By default turn off prefetch when listing snapshots.
In my tests it makes listing snapshots 19% faster with cold cache and
47% faster with warm cache.
MFC r230438 (pjd):
Dramatically optimize listing snapshots when user requests only snapshot
names and wants to sort them by name, ie. when executes:
# zfs list -t snapshot -o name -s name
Because only name is needed we don't have to read all snapshot properties.
Below you can find how long does it take to list 34509 snapshots from a single
disk pool before and after this change with cold and warm cache:
before:
# time zfs list -t snapshot -o name -s name > /dev/null
cold cache: 525s
warm cache: 218s
after:
# time zfs list -t snapshot -o name -s name > /dev/null
cold cache: 1.7s
warm cache: 1.1s
kib [Mon, 20 Feb 2012 11:27:37 +0000 (11:27 +0000)]
MFC r231075:
Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local
thread flag to disable async i/o for current thread only. Use the
opportunity to move DOINGASYNC() macro into sys/vnode.h and
consistently use it through places which tested for MNTK_ASYNC.
MFC r231204:
Unbreak detection of the async mode for clustered writes after r231075.
dougb [Mon, 20 Feb 2012 10:13:09 +0000 (10:13 +0000)]
MFC r231862:
Increase the default shutdown timer to 90 seconds. This will allow
certain systems that take a long time to shut down, without adversely
affecting things that shut down quickly. It's also 30 seconds less than
the default hard limit of 120 seconds in kern.init_shutdown_timeout.
These tools are mainly useful for people that want to manipulate llvm
bitcode (.bc) and llvm assembly language (.ll) files, or want to tinker
with llvm and clang themselves.
andreast [Sun, 19 Feb 2012 08:58:31 +0000 (08:58 +0000)]
MFC r230391, r230400, 231019:
This commit adds profiling support for powerpc64. Now we can do application
profiling and kernel profiling. To enable kernel profiling one has to build
kgmon(8). I will enable the build once I managed to build and test powerpc
(32-bit) kernels with profiling support.
- add a powerpc64 PROF_PROLOGUE for _mcount.
- add macros to avoid adding the PROF_PROLOGUE in certain assembly entries.
- apply these macros where needed.
- add size information to the MCOUNT function.
tuexen [Fri, 17 Feb 2012 10:54:09 +0000 (10:54 +0000)]
MFC 231672:
Fix a bug where the wrong protocol overhead was used. This can lead
to a deadlock of an association when an IPv6 socket was used to
communcate with IPv4 and an ICMPv4 fragmentation needed message
was received.
While there, simplify the code a bit.
r231743
=======
Enhance documentation, improve interoperability, and fix defects in
FreeBSD's front and back Xen blkif interface drivers.
sys/dev/xen/blkfront/block.h:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
Replace FreeBSD specific multi-page ring impelementation with
support for both the Citrix and Amazon/RedHat versions of this
extension.
sys/dev/xen/blkfront/blkfront.c:
o Add a per-instance sysctl tree that exposes all negotiated
transport parameters (ring pages, max number of requests,
max request size, max number of segments).
o In blkfront_vdevice_to_unit() add a missing return statement
so that we properly identify the unit number for high numbered
xvd devices.
sys/dev/xen/blkback/blkback.c:
o Add static dtrace probes for several events in this driver.
o Defer connection shutdown processing until the front-end
enters the closed state. This avoids prematurely tearing
down the connection when buggy front-ends transition to the
closing state, even though the device is open and they
veto the close request from the tool stack.
o Add nodes for maximum request size and the number of active
ring pages to the exising, per-instance, sysctl tree.
o Miscelaneous style cleanup.
sys/xen/interface/io/blkif.h:
o Add extensive documentation of the XenStore nodes used to
implement the blkif interface.
o Document the startup sequence between a front and back driver.
o Add structures and documenatation for the "discard" feature
(AKA Trim).
o Cleanup some definitions related to FreeBSD's request
number/size/segment-limit extension.
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
sys/xen/xenbus/xenbusvar.h:
Add the convenience function xenbus_get_otherend_state() and
use it to simplify some logic in both block-front and block-back.
r231837
=======
sys/dev/xen/blkback/blkback.c:
Fix typo in a printf string: "specificed" -> "specified".
r231839
=======
Fix a bug in the calculation of the maximum I/O request size.
The previous code did not limit the I/O request size based on
the maximum number of segments supported by the back-end. In
current practice, since the only back-end supporting chained
requests is the FreeBSD implementation, this limit was never
exceeded.
sys/dev/xen/blkfront/block.h:
Add two macros, XBF_SEGS_TO_SIZE() and XBF_SIZE_TO_SEGS(),
to centralize the logic of reserving a segment to deal with
non-page-aligned I/Os.
sys/dev/xen/blkfront/blkfront.c:
o When negotiating transfer parameters, limit the
max_request_size we use and publish, if it is greater
than the maximum, unaligned, I/O we can support with
the number of segments advertised by the backend.
o Don't unilaterally reduce the I/O size published to
the disk layer by a single page. max_request_size
is already properly limited in the transfer parameter
negotiation code.
o Fix typos in printf strings:
"max_requests_segments" -> "max_request_segments"
"specificed" -> "specified"
emaste [Thu, 16 Feb 2012 00:46:11 +0000 (00:46 +0000)]
MFC r231573:
Fix panic after "WARNING - ATA_IDENTIFY taskqueue timeout"
When performing a firmware upgrade via atacontrol[1] the subsequent
command may time out producing the error message above. When this
happens the callout could still be active, and the system would then
panic due to a destroyed semaphore.
Instead, ensure that the callout is done first, via callout_drain.
jilles [Wed, 15 Feb 2012 21:03:26 +0000 (21:03 +0000)]
MFC r230512: sockstat: Also show sockets not associated with a descriptor.
Sockets not associated with a file descriptor include TCP TIME_WAIT states
and sockets created via the socket(9) API such as from rpc.lockd and the NFS
client.
alc [Wed, 15 Feb 2012 18:15:26 +0000 (18:15 +0000)]
MFC r229363
Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and
tmpfs_nocacheread(). It is both unnecessary and a pessimization. It
results in either the page being zeroed twice or zeroed first and then
overwritten by an I/O operation.