Commit Graph

392 Commits

Author SHA1 Message Date
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
Martin Matuska
77a7f64749 Fix deadlock during zfs receive.
OpenSolaris onnv revision:	9299:8809e849f63e

PR:		kern/146296
Submitted by:	myself
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6783818, 6826836)
MFC after:	1 week
2010-05-04 17:30:07 +00:00
Martin Matuska
df04ddbaa6 Add sysctl and loader tunable vfs.zfs.txg.write_limit_override.
This tunable improves fine-tuning of ZFS write throttling.

PR:		kern/146108
Suggested by:	Nikolay Denev <ndenev at gmail.com>
Approved by:	pjd, delphij (mentor)
MFC after:	2 weeks
2010-05-01 20:44:37 +00:00
Martin Matuska
9ccdc9600e Change description of tunable group vfs.zfs.txg to be more
understandable.

Approved by:	pjd, delphij (mentor)
MFC after:	3 days
2010-05-01 19:53:15 +00:00
Martin Matuska
d8665eb1f6 Fix improper pool write throughput calculation.
OpenSolaris onnv revision:	9366:17553395a745

PR:		kern/146108
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris, Bug ID 6817339
MFC after:	2 weeks
2010-04-30 07:48:29 +00:00
Pawel Jakub Dawidek
b19b0de471 Backport fix for 'zfs_znode_dmu_init: existing znode for dbuf' panic from OpenSolaris.
PR:		kern/144402
Reported by:	Alex Bakhtin <alex.bakhtin@gmail.com>
Tested by:	Alex Bakhtin <alex.bakhtin@gmail.com>
Obtained from:	OpenSolaris, Bug ID 6895088
MFC after:	3 days
2010-04-28 18:29:48 +00:00
Pawel Jakub Dawidek
7af9c09a61 Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
sunlnk) flag is set. We only deny dirctory's removal or rename.

PR:		kern/143343
Reported by:	marck
MFC after:	3 days
2010-04-22 18:47:23 +00:00
Rui Paulo
ff569d8436 Rename the cyclic global variable lapic_cyclic_clock_func to just
cyclic_clock_func. This will make more sense when we start developing non
x86 cyclic version.
2010-04-20 17:03:30 +00:00
Rui Paulo
b527a2a4dc The amd64 version of the cyclic dtrace module is a verbatim copy of the
i386 version, so instead having a copy of the same file, use Makefile
foo to include the i386 version on amd64.
2010-04-20 16:30:17 +00:00
Xin LI
0e568ab25c Partially MFp4 #176265 by pjd@:
- Properly initialize and destroy system_taskq.
 - Add a dummy implementation of taskq_create_proc().

Note: We do not currently use system_taskq in ZFS so this is mostly a
no-op at this time.  Proper system_taskq initialization is required
by newer ZFS code.

Ok'ed by:	pjd
MFC after:	2 weeks
2010-04-19 09:03:36 +00:00
Pawel Jakub Dawidek
bd7226a572 Restore previous order. 2010-04-18 12:43:33 +00:00
Pawel Jakub Dawidek
224329fb6b Style fixes. 2010-04-18 12:36:53 +00:00
Pawel Jakub Dawidek
eb998be67d Add missing list and lock destruction. 2010-04-18 12:27:07 +00:00
Pawel Jakub Dawidek
ad3cb80827 Extend locks scope to match OpenSolaris. 2010-04-18 12:25:40 +00:00