Commit Graph

266127 Commits

Author SHA1 Message Date
Michael Gmelin
278e370066 freebsd-tips: Add fortune on kern.tty_info_kstacks
Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to
alter the output of ^T (tty info).

Reviewed by: ceri
Differential Revision: https://reviews.freebsd.org/D30388
2021-06-09 23:35:38 +02:00
Randall Stewart
b45daaea95 tcp: LRO timestamps have lost their previous precision
Recently we had a rewrite to tcp_lro.c that was tested but one subtle change
was the move to a less precise timestamp. This causes all kinds of chaos
in tcp's that do pacing and needs to be fixed to use the more precise
time that was there before.

Reviewed by: mtuexen, gallatin, hselasky
Sponsored by: Netflix Inc
Differential Revision:	https://reviews.freebsd.org/D30695
2021-06-09 13:58:54 -04:00
Rick Macklem
5e5ca4c8fc nfscl: Add a "has acquired a delegation" flag for delegations
A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount.  Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

MFC after:      2 weeks
2021-06-09 08:00:43 -07:00
Mark Johnston
334335cb14 i386: Add "options HYPERV" to NOTES
This unbreaks the LINT build.

Fixes:		97993d1ebf
Reported by:	mjg
MFC after:	13 days
2021-06-09 09:01:22 -04:00
Lutz Donnerhacke
6b08e68be1 tests/netgraph: Tests for ng_vlan_rotate
Test functionality of ng_vlan_rotate(4):
 - Rotate 1 to 9 stagged vlans in any possible direction and length
 - Rotate random combinations of ethertypes (8100, 88a8, 9100)
 - Automatic reverse rotating for backward data flow
 - Test too many and to few vlans

Reviewed by:	kp (earlier version)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30670
2021-06-09 13:45:37 +02:00
Lutz Donnerhacke
7863faa78a tests/netgraph: Tests for ng_hub
Test functionality of ng_hub(4):
 - replicting traffic to anything but the sending hook
 - persistence
 - an unrestricted loop
 - implementation limits with many hooks.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30633
2021-06-09 13:36:23 +02:00
Lutz Donnerhacke
5554abd9cc tests/netgraph: Factor out univeral data counter functions
Factor out the data counter helpers for other tests to use.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30699
2021-06-09 13:32:22 +02:00
Lutz Donnerhacke
a664ade939 tests/netgraph: Fix style
Indent all files correctly

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30692
2021-06-09 13:31:16 +02:00
Fernando Apesteguía
dc318a4ffa Fix syscall kld example
PR:	255936
Reported by:	splitface@mailfence.com
Approved by:	gbe (mentor), imp@, jilles@
Differential Revision:	https://reviews.freebsd.org/D30498
2021-06-09 12:24:26 +02:00
Andriy Gapon
ffc5dc788f rk3328_cru: fix a typo in the SCLK_I2S2 gate definition
MFC after:	4 days
2021-06-09 12:41:52 +03:00
Andriy Gapon
20eb6bd8c5 rc.d: liberate powerd from ACPI dependency
For instance, many non-ACPI ARM systems have CPU power / frequency
levels.

Discussed with:	manu
MFC after:	1 week
2021-06-09 12:40:53 +03:00
Ed Maste
f530cce55c UPDATING: correct typo
Sponsored by:	The FreeBSD Foundation
2021-06-08 20:47:05 -04:00
Warner Losh
dbbf7cb21c libspl: fix NO_CLEAN build
atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by:		Netflix
2021-06-08 17:56:15 -06:00
Martin Matuska
f20893853e zfs: unbreak build broken in 160388166 2021-06-08 22:21:11 +02:00
Jessica Clarke
6d2648bcab tip: Fix pointer-vs-integer confusion
Currently IREMOTE assumes that every value is (initially) a pointer to a
long. This is true for NUMBERs, but false for STRINGs, which are instead
pointers to pointers, though on ILP32 and LP64 systems these happen to
have the same representation, but this is still a strict aliasing
violation, and of course breaks on systems where the representations are
not the same, such as CHERI. We do not currently have any BOOLs (short,
curiously) or CHARs used with IREMOTE, though the code should not be
relying on that.

This removes the unused setaddress macro, and the now-unused address
macro due to the above issue.

Reviewed by:	imp, kib
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D30697
2021-06-08 18:30:59 +01:00
Jessica Clarke
de295884c4 tip: Cast via intptr_t not long when casting between pointer and int
Whilst all FreeBSD architectures have the same representation for
intptr_t and long (even if the former is int on ILP32 architectures),
this is more general and correct, and on CHERI they are not the same so
warnings are generated by default for integer-to-pointer casts that
aren't via (u)intptr_t.

Reviewed by:	imp, kib
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D30696
2021-06-08 18:30:59 +01:00
Lutz Donnerhacke
9021c46603 tests/netgraph: Attribute errors to the caller
Errors raised in the common util functions should raise the location
of their caller to be useful and include the errno description.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30671
2021-06-08 19:23:50 +02:00
Marcin Wojtas
28c4e511c2 Add ofw interface support to PCI
Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
In order to access information stored in them we need to add ofw bus
support to pci. Pass devinfo request up to our parent, which
is responsible for parsing all the information.
It allows to use ofw interface on PCI devices that support it.
This method is similar to sys/dev/acpica/acpi_pci.c.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30181
2021-06-08 17:52:02 +02:00
Marcin Wojtas
ea52e81588 pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices
Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
It expects the nodes to be mapped to devices enumerated using the standard
PCI method. Mapping is done by reading device and function ids from "reg"
property. Information is dts is used to describe MDIO/PHY connected
to a given interface.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30180
2021-06-08 17:51:40 +02:00
Marcin Wojtas
f0f7b0868a Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c
ThunderX is the only board known to use them.
Move them to the ThunderX PCIe driver.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30179
2021-06-08 17:51:11 +02:00
Warner Losh
b382394332 updating: add note about vendor/openzfs branch rename
Add a pointer to
https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html
to explain how to pull a new tree due to the vendor/openzfs branch
being renamed.

Reviewed by:		lwhsu@
Sponsored by:		Netflix
2021-06-08 09:00:57 -06:00
Martin Matuska
1603881667 zfs: merge openzfs/zfs@75b4cbf62 (master) into main
Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11751 Avoid taking global lock to destroy zfsdev state
  #11786 Ratelimit deadman zevents as with delay zevents
  #11803 ZFS traverse_visitbp optimization to limit prefetch
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11833 Refactor zfsdev state init/destroy to share common code
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11843 libzutil: zfs_isnumber(): return false if input empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11930 vdev_mirror: don't scrub/resilver devices that can't be read
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11955 zfs get: don't lookup mount options when using "-s local"
  #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl
  #11959 vdev_id: variable not getting expanded under map_slot()
  #11966 Scale worker threads and taskqs with number of CPUs
  #11994 Clean up use of zfs_log_create in zfs_dir
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Implement xattr=sa
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12046 Improve scrub maxinflight_bytes math
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12061 Fix dRAID sequential resilver silent damage handling
  #12072 Let zfs diff be more permissive
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode
  #12104 FreeBSD boot code reminder after zpool upgrade
  #12114 Introduce write-mostly sums

Obtained from:	OpenZFS
OpenZFS commit:	75b4cbf625
2021-06-08 16:52:44 +02:00
Martin Matuska
ed9215c8e0 zfs: merge openzfs/zfs@3522f57b6 (master) to main
This changes branch tracking of sys/contrib/openzfs to a new
direct-import branch vendor/openzfs/master.

No functional changes.

OpenZFS tag:	2.1.0-rc1
2021-06-08 16:25:14 +02:00
Mark Johnston
97993d1ebf hyperv: Fix vmbus after the i386 4/4 split
The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by:	Harry Schmalzbauer <freebsd@omnilan.de>
Tested by:	Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by:	whu, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30577
2021-06-08 09:40:30 -04:00
Alan Somers
75b4cbf625
libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
`getfsstat(2)` is used to retrieve the list of mounted file systems,
which libzfs uses when fetching properties like mountpoint, atime,
setuid, etc.  The `mode` parameter may be `MNT_NOWAIT`, which uses
information in the VFS's cache, or `MNT_WAIT`, which effectively does a
`statfs` on every single mounted file system in order to fetch the most
up-to-date information.  As far as I can tell, the only fields that
libzfs cares about are the filesystem's name, mountpoint, fstypename,
and mount flags.  Those things are always updated on mount and unmount,
so they will always be accurate in the VFS's mount cache except in two
circumstances:

1) When a file system is busy unmounting
2) When a ZFS file system changes the value of a mount-overridable
   property like atime or setuid, but doesn't remount the file system.
   Right now that only happens when the property is changed by an
   unprivileged user who has delegated authority to change the property
   but not to mount the dataset.  But perhaps libzfs could choose to do
   it for other reasons in the future.

Switching to `MNT_NOWAIT` will greatly improve speed with no downside,
as long as we explicitly update the mount cache whenever we change a
mount-overridable property.

For comparison, Illumos gets this information using the native
`getmntany` and `getmntent` functions, which also use cached
information.  The illumos function that would refresh the cache,
`resetmnttab`, is never called by libzfs.

And on GNU/Linux, `getmntany` and `getmntent` don't even communicate
with the kernel directly.  They simply parse the file they are given,
which is usually /etc/mtab or /proc/mounts.  Perhaps the implementation
of /proc/mounts is synchronous, ala MNT_WAIT; I don't know.

Sponsored-by:	Axcient
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alan Somers <asomers@gmail.com>
Closes: #12091
2021-06-08 07:36:43 -06:00
Lutz Donnerhacke
6181470239 tests/netgraph: Tests for ng_bridge
Test functionality of ng_bridge(4):
 - replicating traffic to anything but the sending hook
 - persistence
 - detect loops
 - unicast to only one link of many
 - stretch to implementation limits on broadcast

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30647
2021-06-08 13:27:23 +02:00
Corvin Köhne
054accac71 Add a virtio-input device emulation.
This will be used to inject keyboard/mouse input events into a guest.
The command line syntax is:
   -s <slot>,virtio-input,/dev/input/eventX

Reviewed by:	jhb (bhyve), grehan
Obtained from:	Corvin Köhne <C.Koehne@beckhoff.com>
MFC after:	3 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D30020
2021-06-08 19:05:09 +10:00
Lutz Donnerhacke
09307dbfb8 tests/netgraph: Allow receiving answers to messages
Add msg_handler in order to receive messages from netgraph nodes to be
tested.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30657
2021-06-08 12:49:04 +02:00
Edward Tomasz Napierala
f102b61d0e linux: make sure to zero the l_siginfo structure for ptrace(2)
Reported By:	dchagin
Sponsored By:	EPSRC
2021-06-08 10:18:29 +01:00
Philippe Michaud-Boudreault
2362ad457a linux: implement statx(2)
PR:		252106
Reviewed By:	dchagin
Differential Revision:	https://reviews.freebsd.org/D30466
2021-06-08 10:08:56 +01:00
Dmitry Chagin
f570a6723e Fix copyright, remove "all rights reserved".
The eventfd code was written by me, rdivacky@ copyrigth applicable only
to epoll part of the Linuxulator code. Roman is ok to retire his copyright
from sys/kern/sys_eventfd.c and 'All rights reserved.' lines from
sys/compat/linux/linux_event.[c|h] and sys/kern/sys_eventfd.c files.

Reviewed by:		kib, emaste
Approved by:		rdivacky
Differential Revision:	https://reviews.freebsd.org/D30677
MFC after:		2 weeks
2021-06-08 08:18:00 +03:00
наб
9685f363c3 tests/file_check: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:59:01 -07:00
наб
f423411c44 module/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:56 -07:00
наб
6bab6ee838 module/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:51 -07:00
наб
f70f3e2fbc module/zfs: dbuf: dbuf_read_impl: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:47 -07:00
наб
f719d3b160 module/zfs: arc: arc_hdr_realloc_crypt: remove unused variables
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:42 -07:00
наб
4ff49c5a06 libzfs: zfs_send: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:28 -07:00
наб
4f1009face zdb: zdb_decompress_block: don't needlessly set buf
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:23 -07:00
наб
77f3b67520 libzutil: zpool_find_config: remove unused variable
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187
2021-06-07 20:58:10 -07:00
Neel Chauhan
1b602f641a linuxkpi: Fix build from redefined pr_err_once() 2021-06-07 16:37:21 -07:00
Neel Chauhan
37d64dcdfa linuxkpi: Include pr_err_once() in printk.h
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30687
2021-06-07 15:53:24 -07:00
Neel Chauhan
096104e790 linuxkpi: Add rom and romlen to struct pci_dev
Approved by:		bz (src), hselasky (src)
Differential Reivison:	https://reviews.freebsd.org/D30686
2021-06-07 15:53:24 -07:00
Fedor Korotkov
225605ec16 Cirrus-CI: Use the default Git history depth
Which is `50`.  I saw a few errors like
`Failed to force reset to SHA: object not found!` which seems is
happening because the SHA is not available because there were two
commits pushed almost simultaneously and the second from the top fails
with this error because the SHA is not in the history.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/454

Comments on re-commit from emaste:

Originally committed as fcb4797c90 and reverted in 80a840b8ba due
to the clone operation taking significantly longer.  However, I have
seen many failures due to the "object not found" issue recently.
7 of 37 recent runs failed because of this, and intermittent failures
like this makes CI much less useful.

Prefer longer-running runs to intermittent failures.
2021-06-07 18:50:18 -04:00
Rick Macklem
03c81af249 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30660
2021-06-07 13:48:25 -07:00
Mark Johnston
887c753c9f Fix handling of D_GIANTOK
It was meant to suppress only the printf(), not the subsequent injection
of Giant-protected thunks for various file operations.

Fixes:		fbeb4ccac9
Reported by:	pho
Tested by:	pho
MFC after:	6 days
Pointy hat:	markj
2021-06-07 16:45:50 -04:00
наб
2d815d955e
Modernise/fix/rewrite unlinted manpages
zpool-destroy.8: flatten, fix description
zfs-wait.8: flatten, fix description, use list for events
zpool-reguid.8: flatten, fix description
zpool-history.8: flatten, fix description
zpool-export.8: flatten, fix description, remove -f "unmount" reference
  AFAICT no such command exists even in Illumos (as of today, anyway),
  and we definitely don't call it
zpool-labelclear.8: flatten, fix description
zpool-features.5: modernise
spl-module-parameters.5: modernise
zfs-mount-generator.8: rewrite
zfs-module-parameters.5: modernise

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12169
2021-06-07 13:41:54 -06:00
Rich Ercolani
afb96fa6ee
Force --enable-debug on FreeBSD if INVARIANTS is set
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12185
Closes #12163
2021-06-07 13:29:27 -06:00
Serapheim Dimitropoulos
86b5f4c121
Livelist logic should handle dedup blkptrs
Update the logic to handle the dedup-case of consecutive
FREEs in the livelist code. The logic still ensures that
all the FREE entries are matched up with a respective
ALLOC by keeping a refcount for each FREE blkptr that we
encounter and ensuring that this refcount gets to zero
by the time we are done processing the livelist.

zdb -y no longer panics when encountering double frees

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #11480
Closes #12177
2021-06-07 13:09:07 -06:00
Alexander Motin
ea400129c3
More aggsum optimizations
- Avoid atomic_add() when updating as_lower_bound/as_upper_bound.
Previous code was excessively strong on 64bit systems while not
strong enough on 32bit ones.  Instead introduce and use real
atomic_load() and atomic_store() operations, just an assignments
on 64bit machines, but using proper atomics on 32bit ones to avoid
torn reads/writes.

 - Reduce number of buckets on large systems.  Extra buckets not as
much improve add speed, as hurt reads.  Unlike wmsum for aggsum
reads are still important.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12145
2021-06-07 09:02:47 -07:00
Greg V
05c2d94a08 LinuxKPI: add pr_err_once
Reviewed by:	hselasky, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30672
2021-06-07 10:31:48 -04:00