Commit Graph

167947 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
1698a6aec9 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

MFC after:	1 week
2012-01-21 21:12:53 +00:00
Jilles Tjoelker
0105d7224d sh: Remove "kill" example function, which is superseded by the kill builtin
MFC after:	1 week
2012-01-21 20:39:17 +00:00
Pawel Jakub Dawidek
2ce9c023fd Fix minor memory leak.
MFC after:	3 days
2012-01-21 20:13:37 +00:00
Konstantin Belousov
10280ca601 Use getcontextx(3) internal API instead of getcontext(2) to provide
the signal handlers with the context information in the deferrred
case.

Only enable the use of getcontextx(3) in the deferred signal delivery
code on amd64 and i386. Sparc64 seems to have some undetermined issues
with interaction of alloca(3) and signal delivery.

Tested by:	flo (who also provided sparc64 harware access for me), pho
Discussed with:	marius
MFC after:	1 month
2012-01-21 18:06:18 +00:00
Konstantin Belousov
2b1de0afd1 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).

Tested by:  pho
MFC after:  1 month
2012-01-21 18:00:28 +00:00
Konstantin Belousov
f1c8f19055 Adopt to new layout of struct pcb.
MFC after:	1 month
2012-01-21 17:50:14 +00:00
Konstantin Belousov
8c6f8f3d5b Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs.  As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
  and the required size of FPU save area. The hw.use_xsave tunable is
  provided for disabling XSAVE, and hw.xsave_mask may be used to
  select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
  (run-time sized) user save area on the top of the kernel stack,
  right above the PCB. Reorganize the thread0 PCB initialization to
  postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
  well. FPU state is only useful for suspend, where it is saved in
  dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
  enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
  mcontext_t has a valid pointer to out-of-struct extended FPU
  state. Signal handlers are supplied with stack-allocated fpu
  state. The sigreturn(2) and setcontext(2) syscall honour the flag,
  allowing the signal handlers to inspect and manipilate extended
  state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
  place in the fixed-sized mcontext_t to place variable-sized save
  area. And, since mcontext_t is embedded into ucontext_t, makes it
  impossible to fix in a reasonable way.  Instead of extending
  getcontext(2) syscall, provide a sysarch(2) facility to query
  extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
  there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
  consumers, making it opaque. Internally, struct fpu_kern_ctx now
  contains a space for the extended state. Convert in-kernel consumers
  of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by:	pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after:	1 month
2012-01-21 17:45:27 +00:00
Hans Petter Selasky
dd03e19c08 Add support for the DesignWare USB 2.0 OTG controller chipset.
Currently the code is not built by any modules. That will
be fixed later. The Atmel ARM bus interface file part of this
commit is just for sake of example. All registers and bits are
declared like macros and not C-structures like in official
Synopsis header files. This driver mostly origins from the
musb_otg.c driver in FreeBSD except that the chip specific
programming has been replaced by the one for DWC 2.0 USB OTG.
Some parts related to system suspend and resume have been left
like empty functions for the future. USB suspend and resume is
fully supported.
2012-01-21 13:31:38 +00:00
Edward Tomasz Napierala
89ef44efa3 Replace the beerware license on mdconfig(8) with standard 2-clause BSD.
Approved by:	phk@
2012-01-21 11:48:48 +00:00
Andreas Tobler
7abf4584c6 Revert r230390. 2012-01-21 11:42:40 +00:00
Adrian Chadd
e148ff4992 Fix the hwmp code to handle nodes in a "line" topology.
For example, this particular topology didn't work correctly from all
nodes:

[A] - [B] - [C] - [D]

Submitted by:	Monthadar Al Jaberi <monthadar@gmail.com>
Reviewed by:	bschmidt, adrian
2012-01-21 00:42:28 +00:00
Adrian Chadd
f7c90cbb77 Change the hwmp debugging to use %6D rather than ether_sprintf().
This allows for multiple MAC addresses to be printed on the same
debugging line.  ether_sprintf() uses a static char buffer and
thus isn't very useful here.

Submitted by:	Monthadar Al Jaberi <monthadar@gmail.com>
2012-01-21 00:38:18 +00:00
Martin Matuska
6dfe0a3dc2 Use separate buffer for global path to avoid overflow of path buffer.
Reviewed by:	jamie@
MFC after:	3 weeks
2012-01-21 00:06:21 +00:00
Oleksandr Tymoshenko
cccc098d9b We use port_index field of struct octusb_qh to reference USB state
of root HUB. Although it is initialized with port index of the
device's parent hub, which is worng. So track the USB tree up to
root HUB  and initialize this filed ptroprly

Rename port_index to root_port_index in order to reflect its
real semantics.
2012-01-20 23:37:04 +00:00
Martin Matuska
08acd455f3 Add one more copyright line accidentially removed in r228103
MFC after:	3 days
2012-01-20 22:56:57 +00:00
Brooks Davis
2dd3bcd48d When creating the jails /dev/log symlink, do it by full path to avoid
creating stray "log" symlinks if the mount fails.  That apparently
happens in some ezjail configs.

PR:		conf/143084
Submitted by:	Dirk Engling <erdgeist at erdgeist.org>
Reviewed by:	simon
MFC after:	2 weeks
2012-01-20 22:55:19 +00:00
Martin Matuska
f622fcd083 Add accidentially removed copyright lines in r228103
Reported by:	pjd
MFC after:	3 days
2012-01-20 22:55:16 +00:00
Pedro F. Giffuni
5dcd37b17d Replace GPLd headers from the Maestro3 driver with BSD licensed
versions derived from /usr/ports/audio/oss.

The particular headers used were taken from the
attic/drv/oss_allegro directory and are mostly identical
to the previous files.

The Maestro3 driver is now free from the GPL.

NOTE: due to lack of testers this driver is being
considered for deprecation and removal.

PR:		kern/153920
Approved by:	jhb (mentor)
MFC after:	2 weeks
2012-01-20 22:37:10 +00:00
Andreas Tobler
9eab2f146a 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.

MFC after:	3 weeks, together with r230291
2012-01-20 22:34:19 +00:00
Nathan Whitehorn
8bab0d80ca Prevent an error resulting from signed/unsigned comparison on systems
that do not comply with the OF spec.

Submitted by:	Anders Gavare
MFC after:	1 week
2012-01-20 22:24:39 +00:00
Pawel Jakub Dawidek
b636ebaa6a 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 after:	1 week
2012-01-20 22:04:59 +00:00
Pawel Jakub Dawidek
ba1fa0f17e Remove another unused token.
MFC after:	3 days
2012-01-20 21:49:56 +00:00
Pawel Jakub Dawidek
77213228fd Remove unused token 'port'.
MFC after:	3 days
2012-01-20 21:45:24 +00:00
John Baldwin
5aefb4cbbf Close a race in NFS lookup processing that could result in stale name cache
entries on one client when a directory was renamed on another client.  The
root cause for the stale entry being trusted is that each per-vnode nfsnode
structure has a single 'n_ctime' timestamp used to validate positive name
cache entries.  However, if there are multiple entries for a single vnode,
they all share a single timestamp.  To fix this, extend the name cache
to allow filesystems to optionally store a timestamp value in each name
cache entry.  The NFS clients now fetch the timestamp associated with
each name cache entry and use that to validate cache hits instead of the
timestamps previously stored in the nfsnode.  Another part of the fix is
that the NFS clients now use timestamps from the post-op attributes of
RPCs when adding name cache entries rather than pulling the timestamps out
of the file's attribute cache.  The latter is subject to races with other
lookups updating the attribute cache concurrently.  Some more details:
- Add a variant of nfsm_postop_attr() to the old NFS client that can return
  a vattr structure with a copy of the post-op attributes.
- Handle lookups of "." as a special case in the NFS clients since the name
  cache does not store name cache entries for ".", so we cannot get a
  useful timestamp.  It didn't really make much sense to recheck the
  attributes on the the directory to validate the namecache hit for "."
  anyway.
- ABI compat shims for the name cache routines are present in this commit
  so that it is safe to MFC.

MFC after:	2 weeks
2012-01-20 20:02:01 +00:00
Dimitry Andric
462386c6b1 Pull in r148240 from upstream llvm trunk:
Make sure the non-SSE lowering for fences correctly clobbers EFLAGS.
  PR11768.

In particular, this fixes segfaults during the build of devel/icu on
i386.  The __sync_synchronize() builtin used for implementing icu's
internal barrier could lead to incorrect behaviour.

MFC after:	3 days
2012-01-20 19:18:11 +00:00
Robert Millan
475cc570f4 Map foreign architecture names to FreeBSD naming convention.
Approved by:	kib (mentor)
2012-01-20 18:55:56 +00:00
Andreas Tobler
618abe8ba1 Add the .opd section, this is helps booting a profiled kernel.
Adjust the OUTPUT_ARCH and use the builtin ALIGN() to adjust the data segment.
2012-01-20 18:52:31 +00:00
Andreas Tobler
4e7a7ba0b7 Disable GUPROF on archs other than i386/amd64 since the fine details are not
implemented.
2012-01-20 18:49:47 +00:00
Eygene Ryabinkin
edad1b5ba4 /etc/netstart: remove invocation of dhclient
dhclient is no longer a real service, it is a helper script
for /etc/rc.d/netif and devd.  Its direct invocation isn't
needed to bring the network up.

Approved by: jhb
2012-01-20 17:25:15 +00:00
Eygene Ryabinkin
1eea470950 dhclient: don't use syslog for logging non-DHCP interface errors
We should show the error to user, but it doesn't deserve syslog.

Approved by: jhb
2012-01-20 17:19:50 +00:00
Bjoern A. Zeeb
44e489690c Remove a superfluous INET6 check (no opt_inet6.h included anyway).
MFC after:	3 days
2012-01-20 17:18:54 +00:00
David Schultz
7ea324df88 Conditionalize the __floatunsisf and __floatunsidf functions, added in
NetBSD's rev 1.6 of this file, on !defined(SOFTFLOAT_FOR_GCC).  These
functions are provided by libgcc, so we don't need them.  This should
unbreak mips.
2012-01-20 14:44:21 +00:00
Michael Tuexen
c75fdd302b Fix a problem when using the CBAPI.
While there, remove an old comment which does not apply anymore.
2012-01-20 13:26:11 +00:00
Jaakko Heinonen
f3ee32b285 Don't print the nmount(2) provided error message if it is empty. 2012-01-20 12:59:12 +00:00
Doug Barton
72fc1aafe2 If we're booting there is no need to waste time determining if the service
is running or not.

PR:		conf/150752
Submitted by:	YIN Xiaofeng <75394094@qq.com>
2012-01-20 10:31:27 +00:00
Jaakko Heinonen
84d5bd0560 Change mount_fs() to not exit on error. The "failok" mount option
requires that errors are passed to the caller.

PR:		163668
Reviewed by:	Garrett Cooper
2012-01-20 10:06:28 +00:00
Jaakko Heinonen
b8f532c5b7 - Clean up checkpath().
- Remove unneeded sysexits.h include.

No functional change.

Submitted by:	bde
2012-01-20 07:29:29 +00:00
David Schultz
6e3ab4e1b3 Fix a small nit noted by bde: exp_x should be of type float, not double. 2012-01-20 07:02:42 +00:00
David Schultz
b7e83566eb Add a change I missed in r230367 (don't inline arm's fenv.h functions). 2012-01-20 07:01:58 +00:00
David Schultz
988825812e Remove an errant `#define dprintf printf'. It seems to be leftover
debugging code that nothing depends on. (I've had this in my tree for
years without issue.)
2012-01-20 06:59:29 +00:00
David Schultz
b831cdf6b1 These tests check whether the compiler evaluates floating-point
expressions properly.  Some of the tests depend on the compiler
implementing C99's FENV_ACCESS pragma, and only commercial compilers
do; those tests are currently skipped.  If any of the enabled tests
fail, then odds are the libm regression tests will fail also.
This should make it easier to diagnose reported problems on platforms
I don't have.

Currently, gcc passes all the tests that don't depend on FENV_ACCESS
on amd64 and sparc64.  Clang fails a few on amd64 (see clang bug
11406).  Both gcc and clang fare poorly on i386, which has well-known
issues.
2012-01-20 06:57:21 +00:00
David Schultz
7082a2cf72 Don't inline fenv.h functions on arm for now. Inlining makes sense:
the function bodies require only 2 to 10 instructions.  However, it
leads to application binaries that refer to a private ABI, namely, the
softfloat innards in libc.  This could complicate future changes in
the implementation of the floating-point emulation layer, so it seems
best to have programs refer to the official fe* entry points in libm.
2012-01-20 06:54:30 +00:00
David Schultz
9fa03ecd01 Add parentheses where required. Without them, `sizeof LDBL_MAX'
is a syntax error and shouldn't be, while `1 FLT_ROUNDS' isn't a
syntax error and should be.  Thanks to bde for the examples.
2012-01-20 06:51:41 +00:00
David Schultz
c36abe0dcf Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the
original vendor, but we're using their heavily modified version.)
This brings in functions for long double emulation (both extended and
quad formats), which may be useful for testing, and also for replacing
libc/sparc64/fpu/.
2012-01-20 06:16:14 +00:00
Eitan Adler
30d3283b15 Fix warning when compiling with gcc46:
error: variable 'clnt_stat' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:26 +00:00
Eitan Adler
de879bdae9 Fix warning when compiling with gcc46:
error: variable 'flags' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:16 +00:00
Eitan Adler
3688cbc221 Fix warning when compiling with gcc46:
error: variable 'a' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:08 +00:00
Eitan Adler
335797f33e Fix warning when compiling with gcc46:
error: variable 'fd' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:01 +00:00
Eitan Adler
e0ef7724c3 Fix warning when compiling with gcc46:
error: variable 'target' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:52 +00:00
Eitan Adler
3f028229d9 Fix warning when compiling with gcc46:
error: variable 'i2c' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:44 +00:00