summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts
Commit message (Collapse)AuthorAgeFilesLines
* MFC r260835: MFV r260834: Fix memory leak of compressed buffers in ↵avg2014-02-171-9/+8
| | | | l2arc_write_done
* MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of aavg2014-02-173-2/+30
| | | | zfs transaction
* MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before ↵avg2014-02-171-6/+6
| | | | DMU_USERUSED_OBJECT
* MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_removeavg2014-02-171-1/+3
|
* MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow foravg2014-02-1718-1347/+2308
| | | | fine-grained control
* MFC r258291: change the ioctl definition so that the fasttrap ioctlavg2014-02-172-15/+2
| | | | handler is responsible for copying in userland data
* MFC r257679: Use suword32 and suword64 instead of copyout(9) in fasttrapavg2014-02-172-8/+8
|
* MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp"avg2014-02-171-7/+6
|
* MFC r258744-258746: zfs: add zfs_freebsd_putpagesavg2014-01-163-39/+232
|
* MFC r258720: MFV r258665: 4347 ZPL can use dmu_tx_assign(TXG_WAIT)avg2014-01-163-51/+20
|
* MFC r258739: zfs mappedread_sf: assert that a page is never partially validavg2014-01-161-1/+3
|
* MFC r258634: MFV r258376: 3964 L2ARC should always compress metadata buffersavg2014-01-163-2/+6
|
* MFC r258633: MFV r255256: 3954 metaslabs continue to load even afteravg2014-01-163-5/+113
| | | | hitting zfs_mg_alloc_failure limit
* MFC r258632,258704: MFV r255255: 4045 zfs write throttle & i/o scheduleravg2014-01-1634-720/+1472
| | | | | | performance work Sponsored by: HybridCluster [merge]
* MFC r258631: MFV r247578avg2014-01-163-81/+172
| | | | 3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
* MFC r258743: drop ZUT_OBJavg2014-01-161-3/+0
|
* MFC r258630: 734 taskq_dispatch_prealloc() desiredavg2014-01-164-19/+33
|
* MFC r258628: opensolaris taskq: some cosmetic changesavg2014-01-161-15/+14
|
* MFC r258638,258642: expose zfs_flags as debug.zfs_flags r/w tunable and sysctlavg2014-01-161-0/+4
| | | | Sponsored by: HybridCluster
* MFC r256543,r259245,r259421,r259668,r259674jhibbits2014-01-152-9/+583
| | | | | | | | | | | | | | | | | | | 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.
* MFC r259811:delphij2014-01-142-10/+0
| | | | | | | | | | | 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@7fdd916c474ea52896c671bbe7b56ba34a1ca132
* MFC 259240asomers2014-01-101-9/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* MFC Alexander Motin's GEOM direct dispatch work:scottl2014-01-072-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFC r259168:mav2014-01-051-2/+8
| | | | | | | 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.
* MFC r258342:mav2014-01-051-0/+4
| | | | | | | | | 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.
* MFC r258137:mav2014-01-053-2/+28
| | | | | | | | | | | 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.
* MFC r259576:pjd2013-12-221-1/+8
| | | | | | MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 illumos/illumos-gate@bb411a08b05466bfe0c7095b6373bbc1587e259a
* MFC r258311asomers2013-12-161-23/+40
| | | | | | | | | | | | | | | | | | | | | | | | | opensolaris/uts/common/dtrace/fasttrap.c Fix several problems that can cause panics on kldload and kldunload. * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before fasttrap_provs.fth_table gets allocated. This can lead to a panic on module load, because fasttrap_pid_cleanup_cb references fasttrap_provs.fth_table. Move kproc_create down after the point that fasttrap_provs.fth_table gets allocated, and modify the error handling accordingly. * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until after fasttrap_provs.fth_table got freed. That caused panics on module unload because fasttrap_exec_exit calls fasttrap_provider_retire, which references fasttrap_provs.fth_table. NULL those function pointers earlier. * There wasn't any code to destroy the fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload, leading to a resource leak when WITNESS is enabled. Destroy those mutexes during fasttrap_unload(). Sponsored by: Spectra Logic Corporation
* MFC r258294:smh2013-11-251-2/+4
| | | | | | | Fix ZFS deadlock when sending a snapshot which is mounted. Approved by: re (glebius) Sponsored by: Multiplay
* MFV r258378: 4089 NULL pointer dereference in arc_read()avg2013-11-251-9/+11
| | | | | | | illumos/illumos-gate@57815f6b95a743697e148327725b7f568e75e6ea Tested by: adrian Approved by: re (gjb)
* MFV r258377: 4088 use after free in arc_release()avg2013-11-251-1/+1
| | | | | | illumos/illumos-gate@ccc22e130479b5bd7c0002267fee1e0602d3f772 Approved by: re (gjb)
* MFC r258353: zfs page_busy: fix the boundaries of the cleared rangeavg2013-11-251-1/+16
| | | | | | | | | | | | | | | | | | This is a fix for a regression introduced in r246293. vm_page_clear_dirty expects the range to have DEV_BSIZE aligned boundaries, otherwise it extends them. Thus it can happen that the whole page is marked clean while actually having some small dirty region(s). This commit makes the range properly aligned and ensures that only the clean data is marked as such. It would interesting to evaluate how much benefit clearing with DEV_BSIZE granularity produces. Perhaps instead we should clear the whole page when it is completely overwritten and don't bother clearing any bits if only a portion a page is written. Reviewed by: kib Approved by: re (gjb)
* MFC r256889:smh2013-10-241-1/+1
| | | | | | | | | | | Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data(..) when compressing l2arc buffers. This eliminates L2ARC I/O errors, which resulted in very poor performance on vdev's configured with block size greater than 512b due to compression assuming a smaller min block size than the vdev supports. Approved by: re (glebius)
* MFV r255257: 4082 zfs receive gets EFBIG from dmu_tx_hold_free()avg2013-10-102-1/+11
| | | | | | | | | | | | | | | | illumos change 14172:be36a38bac3d: illumos ZFS issues: 4082 zfs receive gets EFBIG from dmu_tx_hold_free() Please note that this change is slightly different from r255257, because it is merged out of order with other (larger) upstream changes. PR: kern/182570 Reported by: Keith White <kwhite@site.uottawa.ca> Tested by: Keith White <kwhite@site.uottawa.ca> Approved by: re (glebius) MFC after: 1 week X-MFC after: r254753
* Initialize and free the DTrace taskqueue in the dtrace module load/unloadmarkj2013-10-081-9/+0
| | | | | | | | | | | | handlers rather than in the dtrace device open/close methods. The current approach can cause a panic if the device is closed which the taskqueue thread is active, or if a kernel module containing a provider is unloaded while retained enablings are present and the dtrace device isn't opened. Submitted by: gibbs (original version) Reviewed by: gibbs Approved by: re (glebius) MFC after: 2 weeks
* Improve lzjb decompress performance by reorganizing the codedelphij2013-10-081-1/+3
| | | | | | | | to tighten the copy loop. Submitted by: Denis Ahrens <denis h3q com> MFC after: 2 weeks Approved by: re (gjb)
* Optimize the block size used on ZFS cache devices as is already donegibbs2013-09-211-0/+2
| | | | | | | | | | for data and log devices. Reported by: Dmitryy Makarov Submitted by: smh Reviewed by: gibbs Approved by: re (delphij) MFC after: 2 weeks
* MFV r254750:delphij2013-09-219-45/+380
| | | | | | | | | | | | | Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. Illumos ZFS issues: 2932 support crash dumps to raidz, etc. pools MFC after: 1 month Approved by: re (ZFS blanket)
* Fixup cross-device rename checks in ZFS. Add a check for the casedavide2013-09-201-4/+7
| | | | | | | | | where 'fdvp' is a directory, 'tvp' is an already existing directory and they have different mount points. Reported by: avg, pjd Reviewed by: pjd Approved by: re (rodrigc)
* MFV r247844 (illumos-gate 13975:ef6409bc370f)delphij2013-09-107-34/+43
| | | | | | | | | | | Illumos ZFS issues: 3582 zfs_delay() should support a variable resolution 3584 DTrace sdt probes for ZFS txg states Provide a compatibility shim for Solaris's cv_timedwait_hires to help aid future porting. Approved by: re (ZFS blanket)
* Add sysctl/tunables for various metaslab variables.pjd2013-09-051-4/+33
|
* Change the cap_rights_t type from uint64_t to a structure that we can extendpjd2013-09-052-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation
* Previously, both zfs_rename and zfs_link does a check on whetherdelphij2013-08-281-3/+11
| | | | | | | | | | | | | | | | | | | | | | the passed vnode belongs to the same mount point (v_vfsp or also known as v_mount in FreeBSD). This check prevents the code from proceeding further on vnodes that do not belong to ZFS, for instance, on UFS or NULLFS. The recent change (merged as r254585) on upstream changes the check of v_vfsp to instead check the znode's z_zfsvfs. On Illumos this would work because when the vnode comes from lofs, the VOP_REALVP() would give the right vnode, this is not true on FreeBSD where our VOP_REALVP is a no-op, and as such tdvp is not guaranteed to be a ZFS vnode, and will later trigger a failed assertion when verifying the vnode. This changeset modifies our local shims (zfs_freebsd_rename and zfs_freebsd_link) to check if v_mount matches before proceeding further. Reported by: many Diagnostic work by: avg
* Rename the kld_unload event handler to kld_unload_try, and add a newmarkj2013-08-241-2/+2
| | | | | | | | | | | | | | kld_unload event handler which gets invoked after a linker file has been successfully unloaded. The kld_unload and kld_load event handlers are now invoked with the shared linker lock held, while kld_unload_try is invoked with the lock exclusively held. Convert hwpmc(4) to use these event handlers instead of having kern_kldload() and kern_kldunload() invoke hwpmc(4) hooks whenever files are loaded or unloaded. This has no functional effect, but simplifes the linker code somewhat. Reviewed by: jhb
* MFV r254749:delphij2013-08-242-38/+14
| | | | | | | | | | | Don't hold dd_lock for long by breaking it when not doing dsl_dir accounting. It is not necessary to hold the lock while manipulating the parent's accounting, because there is no interface for userland to see a consistent picture of both parent and child at the same time anyway. Illumos ZFS issues: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended
* MFV r254747:delphij2013-08-248-89/+97
| | | | | | | | | Fix a panic from dbuf_free_range() from dmu_free_object() while doing zfs receive. This is a regression from FreeBSD r253821. Illumos ZFS issues: 4047 panic from dbuf_free_range() from dmu_free_object() while doing zfs receive
* MFV r254422:delphij2013-08-231-2/+5
| | | | | | | | Illumos DTrace issues: 3089 want ::typedef 3094 libctf should support removing a dynamic type 3095 libctf does not validate arrays correctly 3096 libctf does not validate function types correctly
* zfs: do not reject any operations on a pool just because it's a boot poolavg2013-08-231-0/+2
| | | | | | | | Unlike the upstream FreeBSD supports booting to all kinds of pools. Requested by: many Tested by: sbruno MFC after: 12 days
* zfs: inline and remove zfs_vnode_lockavg2013-08-233-15/+5
| | | | | | | | It didn't serve any useful purpose, but obscured file and line information useful for debugging. MFC after: 5 days X-MFC with: r254445
* Remove the deprecated VM_ALLOC_RETRY flag for the vm_page_grab(9).kib2013-08-221-1/+1
| | | | | | | | The flag was mandatory since r209792, where vm_page_grab(9) was changed to only support the alloc retry semantic. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud