Commit Graph

188231 Commits

Author SHA1 Message Date
attilio
be627ca24c - When panicing for "too small boot cache" reason, print the actual
cache size value
- Add a way to specify the size of the boot cache at compile time

Sponsored by:	EMC / Isilon storage division
2013-02-15 14:50:36 +00:00
attilio
47ecbcf556 Improve dynamic branch prediction and i-cache utilization:
- Use predict_false() to tag boot-time cache decisions
- Compact boot-time cache allocation into a separate, non-inline,
  function that won't be called most of the times.

Sponsored by:	EMC / Isilon storage division
2013-02-15 14:48:06 +00:00
attilio
af55a9fb46 - Fix style in vm_page_lookup(): there is no whiteline between
assertions and other code in this file.
- Reinsert some comments that were lost during the work but which are
  actual yet, reducing differences with HEAD.

Sponsoed by:	EMC / Isilon storage division
2013-02-15 12:35:16 +00:00
attilio
431fc15e42 Merge from vmcontention. 2013-02-14 15:43:37 +00:00
attilio
8dfc0ddbd3 MFC 2013-02-14 15:35:58 +00:00
attilio
642ba82fdf Remove an unuseful check on resident_page_count.
vm_radix_lookup_ge() of an empty trie is as fast as checking a
NULL pointer.
2013-02-14 15:25:31 +00:00
attilio
908e129569 Fix style. 2013-02-14 15:24:13 +00:00
attilio
eafe26c8a6 The radix preallocation pages can overfow the biggestone segment, so
use a different scheme for preallocation: reserve few KB of nodes to be
used to cater page allocations before the memory can be efficiently
pre-allocated by UMA.

This at all effects remove boot_pages further carving and along with
this modifies to the boot_pages allocation system and necessity to
initialize the UMA zone before pmap_init().

Reported by:	pho, jhb
2013-02-14 15:23:00 +00:00
bapt
dafec87d65 Revert r246791 as it needs a security review first
Reported by:	gavin, rwatson
2013-02-14 15:17:53 +00:00
charnier
5aae6da9c9 remove old-style function definition
reduce WARNS=6 output
2013-02-14 14:44:08 +00:00
bapt
99980d8453 Allow fdescfs to be mounted from inside a jail
MFC after:	1 week
2013-02-14 13:03:15 +00:00
bapt
efbce5fcea In case of failure of the pkg boostrap advice the user to either change the
PACKAGESITE they use or install from ports directly indicating where the port
is localted in the port collection

Submitted by:	kientzle
2013-02-14 12:42:09 +00:00
hselasky
d7b1840a86 Add USB API to read power draw on USB devices.
Update usbconfig to print power draw on USB devices.

MFC after:	2 weeks
Submitted by:	Matt Burke @ icritical.com
2013-02-14 12:22:40 +00:00
hrs
af9a6b5901 - Fix libmd dependency. It is needed in the bootstrap library list because
usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile.  No symbol was actually used.

Reviewed by:	brooks
2013-02-14 08:32:07 +00:00
charnier
8426ce9b0a rework old-style functions prototypes
reduce WARNS=6 output
2013-02-14 08:16:03 +00:00
delphij
f061b4d302 Simplify r243637 and make sure that nfsdargs.{min,max}threads are always set
to meaningful value:

 - When nfsdcnt is set, it dictates all values;
 - Otherwise, nfsdargs.minthreads is set to user specified value, or the
   automatically detected value if there is no one specified;
   nfsdargs.maxthreads is set to the user specified value, or the value
   of nfsdargs.minthreads if there is no one specified; when it is smaller
   than nfsdargs.minthreads, the latter's value is always used.

MFC after:	2 weeks
2013-02-14 02:00:41 +00:00
delphij
236389d4e1 Abstract out setting of nfsdcnt and consistently use MAXNFSDCNT when the
proposed value is too high and DEFNFSDCNT when proposed value is too low.

MFC after:	2 weeks
2013-02-14 01:25:14 +00:00
delphij
7c3bad2349 Use static for all functions that do not need to be exported.
MFC after:	2 weeks
2013-02-14 01:01:53 +00:00
neel
0c9e7f62b2 Requests for invalid CPUID leaves should map to the highest known leaf instead.
Reviewed by:	grehan
Obtained from:	NetApp
2013-02-13 23:22:17 +00:00
mm
a590bde3e5 Change vfs.zfs.write_to_degraded from CTLFLAG_RW to CTLFLAG_RWTUN
Suggested by:	pjd
2013-02-13 23:11:25 +00:00
jkim
754bee5776 Merge OpenSSL 1.0.1e.
Approved by:	secteam (simon), benl (silence)
2013-02-13 23:07:20 +00:00
jkim
a6d6a27870 Change "the the" to "the". It is a continuation of r226436 and missed in
r237658.

Approved by:	benl (maintainer, implicit)
2013-02-13 22:38:20 +00:00
jkim
9069337c83 Import OpenSSL 1.0.1e.
Approved by:	secteam (delphij, simon), benl (silence)
2013-02-13 22:15:56 +00:00
delphij
c4e7fd7fa4 Restore De Bruijn algorithm for sparc64 where the compiler rely on a
library function for __builtin_c?z.

Tested by:	Michael Moll <kvedulv kvedulv de>
2013-02-13 17:30:54 +00:00
zeising
742b0cd5e4 Add strchrnul(), a GNU function similar to strchr(), except that it returns
a pointer to the end of the string, rather than NULL, if the character was
not found.

Approved by:	theraven
2013-02-13 15:46:33 +00:00
hselasky
5f9d7af0e4 Remove unused variable.
MFC after:	1 week
2013-02-13 15:43:15 +00:00
ian
3369101014 Add a dependency so that when compiling in a static dtb, the kernel gets
re-linked after changing the .dts source.

Reviewed by:	cognet, arm@
2013-02-13 15:13:47 +00:00
ian
cfdf5de939 Make the F_READAHEAD option to fcntl(2) work as documented: a value of zero
now disables read-ahead.  It used to effectively restore the system default
readahead hueristic if it had been changed; a negative value now restores
the default.

Reviewed by:	kib
2013-02-13 15:09:16 +00:00
hselasky
a40dc60f62 Resolve a LOR after r246616. Protect control requests using the USB device
enumeration lock. Make sure all callers of usbd_enum_lock() check the return
value. Remove the control transfer specific lock. Bump the FreeBSD version
number, hence external USB modules may need to be recompiled due to a USB
device structure change.

MFC after:	1 week
2013-02-13 12:35:17 +00:00
hselasky
6133fc8dbb Add new USB ID to FTDI driver.
MFC after:	1 week
PR:		kern/175893
Submitted by:	Tomek
2013-02-13 08:28:27 +00:00
hselasky
3d483cc0fe Add specific supported revision of D-Link DWA-140 rev B1, B2.
Submitted by:	PseudoCylon
MFC after:	1 week
2013-02-13 08:20:29 +00:00
glebius
6a0158e226 Fix my email. 2013-02-13 07:32:09 +00:00
pclin
03cebfbf5a Add myself as a ports committer and my mentor relationship.
Approved by:	swills (mentor)
2013-02-13 05:44:35 +00:00
adrian
af7893e0d4 Pull out the if_transmit() work and revert back to ath_start().
My changed had some rather significant behavioural changes to throughput.
The two issues I noticed:

* With if_start and the ifnet mbuf queue, any temporary latency
  would get eaten up by some mbufs being queued.  With ath_transmit()
  queuing things to ath_buf's, I'd only get 512 TX buffers before I
  couldn't queue any further frames.

* There's also some non-zero latency involved with TX being pushed
  into a taskqueue via direct dispatch.  Any time the scheduler didn't
  immediately schedule the ath TX task would cause extra latency.
  Various 1ge/10ge drivers implement both direct dispatch (if the TX
  lock can be acquired) and deferred task transmission (if the TX lock
  can't be acquired), with frames being pushed into a drbd queue.
  I'll have to do this at some point, but until I figure out how to
  deal with 802.11 fragments, I'll have to wait a while longer.

So what I saw:

* lots of extra latency, specially under load - if the taskqueue
  wasn't immediately scheduled, things went pear shaped;

* any extra latency would result in TX ath_buf's taking their sweet time
  being replenished, so any further calls to ath_transmit() would drop
  mbufs.

* .. yes, there's no explicit backpressure here - things are just dropped.
  Eek.

With this, the general performance has gone up, but those subtle if_start()
related race conditions are back.  For some reason, this is doubly-obvious
with the AR5416 NIC and I don't quite understand why yet.

There's an unrelated issue with AR5416 performance in STA mode (it's
fine in AP mode when bridging frames, weirdly..) that requires a little
further investigation.  Specifically - it works fine on a Lenovo T40
(single core CPU) running a March 2012 9-STABLE kernel, but a Lenovo T60
(dual core) running an early November 2012 kernel behaves very poorly.
The same hardware with an AR9160 or AR9280 behaves perfectly.
2013-02-13 05:32:19 +00:00
rpaulo
5d56fc6ccd Introduce PLATFORMMETHOD_END and use it. 2013-02-13 02:21:45 +00:00
attilio
3db337c2ea Grammar.
Sponsored by:	EMC / Isilon storage division
2013-02-13 02:04:49 +00:00
attilio
f61b4323c2 Merge from vmcontention 2013-02-13 01:30:35 +00:00
attilio
e403650531 MFC 2013-02-13 01:25:17 +00:00
attilio
53f78d1a7d Implement a new algorithm for managing the radix trie which also
includes path-compression. This greatly helps with sparsely populated
tries, where an uncompressed trie may end up by having a lot of
intermediate nodes for very little leaves.

The new algorithm introduces 2 main concepts: the node level and the
node owner.  Every node represents a branch point where the leaves share
the key up to the level specified in the node-level (current level
excluded, of course).  Such key partly shared is the one contained in
the owner.  Of course, the root branch is exempted to keep a valid
owner, because theoretically all the keys are contained in the space
designed by the root branch node.  The search algorithm seems very
intuitive and that is where one should start reading to understand the
full approach.

In the end, the algorithm ends up by demanding only one node per insert
and this is not necessary in all the cases.  To stay safe, we basically
preallocate as many nodes as the number of physical pages are in the
system, using uma_preallocate().  However, this raises 2 concerns:
* As pmap_init() needs to kmem_alloc(), the nodes must be pre-allocated
  when vm_radix_init() is currently called, which is much before UMA
  is fully initialized.  This means that uma_prealloc() will dig into the
  UMA_BOOT_PAGES pool of pages, which is often not enough to keep track
  of such large allocations.
  In order to fix this, change a bit the concept of UMA_BOOT_PAGES and
  vm.boot_pages. More specifically make the UMA_BOOT_PAGES an initial "value"
  as long as vm.boot_pages and extend the boot_pages physical area by as
  many bytes as needed with the information returned by
  vm_radix_allocphys_size().
* A small amount of pages will be held in per-cpu buckets and won't be
  accessible from curcpu, so the vm_radix_node_get() could really panic
  when the pre-allocation pool is close to be exhausted.
  In theory we could pre-allocate more pages than the number of physical
  frames to satisfy such request, but as many insert would happen without
  a node allocation anyway, I think it is safe to assume that the
  over-allocation is already compensating for such problem.
  On the field testing can stand me correct, of course.  This could be
  further helped by the case where we allow a single-page insert to not
  require a complete root node.

The use of pre-allocation gets rid all the non-direct mapping trickery
and introduced lock recursion allowance for vm_page_free_queue.

The nodes children are reduced in number from 32 -> 16 and from 16 -> 8
(for respectively 64 bits and 32 bits architectures).
This would make the children to fit into cacheline for amd64 case,
for example, and in general spawn less cacheline, which may be
helpful in lookup_ge() case.
Also, path-compression cames to help in cases where there are many levels,
making the fallouts of such change less hurting.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	jeff (partially)
Tested by:	flo
2013-02-13 01:19:31 +00:00
zont
58f911cb15 - Make actually printing path of AF_LOCAL socket types.
MFC after:	1 week
2013-02-12 19:10:54 +00:00
zont
524959b2e6 - Use correct size of copying different socket structures.
MFC after:	1 week
2013-02-12 18:48:11 +00:00
marcel
6da471ce02 Eliminate the PC_CURTHREAD symbol and load the current thread's
thread structure pointer atomically from r13 (the pcpu pointer)
for the current CPU/core.
Add a CTASSERT in machdep.c to make sure that pc_curthread is in
fact the first field in struct pcpu.

The only non-atomic operations left were those related to process-
space operations, such as casuword, subyte, suword16, fubyte,
fuword16, copyin, copyout and their variations.

The casuword function has been re-structured more complete than
the others. This way we have an example of a better bundling
without introducing a lot of risk when we get it wrong. The
other functions can be rebundled in separate commits and with
the appropriate testing.
2013-02-12 17:38:35 +00:00
marcel
bd362fd0fc Eliminate padding by moving 'narg' next to 'code'. Both are 32-bit
entities in the syscall_args structure that otherwise has 64-bit
only fields.
2013-02-12 17:24:41 +00:00
kib
bd7f0fa0bb Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c.  It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code.  The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync().  Previously this was done in a type specific
way.  Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by:	jeff (sponsored by EMC/Isilon)
Reviewed by:	kan (previous version), scottl,
	mjacob (isp(4), no objections for target mode changes)
Discussed with:	     ian (arm changes)
Tested by:	marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
	amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
2013-02-12 16:57:20 +00:00
marcel
e0a463e76c Now that we actually use more memory descriptors, make sure to dump
them as well.
2013-02-12 16:51:43 +00:00
pluknet
99dfead46f o Bring in sync decoding the first nfssvc(2) parameter (flags) with
the current definitions location.
o Respect numbers in NFSSVC_* (e.g. NFSSVC_V4ROOTEXPORT).

MFC after:	1 week
2013-02-12 13:01:34 +00:00
glebius
f03c14c9a7 Substitute '#ifdef ALIGNED_POINTER' with '#ifndef __NO_STRICT_ALIGNMENT',
since the former is defined everywhere. This cuts off some code not
necessary on non strict aligment arches.

Reviewed by:	adrian
Sponsored by:	Nginx, Inc.
2013-02-12 11:24:37 +00:00
gonzo
230643b5db Remove debug output 2013-02-12 07:27:40 +00:00
andrew
3303d1f6a9 When clang builds libc it may insert calls to __aeabi_* functions. Normally
this is not a problem as they are resolved by libgcc. The exception is for
the __aeabi_mem* functions. These call back into libc to the appropriate
function. This causes issues for static binaries as we only link against
libc once so there is no way for it to call into libgcc and back.

The fix for this is to include these symbols in libc but keep them hidden
so binaries use the libgcc version.
2013-02-12 06:04:51 +00:00
andrew
180d9ee4c7 Allow us to build clang for ARM EABI. Clang and llvm use the
arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or
armv6 and are building for EABI.

Reviewed by:	dim
2013-02-12 05:56:00 +00:00