aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl
Commit message (Collapse)AuthorAgeFilesLines
* loader: support com.delphix:removingToomas Soome2019-08-086-10/+139
| | | | | | | | | | | | We should support removing vdev from boot pool. Update loader zfs reader to support com.delphix:removing. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18901 Notes: svn path=/head/; revision=350772
* Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib,Xin LI2019-08-0120-8801/+45
| | | | | | | | | | | | | | | | | | | | | | | | with an eventual goal to convert all legacl zlib callers to the new zlib version: * Move generic zlib shims that are not specific to zlib 1.0.4 to sys/dev/zlib. * Connect new zlib (1.2.11) to the zlib kernel module, currently built with Z_SOLO. * Prefix the legacy zlib (1.0.4) with 'zlib104_' namespace. * Convert sys/opencrypto/cryptodeflate.c to use new zlib. * Remove bundled zlib 1.2.3 from ZFS and adapt it to new zlib and make it depend on the zlib module. * Fix Z_SOLO build of new zlib. PR: 229763 Submitted by: Yoshihiro Ota <ota j email ne jp> Reviewed by: markm (sys/dev/zlib/zlib_kmod.c) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19706 Notes: svn path=/head/; revision=350496
* Fix FASTTRAPIOC_GETINSTR.Mark Johnston2019-07-172-3/+1
| | | | | | | | | | This ioctl is used when a breakpoint is encountered while disassembling a symbol in the target process. Since only one DTrace consumer can toggle or enumerate fasttrap probes from a given process at time, this ioctl does not appear to be used in practice. Notes: svn path=/head/; revision=350084
* Merge the vm_page hold and wire mechanisms.Mark Johnston2019-07-081-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The hold_count and wire_count fields of struct vm_page are separate reference counters with similar semantics. The remaining essential differences are that holds are not counted as a reference with respect to LRU, and holds have an implicit free-on-last unhold semantic whereas vm_page_unwire() callers must explicitly determine whether to free the page once the last reference to the page is released. This change removes the KPIs which directly manipulate hold_count. Functions such as vm_fault_quick_hold_pages() now return wired pages instead. Since r328977 the overhead of maintaining LRU for wired pages is lower, and in many cases vm_fault_quick_hold_pages() callers would swap holds for wirings on the returned pages anyway, so with this change we remove a number of page lock acquisitions. No functional change is intended. __FreeBSD_version is bumped. Reviewed by: alc, kib Discussed with: jeff Discussed with: jhb, np (cxgbe) Tested by: pho (previous version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19247 Notes: svn path=/head/; revision=349846
* Avoid extra taskq_dispatch() calls by DMU.Alexander Motin2019-06-253-5/+38
| | | | | | | | | | | | | DMU sync code calls taskq_dispatch() for each sublist of os_dirty_dnodes and os_synced_dnodes. Since the number of sublists by default is equal to number of CPUs, it will dispatch equal, potentially large, number of tasks, waking up many CPUs to handle them, even if only one or few of sublists actually have any work to do. This change adds check for empty sublists to avoid this. Notes: svn path=/head/; revision=349381
* Minimize aggsum_compare(&arc_size, arc_c) calls.Alexander Motin2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | For busy ARC situation when arc_size close to arc_c is desired. But then it is quite likely that aggsum_compare(&arc_size, arc_c) will need to flush per-CPU buckets to find exact comparison result. Doing that often in a hot path penalizes whole idea of aggsum usage there, since it replaces few simple atomic additions with dozens of lock acquisitions. Replacing aggsum_compare() with aggsum_upper_bound() in code increasing arc_p when ARC is growing (arc_size < arc_c) according to PMC profiles allows to save ~5% of CPU time in aggsum code during sequential write to 12 ZVOLs with 16KB block size on large dual-socket system. I suppose there some minor arc_p behavior change due to lower precision of the new code, but I don't think it is a big deal, since it should affect only very small window in time (aggsum buckets are flushed every second) and in ARC size (buckets are limited to 10 average ARC blocks per CPU). MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349040
* Alike to ZoL disable metaslab allocation tracing code.Alexander Motin2019-06-141-1/+33
| | | | | | | | | | | | It is too generous to collect in production debug traces that can only be read with kernel debugger. Illumos includes special code in their mdb debugger to read it, we don't. MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349039
* Properly align struct multilist_sublist to cache line.Alexander Motin2019-06-141-4/+3
| | | | | | | | | | Manual Illumos alignment does not fit us due to different kmutex_t size. MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349035
* Move write aggregation memory copy out of vq_lock.Alexander Motin2019-06-131-10/+12
| | | | | | | | | | | | | | | | | | | | | Memory copy is too heavy operation to do under the congested lock. Moving it out reduces congestion by many times to almost invisible. Since the original zio removed from the queue, and the child zio is not executed yet, I don't see why would the copy need protection. My guess it just remained like this from the time when lock was not dropped here, which was added later to fix lock ordering issue. Multi-threaded sequential write tests with both HDD and SSD pools with ZVOL block sizes of 4KB, 16KB, 64KB and 128KB all show major reduction of lock congestion, saving from 15% to 35% of CPU time and increasing throughput from 10% to 40%. Reviewed by: ahrens, behlendorf, ryao MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349006
* Fix comparison signedness in arc_is_overflowing().Alexander Motin2019-06-071-2/+2
| | | | | | | | | | | | | When ARC size is very small, aggsum_lower_bound(&arc_size) may return negative values, that due to unsigned comparison caused delays, waiting for arc_adjust() to "fix" it by calling aggsum_value(&arc_size). Use of signed comparison there fixes the problem. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=348790
* Explicitly start ARC adjustment on limits change.Alexander Motin2019-06-071-0/+11
| | | | | | | | | | While formally it is not necessary, but the sooner it start, the sooner it finish, and supposedly less disturbing for workload it will be. MFC after: 2 weeks Notes: svn path=/head/; revision=348788
* Restore ARC MFU/MRU pressureAndriy Gapon2019-06-071-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before r305323 (MFV r302991: 6950 ARC should cache compressed data) arc_read() code did this for access to a ghost buffer: arc_adapt() (from arc_get_data_buf()) arc_access(hdr, hash_lock) I.e., we first checked access to the MFU ghost/MRU ghost buffer and adapt MFU/MRU sizes (in arc_adapt()) and next move buffer from the ghost state to regular. After r305323 the sequence is different: arc_access(hdr, hash_lock); arc_hdr_alloc_pabd(hdr); I.e., we first move the buffer from the ghost state in arc_access() and then we check access to buffer in ghost state (in arc_hdr_alloc_pabd() -> arc_get_data_abd() -> arc_get_data_impl() -> arc_adapt()). This is incorrect: arc_adapt() never see access to the ghost buffer because arc_access() already migrated the buffer from the ghost state to regular. So, the fix is to restore a call to arc_adapt() before arc_access() and to suppress the call to arc_adapt() after arc_access(). Submitted by: Slawa Olhovchenkov <slw@zxy.spb.ru> MFC after: 2 weeks Sponsored by: Integros [integros.com] Differential Revision: https://reviews.freebsd.org/D19094 Notes: svn path=/head/; revision=348772
* Fix a race between fasttrap and the user breakpoint handler.Mark Johnston2019-06-061-19/+5
| | | | | | | | | | | | | | | | | | | | | When disabling the last enabled userspace probe, fasttrap clears the function pointers which hook in to the breakpoint handler. If a traced thread hit a fasttrap breakpoint before it was removed, we must ensure that it is able to call the hook; otherwise fasttrap will not consume the trap and SIGTRAP will be delievered to the thread. Synchronize with such threads by ensuring that they load the hook pointer with interrupts disabled, and by completing an SMP rendezvous after removing breakpoints and before clearing the pointers. Reported by: Alexander Alexeev <Alexander.Alexeev@dell.com> Tested by: Alexander Alexeev (earlier version) Reviewed by: cem, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20526 Notes: svn path=/head/; revision=348742
* dtrace: 64-bits registers supportMariusz Zaborski2019-06-051-0/+4
| | | | | | | | | | | | | | The registers in ilumos and FreeBSD have a different number. In the illumos, last 32-bits register defined is SS an in FreeBSD is GS. This off-by-one caused the uregs array to returns the wrong 64-bits register on amd64. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20363 Notes: svn path=/head/; revision=348705
* MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()Alexander Motin2019-06-031-1/+46
| | | | | | | | | | | | | | illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb Reviewed by: Sara Hartse <sara.hartse@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: Pavel Zakharov <pavel.zakharov@delphix.com> This is irrelevant to FreeBSD, just to reduce divergence. Notes: svn path=/head/; revision=348586
* MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objectsAlexander Motin2019-06-032-1/+2
| | | | | | | | | | | | | illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3 Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=348584
* MFV r348578: 9962 zil_commit should omit cache thrashAlexander Motin2019-06-035-73/+202
| | | | | | | | | | | | | | illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Joshua M. Clulow <josh@sysmgr.org> Author: Prakash Surya <prakash.surya@delphix.com> Notes: svn path=/head/; revision=348579
* MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flushAlexander Motin2019-06-033-8/+23
| | | | | | | | | | | | | illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: Prakash Surya <prakash.surya@delphix.com> Notes: svn path=/head/; revision=348577
* MFV r348573: 9993 zil writes can get delayed in zio pipelineAlexander Motin2019-06-031-1/+2
| | | | | | | | | | | | | illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: George Wilson <george.wilson@delphix.com> Notes: svn path=/head/; revision=348574
* MFV r348555: 9690 metaslab of vdev with no space maps was flushed during removalAlexander Motin2019-06-031-12/+10
| | | | | | | | | | | | illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8 Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Serapheim Dimitropoulos <serapheim@delphix.com> Notes: svn path=/head/; revision=348567
* MFC r348554: 9688 aggsum_fini leaks memoryAlexander Motin2019-06-032-2/+18
| | | | | | | | | | | | | | | illumos/illumos-gate@29bf2d68bef208274f5a54a14cc80c4a8cb76f53 Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Prashanth Sreenivasa <pks@delphix.com> Reviewed by: Jorgen Lundman <lundman@lundman.net> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Robert Mustacchi <rm@joyent.com> Author: Paul Dagnelie <pcd@delphix.com> Notes: svn path=/head/; revision=348566
* MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()Alexander Motin2019-06-032-54/+0
| | | | | | | | | | | | illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728 Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=348565
* MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening poolAlexander Motin2019-06-031-4/+9
| | | | | | | | | | | | | illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047 Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Serapheim Dimitropoulos <serapheim@delphix.com> Notes: svn path=/head/; revision=348564
* MFV r348551: 9862 fix typo in comment in vdev_impl.hAlexander Motin2019-06-031-1/+1
| | | | | | | | | | | | illumos/illumos-gate@84927f52bd837f6e4882a19e43fd026f1828d910 Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Robert Mustacchi <rm@joyent.com> Author: Allan Jude <allanjude@freebsd.org> Notes: svn path=/head/; revision=348563
* MFV r348550: 1700 Add SCSI UNMAP supportAlexander Motin2019-06-031-29/+52
| | | | | | | | | | | | | | | illumos/illumos-gate@047c81d31d0f571d6652e97143cd15281de61e84 Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Dan McDonald <danmcd@joyent.com> Author: Saso Kiselkov <saso.kiselkov@nexenta.com> This is irrelevant to FreeBSD, just a diff reduction. Notes: svn path=/head/; revision=348562
* MFV r348548: 9617 too-frequent TXG sync causes excessive write inflationAlexander Motin2019-06-033-8/+14
| | | | | | | | | | | | | | illumos/illumos-gate@7928f4baf4ab3230557eb6289be68aa7a3003f38 Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=348561
* MFV r348537: 8601 memory leak in get_special_prop()Alexander Motin2019-06-031-6/+11
| | | | | | | | | | | | | | | illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1 Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: John Gallagher <john.gallagher@delphix.com> Notes: svn path=/head/; revision=348559
* MFV r348535: 9677 panic from zio_write_gang_block() when creating dump ↵Alexander Motin2019-06-031-6/+14
| | | | | | | | | | | | | | | device on fragmented rpool illumos/illumos-gate@7341a7de4f0489193e0cfe11049a7bcf1596a4db Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prashanth Sreenivasa <pks@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Brad Lewis <brad.lewis@delphix.com> Notes: svn path=/head/; revision=348558
* Fix assertion in ZFS TRIM codeAllan Jude2019-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to an attempt to check two conditions at once in a macro not designed as such, the assertion would always evaluate to true. #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \ const TYPE __left = (TYPE)(LEFT); \ const TYPE __right = (TYPE)(RIGHT); \ if (!(__left OP __right)) \ assfail3(#LEFT " " #OP " " #RIGHT, \ (uintmax_t)__left, #OP, (uintmax_t)__right, \ __FILE__, __LINE__); \ _NOTE(CONSTCOND) } while (0) #define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t) Mean that we compared: left = (type == ZIO_TYPE_FREE || psize) OP = "<=" right = (SPA_MAXBLOCKSIZE) If the type was not FREE, 0 is less than SPA_MAXBLOCKSIZE (16MB) If the type is ZIO_TYPE_FREE, 1 is less than SPA_MAXBLOCKSIZE The constraint on psize (physical size of the FREE operation) is never checked against SPA_MAXBLOCKSIZE Reported by: Ka Ho Ng <khng300@gmail.com> Reviewed by: kevans MFC after: 2 weeks Sponsored by: Klara Systems Notes: svn path=/head/; revision=348370
* powerpc/dtrace: Fix fbt function probing for ELFv2Justin Hibbits2019-05-271-0/+2
| | | | | | | | | | | | | '.' function names exist only in ELFv1. ELFv2 does away with function descriptors, and look more like they do on powerpc(32) and most other platforms, as direct function pointers. Stop blacklisting regular function names in ELFv2. Submitted by: Brandon Bergren Differential Revision: https://reviews.freebsd.org/D20346 Notes: svn path=/head/; revision=348298
* Allocate buffers smaller then ABD chunk size as linear.Alexander Motin2019-05-221-1/+1
| | | | | | | | | | | | | | | | | | This allows to reduce memory waste by letting UMA to put multiple small buffers into one memory page slab. The page sharing means that UMA may not be able to free memory page when some of buffers are freed, but alternatively memory used by that buffer would just be wasted from the beginning. This change follows alike change in ZoL, but unlike Linux (according to my understanding of it from comments) FreeBSD never shares slabs bigger then one memory page, so this should be even less invasive then there. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=348117
* Fix typo in r348068Allan Jude2019-05-211-1/+1
| | | | Notes: svn path=/head/; revision=348071
* ZFS: Make deadman tunables no longer read-onlyAllan Jude2019-05-211-3/+3
| | | | | | | | | | | | | | | | This allows the user to enable, disable, and adjust the I/O deadman at runtime. This can be especially useful when a pool is backed by remote storage (such as iscsi, ggated, etc). PR: 221906 Submitted by: Fabian Keil <fk@fabiankeil.de> Obtained from: ElectroBSD MFC after: 1 week Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348068
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* powerpc/dtrace: Actually fix stack tracesJustin Hibbits2019-05-172-22/+25
| | | | | | | | | | | | | Fix stack unwinding such that requesting N stack frames in lockstat will actually give you N frames, not anywhere from 0-3 as had been before. lockstat prints the mutex function instead of the caller as the reported locker, but the stack frame is detailed enough to find the real caller. MFC after: 2 weeks Notes: svn path=/head/; revision=347943
* Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros.Konstantin Belousov2019-05-161-7/+7
| | | | | | | | | | | | | In all practical situations, the resolver visibility is static. Requested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: so (emaste) Differential revision: https://reviews.freebsd.org/D20281 Notes: svn path=/head/; revision=347895
* Add mutex_destroy() missed in r334844.Alexander Motin2019-04-261-1/+3
| | | | | | | | MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=346762
* Fix minor mismerges.Alexander Motin2019-04-261-8/+1
| | | | | | | | | No functional change. MFC after: 1 week Notes: svn path=/head/; revision=346760
* Change the way FreeBSD GID inheritance is hacked.Alexander Motin2019-04-191-4/+4
| | | | | | | | | | | | | | | | | I believe previous ifdef caused NULL dereference in later zfs_log_create() on attempt to create file inside directory belonging to ephemeral group created on illumos, trying to write to log information about GID domain of the newly created file, inheriting the ephemeral GID. This patch reuses original illumos SGID code with exception that due to lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBODY by another ifdef inside zfs_fuid_map_id(). MFC after: 1 month Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=346390
* powerpc/dtrace: Fix dtrace powerpc asm, and simplify stack walkingJustin Hibbits2019-04-132-42/+22
| | | | | | | | | | | | | | | | | Fix some execution bugs in the dtrace powerpc asm. addme pulls in the carry flag which we don't want, and the result wasn't recorded anyways, so the following beq to check for exit condition wasn't checking the right condition. Simplify the stack walking in dtrace_isa.c, so there's only a single walker that handles both pc and sp. This should make it easier to follow, and any bugfix that may be needed for walking only needs to be made in one place instead of two now. MFC after: 2 weeks Notes: svn path=/head/; revision=346173
* Introduce funlinkat syscall that always us to check if we are removingMariusz Zaborski2019-04-061-1/+2
| | | | | | | | | | | | the file associated with the given file descriptor. Reviewed by: kib, asomers Reviewed by: cem, jilles, brooks (they reviewed previous version) Discussed with: pjd, and many others Differential Revision: https://reviews.freebsd.org/D14567 Notes: svn path=/head/; revision=345982
* Replace read_random(9) with more appropriate arc4rand(9) KPIsConrad Meyer2019-04-041-1/+1
| | | | | | | | | Reviewed by: ae, delphij Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19760 Notes: svn path=/head/; revision=345865
* If the autoexpand pool property is turned on and vdev is healthy try toPawel Jakub Dawidek2019-03-301-0/+24
| | | | | | | | | | | expand the pool automatically when we detect underlying GEOM provider size change. Obtained from: Fudo Security Tested in: AWS Notes: svn path=/head/; revision=345728
* Revert r345410, VOP_FSYNC change in ZFS vdev_fileAndriy Gapon2019-03-221-5/+0
| | | | | | | | | | | | | I overlooked the fact that that VOP_FSYNC() call is not a FreeBSD VFS call, but a macro that provides an illumos-compatible wrapper for the FreeBSD operation. PR: 236475 Reported by: lwhsu Pointyhat to: avg Notes: svn path=/head/; revision=345418
* ZFS vdev_file: use correct value for waitfor parameter of VOP_FSYNCAndriy Gapon2019-03-221-0/+5
| | | | | | | | | PR: 236475 Reported by: asomers MFC after: 2 weeks Notes: svn path=/head/; revision=345410
* Use an explicit comparison with VM_GUEST_NO.Mark Johnston2019-03-212-2/+2
| | | | | | | | | Reported by: jhb MFC with: r345359 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345384
* Don't attempt to measure TSC skew when running as a VM guest.Mark Johnston2019-03-212-0/+6
| | | | | | | | | | | | | It simply doesn't work in general since VCPUs may migrate between physical cores. The approach used to measure skew also doesn't make much sense in a VM. PR: 218452 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345359
* MFV r336930: 9284 arc_reclaim_thread has 2 jobsAlexander Motin2019-03-153-183/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `arc_reclaim_thread()` calls `arc_adjust()` after calling `arc_kmem_reap_now()`; `arc_adjust()` signals `arc_get_data_buf()` to indicate that we may no longer be `arc_is_overflowing()`. The problem is, `arc_kmem_reap_now()` can take several seconds to complete, has no impact on `arc_is_overflowing()`, but due to how the code is structured, can impact how long the ARC will remain in the `arc_is_overflowing()` state. The fix is to use seperate threads to: 1. keep `arc_size` under `arc_c`, by calling `arc_adjust()`, which improves `arc_is_overflowing()` 2. keep enough free memory in the system, by calling `arc_kmem_reap_now()` plus `arc_shrink()`, which improves `arc_available_memory()`. illumos/illumos-gate@de753e34f9c399037936e8bc547d823bba9d4b0d Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Dan McDonald <danmcd@joyent.com> Reviewed by: Tim Kordas <tim.kordas@joyent.com> Approved by: Garrett D'Amore <garrett@damore.org> Author: Brad Lewis <brad.lewis@delphix.com> Notes: svn path=/head/; revision=345200
* Add _PC_ACL_* to vop_stdpathconfSimon J. Gerraty2019-03-111-4/+0
| | | | | | | | | | This avoid EINVAL from tmpfs etc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D19512 Notes: svn path=/head/; revision=345024
* Revert minor part of r344934.Alexander Motin2019-03-111-1/+1
| | | | | | | | | | | I tried to save some CPU time on hopeless aggregation attempts, but it seems the condition I added is overly strict, blocking also aggregation of optional I/Os in cases which previously were possible. Revert just to be safe. MFC after: 1 month Notes: svn path=/head/; revision=345014