Commit Graph

405 Commits

Author SHA1 Message Date
Rui Paulo
6e19f4de12 Merge from vendor-sys/opensolaris:
* add fasttrap files
2010-07-06 10:28:19 +00:00
Martin Matuska
d3cf8f4b68 Import latest ARC change from OpenSolaris:
- large ghost eviction causes high write latency
- arc_adjust might adjust MRU unnecessarily
- arc_adapt can lead to wild arc_p adjustment

OpenSolaris onnv-revision:	12636:13b5d698941e

Submitted by:	avg
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6950219, 6953403, 6951024)
MFC after:	1 month
2010-06-17 22:47:44 +00:00
Pawel Jakub Dawidek
653e034db5 Turn off UMA allocations on all archs by default. It isn't stable even on
amd64.

Reported by:	many
MFC after:	3 days
2010-06-17 17:41:42 +00:00
Pawel Jakub Dawidek
fcc7888f82 Remove redundant assignment.
MFC after:	3 days
2010-06-16 12:42:20 +00:00
Martin Matuska
bc5752e811 Fix arc_read_done may try to byteswap undefined data (sparc related)
OpenSolaris onnv-revision:	10839:cf83b553a2ab

Obtained from:	OpenSolaris (Bug ID 6836714)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:28:46 +00:00
Martin Matuska
726db0af89 Fix panic in zfs_getsecattr
OpenSolaris onnv-revision:	10295:f7a18a1e9610

Obtained from:	OpenSolaris (Bug ID 6870564)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:27:10 +00:00
Martin Matuska
9dac494ce6 Fix possible zfs panic on zpool import
OpenSolaris onnv-revision:	10040:38b25aeeaf7a

Obtained from:	OpenSolaris (Bug ID 6857012)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:25:57 +00:00
Martin Matuska
16547ea20b Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock
OpenSolaris onnv-revision:	9997:174d75a29a1c

Obtained from:	OpenSolaris (Bug ID 6843235)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:24:10 +00:00
Martin Matuska
072b6fc60e Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget
OpenSolaris onnv-revision:	9774:0bb234ab2287

Obtained from:	OpenSolaris (Bug ID 6788152)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:22:45 +00:00
Martin Matuska
1aa2ebdd23 Fix vdev_probe() starvation brings txg train to a screeching halt
OpenSolaris onnv-revision:	9722:e3866bad4e96

Obtained from:	OpenSolaris (Bug ID 6844069)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:21:37 +00:00
Martin Matuska
a2d6c8d15b Fix incomplete resilvering after disk replacement (raidz)
OpenSolaris onnv-revision:	9434:3bebded7c76a

Obtained from:	OpenSolaris (Bug ID 6794570)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:20:50 +00:00
Martin Matuska
b90308c521 Fix zfs destroy fails to free object in open context, stops up txg train
OpenSolaris onnv-revision:	9409:9dc3f17354ed

Obtained from:	OpenSolaris (Bug ID 6809683)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:19:51 +00:00
Martin Matuska
62c55b6d08 Fix unable to remove a file over NFS after hitting refquota limit
OpenSolaris onnv-revision:	8890:8c2bd5f17bf2

Obtained from:	OpenSolaris (Bug ID 6798878)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-06-12 11:18:29 +00:00
John Baldwin
3aa6d94e0c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
Martin Matuska
711bf9bcf1 Fix freeing space after deleting large files with holes.
OpenSolaris onnv revision:	9950:78fc41aa9bc5

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6792701)
MFC after:	3 days
2010-06-03 11:08:46 +00:00
Martin Matuska
dc5d34e454 Fix ZIL close when doing zfs rollback or zfs receive on a mounted dataset.
The fix is a partial import and merge of OpenSolaris onnv revisions
8227:f7d7be9b1f56. and 9292:e112194b5b73

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6798298)
MFC after:	3 days
2010-06-01 08:43:46 +00:00
Pawel Jakub Dawidek
510ec358c5 Fix a bug where resilver is not started automatically on pool import or load.
If disk was missing on pool load or import and on next pool load or import
it was present, resilver wasn't started automatically and ZFS reported all disks
as ONLINE and healthy. Then, when another disk died, pool became unaccessible,
because if it was 2-way mirror or RAIDZ1 two vdevs were out of sync.

To fix the problem, start resilver automatically on pool load or import.

Obtained from:	OpenSolaris
MFC after:	3 days
2010-05-31 23:17:45 +00:00
Pawel Jakub Dawidek
b1c7417cd8 Fix panic when reading label from provider with non power of 2 sector size.
Reported by:	James R. Van Artsdalen <james-freebsd-fs2@jrv.org>
MFC after:	3 days
2010-05-31 23:11:43 +00:00
Martin Matuska
dd85b12982 Remove kstat.zfs.arcstats.l2_write_bytes_written
The arcstats.l2_write_bytes_written kstat counter introduced
in r205231 was duplicite with vendor's arcstats.l2_write_bytes counter
imported in r208373 (OpenSolaris revision 8582:df9361868dbe)

Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-05-23 21:16:34 +00:00
Martin Matuska
5b170d55ae Fix zfs receive temporarily changing unchanged stream properties.
Fix possible panic with zfs_enable_datasets.

OpenSolaris onnv revision:	8536:33bd5de3260e

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6748561, 6757075)
MFC after:	3 days
2010-05-23 21:02:43 +00:00
Pawel Jakub Dawidek
4e8c7af455 Create UMA zones unconditionally.
MFC after:	3 days
2010-05-23 19:10:06 +00:00
Pawel Jakub Dawidek
a95add4cf8 Remove ZIO_USE_UMA from arc.c as well.
MFC after:	3 days
2010-05-23 18:42:33 +00:00
Konstantin Belousov
afe1a68827 Reorganize syscall entry and leave handling.
Extend struct sysvec with three new elements:
sv_fetch_syscall_args - the method to fetch syscall arguments from
  usermode into struct syscall_args. The structure is machine-depended
  (this might be reconsidered after all architectures are converted).
sv_set_syscall_retval - the method to set a return value for usermode
  from the syscall. It is a generalization of
  cpu_set_syscall_retval(9) to allow ABIs to override the way to set a
  return value.
sv_syscallnames - the table of syscall names.

Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding
the call to cpu_set_syscall_retval().

The new functions syscallenter(9) and syscallret(9) are provided that
use sv_*syscall* pointers and contain the common repeated code from
the syscall() implementations for the architecture-specific syscall
trap handlers.

Syscallenter() fetches arguments, calls syscall implementation from
ABI sysent table, and set up return frame. The end of syscall
bookkeeping is done by syscallret().

Take advantage of single place for MI syscall handling code and
implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and
PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the
thread is stopped at syscall entry or return point respectively.  The
EXEC flag augments SCX and notifies debugger that the process address
space was changed by one of exec(2)-family syscalls.

The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are
changed to use syscallenter()/syscallret(). MIPS and arm are not
converted and use the mostly unchanged syscall() implementation.

Reviewed by:	jhb, marcel, marius, nwhitehorn, stas
Tested by:	marcel (ia64), marius (sparc64), nwhitehorn (powerpc),
	stas (mips)
MFC after:	1 month
2010-05-23 18:32:02 +00:00
Martin Matuska
55a381515b Fix kernel panic when calling spa_tryimport() on a corrupted pool.
OpenSolaris onnv revision:	8680:005fe27123ba

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6786321)
MFC after:	1 day
2010-05-23 10:13:11 +00:00
Martin Matuska
e3fffd1a9f Fix mutex_exit misorder that can cause a kernel panic.
OpenSolaris onnv revision:	8667:5c308a17eb7c

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6795440)
MFC after:	1 day
2010-05-23 10:08:05 +00:00
Martin Matuska
7838815ebb Update L2ARC code and fix several bugs.
- improve ARC memory consumption (Bug ID 6488341)
- ARC/L2ARC metadata accounting (Bug ID 6748019)
- L2ARC turbo warmup (Bud ID 6748023)
- kstats for ARC content (Bug ID 6748023)
- kstats for evicted bytes from ARC by L2ARC state (Bud ID 6871680)
- fix panic on i386 systems (Bug ID 6821260)

OpenSolaris onnv revisions:
8582:df9361868dbe, 8628:97dcded6e556, 9215:7c4584f76b47,
9274:a10f8bd993c1, 10357:29060492b29d

OpenSolaris Bug IDs:
6748019, 6748023, 6748030, 6488341, 6798268, 6821260, 6790261, 6871680

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSlaris (multiple bug IDs)
MFC after:	3 days
2010-05-21 09:52:49 +00:00
Martin Matuska
370227d241 Reorder some already introduced locking variables.
OpenSolaris onnv revision:	8214:d7abf7c1f1c1

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6747934)
MFC after:	3 days
2010-05-21 09:35:28 +00:00
Martin Matuska
911e1f9b1d Fix stack overflow in zfs send.
OpenSolaris onnv-revision: 8012:8ea30813950f

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6765626)
MFC after:	3 days
2010-05-21 08:55:18 +00:00
Martin Matuska
8b2bc083b9 Fix: vdev_reopen() can lead to failed allocations
OpenSolaris onnv-revision: 7980:589f37f25048

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6764914)
MFC after:	3 days
2010-05-21 08:50:34 +00:00
Pawel Jakub Dawidek
2b3d97b81d Fix userland build by making io_task available only for the kernel and by
providing taskq_dispatch_safe() macro.

MFC after:	1 week
2010-05-16 19:44:08 +00:00
Pawel Jakub Dawidek
ed3c664257 Allow to configure UMA usage for ZIO data via loader and turn it on by
default for amd64. On i386 I saw performance degradation when UMA was used,
but for amd64 it should help.

MFC after:	3 days
2010-05-16 15:14:59 +00:00
Pawel Jakub Dawidek
cfb3e98d37 Add task structure to zio and use it instead of allocating one.
This eliminates the only place where we can sleep when calling zio_interrupt().
As a side-effect this can actually improve performance a little as we
allocate one less thing for every I/O.

Prodded by:	kib
MFC after:	1 week
2010-05-16 15:12:34 +00:00
Pawel Jakub Dawidek
ea478cb1da The whole point of having dedicated worker thread for each leaf VDEV was to
avoid calling zio_interrupt() from geom_up thread context. It turns out that
when provider is forcibly removed from the system and we kill worker thread
there can still be some ZIOs pending. To complete pending ZIOs when there is
no worker thread anymore we still have to call zio_interrupt() from geom_up
context. To avoid this race just remove use of worker threads altogether.
This should be more or less fine, because I also thought that zio_interrupt()
does more work, but it only makes small UMA allocation with M_WAITOK.
It also saves one context switch per I/O request.

PR:		kern/145339
Reported by:	Alex Bakhtin <Alex.Bakhtin@gmail.com>
MFC after:	1 week
2010-05-16 11:56:42 +00:00
Martin Matuska
ee56d88b76 Fix deadlock between zfs_dirent_lock and zfs_rmdir
OpenSolaris onnv revision:	11321:506b7043a14c

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6847615)
MFC after:	3 days
2010-05-16 07:46:03 +00:00
Martin Matuska
db708a6e2c Fix perfomance problem with ZFS prefetch caching [1]
Add statistics for ZFS prefetch (sysctl kstat.zfs.misc.zfetchstats)

Partial import of OpenSolaris onnv revision 10474:0e96dd3b905a

Reported by:	jhell@dataix.net (private e-mail) [1]
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6859997, 6868951)
MFC after:	3 days
2010-05-16 07:16:28 +00:00
Martin Matuska
bef629c14d Fix ZIL-related panic on zfs rollback.
OpenSolaris onnv-revision: 8746:e1d96ca6808c

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6796377)
MCF after:	1 week
2010-05-13 20:55:58 +00:00
Martin Matuska
c43d127a9a Import OpenSolaris revision 7837:001de5627df3
It includes the following changes:
- parallel reads in traversal code (Bug ID 6333409)
- faster traversal for zfs send (Bug ID 6418042)
- traversal code cleanup (Bug ID 6725675)
- fix for two scrub related bugs (Bug ID 6729696, 6730101)
- fix assertion in dbuf_verify (Bug ID 6752226)
- fix panic during zfs send with i/o errors (Bug ID 6577985)
- replace P2CROSS with P2BOUNDARY (Bug ID 6725680)

List of OpenSolaris Bug IDs:
6333409, 6418042, 6757112, 6725668, 6725675, 6725680,
6725698, 6729696, 6730101, 6752226, 6577985, 6755042

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (multiple Bug IDs)
MFC after:	1 week
2010-05-13 20:32:56 +00:00
Edward Tomasz Napierala
4e28b70950 Add missing check to prevent local users from panicing the kernel by trying
to set malformed ACL.

MFC after:	3 days
2010-05-13 15:31:00 +00:00
Martin Matuska
f2d1218cbe Fix possible hang when replaying large truncations.
OpenSolaris onnv revision:	7904:6a124a4ca9c5

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6761624)
MFC after:	3 days
2010-05-12 09:51:57 +00:00
Pawel Jakub Dawidek
c60c36a745 I added vfs_lowvnodes event, but it was only used for a short while and now
it is totally unused. Remove it.

MFC after:	3 days
2010-05-11 22:46:36 +00:00
Pawel Jakub Dawidek
8423e00b36 Eventhough r203504 eliminates taste traffic provoked by vdev_geom.c,
ZFS still like to open all vdevs, close them and open them again,
which in turn provokes taste traffic anyway.

I don't know of any clean way to fix it, so do it the hard way - if we can't
open provider for writing just retry 5 times with 0.5 pauses. This should
elimitate accidental races caused by other classes tasting providers created on
top of our vdevs.

MFC after:	3 days
Reported by:	James R. Van Artsdalen <james-freebsd-fs2@jrv.org>
Reported by:	Yuri Pankov <yuri.pankov@gmail.com>
2010-05-11 22:29:00 +00:00
Pawel Jakub Dawidek
204b20d932 Add missing new line characters to the warnings.
MFC after:	3 days
2010-05-11 22:23:35 +00:00
Martin Matuska
8c04b2242e Fix failed assertion on destroying datasets from an older pool version.
OpenSolaris onnv revision:	9390:887948510f80

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6826861)
MFC after:	3 days
2010-05-11 09:26:46 +00:00
Martin Matuska
431905576e Fix possible panic with zfs destroy.
OpenSolaris onnv revision:	8779:f164e0e90508

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784924)
MFC after:	3 days
2010-05-11 09:23:46 +00:00
Martin Matuska
bb8b966850 Fix zfs rename (may occasionally fail with dataset busy).
OpenSolaris onnv revision:	8517:41a0783dde17

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784757)
MFC after:	3 days
2010-05-11 09:19:41 +00:00
Martin Matuska
dbbd1505bf Fix endianess bug in ZFS intent log (ZIL).
OpenSolaris onnv revision:	8109:6147a1bdd359

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6760048)
MFC after:	3 days
2010-05-11 07:25:13 +00:00
Edward Tomasz Napierala
dc510c105f Enforce RLIMIT_FSIZE in ZFS.
Reviewed by:	pjd@
2010-05-07 14:30:21 +00:00
Marius Strobl
626b7c61f8 - Fix broken symlinks on cross platform zfs send/recv. [1]
- Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between
  amd64 and sparc64 in both directions by Michael Moll).

PR:		146272
Approved by:	mm, pjd
Obtained from:	OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1]
MFC after:	3 days
2010-05-05 22:15:20 +00:00
Martin Matuska
d75554ec04 Introduce hardforce export option (-F) for "zpool export".
When exporting with this flag, zpool.cache remains untouched.

OpenSolaris onnv revision: 8211:32722be6ad3b

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID: 6775357)
2010-05-05 18:22:29 +00:00
Martin Matuska
7d4daf9a10 Speed up ZFS list operation with objset prefetching.
Partial import of OpenSolaris onnv revisions:
8415:8809e849f63e, 10474:0e96dd3b905a

PR:		kern/146297
Submitted by:	myself
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6386929, 6755389, 6847118)
MFC after:	2 weeks
2010-05-04 17:40:24 +00:00