Commit Graph

99660 Commits

Author SHA1 Message Date
ae
ddff0f179e MFC r260485,260496:
Remove extra nesting from X_ip6_mforward() function.
  Also remove disabled definitions from ip6_mroute.h.

  PR:		185148
2014-01-28 00:30:17 +00:00
glebius
6e1079d8b4 Merge 261024: fix PIM input regression. 2014-01-27 09:33:30 +00:00
jhibbits
5c96f061e7 MFC r260872:
There's actually no data in the PMU_GET_VERSION command.  Don't send any.
This change now allows the PMU to be used on PowerBook5,8
2014-01-26 02:23:16 +00:00
mav
f1efe4c670 MFC r260549:
Move xpt_run_devq() call before request completion callback where it was
originally.

I am not sure why exactly have I moved it during one of many refactorings
during camlock project, but obviously it opens race window that may cause
use after free panics during SIM (in reported cases umass(4)) detach.
2014-01-25 01:58:15 +00:00
hselasky
ca0a2ea2d2 MFC r257132:
Add id for GTM661W.
This also fixes kernel build breakage since last revision.
2014-01-24 08:27:19 +00:00
hselasky
7736d27545 MFC r260534:
Move USB ID from u3g driver to uhso driver.
2014-01-24 08:22:29 +00:00
hselasky
6c824eefbf MFC r258545:
Comply to the XHCI specification. Certain input context fields should
always be zero.
2014-01-24 08:15:21 +00:00
hselasky
6e5156d6bb MFC r260808 and r260814:
- Close a minor deadlock.
- Fix a possible memory use after free and leak situation associated
with USB device detach when using character device handles. This also
includes LibUSB. It turns out that "usb_close()" cannot always get a
reference to clean up its USB transfers and such, if called during the
kernel USB device detach.
2014-01-24 08:10:08 +00:00
hselasky
f692196495 MFC r260588 and r260589:
- Separate I/O errors from reception of STALL PID.
- Implement better error recovery for Transaction Translators, TTs,
found in High Speed USB HUBs which translate from High Speed USB into
FULL or LOW speed USB. In some rare cases SPLIT transactions might get
lost, which might leave the TT in an unknown state. Whenever we detect
such an error try to issue either a clear TT buffer request, or if
that is not possible reset the whole TT.
2014-01-24 07:48:52 +00:00
hselasky
34792a80a8 MFC r260563:
Make sure reserved fields of the EHCI DMA descriptors are not dirty
after previous transfers.
2014-01-24 07:43:46 +00:00
hselasky
9fee04223f MFC r260559:
Don't do synchronous USB requests inside USB transfer callbacks. It is
technically OK, but not recommended.
2014-01-24 07:32:05 +00:00
hselasky
f51f01df30 MFC r260388, r260535 and r260536:
Fix XHCI interrupt logic for "Intel Lynx Point" found in MBP2013.
2014-01-24 07:24:40 +00:00
mav
3a9defd5d2 MFC r260521:
Remove not applicable PI_SDTR_ABLE and PI_WIDE_16 hba_inquiry flags to
make CAM to not try negotiate unsupported settings and suppress warnings.

While there, enable command queuing on pass-through devices, announced
in hba_inquiry, but disabled.  Even though queue size is very small, It
seems working well enough.
2014-01-24 00:41:02 +00:00
jhb
e1016866c7 MFC 257422,257661,258075,258476,258494,258579,258609,258699:
Several enhancements to the I/O APIC support in bhyve including:
- Move the I/O APIC device model from userspace into vmm.ko and add
  ioctls to assert and deassert I/O APIC pins.
- Add HPET device emulation including a single timer block with 8 timers.
- Remove the 'vdev' abstraction.

Approved by:	neel
2014-01-23 20:21:39 +00:00
loos
49a10991a2 MFC r256959:
Add the Raspberry Pi BSC (I2C compliant) controller driver.

  Reviewed by:	rpaulo

MFC r256961:

  Enable the build of OFW I2C bus for FDT systems.

MFC r258045:

  As all the IIC controllers on system uses the same 'iichb' prefix we cannot
  rely only on checking the device unit to indentify the BSC unit we are
  attaching to.  Make use of the device base address to identify our BSC unit.

MFC r259127:

  Bring the RPi I2C driver in line with ti_i2c.  Make it treat any slave
  address as a 7-bit address.

Approved by:	adrian (mentor)
2014-01-23 12:32:30 +00:00
loos
f516feec90 MFC r257127:
Remove all the instances of '#undef DEBUG' from kernel.

Suggested by:	rpaulo
Approved by:	adrian (mentor)
2014-01-23 12:02:04 +00:00
mav
31820682b5 MFC r260229, r260258, r260367, r260390, r260459, r260648:
Rework NFS Duplicate Request Cache cleanup logic.

 - Introduce additional hash to group requests by hash of sockref.  This
allows to process TCP acknowledgements without looping though all the cache,
and as result allows to do it every time.
 - Indroduce additional callbacks to notify application layer about sockets
disconnection.  Without this last few requests processed just before socket
disconnection never processed their ACKs and stuck in cache for many hours.
 - Implement transport-specific method for tracking reply acknowledgements.
New implementation does not cross multiple stack layers to get the data and
does not have race conditions that previously made some requests stuck
in cache.  This could be done more efficiently at sockbuf layer, but that
would broke some KBIs, while I don't know other consumers for it aside NFS.
 - Instead of traversing all DRC twice per request, run cleaning only once
per request, and except in some conditions traverse only single hash slot
at a time.

Together this limits NFS DRC growth only to situations of real connectivity
problems.  If network is working well, and so all replies are acknowledged,
cache remains almost empty even after hours of heavy load.  Without this
change on the same test cache was growing to many thousand requests even
with perfectly working local network.

As another result this reduces CPU time spent on the DRC handling during
SPEC NFS benchmark from about 10% to 0.5%.

Sponsored by:   iXsystems, Inc.
2014-01-22 23:55:25 +00:00
mav
9b0c44b0a6 MFC r260097:
Move most of NFS file handle affinity code out of the heavily congested
global RPC thread pool lock and protect it with own set of locks.

On synthetic benchmarks this improves peak NFS request rate by 40%.
2014-01-22 23:52:20 +00:00
mav
695b5b9179 MFC r260036:
Introduce xprt_inactive_self()  -- variant for use when sure that port
is assigned to thread.  For example, withing receive handlers.  In that
case the function reduces to single assignment and can avoid locking.
2014-01-22 23:51:12 +00:00
mav
ec416d0ab8 MFC r260031:
In addition to r259632 completely block receive upcalls if we have more
data than we need.  This reduces lock pressure from xprt_active() side.
2014-01-22 23:50:13 +00:00
mav
2d67ee21c0 MFC r259877:
Slightly simplify expiration logic introduced in r254337.

 - Do not update the histogram for items we are any way deleting from cache.
 - Do not update the histogram if nfsrc_tcphighwater is not set.
 - Remove some extra math operations.
2014-01-22 23:49:37 +00:00
mav
28a527f07e MFC r259828:
Fix a bug introduced at r259632, triggering infinite loop in some cases.
2014-01-22 23:48:54 +00:00
mav
bdd6d3eac3 MFC r259765:
Fix RPC server threads file handle affinity to work better with ZFS.

  Instead of taking 8 specific bytes of file handle to identify file during
RPC thread affitinity handling, use trivial hash of the full file handle.
ZFS's struct zfid_short does not have padding field after the length field,
as result, originally picked 8 bytes are loosing lower 16 bits of object ID,
causing many false matches and unneeded requests affinity to same thread.
  This fix substantially improves NFS server latency and scalability in SPEC
NFS benchmark by more flexible use of multiple NFS threads.
2014-01-22 23:48:15 +00:00
mav
76d8788652 MFC r259659, r259662:
Remove several linear list traversals per request from RPC server code.

  Do not insert active ports into pool->sp_active list if they are success-
fully assigned to some thread.  This makes that list include only ports that
really require attention, and so traversal can be reduced to simple taking
the first one.

  Remove idle thread from pool->sp_idlethreads list when assigning some
work (port of requests) to it.  That again makes possible to replace list
traversals with simple taking the first element.
2014-01-22 23:47:29 +00:00
mav
01e3debc7e MFC r259632:
Rework flow control for connection-oriented (TCP) RPC server.

  When processing receive buffer, write the amount of data, expected
in present request record, into socket's so_rcv.sb_lowat to make stack
aware about our needs.  When processing following upcalls, ignore them
until socket collect enough data to be read and processed in one turn.
  This change reduces number of context switches and other operations
in RPC stack during large NFS writes (especially via non-Jumbo networks)
by order of magnitude.

  After precessing current packet, take another look into the pending
buffer to find out whether the next packet had been already received.
If not, deactivate this port right there without making RPC code to
push this port to another thread just to find that there is nothing.
If the next packet is received partially, also deactivate the port, but
also update socket's so_rcv.sb_lowat to not be woken up prematurely.
  This change additionally reduces number of context switches per NFS
request about in half.
2014-01-22 23:46:19 +00:00
mav
4202d51e16 MFC r258578, r258580, r258581 (by hrs):
Replace Sun RPC license in TI-RPC library with a 3-clause BSD license
with the explicit permissions.
2014-01-22 23:45:27 +00:00
mav
096adafbe7 MFC r258132:
Some minor tuning to rpc/svc.c:
 - close cosmetic race in svc_exit();
 - do not set wait timeout for idle threads if we have no use for wakeups;
 - create new requested thread sooner, not only after some another thread
wakeup, that may happen later under constant load.
2014-01-22 23:42:30 +00:00
glebius
dfcbb7ef75 Merge r260377: fix panic on pf_get_translation() failure.
PR:		182557
2014-01-22 10:45:16 +00:00
glebius
929fc2bbee Merge r260046: Fix the parse type for NGM_LISTTYPES. 2014-01-22 10:38:01 +00:00
glebius
99ea781723 Merge r258478, r258479, r258480, r259719: fixes related to mass source
nodes removal.

PR:		176763
2014-01-22 10:29:15 +00:00
glebius
5da449f113 Merge several fixlets from head:
r257619: Remove unused PFTM_UNTIL_PACKET const.
r257620: Code logic of handling PFTM_PURGE into pf_find_state().
r258475: Don't compare unsigned <= 0.
r258477: Fix off by ones when scanning source nodes hash.
2014-01-22 10:18:25 +00:00
glebius
34e36d1706 Merge r257846:
Make TCP_KEEP* socket options readable. At least PostgreSQL wants
  to read the values.
2014-01-22 10:08:33 +00:00
glebius
4277478f01 Merge 260225:
Fix circular math macro.

PR:	146082
2014-01-22 09:22:39 +00:00
gjb
a3e74b51d9 10.0-RELEASE is out, so call stable/10 -STABLE again.
Reminded by:	David Wolfskill
Sponsored by:	The FreeBSD Foundation
2014-01-21 15:57:59 +00:00
marck
bc9a363c26 MFC r259925-259926:
Add GPT UUID for VMware vSAN meta-data partition.

Approved by:	ae
2014-01-21 09:19:28 +00:00
mav
5f170995ac MFC r260407:
Allow delete_method sysctl to be set to "DISABLE".
2014-01-20 23:56:49 +00:00
pluknet
9ee780ef73 MFC r258675: Fix build. 2014-01-18 21:57:38 +00:00
bryanv
416eede02b MFC r260583: Add unmapped IO support to virtio_scsi(4) 2014-01-18 18:41:24 +00:00
bryanv
652e7f2331 MFC r260582: Add unmapped IO support to virtio_blk(4) 2014-01-18 18:39:39 +00:00
bryanv
ef8dde25f6 MFC r260581: Add sglist_append_bio(9) to append a struct bio's data to
a sglist
2014-01-18 18:36:41 +00:00
bryanv
c634686d69 MFC r260566: Remove incorrect bit shift when assigning the LUN request field 2014-01-18 03:33:01 +00:00
mckusick
ccb26f3b89 MFC of 260088:
Fine tune filesystem block allocations under low free-space
conditions (-r254995) based on further operational experience.

Submitted by:  Dmitry Sivachenko
Fix Tested by: Dmitry Sivachenko
2014-01-17 16:22:10 +00:00
mckusick
f241188281 MFC of 260079:
Properly handle unsigned comparison.
2014-01-17 16:17:07 +00:00
avg
c1dbdbde60 MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2014-01-17 10:58:59 +00:00
avg
c2040a08a9 MFC r258605: Convert over the TCP probes to use mtod()
MFC slacker:	adrian
2014-01-17 10:48:44 +00:00
avg
f481239dd3 MFC r257037: Redefine the io provider using the SDT(9) macros
MFC slacker:	markj
2014-01-17 10:34:01 +00:00
avg
cc2516d697 MFC r258744-258746: zfs: add zfs_freebsd_putpages 2014-01-16 18:15:59 +00:00
avg
5bc00a6112 MFC r259612: ttm_bo_vm_lookup_rb: actually make use of the red-black tree 2014-01-16 16:28:19 +00:00
avg
c80798a63f MFC r258720: MFV r258665: 4347 ZPL can use dmu_tx_assign(TXG_WAIT) 2014-01-16 16:15:38 +00:00
avg
f06ee197d0 MFC r258739: zfs mappedread_sf: assert that a page is never partially valid 2014-01-16 16:13:21 +00:00
avg
9446d15bf5 MFC r258634: MFV r258376: 3964 L2ARC should always compress metadata buffers 2014-01-16 16:07:59 +00:00
avg
926bf5d727 MFC r258633: MFV r255256: 3954 metaslabs continue to load even after
hitting zfs_mg_alloc_failure limit
2014-01-16 16:05:21 +00:00
avg
26096ba436 MFC r258632,258704: MFV r255255: 4045 zfs write throttle & i/o scheduler
performance work

Sponsored by:	HybridCluster [merge]
2014-01-16 15:57:39 +00:00
avg
81894fb568 MFC r258631: MFV r247578
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
2014-01-16 14:47:29 +00:00
avg
df666f4c3e MFC r258743: drop ZUT_OBJ 2014-01-16 14:37:31 +00:00
avg
a4ee4e9fb0 MFC r258630: 734 taskq_dispatch_prealloc() desired 2014-01-16 14:34:53 +00:00
avg
16f4d5cb30 MFC r258628: opensolaris taskq: some cosmetic changes 2014-01-16 14:30:26 +00:00
avg
564d281d6a MFC r258648: use saner calculations in should_yield 2014-01-16 14:27:20 +00:00
avg
2a24dbf417 MFC r258638,258642: expose zfs_flags as debug.zfs_flags r/w tunable and sysctl
Sponsored by:	HybridCluster
2014-01-16 14:21:24 +00:00
avg
903d9c4e01 MFC r258354: taskqueue_cancel: garbage collect a write-only variable 2014-01-16 14:11:45 +00:00
ae
7c65e72b87 MFC r260481:
Add MRT6_DLOG() macro for debugging.
  Reduce number of MRT6DEBUG ifdefs and fix some broken format strings.
2014-01-16 13:21:32 +00:00
jhibbits
0920d1cd65 MFC r259284,r259287
Add PMU-based CPU frequency scalling.  This is used on most Titanium
PowerBooks.
2014-01-15 06:17:15 +00:00
jhibbits
876be05179 MFC r259082
Make some unsigned ints signed.

Found by:	clang (powerpc64)
2014-01-15 05:52:06 +00:00
jhibbits
18daeaf646 MFC r257941,r258119
Add the necessary bits for dumps on ppc64.
2014-01-15 05:41:28 +00:00
jhibbits
b1391adbae MFC r256543,r259245,r259421,r259668,r259674
r256543:

Add fasttrap for PowerPC.  This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.
2014-01-15 05:19:37 +00:00
jhibbits
44cab258a2 MFC r259394,r259395,r259699
r259394:
Rebase the PMC indices at 1, since PMC_SOFT is at 0.

r259395,r259699:
Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.
2014-01-15 04:44:52 +00:00
jhibbits
541949d319 MFC r256542,r256581
Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.
2014-01-15 04:16:45 +00:00
pfg
b405aa87ad 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.

PR:		kern/185448
2014-01-14 15:20:33 +00:00
mav
204096a62c MFC r260541, r260547:
Take additional reference on SCSI probe periph to cover its freeze count.

Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.
2014-01-14 12:01:36 +00:00
delphij
139f0a076d MFC r259811:
MFV r258373:

4168 ztest assertion failure in dbuf_undirty

4169 verbatim import causes zdb to segfa
4170 zhack leaves pool in ACTIVE state

illumos/illumos-gate@7fdd916c47
2014-01-14 01:28:08 +00:00
delphij
d17709df94 MFC r260110:
Eliminate unused drbr_stats_update implementation in oce(4) driver.

Noticed by:	dim
2014-01-13 19:34:23 +00:00
dim
efe1ed4163 MFC r260494:
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use <bsd.sys.mk>.  So revert that particular change for now.

Pointy hat to:	me
Noticed by:	zbb
2014-01-12 14:37:39 +00:00
hselasky
2d29b474fb MFC r260184:
Minor correction for the XHCI reset logic.
2014-01-11 08:21:13 +00:00
asomers
d1a85fc0d9 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.
2014-01-10 16:56:59 +00:00
ae
65169ca8a0 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.
2014-01-10 09:45:28 +00:00
ae
2865f87f4a 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.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
  Now it is easy to expand the size of the mirror when all its components
  are replaced. Also add g_resize method to geom_mirror class. It will write
  updated metadata to new last sector, when parent provider is resized.
2014-01-10 07:43:40 +00:00
dim
01c13c7d48 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.
2014-01-09 23:08:56 +00:00
dim
999774a8ef 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.
2014-01-09 22:40:51 +00:00
loos
837513035e MFC r257064:
Add an OFW SPI compatible bus.  Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2014-01-09 18:28:58 +00:00
mav
263d261fe5 MFC r258683:
Escape special XML chars, returned by some devices, confusing XML parsers.
2014-01-09 11:13:03 +00:00
mav
3b6d8c3206 MFC r258220, r258251:
Implement automatic live resize support for GEOM MULTIPATH class.

In "manual" mode just automatically resize provider in any direction.
In "automatic" mode allow growth (with new metadata write); in case of
shrinking check if there is already valid metadata found at the new
location.  This should allow easy transparent recovery if first resize
was done by mistake.

While there, unify metadata write code and fix minor memory leak.
2014-01-09 11:11:47 +00:00
mav
f9a52747b5 MFC r257946:
Introduce seperate mutex lock to protect protect CTL I/O pools, slightly
reducing global CTL lock scope and congestion.

While there, simplify CTL I/O pools KPI, hiding implementation details.
2014-01-09 10:59:31 +00:00
mav
2886802896 MFC r256995:
Remove 128KB bzero() call done for every block I/O data buffer.
2014-01-09 10:50:20 +00:00
mav
2e2af5808b MFC r256547 (by smh):
Added 4K quirks for Corsair Neutron GTX SSD's
2014-01-09 10:49:14 +00:00
mav
211b1cf423 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.
2014-01-09 10:44:27 +00:00
kib
dd0e0d7345 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.
2014-01-09 03:32:03 +00:00
kib
a3d28139be MFC r260204:
Assert that accounting for the pmap resident pages does not underflow.
2014-01-09 03:24:36 +00:00
peter
aa3916c7c0 Revert MFC of r258821 - it was already handled by MFC of r239672.
Pointy hat to: peter
2014-01-08 03:16:21 +00:00
cperciva
5190528326 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.
2014-01-08 02:19:39 +00:00
tuexen
624cda0839 MFC r259943:
Address some warnings which showed up on the userland version.
2014-01-07 23:50:02 +00:00
peter
16f467cacd MFC r258821 - fix tcp simultaneous close
PR:		kern/99188
2014-01-07 23:00:58 +00:00
edavis
be72cc4373 Merged r260415 from head.
Approved by:	davidch
2014-01-07 22:59:33 +00:00
pjd
9a40d227b3 MFC r260290:
Bring back the old size of the kinfo_file structure to preserve ABI.
Keep only one uint64_t spare for further cap_rights_t expension.

Add a comment clarifying that if the size of this structure changes,
a new sysctl MIB has to be allocate for it and the old structure has
to be returned by the old sysctl MIB.

Requested by:   re
2014-01-07 19:46:17 +00:00
mjg
759bcf6814 MFC r260232:
Don't check for fd limits in fdgrowtable_exp.

Callers do that already and additional check races with process
decreasing limits and can result in not growing the table at all, which
is currently not handled.
2014-01-07 19:28:10 +00:00
scottl
cd4455d638 MFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
locking support for CAM

r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

r256836:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

r256843:
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

r256888:
Unconditionally acquire periph reference on CCB allocation failure.

r256895:
Fix memory and references leak due to unfreed path.

r256960:
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

r256975:
Minor (mostly cosmetical) addition to r256960.

r257054:
Some microoptimizations for da and ada drivers:
 - Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.

r257482:
Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

r257501:
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment.  getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.

r257914:
Some CAM locks polishing:
 - Fix LOR and possible lock recursion when handling high-power commands.
Introduce new lock to protect left power quota and list of frozen devices.
 - Correct locking around xpt periph creation.
 - Remove seems never used XPT_FLAG_OPEN xpt periph flag.

Again, Netflix assisted with testing the merge, but all of the credit goes
to Alexander and iX Systems.

Submitted by:	mav
Sponsored by:	iX Systems
2014-01-07 01:51:48 +00:00
scottl
0a34594b9c MFC Alexander Motin's GEOM direct dispatch work:
r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time.  Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer.  That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

r256880:
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

r259247:
Fix bug introduced at r256607.  We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by:   mav
Sponsored by:   iX Systems
2014-01-07 01:32:23 +00:00
mav
1bce546983 MFC r256885:
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.
2014-01-05 23:02:03 +00:00
mav
4fb4fef0e1 MFC r256614:
- Take BIO lock in biodone() only when there is no completion callback set
and so we should wake up thread waiting in biowait().
 - Remove msleep() timeout from biowait().  It was added 11 years ago, when
there was no locks used, and it should not be needed any more.
2014-01-05 23:00:38 +00:00
mav
3dd7b80d9a MFC r258173:
Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal.
2014-01-05 22:55:21 +00:00
mav
75eb8161f4 MFC r258169:
Add ID for Intel Avoton SMBus controller.
2014-01-05 22:53:55 +00:00
mav
2ab2b6ae11 MFC r258168, r258170:
Add some more Intel HDA controller and CODEC IDs.
2014-01-05 22:52:59 +00:00
mav
51a1cf7d15 MFC r258164:
Handle case when ACPI reports HPET device, but does not provide memory
resource for it.  In such case take the address range from the HPET table.

This fixes hpet(4) driver attach on Asrock C2750D4I board.
2014-01-05 22:51:09 +00:00
mav
59357c8a6d MFC r258162:
Add some more IDs for Intel ATA, AHCI and USB controllers.
2014-01-05 22:49:54 +00:00
mav
d0f66a4aef MFC r257932:
Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+).  We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.
2014-01-05 22:48:12 +00:00
mav
67d4b65ac1 MFC r257930:
Some more registers access optimizations:
 - Process ATIO queue only if interrupt status tells so;
 - Do not update queue out pointers after each processed command, do it
only once at the end of the loop.
2014-01-05 22:47:12 +00:00
mav
116abbfd1f MFC r257916:
Save one more register read per command by not reading rqstoutrp register
every time.  The purpose of that register is unlikely output queue overflow
detection, so read it only when its last known (and probably stale now)
value signals overflow.
2014-01-05 22:45:46 +00:00
mav
2ef8e6e39b MFC r256893:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109815
2014-01-05 22:43:40 +00:00
mav
97d7cc4f54 MFC r256887:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109817
2014-01-05 22:42:42 +00:00
mav
a5ea679e93 MFC r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.
2014-01-05 22:40:28 +00:00
mav
eb69a5b0d1 MFC r256705:
Optimize isp(4) to reduce CPU usage, especially in target mode:
 - Remove two excessive and slow register reads from isp_intr().  Instead
of rereading value every time, assume that registers contain what we have
written there.
 - Avoid sequential search through 4096 array elements when looking for
command tag.  Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.
2014-01-05 22:38:44 +00:00
mav
cebac06b67 MFC r259168:
Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE
(64MB).  Even if we would find one somehow, ZFS kernel code rejects such
devices.  It is funny to look on attempts to read 4 256K vdev labels from
1.44MB floppy, though it is not very practical and quite slow.
2014-01-05 22:14:12 +00:00
mav
0e037d0ee8 MFC r258342:
Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261.

On machines with seveal CPUs and enough RAM this can easily twice improve
ZFS performance or twice reduce CPU usage.  It was disabled three years
ago due to memory and KVA exhaustion reports, but our VM subsystem got
improved a lot since that time, hopefully enough to make another try.
2014-01-05 22:12:45 +00:00
mav
fe82b61321 MFC r258137:
Introduce allocation cache to store LZ4 compression contexts without kicking
VM subsystem twice for every written record.

Tests on 24-core system show double reduction of CPU time spent on copying
single large well-compressed file.

This patch is not really needed on illumos (while not harm either) since
their memory allocator by default uses caching for all requests up to 128K.
2014-01-05 22:09:18 +00:00
dim
dafd81e458 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.
2014-01-05 15:39:37 +00:00
glebius
e3ce8ac51c Merge r260188 from head:
Fix regression from r249894. Now we pass "gw" as argument to if_output
  method, thus for multicast case we need it to point at "dst".

PR:		185395
2014-01-05 13:55:33 +00:00
mav
b8172b7691 MFC r258716:
- Add bucket size column to `show uma` DDB command.
 - Add `show umacache` command to show alike stats for cache-only UMA zones.
2014-01-04 23:43:18 +00:00
mav
00fb1dac34 MFC r258693:
Make UMA to not blindly force offpage slab header allocation for large
(> PAGE_SIZE) zones.  If zone is not multiple to PAGE_SIZE, there may
be enough space for the header at the last page, so we may avoid extra
header memory allocation and hash table update/lookup.

ZFS creates bunch of odd-sized UMA zones (5120, 6144, 7168, 10240, 14336).
This change gives good use to at least some of otherwise lost memory there.
2014-01-04 23:42:24 +00:00
mav
91cfd3a7cc MFC r258691:
Don't count bucket allocation failures for UMA zones as their own failures.
There are good reasons for this to happen, such as recursion prevention, etc.
and they are not fatal since buckets are just an optimization mechanism.
Real bucket allocation failures are any way counted by the bucket zones
themselves, and we don't need double accounting there.
2014-01-04 23:40:47 +00:00
mav
3ff6064c46 MFC r258340, r258497:
Implement mechanism to safely but slowly purge UMA per-CPU caches.

This is a last resort for very low memory condition in case other measures
to free memory were ineffective.  Sequentially cycle through all CPUs and
extract per-CPU cache buckets into zone cache from where they can be freed.
2014-01-04 23:39:39 +00:00
mav
4f2347ab59 MFC r258338:
Grow UMA zone bucket size also on lock congestion during item free.

Lock congestion is the same, whether it happens on alloc or free, so
handle it equally.  Now that we have back pressure, there is no problem
to grow buckets a bit faster.  Any way growth is much slower then in 9.x.
2014-01-04 23:38:06 +00:00
mav
363e273d8f MFC r258337:
Add two new UMA bucket zones to store 3 and 9 items per bucket.

These new buckets make bucket size self-tuning more soft and precise.
Without them there are buckets for 1, 5, 13, 29, ... items.  While at
bigger sizes difference about 2x is fine, at smallest ones it is 5x and
2.6x respectively.  New buckets make that line look like 1, 3, 5, 9, 13,
29, reducing jumps between steps, making algorithm work softer, allocating
and freeing memory in better fitting chunks.  Otherwise there is quite a
big gap between allocating 128K and 5x128K of RAM at once.
2014-01-04 23:37:01 +00:00
mav
a5fd15da70 MFC r258336:
Implement soft pressure on UMA cache bucket sizes.

Every time system detects low memory condition decrease bucket sizes for
each zone by one item.  As result, higher memory pressure will push to
smaller bucket sizes and so smaller per-CPU caches and so more efficient
memory use.

Before this change there was no force to oppose buckets growth as result
of practically inevitable zone lock conflicts, and after some run time
per-CPU caches could consume enough RAM to kill the system.
2014-01-04 23:35:34 +00:00
mav
afcf784d4c MFC r259232:
Create own free list for each of the first 32 possible allocation sizes.
In case of 4K allocation quantum that means for allocations up to 128K.

With growth of memory fragmentation these lists may grow to quite a large
sizes (tenths and hundreds of thousands items).  Having in one list items
of different sizes in worst case may require full linear list traversal,
that may be very expensive.  Having lists for items of single size means
that unless user specify some alignment or border requirements (that are
very rare cases) first item found on the list should satisfy the request.

While running SPEC NFS benchmark on top of ZFS on 24-core machine with
84GB RAM this change reduces CPU time spent in vmem_xalloc() from 8%
and lock congestion spinning around it from 20% to invisible levels.
And that all is by the cost of just 26 more pointers per vmem instance.

If at some point our kernel will start to actively use KVA allocations
with odd sizes above 128K, something may need to be done to bigger lists
also.
2014-01-04 23:31:34 +00:00
dim
04ce9320a8 MFC r260112:
In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.
2014-01-04 23:12:01 +00:00
dim
df316577ae MFC r260111:
For sys/ofed/drivers/infiniband/hw/mlx4/mcg.c, disable warning about
unused variables for now.
2014-01-04 23:00:56 +00:00
dim
1740bd87f0 MFC r260104:
For sys/ofed/drivers/infiniband/core/cm.c, disable warning about unused
functions for now.
2014-01-04 22:13:16 +00:00
dim
385c846a94 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.
2014-01-04 22:00:07 +00:00
dim
3a06a5ceae MFC r260103:
In sys/amd64/amd64/pmap.c, remove static function pmap_is_current(),
which has been unused since r189415.

Reviewed by:	alc
2014-01-04 21:45:52 +00:00
dim
6f23e4f462 MFC r260057:
In sys/dev/scc, remove unused static function scc_setmreg().  While
here, invoke scc_getmreg() in two more places where it can be used.

Reviewed by:	marcel
2014-01-04 21:32:53 +00:00
dim
b5bbabfb5f MFC r260056:
In sys/dev/vxge/vxgehal/vxgehal-ring.c, #if 0 an unused static function.
2014-01-04 21:23:49 +00:00
dim
5e502f56a4 MFC r260055:
In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.
2014-01-04 21:18:54 +00:00
glebius
a19f1f1902 Merge r258690 by mav from head:
Fix bug introduced at r252226, when udata argument passed to bucket_alloc()
  was used without making sure first that it was really passed for us.

  On some of my systems this bug made user argument passed by ZFS code to
  uma_zalloc_arg() unexpectedly block UMA per-CPU caches for those zones.
2014-01-04 19:51:57 +00:00
dim
d612a2323c MFC r260054:
In sys/dev/tpm/tpm.c, #if 0 an unused static function.
2014-01-04 19:13:25 +00:00
dim
641c7c0871 MFC r260048:
In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].
2014-01-04 19:04:53 +00:00
dim
a29e1060a5 MFC r260042:
Remove superfluous old-style rcsid[] from if_my.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 18:58:18 +00:00
dim
98319f939f 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.
2014-01-04 18:53:31 +00:00
dim
a0f0f71f55 MFC r260038:
In sys/dev/en/midway.c, #if 0 an unused static function.
2014-01-04 18:48:29 +00:00
dim
66ceef72b9 MFC r260039:
Turn off warnings about unused variables for a bunch of files under
contrib/ipfilter.
2014-01-04 18:33:28 +00:00
dim
d1cdc4fc9a MFC r260026:
Disable warning about unused functions for ieee80211_crypto.c and
ieee80211_mesh.c for now.
2014-01-04 18:24:45 +00:00
dim
83ddc49dd1 MFC r260025:
Disable warning about unused functions for ar9300_reset.c for now.
2014-01-04 18:19:53 +00:00
dim
d67626df70 MFC r260019:
For some files under sys/dev/drm2/i915, turn off warnings about unused
functions and variables, since they are contributed code.
2014-01-04 17:59:40 +00:00
dim
7a170f6d98 MFC r260020:
For sys/dev/drm2/radeon, only use -fms-extensions with gcc.  This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do.  For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.

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.
2014-01-04 17:54:06 +00:00
dim
dfba73dcd1 MFC r260017:
Mark unused static inline functions defined by the PCTRIE_DEFINE() macro
as __unused, so warnings about them are avoided.
2014-01-04 17:36:13 +00:00
dim
110965f5ae MFC r260016:
Remove superfluous old-style rcsid[] from if_sk.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 17:33:05 +00:00
mav
31e9f724fc MFC r259464:
Fix periodic per-CPU timers startup on boot.
2014-01-03 20:47:51 +00:00
kib
cb147dc4e3 MFC r259953:
Fix accounting for the negative cache entries when reusing v_cache_dd.
2014-01-03 20:02:30 +00:00
glebius
b1d31e2810 Merge r259681 from head:
Changes:
  - Reinit uio_resid and flags before every call to soreceive().
  - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the
    module doesn't support INET6.
  - Properly handle MSG_TRUNC return from soreceive().

PR:	184601
2014-01-03 12:28:33 +00:00
pluknet
ac5822de6e MFC r259906: Draft-ietf-tcpm-initcwnd-05 became RFC6928. 2014-01-02 16:48:08 +00:00
scottl
e03e146ca1 MFC r260070
Multi-queue NIC drivers and multi-port lagg tend to use the same lower
 bits of the flowid as each other, resulting in a poor distribution of
 packets among queues in certain cases.  Work around this by adding a
 set of sysctls for controlling a bit-shift on the flowid when doing
 multi-port aggrigation in lagg and lacp.  By default, lagg/lacp will
 now use bits 16 and higher instead of 0 and higher.

Obtained from:	Netflix
2014-01-02 01:51:54 +00:00